예제 #1
0
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/7/13
 * Time: 16:29
 * 获取攻击发生的小时段汇总数据
 */
require '../../include/init.inc.php';
$portid = $start_date = $end_date = '';
$_GET['portid'] = empty($_GET['portid']) ? 0 : intval($_GET['portid']);
$_GET['start_date'] = empty($_GET['start_date']) ? date("Y-m-d", time() - 86400) : $_GET['start_date'];
$_GET['end_date'] = empty($_GET['end_date']) ? date("Y-m-d", time()) : $_GET['end_date'];
extract($_GET, EXTR_IF_EXISTS);
if ($portid != 0) {
    $portsItem = RoomBussflow::getNdMroomBandwithByPortID($portid);
    $list = RoomBussflow::getMaxBandwidthSummary($portsItem['NETWORK_NAME'], $portsItem['MROOM'], $portsItem['PORTS'], $start_date, $end_date);
    $jpg = $list[0]["IMAGE"];
    if (!empty($jpg)) {
        $filename = 'hoursbandwidth.png';
        $file = file_put_contents(ADMIN_BASE_RIMAGE . $filename, $jpg);
        //打开文件准备写入
        $imgurl = ADMIN_URL_RIMAGE . $filename . '?' . microtime(true);
        $img = "<center><img src=\"{$imgurl}\"></center>";
    } else {
        $img = "图片加载失败";
    }
    exit($img);
    //exit($img);
} else {
    //$img = "请点击\"检索\"按钮进行查询,图片生成时间预计5秒内,请不要重复检索";