reports.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:2k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: reports.php,v $
- // | $Date: 2004/02/10 01:34:25 $
- // | $Revision: 1.6 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Report generation.
- // +-------------------------------------------------------------+
- error_reporting(E_ALL ^ E_NOTICE);
- cron_check();
- require_once(INCLUDE_PATH.'/functions/calendar_functions.php');
- $reports = $db->query_return("SELECT * FROM report WHERE repeattype");
- if (is_array($reports)) {
- foreach ($reports AS $report) {
- $lastrun = date('Y-m-d', $report['lastrun']);
- $today = date('Y-m-d');
- $runstart = date('Y-m-d', strtotime("$today -1 month"));
- $runstart = explode('-', $runstart);
- $prev = $lastrun;
- while ($next = next_event($report['repeattype'], $report['value1'], $report['value2'], $prev, $today)) {
- if (date('Y-m-d', $next) == $today) {
- $_REQUEST['do'] = 'runreport';
- $_REQUEST['id'] = $options['reportid'];
- $_REQUEST['ydate'] = $runstart[0];
- $_REQUEST['mdate'] = $runstart[1];
- $_REQUEST['ddate'] = $runstart[2];
- $_REQUEST['number'] = '1';
- $_REQUEST['type'] = 'month';
- require_once('../../admin/runreport.php');
- $now = mktime();
- $db->query("UPDATE report SET lastrun = '$now' WHERE id = '$report[id]'");
- break;
- }
- }
- }
- }