<?php
date_default_timezone_set('PRC');
set_time_limit(0);
$doc = $_SERVER["DOCUMENT_ROOT"];
include("$doc/common.php");
$devid = $_POST['devid'];
$ipaddr = $_POST['ipaddr'];
$qqnumber = $_POST['qqnumber'];
$strstart = $_POST['starttime'];
$strend = $_POST['endtime'];
$topn = $_POST['topn'];
$account = $_POST['account'];
$errfile = _CHECKING_STATUS_F.'/'.$_POST['errname'];
$bexport = $_POST['bexport'];
$eventtype = $_POST['eventtype'];
if ($bexport == 1)
$filename = date("YmdHis").".xls";
else if ($bexport == 2)
$filename = date("YmdHis").".txt";
else if ($bexport == 3)
$filename = date("YmdHis").".csv";
else $filename = "none";
$longstart = strtotime($strstart);
$longend = strtotime($strend);
if ($ipaddr == "") $ipaddr = "none";
else $ipaddr = ip2long($ipaddr);
if ($qqnumber == "") $qqnumber = "none";
if ($account == "") $account = "none";
$tbstart = explode(' ', $strstart);
$tbstarts = $tbstart[0]." 00:00:00";
$slong = strtotime($tbstarts) - 24*3600;
$elong = $longend;
$tablestr = $slong."/".$elong;
$k = 0;
$result = array();
$res = array();
$link = $filename;
$tablefile = php_getqqtable($strstart, $strend);
$cmd = LOGDPATH."/bin/logeye qqcheck $devid $ipaddr $qqnumber $account $longstart $longend $tablefile $bexport $filename $errfile $topn $eventtype";
exec($cmd, $output, $return);
if (!$bexport){
for ($i = 0; $i < count($output); $i++){
$ds = explode(' ', $output[$i]);
if ($ds[6] == '$' || $ds[6] == 'none' || $ds[6] == 'null')
$account = '';
else $account = $ds[6];
array_push($res, array('devid'=>$ds[0], 'qq'=>$ds[1], 'time'=>date("Y/m/d H:i:s", $ds[3]),
'type'=>'用户登录', 'ip'=>long2ip($ds[4]), 'serip'=>long2ip($ds[5]),
'account'=>iconv('gb2312','utf-8', $account)));
}
$result['rows'] = $res;
echo json_encode($result);
}else
{
$result['file'] = $link;
echo json_encode($result);
}
?>
2022年4月20日 下午1:53 1F
你这个测试的版本也太老了,还是2014年的