📄 reports.php
字号:
<?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;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -