Exemplo n.º 1
0
}
$_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'];
$_GET['width'] = empty($_GET['width']) ? 800 : $_GET['width'];
$_GET['height'] = empty($_GET['height']) ? 720 : $_GET['height'];
extract($_GET, EXTR_IF_EXISTS);
$room_option_list = array();
foreach ($DimRoom as $room) {
    $room_option_list[$room['ID']] = $room['NAME'];
}
if ($search) {
    if (empty($roomid)) {
        $roomid = -1;
    }
    $list = AttackdefenseMonitor::getAttackHourBoxPlot($roomid, $start_date, $end_date, $width, $height);
    $jpg = $list[0]['IMAGE'];
    if (!empty($jpg)) {
        $filename = 'attackHours' . $roomid . '.png';
        $file = file_put_contents(ADMIN_BASE_RIMAGE . $filename, $jpg);
        //打开文件准备写入
        $imgurl = ADMIN_URL_RIMAGE . $filename . '?' . microtime(true);
        $img = "<center><img src=\"{$imgurl}\"></center>";
    } else {
        if (count($count) > 0) {
            $img = "无数据!";
        } else {
            $img = "图片加载失败";
        }
    }
    exit($img);