机票出票后台
parent
9cd43e73da
commit
0d208075e5
@ -0,0 +1,21 @@
|
|||||||
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||||
|
//途牛apiurl
|
||||||
|
define("TUNIU_FLIGHT_API","http://silkroad.tuniu.com/atd/dist/api");
|
||||||
|
//id
|
||||||
|
define("TUNIU_FLIGHT_ID","23770");
|
||||||
|
//途牛apikey
|
||||||
|
define("TUNIU_FLIGHT_KEY","MIIBVgIBADANBgkqhkiG9w0BAQEFAASCAUAwggE8AgEAAkEAq2ueljB82bcpF228w5mpCVs+ZK8kE7TQuw2LDegNRUJyP8PlVJXpB438bkTq6J/riqMNLaztUVVXFTL8YXeh7QIDAQABAkEAp9GUUDToBbzq3aTxSA0HD8HkM23DRAeg0X9QwyyK0WHBe/zXgvJ4t6SArTSWUOV3esxGbZQUSOB3U7m89rR0AQIhANUsDojh5WCkNo8Oaqfv35DE9JD5JvixoGMnrNCnozZJAiEAzdwsiYUp2Mlem6bizVsVGejHYMdAG1LCnSbpkUtQ/oUCIGuwuhcEp7BOxRE4I0F7uOGV3kdu1vVEJtZwsKkoRxehAiEAkAYZVsFGjLgdq7JvfRLbSXw1eX0NWdBl/gLKaG+UI+0CIQDFvEQz3ueuyfj/4DnPUnfo0QnAiKJ5Mv57adjoeAOIpg==");
|
||||||
|
|
||||||
|
//订单状态说明
|
||||||
|
$config["train_order_status_msg"]=array(
|
||||||
|
"0"=>"待处理",
|
||||||
|
"1"=>"失效订单",
|
||||||
|
"2"=>"待支付",
|
||||||
|
"3"=>"已支付,待出票",
|
||||||
|
"4"=>"出票成功",
|
||||||
|
"5"=>"出票失败",
|
||||||
|
"6"=>"线上退票处理中",
|
||||||
|
"7"=>"有乘客退票(改签)成功",
|
||||||
|
"8"=>"乘客退票失败",
|
||||||
|
"e"=>"数据错误,提交失败"
|
||||||
|
);
|
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
if (!defined('BASEPATH'))
|
||||||
|
exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class pages extends CI_Controller{
|
||||||
|
public function __construct(){
|
||||||
|
parent::__construct();
|
||||||
|
$this->load->helper('tuniu');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(){
|
||||||
|
exit('前方高能!!!');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function homepage(){
|
||||||
|
$this->load->view('common/header');
|
||||||
|
$this->load->view('homepage');
|
||||||
|
$this->load->view('common/footer');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||||
|
|
||||||
|
//验证参数是否存在并且是否为数字
|
||||||
|
function checkNum($num){
|
||||||
|
if(isset($num)){
|
||||||
|
if(is_numeric($num)){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//余票转换
|
||||||
|
function ticket_exchange($num,$iseven){
|
||||||
|
if($iseven){
|
||||||
|
return '有';
|
||||||
|
}else{
|
||||||
|
if(is_numeric($num)){
|
||||||
|
if($num == 0){
|
||||||
|
return '无';
|
||||||
|
}elseif($num >= 99){
|
||||||
|
return '有';
|
||||||
|
}else{
|
||||||
|
return $num;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取毫秒数
|
||||||
|
function get_microtime (){
|
||||||
|
list($s1, $s2) = explode(' ', microtime());
|
||||||
|
return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取飞机查询报文
|
||||||
|
function get_serach_json($departime,$fromcode,$tocode,$flightnumber=null){
|
||||||
|
$timestamp = time();
|
||||||
|
$function = 'queryNew';
|
||||||
|
$flightnumberstr = '';
|
||||||
|
if(!empty($flightnumber)){
|
||||||
|
$flightnumberstr = ',"flightNum":"'.$flightnumber.'"';
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = '{"channelId":7,"departureDate":"'.$departime.'","dstCityCode":"'.$tocode.'"'.$flightnumberstr.',"orgCityCode":"'.$fromcode.'"}';
|
||||||
|
$sign = md5(TUNIU_FLIGHT_KEY.$data.$timestamp);
|
||||||
|
|
||||||
|
$postJson = '{
|
||||||
|
"purchaseId": '.TUNIU_FLIGHT_ID.',
|
||||||
|
"sign": "'.$sign .'",
|
||||||
|
"timestamp": '.$timestamp.',
|
||||||
|
"function": "'.$function.'",
|
||||||
|
"data":'.$data.'
|
||||||
|
}';
|
||||||
|
|
||||||
|
return $postJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送请求函数
|
||||||
|
function post_tuniu($url, $data = '', $method = 'GET') {
|
||||||
|
$curl = curl_init(); // 启动一个CURL会话
|
||||||
|
curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址
|
||||||
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
|
||||||
|
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
|
||||||
|
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器
|
||||||
|
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
|
||||||
|
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
|
||||||
|
if ($method == 'POST' && !empty($data)) {
|
||||||
|
curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
||||||
|
}
|
||||||
|
curl_setopt($curl, CURLOPT_TIMEOUT, 40); // 设置超时限制防止死循环
|
||||||
|
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 40000); // 设置超时限制防止死循环
|
||||||
|
curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回
|
||||||
|
$tmpInfo = curl_exec($curl); // 执行操作
|
||||||
|
$errno = curl_errno($curl);
|
||||||
|
if ($errno !== 0) {
|
||||||
|
return false;
|
||||||
|
echo $errno . curl_error($curl); //记录错误日志
|
||||||
|
}
|
||||||
|
curl_close($curl); //关闭CURL会话
|
||||||
|
return $tmpInfo; //返回数据
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
@ -0,0 +1,131 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>出票系统</title>
|
||||||
|
<link rel="stylesheet" href="/css/information-system3.css?v=201508112" type="text/css" />
|
||||||
|
<script type="text/javascript" src="/min/?f=/js/information-system3.min.js,/js/common.js"></script>
|
||||||
|
<link rel="shortcut icon" href="/bootstrap/img/glyphicons_290_skull.png">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<nav class="navbar navbar-inverse">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="navbar-header">
|
||||||
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-9" aria-expanded="false">
|
||||||
|
<span class="sr-only">Toggle navigation</span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="/"><span class="glyphicon glyphicon-home text-white"></span></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-9">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li><a href="<?php echo site_url(''); ?>">信息管理</a></li>
|
||||||
|
<li><a href="<?php echo site_url('product') ?>">产品管理</a></li>
|
||||||
|
<li><a href="<?php echo site_url('author'); ?>">作者平台</a></li>
|
||||||
|
<li><a href="<?php echo site_url('keyworlds') ?>">关键词</a></li>
|
||||||
|
<li class="dropdown">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||||
|
更多<b class="caret"></b>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="<?php echo site_url('seo') ?>">SEO管理</a></li>
|
||||||
|
<li> <a href="<?php echo site_url('thirdparty/public/infopayauthor') ?>">打赏统计</a></li>
|
||||||
|
<li> <a href="<?php echo site_url('thirdparty/form') ?>">表单管理</a></li>
|
||||||
|
<li><a href="<?php echo site_url('thirdparty/advertise') ?>">广告管理</a></li>
|
||||||
|
<li><a href="<?php echo site_url('setting') ?>">系统设置</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<form id="form_information_search" name="form_information_search" method="post" action="<?php echo $this->router->class == 'infoshare' ? site_url('infoshare/search/') : site_url('welcome/search/'); ?>" class="navbar-form navbar-left" >
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon">
|
||||||
|
<input type="checkbox" title="全文搜索" name="all_text_search" id="all_text_search" value="true" >
|
||||||
|
</span>
|
||||||
|
<input type="text" class="form-control input-sm" name="keywords" id="keywords" value="<?php echo isset($keywords) ? $keywords : false; ?>" style="min-width:450px;">
|
||||||
|
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button class="btn btn-default btn-sm" type="submit">搜索</button>
|
||||||
|
<a href="#" onclick="openKCFinder_fast();" class="btn btn-default btn-sm" title="快速上传图片" ><span class="glyphicon glyphicon-picture"></span></a>
|
||||||
|
<a href="#" title="静态化更新" class="btn btn-default btn-sm" data-toggle="modal" data-target="#cache_refresh_modal" ><span class="glyphicon glyphicon-repeat"></span></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
<?php
|
||||||
|
$all_unread_sms = get_all_unread_sms();
|
||||||
|
$info_unread_sms = get_all_unread_sms('info');
|
||||||
|
if (isset($information->ic_id))
|
||||||
|
$current_msg = $information->ic_id;
|
||||||
|
if (isset($task->t_id))
|
||||||
|
$current_msg = $task->t_id;
|
||||||
|
$total_count = $all_unread_sms['sms_count'] + $info_unread_sms['sms_count']; //计算未读消息总数
|
||||||
|
$unread_sms_ic_id = 0; //用于设置所有收录消息为已读
|
||||||
|
if ($total_count != 0) {
|
||||||
|
?>
|
||||||
|
<!-- 如果当前页面存在未读消息,则消息数减一 -->
|
||||||
|
<?php
|
||||||
|
if (isset($current_msg) && isset($all_unread_sms['sms'][$current_msg])) {
|
||||||
|
$total_count = $total_count - count($all_unread_sms['sms'][$current_msg]);
|
||||||
|
unset($all_unread_sms['sms'][$current_msg]);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
if (isset($current_msg) && isset($info_unread_sms['sms'][$current_msg])) {
|
||||||
|
$total_count = $total_count - count($info_unread_sms['sms'][$current_msg]);
|
||||||
|
unset($info_unread_sms['sms'][$current_msg]);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<li class="dropdown">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<i class="icon-envelope icon-white pull-left" style="margin-top:3px;"></i> <span class="badge badge-important pull-right"><?php echo $total_count; ?></span>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<!-- 信息平台的消息 -->
|
||||||
|
<?php if (isset($info_unread_sms['sms']) && !empty($info_unread_sms['sms'])) { ?>
|
||||||
|
<a style="padding-left:20px;" href="javascript:void(0);" onclick="set_allmsg_to_read($('#unreadinfomsg').val());">标记全部收录信息为已读</a>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<?php foreach ($info_unread_sms['sms'] as $m) { ?>
|
||||||
|
<li><a href="<?php echo site_url('information/edit/' . $m[0]->is_id); ?>"><?php
|
||||||
|
$t_title = get_text_short($m[0]->t_title, 15);
|
||||||
|
echo '[' . $m[0]->ic_sitecode . '] ' . $t_title['content'] . ' (' . $m[0]->m_content . ')';
|
||||||
|
?></a></li>
|
||||||
|
<?php $unread_sms_ic_id.=',' . $m[0]->m_object_id; ?>
|
||||||
|
<?php } ?>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<input type="hidden" name="unreadinfomsg" id="unreadinfomsg" value="<?php echo $unread_sms_ic_id; ?>">
|
||||||
|
<?php } ?>
|
||||||
|
<!--作者平台的消息-->
|
||||||
|
<?php foreach ($all_unread_sms['sms'] as $am) { ?>
|
||||||
|
<li><a href="<?php echo site_url('author/edit_task/' . $am[0]->m_object_id); ?>"><?php
|
||||||
|
$t_title = get_text_short($am[0]->t_title, 15);
|
||||||
|
echo $t_title['content'] . ' (' . count($am) . ')';
|
||||||
|
?></a></li>
|
||||||
|
<?php } ?>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
|
<li class="dropdown">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<?php
|
||||||
|
echo $this->config->item('site_code');
|
||||||
|
echo ' -';
|
||||||
|
$admin_info = $this->session->userdata('session_admin');
|
||||||
|
echo $admin_info['OPI_Name'];
|
||||||
|
?>
|
||||||
|
<b class="caret"></b>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<?php foreach ($this->config->item('site') as $site_item) { ?>
|
||||||
|
<li> <a href="<?php echo site_url('login/change_site/' . $site_item['site_code']); ?>" ><?php echo $site_item['site_code'] ?></a></li>
|
||||||
|
<?php } ?>
|
||||||
|
<li><a href="<?php echo site_url('login/out'); ?>" >退出</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
Loading…
Reference in New Issue