コード例 #1
0
ファイル: attackDuration.php プロジェクト: hongweipeng/screen
$end_date = date("Y-m-d");
if (!empty($times) && count($times) > 0) {
    $start_date = $times[0]['BDATE'];
    $end_date = $times[0]['EDATE'];
}
$_GET['roomid'] = empty($_GET['roomid']) ? $currentrommid : intval($_GET['roomid']);
$_GET['start_date'] = empty($_GET['start_date']) ? $start_date : $_GET['start_date'];
$_GET['end_date'] = empty($_GET['end_date']) ? $end_date : $_GET['end_date'];
extract($_GET, EXTR_IF_EXISTS);
$room_option_list = array();
foreach ($DimRoom as $room) {
    $room_option_list[$room['ID']] = $room['NAME'];
}
if (empty($roomid)) {
    $roomid = -1;
}
//获取每天攻防信息
$list = AttackdefenseMonitor::getAttackDurationData($roomid, $start_date, $end_date);
$day = array();
$attackTimes = array();
foreach ($list as $item) {
    $day[] = $item['SATTACK_DATE'];
    $attackTimes[] = $item['TIMES'];
}
$day = json_encode($day);
$attackTimes = json_encode($attackTimes);
Template::assign('room_option_list', $room_option_list);
Template::assign('day', $day);
Template::assign('attackTimes', $attackTimes);
Template::assign('_GET', $_GET);
Template::display('netshow/dimmroom/attackDuration.tpl');