@ -1,26 +1,26 @@
<?php
<?php
//订单号 -> IP
//订单号 -> IP
//
//
//{
//{
// "COLI_WebCode": "JP",
// "COLI_WebCode": "JP",
// "COLI_ID": "ZPL161028068",
// "COLI_ID": "ZPL161028068",
// "COLI_ApplyDate": "2016-04-15 23:17:20",
// "COLI_ApplyDate": "2016-04-15 23:17:20",
// "COLI_SenderIP": "116.226.169.236"
// "COLI_SenderIP": "116.226.169.236"
//}
//}
//
//
//CHT:http://www.chinahighlights.com/api/api.php?method=order.json_by_lmr& order_id=hy161104033
//CHT:http://www.chinahighlights.com/api/api.php?method=order.json_by_lmr& order_id=hy161104033
//国际:http://www.viaje-a-china.com/index.php/ajax/ajax_order_datas/
//国际:http://www.viaje-a-china.com/index.php/ajax/ajax_order_datas/
//
//
//
//
$order_id = isset($_GET['order_id']) ? $_GET['order_id'] : FALSE;
$order_id = isset($_GET['order_id']) ? $_GET['order_id'] : FALSE;
$order_id = isset($_POST['order_id']) ? $_POST['order_id'] : $order_id;
$order_id = isset($_POST['order_id']) ? $_POST['order_id'] : $order_id;
//$site = isset($_GET['site']) ? $_GET['site'] : FALSE;
//$site = isset($_GET['site']) ? $_GET['site'] : FALSE;
//$site = isset($_POST['site']) ? $_POST['site'] : $site;
//$site = isset($_POST['site']) ? $_POST['site'] : $site;
$ip = '255.255.255.255';
$ip = '255.255.255.255';
$web_code = FALSE;
$web_code = FALSE;
$date = date('Y-m-d h:i:s');
$date = date('Y-m-d h:i:s');
$host = [
$host = [
'xx' => 'xx',
'xx' => 'xx',
'jp' => 'JP',
'jp' => 'JP',
'vc' => 'FR',
'vc' => 'FR',
@ -34,28 +34,28 @@
'ct' => 'yincheng',
'ct' => 'yincheng',
'gm' => 'gm-vps',
'gm' => 'gm-vps',
'ah' => 'AH',
'ah' => 'AH',
];
];
$host_name = [
$host_name = [
'jp' => 'http://www.arachina.com',
'jp' => 'http://www.arachina.com',
'vc' => 'http://www.voyageschine.com',
'vc' => 'http://www.voyageschine.com',
'vac' => 'http://www.viaje-a-china.com',
'vac' => 'http://www.viaje-a-china.com',
'train_vac' => 'http://www.viaje-a-china.com',
'train_vac' => 'http://www.viaje-a-china.com',
'ru' => 'http://www.chinahighlights.ru',
'ru' => 'http://www.chinahighlights.ru',
'train_ru' => 'http://www.chinahighlights.ru',
'train_ru' => 'http://www.chinahighlights.ru',
'it' => 'http://www.viaggio-in-cina .it',
'it' => 'http://www.chinahighlights .it',
'train_it' => 'http://www.viaggio-in-cina .it',
'train_it' => 'http://www.chinahighlights .it',
'cht' => 'http://www.chinahighlights.com',
'cht' => 'http://www.chinahighlights.com',
'ct' => 'http://www.chinatravel.com',
'ct' => 'http://www.chinatravel.com',
'gm' => 'http://www.chinahighlightstravel.de',
'gm' => 'http://www.chinahighlightstravel.de',
'ah' => 'http://www.asiahighlights.com',
'ah' => 'http://www.asiahighlights.com',
];
];
$bf_date = date('m/d/Y:00:00:00', time() - 3600 * 24 * 90);
$bf_date = date('m/d/Y:00:00:00', time() - 3600 * 24 * 90);
$af_date = date('m/d/Y:00:00:00', time() + 3600 * 24 * 90);
$af_date = date('m/d/Y:00:00:00', time() + 3600 * 24 * 90);
$order_txt = '';
$order_txt = '';
$web_code = 'xx';
$web_code = 'xx';
$order_date = '';
$order_date = '';
if ($order_id) {
if ($order_id) {
//if ($site == 'ch')
//if ($site == 'ch')
//{
//{
// $order = @file_get_contents('http://www.chinahighlights.com/api/api.php?method=order.json_by_lmr&order_id='.$order_id);
// $order = @file_get_contents('http://www.chinahighlights.com/api/api.php?method=order.json_by_lmr&order_id='.$order_id);
@ -68,7 +68,7 @@
if ($order & & $order !== 'no data') {
if ($order & & $order !== 'no data') {
$order = json_decode($order);
$order = json_decode($order);
$ip = $order->COLI_SenderIP;
$ip = $order->COLI_SenderIP;
if (! $ip || $ip == '159.8.126.74' || $ip == '180.140.114.208') {
if (!$ip || $ip == '159.8.126.74' || $ip == '180.140.114.208') {
$ip = null;
$ip = null;
}
}
$web_code = $order->COLI_WebCode;
$web_code = $order->COLI_WebCode;
@ -78,79 +78,156 @@
$af_date = date('m/d/Y:00:00:00', $date_time + 3600 * 24 * 90);
$af_date = date('m/d/Y:00:00:00', $date_time + 3600 * 24 * 90);
$order_txt = $order->COLI_OrderDetailText;
$order_txt = $order->COLI_OrderDetailText;
}
}
}
}
//连接Splunk SDK
//连接Splunk SDK
require_once '../Splunk.php';
require_once '../Splunk.php';
$connect_arguments = [
$connect_arguments = [
'scheme' => 'https',
'scheme' => 'https',
'host' => '192.155.250.125',
'host' => '192.155.250.125',
'port' => 8089,
'port' => 8089,
'username' => 'haina',
'username' => 'haina',
'password' => '383d43GZ82[Ai',
'password' => '383d43GZ82[Ai',
];
];
$service = new Splunk_Service($connect_arguments);
$service = new Splunk_Service($connect_arguments);
$service->login();
$service->login();
//查询IP
//查询IP
//[EXA] host=ES "68.180.229.232" earliest="11/1/2016:00:00:00" latest="11/2/2016:00:00:00"
//[EXA] host=ES "68.180.229.232" earliest="11/1/2016:00:00:00" latest="11/2/2016:00:00:00"
$results = [];
$results = [];
if ($ip) {
if ($ip) {
$search = 'search host=' . $host[strtolower($web_code)] . ' "' . $ip . '" earliest="' . $bf_date . '" latest="' . $af_date . '" NOT("/ngx_pagespeed_beacon" OR "/tourprice" OR "/include" OR "/api" OR "/ajax" OR "/image" OR "/common" OR "/ckplayer" OR ".css" OR ".js" OR ".ico" OR ".gif" OR ".jpg" OR ".png" OR ".json" OR ".xml" OR ".ttf" OR ".woff" OR ".eot" OR "webhtmllog" OR "asphttp_accept_language" OR "down.asp" OR "verifyemail" OR "test")';
$search = 'search host=' . $host[strtolower($web_code)] . ' "' . $ip . '" earliest="' . $bf_date . '" latest="' . $af_date . '" NOT("/ngx_pagespeed_beacon" OR "/tourprice" OR "/include" OR "/api" OR "/ajax" OR "/image" OR "/common" OR "/ckplayer" OR ".css" OR ".js" OR ".ico" OR ".gif" OR ".jpg" OR ".png" OR ".json" OR ".xml" OR ".ttf" OR ".woff" OR ".eot" OR "webhtmllog" OR "asphttp_accept_language" OR "down.asp" OR "verifyemail" OR "test")';
//调用Spluck Search
//调用Spluck Search
$job = $service->getJobs()->create($search);
$job = $service->getJobs()->create($search);
while (! $job->isDone()) {
while (!$job->isDone()) {
$job->refresh();
$job->refresh();
}
}
$results = $job->getResults();
$results = $job->getResults();
}
}
?><!DOCTYPE html>
?><!DOCTYPE html>
< html lang = "en" >
< html lang = "en" >
< head >
< head >
< title > 订单日志查询< / title >
< title > 订单日志查询< / title >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" >
< meta name = "viewport" content = "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" >
< link href = "/css/another/bootstrap.min.css" rel = "stylesheet" type = "text/css" / >
< link href = "/css/another/bootstrap.min.css" rel = "stylesheet" type = "text/css" / >
< script src = "/js/jquery.min.js" > < / script >
< script src = "/js/jquery.min.js" > < / script >
< style type = "text/css" >
< style type = "text/css" >
@media (min-width: 768px) {
@media (min-width: 768px) {
.container {width: 750px;}
.container {
._raw{max-width:700px;word-wrap: break-word;}
width: 750px;
.btn-default {max-width: 700px;}
}
}
@media (min-width: 992px) {
._raw {
.container {width: 970px;}
max-width: 700px;
._raw{max-width:920px;word-wrap: break-word;}
word-wrap: break-word;
.btn-default {max-width: 860px;}
}
}
@media (min-width: 1200px) {
.btn-default {
.container {width: 1200px;}
max-width: 700px;
._raw{max-width:1100px;word-wrap: break-word;}
}
.btn-default {max-width: 1000px;}
}
}
#formbody {margin:20px 0;}
@media (min-width: 992px) {
#start_date, #end_date, #fz_name, #dz_name, #train_date {width: 135px;}
.container {
#site_code {min-width: 200px}
width: 970px;
#train_date {min-width: 152px;}
}
#fix_alert {padding-top: 8px;padding-bottom: 8px;}
td,th {font-size: 13px;}
._raw {
.pagination {margin: 0 0 12px;}
max-width: 920px;
#ui-datepicker-div {z-index: 1000!important;}
word-wrap: break-word;
pre {margin-top: 5px;font-size: 0.8em;}
}
.btn-default {white-space: initial;text-align: left;word-wrap: break-word;}
.tt{color: #07c;}
.btn-default {
._raw a.btn-sm {font-size: 14px;}
max-width: 860px;
< / style >
}
}
@media (min-width: 1200px) {
.container {
width: 1200px;
}
._raw {
max-width: 1100px;
word-wrap: break-word;
}
.btn-default {
max-width: 1000px;
}
}
#formbody {
margin: 20px 0;
}
#start_date,
#end_date,
#fz_name,
#dz_name,
#train_date {
width: 135px;
}
#site_code {
min-width: 200px
}
#train_date {
min-width: 152px;
}
#fix_alert {
padding-top: 8px;
padding-bottom: 8px;
}
td,
th {
font-size: 13px;
}
.pagination {
margin: 0 0 12px;
}
#ui-datepicker-div {
z-index: 1000 !important;
}
pre {
margin-top: 5px;
font-size: 0.8em;
}
.btn-default {
white-space: initial;
text-align: left;
word-wrap: break-word;
}
.tt {
color: #07c;
}
._raw a.btn-sm {
font-size: 14px;
}
< / style >
< / head >
< / head >
< body class = "container" >
< body class = "container" >
< div id = "formbody" >
< div id = "formbody" >
< form class = "form-inline" action = "" method = "post" id = "sform" >
< form class = "form-inline" action = "" method = "post" id = "sform" >
< div class = "form-group has-success" >
< div class = "form-group has-success" >
< label class = "sr-only" for = "order_id" > 订单号< / label >
< label class = "sr-only" for = "order_id" > 订单号< / label >
< input type = "text" name = "order_id" class = "form-control" id = "order_id" placeholder = "输入订单号" value = " <?php if ( $order_id ) {
< input type = "text" name = "order_id" class = "form-control" id = "order_id" placeholder = "输入订单号"
echo($order_id);
value="<?php if ( $order_id ) {
echo ($order_id);
}
}
?>">
?>">
< / div >
< / div >
@ -160,15 +237,15 @@ pre {margin-top: 5px;font-size: 0.8em;}
< div class = "alert alert-info" role = "alert" id = "fix_alert" >
< div class = "alert alert-info" role = "alert" id = "fix_alert" >
<?php
<?php
if ($web_code) {
if ($web_code) {
echo(' [站点:' . $web_code . ']');
echo (' [站点:' . $web_code . ']');
}
}
if ($order_date) {
if ($order_date) {
echo(' [提交日期:' . $order_date . ']');
echo (' [提交日期:' . $order_date . ']');
}
}
if ($order_txt) {
if ($order_txt) {
echo('< pre > ' . $order_txt . '< / pre > ');
echo ('< pre > ' . $order_txt . '< / pre > ');
}
}
//echo(' 【SPL: '.$search.'】');
//echo(' 【SPL: '.$search.'】');
@ -190,7 +267,7 @@ pre {margin-top: 5px;font-size: 0.8em;}
}
}
?>
?>
< li class = " <?php echo ( $prev_cls ); ?> " >
< li class = " <?php echo ( $prev_cls ); ?> " >
< a href = "#" aria-label = "Previous" id = "prev" >
< a href = "#" aria-label = "Previous" id = "prev" >
< span aria-hidden = "true" > « < / span >
< span aria-hidden = "true" > « < / span >
< / a >
< / a >
@ -202,9 +279,9 @@ pre {margin-top: 5px;font-size: 0.8em;}
}
}
?>
?>
< li class = " <?php echo ( $cls ); ?> " >< a href = "javascript:;" class = "page_a" data-action = "/train/china-trains/search/logs/ <?php echo ( $i ); ?> " > <?php echo ( $i ); ?> </ a ></ li >
< li class = " <?php echo ( $cls ); ?> " >< a href = "javascript:;" class = "page_a" data-action = "/train/china-trains/search/logs/ <?php echo ( $i ); ?> " > <?php echo ( $i ); ?> </ a ></ li >
<?php } ?>
<?php } ?>
< li class = " <?php echo ( $next_cls ); ?> " >
< li class = " <?php echo ( $next_cls ); ?> " >
< a href = "#" aria-label = "Next" id = "next" >
< a href = "#" aria-label = "Next" id = "next" >
< span aria-hidden = "true" > » < / span >
< span aria-hidden = "true" > » < / span >
< / a >
< / a >
@ -261,7 +338,7 @@ pre {margin-top: 5px;font-size: 0.8em;}
echo '< a href = "' . $matches[6] . '" class = "btn btn-sm btn-default" type = "button" target = "_blank" > < span class = "badge" > from< / span > ' . urldecode($matches[6]) . '< / a > ';
echo '< a href = "' . $matches[6] . '" class = "btn btn-sm btn-default" type = "button" target = "_blank" > < span class = "badge" > from< / span > ' . urldecode($matches[6]) . '< / a > ';
}
}
if (! isset($matches[1])) {
if (!isset($matches[1])) {
echo $log;
echo $log;
}
}
}
}
@ -307,42 +384,41 @@ pre {margin-top: 5px;font-size: 0.8em;}
?>
?>
< / ul >
< / ul >
<?php endif ; ?>
<?php endif ; ?>
<?php if ( ! $anyRows && ( count ( $messages ) === 0 )) : ?>
<?php if ( ! $anyRows && ( count ( $messages ) === 0 )) : ?>
< p >
< p >
没有查到相关日志
没有查到相关日志
< / p >
< / p >
<?php endif ; ?>
<?php endif ; ?>
< script type = "text/javascript" >
< script type = "text/javascript" >
function openwindow(url,name,iWidth,iHeight)
function openwindow(url, name, iWidth, iHeight) {
{
var url; //转向网页的地址;
var url; //转向网页的地址;
var name; //网页名称,可为空;
var name; //网页名称,可为空;
var iWidth; //弹出窗口的宽度;
var iWidth; //弹出窗口的宽度;
var iHeight; //弹出窗口的高度;
var iHeight; //弹出窗口的高度;
//window.screen.height获得屏幕的高, window.screen.width获得屏幕的宽
//window.screen.height获得屏幕的高, window.screen.width获得屏幕的宽
var iTop = (window.screen.height-30-iHeight)/2; //获得窗口的垂直位置;
var iTop = (window.screen.height - 30 - iHeight) / 2; //获得窗口的垂直位置;
var iLeft = (window.screen.width-10-iWidth)/2; //获得窗口的水平位置;
var iLeft = (window.screen.width - 10 - iWidth) / 2; //获得窗口的水平位置;
window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
}
}
$('a.js_win').on('click', function() {
$('a.js_win').on('click', function () {
var _sn = $(this).attr('data-sn');
var _sn = $(this).attr('data-sn');
var _url = '/train/china-trains/search/log_data/'+_sn+'/';
var _url = '/train/china-trains/search/log_data/' + _sn + '/';
openwindow(_url, "SL", 809, 500);
openwindow(_url, "SL", 809, 500);
});
});
$('.page_a').on('click', function(){
$('.page_a').on('click', function () {
$('#sform').attr('action', $(this).attr('data-action')).submit();
$('#sform').attr('action', $(this).attr('data-action')).submit();
});
});
$('#prev').on('click', function() {
$('#prev').on('click', function () {
if (!$(this).parent('li').hasClass('disabled')) {
if (!$(this).parent('li').hasClass('disabled')) {
var curr = $('li.active').index();
var curr = $('li.active').index();
$('#sform').attr('action', '/train/china-trains/search/logs/'+ (curr-1)).submit();
$('#sform').attr('action', '/train/china-trains/search/logs/' + (curr - 1)).submit();
}
}
});
});
$('#next').on('click', function() {
$('#next').on('click', function () {
if (!$(this).parent('li').hasClass('disabled')) {
if (!$(this).parent('li').hasClass('disabled')) {
var curr = $('li.active').index();
var curr = $('li.active').index();
$('#sform').attr('action', '/train/china-trains/search/logs/'+ (curr+1)).submit();
$('#sform').attr('action', '/train/china-trains/search/logs/' + (curr + 1)).submit();
}
}
});
});
$('#btn6').on('click', function () {
$('#btn6').on('click', function () {
@ -352,4 +428,5 @@ pre {margin-top: 5px;font-size: 0.8em;}
})
})
< / script >
< / script >
< / body >
< / body >
< / html >
< / html >