reports.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:2k
源码类别:

电子政务应用

开发平台:

Java

  1. <?php
  2. // +-------------------------------------------------------------+
  3. // | DeskPRO v [2.0.1 Production]
  4. // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
  5. // | Supplied by WTN-WDYL
  6. // | Nullified by WTN-WDYL
  7. // | Distribution via WebForum, ForumRU and associated file dumps
  8. // +-------------------------------------------------------------+
  9. // | DESKPRO IS NOT FREE SOFTWARE
  10. // +-------------------------------------------------------------+
  11. // | License ID : Full Enterprise License =) ...
  12. // | License Owner : WTN-WDYL Team
  13. // +-------------------------------------------------------------+
  14. // | $RCSfile: reports.php,v $
  15. // | $Date: 2004/02/10 01:34:25 $
  16. // | $Revision: 1.6 $
  17. // +-------------------------------------------------------------+
  18. // | File Details:
  19. // | - Report generation.
  20. // +-------------------------------------------------------------+
  21. error_reporting(E_ALL ^ E_NOTICE);
  22. cron_check();
  23. require_once(INCLUDE_PATH.'/functions/calendar_functions.php');
  24. $reports = $db->query_return("SELECT * FROM report WHERE repeattype");
  25. if (is_array($reports)) {
  26. foreach ($reports AS $report) {
  27. $lastrun = date('Y-m-d', $report['lastrun']);
  28. $today = date('Y-m-d');
  29. $runstart = date('Y-m-d', strtotime("$today -1 month"));
  30. $runstart = explode('-', $runstart);
  31. $prev = $lastrun;
  32. while ($next = next_event($report['repeattype'], $report['value1'], $report['value2'], $prev, $today)) {
  33. if (date('Y-m-d', $next) == $today) {
  34. $_REQUEST['do'] = 'runreport';
  35. $_REQUEST['id'] = $options['reportid'];
  36. $_REQUEST['ydate'] = $runstart[0];
  37. $_REQUEST['mdate'] = $runstart[1];
  38. $_REQUEST['ddate'] = $runstart[2];
  39. $_REQUEST['number'] = '1';
  40. $_REQUEST['type'] = 'month';
  41. require_once('../../admin/runreport.php');
  42. $now = mktime();
  43. $db->query("UPDATE report SET lastrun = '$now' WHERE id = '$report[id]'");
  44. break;
  45. }
  46. }
  47. }
  48. }