v-Brocloni 3 years ago
parent
commit
f76002ae80
100 changed files with 8029 additions and 0 deletions
  1. +23
    -0
      1.php
  2. +23
    -0
      Config.php
  3. +38
    -0
      Function.php
  4. +1
    -0
      MP_verify_ssDJc2evTZFEa3nT.txt
  5. +19
    -0
      Mysql.php
  6. +11
    -0
      ZZDZ/.project
  7. +104
    -0
      ZZDZ/application/api/cancel_order.php
  8. +28
    -0
      ZZDZ/application/api/common.php
  9. +153
    -0
      ZZDZ/application/api/create_order.php
  10. +500
    -0
      ZZDZ/application/api/dispatch_algorithm.php
  11. +32
    -0
      ZZDZ/application/api/get_line_info.php
  12. +74
    -0
      ZZDZ/application/api/get_order_info.php
  13. +87
    -0
      ZZDZ/application/api/get_run_list.php
  14. +109
    -0
      ZZDZ/application/api/get_time_by_location.php
  15. +90
    -0
      ZZDZ/application/custom_made/cancel_outtime_order.php
  16. +13
    -0
      ZZDZ/application/custom_made/control.php
  17. +56
    -0
      ZZDZ/application/custom_made/order/getposition.php
  18. +232
    -0
      ZZDZ/application/custom_made/order/list.php
  19. +169
    -0
      ZZDZ/application/custom_made/order/order_list.php
  20. +159
    -0
      ZZDZ/application/custom_made/order/orderdetailinfo.php
  21. +169
    -0
      ZZDZ/application/custom_made/order/orderlist.php
  22. +106
    -0
      ZZDZ/application/custom_made/order/refund.php
  23. +521
    -0
      ZZDZ/application/custom_made/order/submit.php
  24. +524
    -0
      ZZDZ/application/custom_made/order/submitforout.php
  25. +135
    -0
      ZZDZ/application/custom_made/order/xiecheng_order.php
  26. +81
    -0
      ZZDZ/application/custom_made/test_cancel.php
  27. +294
    -0
      ZZDZ/application/service/createOrderService.php
  28. +113
    -0
      ZZDZ/application/utils/commonUtils.php
  29. +188
    -0
      ZZDZ/bbbb.html
  30. +111
    -0
      ZZDZ/bus_line.html
  31. +23
    -0
      ZZDZ/calendar.html
  32. +13
    -0
      ZZDZ/config/Config.php
  33. +31
    -0
      ZZDZ/config/ConfigDev.php
  34. +5
    -0
      ZZDZ/config/ConfigPro.php
  35. +16
    -0
      ZZDZ/config/Config_errinfo.php
  36. +178
    -0
      ZZDZ/config/Function.php
  37. +36
    -0
      ZZDZ/config/Mysql.php
  38. +86
    -0
      ZZDZ/config/sinaAPI.php
  39. +15
    -0
      ZZDZ/dzbs_list.php
  40. +15
    -0
      ZZDZ/dzbs_login.php
  41. +100
    -0
      ZZDZ/index.html
  42. +90
    -0
      ZZDZ/order_detail.html
  43. +104
    -0
      ZZDZ/order_list.html
  44. +26
    -0
      ZZDZ/order_menu.html
  45. +53
    -0
      ZZDZ/order_success.html
  46. +49
    -0
      ZZDZ/pay_success.html
  47. +64
    -0
      ZZDZ/public/css/baidu.css
  48. +106
    -0
      ZZDZ/public/css/bus_css/fill_order.css
  49. +23
    -0
      ZZDZ/public/css/bus_css/order_list.css
  50. +8
    -0
      ZZDZ/public/css/bus_css/query_result.css
  51. +63
    -0
      ZZDZ/public/css/calendar.css
  52. +446
    -0
      ZZDZ/public/css/main.css
  53. +474
    -0
      ZZDZ/public/css/master.css
  54. +44
    -0
      ZZDZ/public/css/reset.css
  55. +494
    -0
      ZZDZ/public/css/ui-base.css
  56. +164
    -0
      ZZDZ/public/css/ui-box.css
  57. +110
    -0
      ZZDZ/public/css/ui-color.css
  58. +5
    -0
      ZZDZ/public/css/wechat.min.css
  59. BIN
      ZZDZ/public/images/Combined_Shape.png
  60. BIN
      ZZDZ/public/images/b1_banner.png
  61. BIN
      ZZDZ/public/images/b1_bg.png
  62. BIN
      ZZDZ/public/images/car.png
  63. BIN
      ZZDZ/public/images/ic_call.png
  64. BIN
      ZZDZ/public/images/ic_car.png
  65. BIN
      ZZDZ/public/images/ic_change.png
  66. BIN
      ZZDZ/public/images/ic_close.png
  67. BIN
      ZZDZ/public/images/ic_enter.png
  68. BIN
      ZZDZ/public/images/ic_enter2.png
  69. BIN
      ZZDZ/public/images/ic_erweima_gre.png
  70. BIN
      ZZDZ/public/images/ic_return_d.png
  71. BIN
      ZZDZ/public/images/ic_return_gr.png
  72. BIN
      ZZDZ/public/images/ic_return_n.png
  73. BIN
      ZZDZ/public/images/ic_return_n_l.png
  74. BIN
      ZZDZ/public/images/ic_search.png
  75. BIN
      ZZDZ/public/images/ic_select_dis.png
  76. BIN
      ZZDZ/public/images/ic_select_nor.png
  77. BIN
      ZZDZ/public/images/ic_select_nor2.png
  78. BIN
      ZZDZ/public/images/ic_select_sel.png
  79. BIN
      ZZDZ/public/images/ic_time.png
  80. BIN
      ZZDZ/public/images/ic_wenhao.png
  81. BIN
      ZZDZ/public/images/img_chenggong.png
  82. BIN
      ZZDZ/public/images/img_gantanhao.png
  83. BIN
      ZZDZ/public/images/img_line.png
  84. BIN
      ZZDZ/public/images/img_line_ga.png
  85. BIN
      ZZDZ/public/images/img_line_gr.png
  86. BIN
      ZZDZ/public/images/img_null_l.png
  87. BIN
      ZZDZ/public/images/img_pro_d.png
  88. BIN
      ZZDZ/public/images/img_pulldown.png
  89. BIN
      ZZDZ/public/images/img_time.png
  90. BIN
      ZZDZ/public/images/loading2.gif
  91. BIN
      ZZDZ/public/images/tuisong_er.png
  92. BIN
      ZZDZ/public/images/tuisong_er1.png
  93. BIN
      ZZDZ/public/images/tuisong_er2.png
  94. +197
    -0
      ZZDZ/public/js/calendar.js
  95. +153
    -0
      ZZDZ/public/js/index.js
  96. +4
    -0
      ZZDZ/public/js/jquery-2.2.4.min.js
  97. +230
    -0
      ZZDZ/public/js/main.js
  98. +112
    -0
      ZZDZ/public/js/master.js
  99. +181
    -0
      ZZDZ/public/js/order_detail.js
  100. +148
    -0
      ZZDZ/public/js/order_list.js

+ 23
- 0
1.php View File

@@ -0,0 +1,23 @@
<?php
require_once './php_include/Mysql.php';
/*
$pdo=conn();
$sql="SELECT * FROM base_org WHERE org_id > 0";
$result=$pdo->query($sql);
$r=$result->fetchAll();
print_r($r);
*/
?>

<html>
<head>
</head>
<body>
<a href="list1.php">车票</a><br />
<a href="list2.php">门票</a><br />
<a href="list3.php">演出票</a><br />
</body>
</html>




+ 23
- 0
Config.php View File

@@ -0,0 +1,23 @@
<?php
/*
Author:XM
Compeny:Spiders Travel
*/
define("MYSQL_HOST", "139.196.199.238");
define("MYSQL_USER", "root");
define("MYSQL_PASSWORD", "123456");
define("MYSQL_DB", "disney");
define("MYSQL_PORT", 3306);

$_ary_tickets_type = array(
"1" => "普通票",
"2" => "儿童票"
);

$_ary_goods_type = array(
"1" => "往返接驳票",
"2" => "迪尼斯门票",
"3" => "狮子王演出票"
);



+ 38
- 0
Function.php View File

@@ -0,0 +1,38 @@
<?php
/*
Author:XM
Compeny:Spiders Travel
*/
function writeLog($log){
$dir=__DIR__."/../Log/";
if (!is_dir($dir)){
mkdir($dir);
}
$filename=$dir.date("Y-m-d").".log";
file_put_contents($filename, date("Y-m-d H:i:s")."\t".$log.PHP_EOL,FILE_APPEND);
}
function makeSign($array){
$str='';
foreach ($array as $v){
$str.=$v;
}
return sha1($str.TOKEN);
}
function getUserId(){
if (isset($_COOKIE['xm_data'])){
$xm_data=$_COOKIE['xm_data'];
$data=unserialize($xm_data);
$id=$data['id'];
$user=$data['user'];
$checkToken=$data['token'];
$list=$data['list'];
$token=makeSign(array($id,$user,serialize($list)));
if ($checkToken == $token){
return $id;
}else{
return false;
}
}else{
return false;
}
}

+ 1
- 0
MP_verify_ssDJc2evTZFEa3nT.txt View File

@@ -0,0 +1 @@
ssDJc2evTZFEa3nT

+ 19
- 0
Mysql.php View File

@@ -0,0 +1,19 @@
<?php
/*
Author:XM
Compeny:Spiders Travel
*/
require_once __DIR__.'/Config.php';
function conn(){
$port=defined('MYSQL_PORT')?MYSQL_PORT:3306;
try {
$pdo=new PDO("mysql:host=".MYSQL_HOST.";port=".$port.";dbname=".MYSQL_DB, MYSQL_USER, MYSQL_PASSWORD,array(PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8"));
return $pdo;
}catch (PDOException $e){
writeLog('new PDO failed:'.$e->getMessage());
}
}





+ 11
- 0
ZZDZ/.project View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>订制巴士</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

+ 104
- 0
ZZDZ/application/api/cancel_order.php View File

@@ -0,0 +1,104 @@
<?php
/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/9/8
* Time: 19:21
*/
require_once __DIR__ . '/common.php';

class cancelOrder extends virtifyUsers
{
function funCancelOrder($prodID, $runID, $busID, $orderID, $run_date)
{
//return $prodID."||" .$runID."||". $busID."||". $orderID."||". $run_date;
$orderService = new createOrderService();
$mem = new Memcache();
$mem->connect('127.0.0.1', 11211);
$orderlist = $mem->get("orderList[$runID]");
//将该订单从订单池中移除
if (!$orderlist) {
return false;
}
$current_bus_order_list = $orderlist[$busID];
foreach ($current_bus_order_list as $k => $order) {
if ($order["order_id"] == $orderID) {
array_splice($current_bus_order_list, $k, 1);
if (count($current_bus_order_list) == 0) {
unset($orderlist[$busID]);
}
if (count($orderlist) == 0) {
$mem->delete("orderList[$runID]");
$mem->delete("orderPoolStatus[$runID]");
$res = $orderService->makeOrder($mem, $runID, false, $busID, $prodID);
return $res;
} else {
$orderlist[$busID] = $current_bus_order_list;
$mem->set("orderList[$runID]", $orderlist);
}
}
}
//如果当前订单池已经锁定,将该订单池解除锁定
$PoolStatus = $mem->get("orderPoolStatus[$runID]"); //添加runid标记是为了区别是哪个时间的班次
if ($PoolStatus) {
foreach ($PoolStatus as $k => $v) {
if ($k == $busID) {
if ($v['status'] == 0) { //状态值:0:已锁定;1:未锁定
$PoolStatus[$k]['status'] = 1;
$mem->set("orderPoolStatus[$runID]", $PoolStatus);
}
}

}
}
//重新计算线路,但是此时不用计算冗余时间
$new_order_list = $mem->get("orderList[$runID]");
$current_bus_order_list = $new_order_list[$busID];
if (is_array($current_bus_order_list) && count($current_bus_order_list) == 1) { //退订的订单是该车上的倒数第二个订单
//更新order_main中该车的里面的其他订单的上车时间和下车时间
$time = $orderService->firstOrderNeedTime($current_bus_order_list[0]['startx_y'], $current_bus_order_list[0]['endx_y'], $run_date);
$pdo = conn();
$sql = "update order_main set PROD_START_STATION_TIME = '" . $time['result'][0] . "',PROD_END_STATION_TIME = '" . $time['result'][1] . "' where order_id =" . $current_bus_order_list[0]['order_id'] . " or parent_order_id =" . $current_bus_order_list[0]['order_id'];
$pdo->exec($sql);
$station = $current_bus_order_list[0]['begin_name'] . ";" . $current_bus_order_list[0]['end_name'];
$lat_long = $current_bus_order_list[0]['startx_y'] . ";" . $current_bus_order_list[0]['endx_y'];
$station_type = "0;1";
$station_time = $time['result'][0] . ";" . $time['result'][1];
$orderId_list = $current_bus_order_list[0]['order_id'] . ";" . $current_bus_order_list[0]['order_id'];
$orderService->set_run_station($runID, $busID, $prodID, $orderId_list, $station, $lat_long, $station_type, $station_time);//更新run_bus_station_view表
return true;
}
if (!is_array($current_bus_order_list)) { //最后的一个订单也移除之后,则不进行更新order_main,直接更新run_bus_station_view表
$orderService->makeOrder($mem, $runID, $current_bus_order_list, $busID, $prodID);//更新run_bus_station_view表
return true;
}

//取消后剩余的订单数大于二时,执行下面逻辑
$first_order = array_splice($current_bus_order_list, -1, 1);
$array_start = $orderService->timeMatrix($current_bus_order_list, $first_order[0]['startx_y'], 1); //获取所有起点时间矩阵
$array_end = $orderService->timeMatrix($current_bus_order_list, $first_order[0]['endx_y'], 2); //获取所有终点时间矩阵
//将剩下的订单重新加入算法进行计算(注意这里不再计算冗余时间)
$re_cal_line = new dispatch_algorithm();
$res_time = $re_cal_line->dispatch($prodID, $current_bus_order_list, $first_order[0], $array_start, $array_end, $run_date, false);
$this->update_ordermain_time($res_time, $orderService);//更新order_main中该车的里面的其他订单的上车时间和下车时间

//更新run_bus_station_view表
$res = $orderService->makeOrder($mem, $runID, $res_time, $busID, $prodID);
return $res;
}

//更新order_main中该车的里面的其他订单的上车时间和下车时间
function update_ordermain_time($res_time, $orderService)
{
$start_end_time = array();
foreach ($res_time as $id => $arr) {
if (!isset($start_end_time[$arr['order_id']])) {
$start_end_time[$arr['order_id']] = array();
$start_end_time[$arr['order_id']]["start_time"] = $arr['time'];
} else {
$start_end_time[$arr['order_id']]["end_time"] = $arr['time'];
$orderService->update_order_time($arr['order_id'], $start_end_time[$arr['order_id']]["start_time"], $arr['time']);
}
}
}
}

+ 28
- 0
ZZDZ/application/api/common.php View File

@@ -0,0 +1,28 @@
<?php

/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/8/29
* Time: 16:29
*/

class virtifyUsers
{
public function __construct()
{
header("Access-Control-Allow-Origin:*");
header("Content-Type:text/html;charset=utf-8;");
date_default_timezone_set('PRC');
require_once __DIR__.'/../utils/commonUtils.php';
require_once __DIR__."/../../config/Mysql.php";
require_once __DIR__.'/../service/createOrderService.php';
require_once __DIR__.'/dispatch_algorithm.php';
//微信获取用户基本信息接口
// if (!isset($_COOKIE ["open_id"])) {
// header("Location:http://xmwx.zhizhuchuxing.cn/ZZDZ/dzbs_login.php");
// exit ();
// }

}
}

+ 153
- 0
ZZDZ/application/api/create_order.php View File

@@ -0,0 +1,153 @@
<?php

/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/8/30
* Time: 14:17
* 根据订单信息分配车辆创建订单
*/
require_once __DIR__ . '/common.php';

class createOrder extends virtifyUsers
{
/**
* @param $mem memcache对象
* @param $orderService orderService对象
* @param $runID runID
* @param $res 车调度结果
* @param $bus_order_num 人数
* @param $prodID prodID
*/

function calShortTime($prodID, $runID, $orderID, $num, $beginX_Y, $begin_name, $endX_Y, $end_name, $run_date,$should_be_count=true,$bool_total_time=true)
{
$mem = new Memcache();
$mem->connect('127.0.0.1', 11211);
$PoolStatus = $mem->get("orderPoolStatus[$runID]"); //添加runid标记是为了区别是哪个时间的班次
$unlock_orderlist = $mem->get("orderList[$runID]"); //拿到当前的未锁定的订单池进行进一步操作
$orderService = new createOrderService();
if ($PoolStatus) //存在订单状态池
{
foreach ($PoolStatus as $k => $v) {
if (isset($v['status']) && $v['status'] == 1) { //还有未锁定的订单池
$orderService->stock($runID);
$value = $unlock_orderlist[$k];
$pool_passager_num = $orderService->poolNum($value); //计算该订单池中总共的乘客数
if (!$value || $pool_passager_num + $num > 6) { //说明该订单池不能加入该订单
continue;
}

$begin_x_y = $orderService->timeMatrix($value, $beginX_Y, 1); //获取所有起点时间矩阵
$end_x_y = $orderService->timeMatrix($value, $endX_Y, 2); //获取所有终点时间矩阵
$new_order = array("order_id" => $orderID, "num" => $num, "startx_y" => $beginX_Y, "endx_y" => $endX_Y, "begin_name" => $begin_name, "end_name" => $end_name);
$da = new dispatch_algorithm();
$res = $da->dispatch($prodID, $value, $new_order, $begin_x_y, $end_x_y, $run_date, $should_be_count,$bool_total_time);//调用调配订单算法
writeLog("调度算法返回结果:".json_encode($res));
if (!$res) {
continue;
}
$order = array('order_id' => $orderID, 'num' => $num, 'startx_y' => $beginX_Y, 'endx_y' => $endX_Y, "begin_name" => $begin_name, "end_name" => $end_name);
array_push($unlock_orderlist[$k], $order);
$mem->set("orderList[$runID]", $unlock_orderlist); //加入订单池
//如果该订单池满6个人之后,就要将这个订单池的状态置为锁定
if ($pool_passager_num + $num == 6) {
$PoolStatus[$k]['status'] = 0;
$mem->set("orderPoolStatus[$runID]", $PoolStatus); //加入状态
//更改该订单池在状态池中的状态
}
//TODO:将订单信息存入数据库中
$orderService->makeOrder($mem, $runID, $res, $k, $prodID);
//更新order_main中该车的里面的其他订单的上车时间和下车时间
$start_end_time = array();
writeLog("开始结束时间--:".json_encode($res));
foreach ($res as $id => $arr) {
if (!isset($start_end_time[$arr['order_id']])) {
$start_end_time[$arr['order_id']] = array();
$start_end_time[$arr['order_id']]["start_time"] = $arr['time'];
} else {
$start_end_time[$arr['order_id']]["end_time"] = $arr['time'];
$orderService->update_order_time($arr['order_id'], $start_end_time[$arr['order_id']]["start_time"], $arr['time']);
}
}
$arr_result['order_id'] = $orderID;
$arr_result['bus_no'] = $k;
$order_time = array();
foreach ($res as $num => $order) {
if ($order["order_id"] == $orderID) {
$order_time[] = $order['time'];
}
}
$arr_result['start_time'] = $order_time[0];
$arr_result['end_time'] = $order_time[1];
$data['code'] = '0';
$data['info'] = "配车成功,该订单已加入{$k}号车";
$data['result'] = $arr_result;
return $data;
}
}
//如果该订单均不能符合当前存在的任意订单池,继续派车
$stock = $orderService->stock($runID);
if ($stock['bus_num'] < 1) {
$data['code'] = '101';
$data['info'] = '当前班次无可派车辆';
return $data;
}
//$stock['next_blank_car'] 车ID
$unlock_orderlist[$stock['next_blank_car']][] = array('order_id' => $orderID, 'num' => $num, 'startx_y' => $beginX_Y, 'endx_y' => $endX_Y, "begin_name" => $begin_name, "end_name" => $end_name); //通过orderID标记不同的订单池
$mem->set("orderList[$runID]", $unlock_orderlist); //加入订单池
//初始化该订单池,状态值:0:已锁定;1:未锁定
$PoolStatus[$stock['next_blank_car']] = array('status' => 1);
$mem->set("orderPoolStatus[{$runID}]", $PoolStatus);
//如果该订单池人数满6,状态池置为锁定
if ($num >= 6) {
$PoolStatus[$stock['next_blank_car']]['status'] = 0;
$mem->set("orderPoolStatus[$runID]", $PoolStatus); //加入状态
//更改该订单池在状态池中的状态
}

//TODO:将订单信息存入数据库中
$order_res = $orderService->firstOrderTime($orderID, $beginX_Y, $endX_Y, $run_date);
$orderService->makeOrder($mem, $runID, $order_res, $stock['next_blank_car'], $prodID);
$result['code'] = 0;
$result['info'] = "该订单不能与有订单的车辆匹配,加入{$stock['next_blank_car']}成功";
$res_arr['order_id'] = $orderID;
$res_arr['bus_no'] = $stock['next_blank_car'];
$res_arr['start_time'] = $order_res[0]['time'];
$res_arr['end_time'] = $order_res[1]['time'];
$result['result'] = $res_arr;
return $result;
} else { //不存在当前班次的订单池,直接创建新的订单池以及订单状态池
//这里还需要进行判断有没有可以派的车(即有没有超出规定车辆数量的限制) 需要从数据库读取当前
$stock = $orderService->stock($runID);
if ($stock['bus_num'] < 1) {
$data['code'] = '101';
$data['info'] = '当前班次无可派车辆(当前班次的第一个订单)';
return $data;
}
//初始化该订单状态池,状态值:0:已锁定;1:未锁定
$PoolStatus[$stock['next_blank_car']] = array('status' => 1);
$mem->set("orderPoolStatus[$runID]", $PoolStatus);
$orderList[$stock['next_blank_car']][] = array('order_id' => $orderID, 'num' => $num, 'startx_y' => $beginX_Y, 'endx_y' => $endX_Y, "begin_name" => $begin_name, "end_name" => $end_name); //通过orderID标记不同的订单池
$mem->set("orderList[$runID]", $orderList); //加入订单池

//如果该订单池人数满6,状态池置为锁定
if ($num >= 6) {
$PoolStatus[$stock['next_blank_car']]['status'] = 0;
$mem->set("orderPoolStatus[$runID]", $PoolStatus); //加入状态
//更改该订单池在状态池中的状态
}
//TODO:将订单信息存入数据库中
$order_res = $orderService->firstOrderTime($orderID, $beginX_Y, $endX_Y, $run_date);
$orderService->makeOrder($mem, $runID, $order_res, $stock['next_blank_car'], $prodID);
$result['code'] = 0;
$result['info'] = "当前班次的第一个订单";
$res_arr['order_id'] = $orderID;
$res_arr['bus_no'] = $stock['next_blank_car'];
$res_arr['start_time'] = $order_res[0]['time'];
$res_arr['end_time'] = $order_res[1]['time'];
$result['result'] = $res_arr;
return $result;
}
}
}

+ 500
- 0
ZZDZ/application/api/dispatch_algorithm.php View File

@@ -0,0 +1,500 @@
<?php
/**
* Created by PhpStorm.
* User: Miracle
* Date: 2016/9/5
* Time: 10:51
* 调度算法
*/
require_once __DIR__ . '/common.php';

class dispatch_algorithm extends virtifyUsers
{

private $nj_nt_prod_id = "449860";
private $nt_nj_prod_id = "449865";

/**
* //全排列方法
* @param string $first
* @param $arr
* @param array $results
* Array ( [0] => 1-2-3 [1] => 1-3-2 [2] => 2-1-3 [3] => 2-3-1 [4] => 3-1-2 [5] => 3-2-1 ) 结果格式
*/
function Permutate($first = '', $arr, &$results = array())
{
$len = count($arr);
if ($len == 1) {
$results[] = $first . '-' . $arr[0];
} else {
for ($i = 0; $i < $len; $i++) {
$tmp = $arr[0];
$arr[0] = $arr[$i];
$arr[$i] = $tmp;
if ($first != '') {
$this->Permutate($first . '-' . $arr[0], array_slice($arr, 1), $results);
} else {
$this->Permutate($first . $arr[0], array_slice($arr, 1), $results);
}
}
}
}

/**
* //调度方法
* @param $order_list
* @param $new_order
* @param $array_start
* @param $array_end
* @return string|void
*/
function dispatch($prodID, $order_list, $new_order, $array_start, $array_end, $run_date, $should_be_count,$bool_total_time)
{
$is_xiecheng = false;//判断是否是携程的订单
$order_num = count($order_list) + 1;//将会有多少订单上车
$order_list[$order_num - 1]["order_id"] = $new_order["order_id"];
$order_list[$order_num - 1]["num"] = $new_order["num"];
$order_list[$order_num - 1]["startx_y"] = $new_order["startx_y"];
$order_list[$order_num - 1]["endx_y"] = $new_order["endx_y"];
for ($temp_xiecheng_i = 0; $temp_xiecheng_i < $order_num; $temp_xiecheng_i++) {
if (($order_list[$temp_xiecheng_i]["startx_y"] == "32.116682,118.784105" && $order_list[$temp_xiecheng_i]["endx_y"] == "32.011714,120.894448") || ($order_list[$temp_xiecheng_i]["startx_y"] == "32.011714,120.894448" && $order_list[$temp_xiecheng_i]["endx_y"] == "32.116682,118.784105")) {
$is_xiecheng = true;//是携程的订单
}
}
$arr = range(1, $order_num);//1-3的全排列
//默认相同地点或很近地点时间为0
for ($start_i = 1; $start_i <= $order_num; $start_i++) {
for ($start_ii = 1; $start_ii <= $order_num; $start_ii++) {
if ($array_start[$start_i][$start_ii] <= 2) {
$array_start[$start_i][$start_ii] = 0;//默认相同地点或很近地点时间为0
}
}
}
for ($end_i = 1; $end_i <= $order_num; $end_i++) {
for ($end_ii = 1; $end_ii <= $order_num; $end_ii++) {
if ($array_end[$end_i][$end_ii] <= 2) {
$array_end[$end_i][$end_ii] = 0;//默认相同地点或很近地点时间为0
}
}
}
$Permutate_results = array();
$this->Permutate($first = '', $arr, $Permutate_results);
$totol = count($Permutate_results);
$Permutate_array = array();
for ($ii = 0; $ii < $totol; $ii++) {
$Permutate_array[$ii] = explode('-', $Permutate_results[$ii]);//切分字符串变成数组
}
$min_start_cost_time = 9999;//起始地最小耗时
$min_start_arr_num = 0;//记录起始最小耗时的排列位置
for ($i = 0; $i < $totol; $i++) {
//遍历每一种全排列计算冗余时间
$totol_start_cost = 0;//每种组合实际消耗时间
for ($j = 0; $j < $order_num - 1; $j++) {
//计算每一个点
$totol_start_cost = $totol_start_cost + $array_start[$Permutate_array[$i][$j]][$Permutate_array[$i][$j + 1]];
}
if ($totol_start_cost < $min_start_cost_time) {
$min_start_arr_num = $i;//记录接人最小耗时组合
$min_start_cost_time = $totol_start_cost;//记录接人最小耗时时间值
}
}
$arr_start_rev = array();
$temp_j = $order_num - 1;
$arr_start_rev_cost = 0;//翻转接人耗时
for ($temp_i = 0; $temp_i < $order_num; $temp_i++) {
$arr_start_rev[$temp_i] = $Permutate_array[$min_start_arr_num][$temp_j];
$temp_j--;//翻转接人数组
}
for ($j = 0; $j < $order_num - 1; $j++) {
$arr_start_rev_cost = $arr_start_rev_cost + $array_start[$arr_start_rev[$j]][$arr_start_rev[$j + 1]];
}
$min_end_cost_time = 9999;//起始地最小耗时
$min_end_arr_num = 0;//记录起始最小耗时的排列位置
for ($i = 0; $i < $totol; $i++) {
//遍历每一种全排列计算冗余时间
$totol_end_cost = 0;//每种组合实际消耗时间
for ($j = 0; $j < $order_num - 1; $j++) {
//计算每一个点
$totol_end_cost = $array_end[$Permutate_array[$i][$j]][$Permutate_array[$i][$j + 1]] + $totol_end_cost;
}
if ($totol_end_cost < $min_end_cost_time) {
$min_end_arr_num = $i;//记录送人最小耗时组合
$min_end_cost_time = $totol_end_cost;//记录送人最小耗时时间值
}
}
$arr_end_rev = array();
$temp_j = $order_num - 1;
$arr_end_rev_cost = 0;//翻转送人耗时
for ($temp_i = 0; $temp_i < $order_num; $temp_i++) {
$arr_end_rev[$temp_i] = $Permutate_array[$min_end_arr_num][$temp_j];
$temp_j--;//翻转送人数组
}
for ($j = 0; $j < $order_num - 1; $j++) {
$arr_end_rev_cost = $arr_end_rev_cost + $array_end[$arr_end_rev[$j]][$arr_end_rev[$j + 1]];
}
$start = array(
"$min_start_cost_time" . '-' . $order_list[$Permutate_array[$min_start_arr_num][$order_num - 1] - 1]["startx_y"] => $Permutate_array[$min_start_arr_num],
"$arr_start_rev_cost" . '-' . $order_list[$Permutate_array[$min_start_arr_num][0] - 1]["startx_y"] => $arr_start_rev
);
$end = array(
"$min_end_cost_time" . '-' . $order_list[$Permutate_array[$min_end_arr_num][0] - 1]["startx_y"] => $Permutate_array[$min_end_arr_num],
"$arr_end_rev_cost" . '-' . $order_list[$Permutate_array[$min_end_arr_num][$order_num - 1] - 1]["startx_y"] => $arr_end_rev
);
#region 求出四种组合方式中用时最短的线路
$min_time_list = array();
foreach ($start as $k => $v) {
foreach ($end as $key => $value) {
$begin_lat_lon = explode('-', $k);
$end_lat_lon = explode('-', $key);
$time = commonUtils::baiduShortTime($begin_lat_lon[1], $end_lat_lon[1]);
$current_route = $v;
$total_route = array_merge($current_route, $value);
$total_time = array("min_time" => $begin_lat_lon[0] + ceil($time / 60) + $end_lat_lon[0], "route" => $total_route, "middle_time" => ceil($time / 60));
array_push($min_time_list, $total_time);
}
}
$max_time = 999999;
$min_route_arr = array();
$middleTime = 0;
$min_time_list_count = count($min_time_list);
for ($i = 0; $i < $min_time_list_count; $i++) {
if ($min_time_list[$i]["min_time"] < $max_time) {
$max_time = $min_time_list[$i]["min_time"];
$middleTime = $min_time_list[$i]["middle_time"]; //接人的最后一个点到送人的第一个点的最短时间
$min_route_arr = $min_time_list[$i]["route"];
}
}

$road1 = array("location" => "32.135283,120.230875", "nt" => "77", "nj" => "129");//高速路1 广陵枢纽与沪陕高速公路交叉口(地址:江苏省泰州市泰兴市)to:高速路标记点到南通的最短时间 go:高速路标记点到南京的最短时间
$road2 = array("location" => "31.749506,120.140182", "nt" => "89", "nj" => "116");//高速路2 江苏省常州市武进区横林枢纽立交桥
if ($is_xiecheng) {
//携程的订单
$temp_time_on_the_way = strtotime($run_date);
$time_on_the_way = date("Y-m-d H:i", $temp_time_on_the_way); //到携程的时间
} else {
//不是携程的订单
$temp_time_on_the_way = strtotime($run_date) + 210 * 60;
$time_on_the_way = date("Y-m-d H:i", $temp_time_on_the_way); //到南通的时间
}

#endregion
//调用处理冗余时间逻辑方法
$res = $this->redundantTime($order_list, $middleTime, $min_route_arr, $array_start, $array_end, $road1, $road2, $prodID, $time_on_the_way, $is_xiecheng,$should_be_count,$bool_total_time);
if ($res) {
return $res;
} else {
return false;
}

}

/**
* 处理冗余时间逻辑
* @param $order_list
* @param $middleTime
* @param $min_route_arr
* @param $start_arr
* @param $end_arr
* @return array|bool
*/
function redundantTime($order_list, $middleTime, $min_route_arr, $start_arr, $end_arr, $road1, $road2, $prodID, $time_on_the_way, $is_xiecheng, $should_be_count,$bool_total_time)
{
writeLog("heyikai_startarr:" . json_encode($start_arr));
writeLog("heyikai_endarr:" . json_encode($end_arr));
$boolean_total_time=$bool_total_time;
$new_order_is_xiecheng = false;//新订单是否是携程 1是0否
$xiecheng_order = $is_xiecheng;//是否是携程的订单 1是0否
$redundantTime_count = $should_be_count;
$go_where = $prodID;//去哪儿
$point_a = $road1;//关键点a
$point_b = $road2;//关键点b
$run_time = ceil(strtotime($time_on_the_way) / 60);//到达关键点时间
$go_time_arr = array();//接客时间数组
$send_time_arr = array();//送客时间数组
$every_one_go_cost_tiem_arr = array();//每位乘客的接客耗时
$every_one_send_cost_tiem_arr = array();//每位乘客的接客耗时
$can_seat_in = true;
$info = "";
$min_route_num = count($min_route_arr);
$order_count = count($order_list);//订单号
$total_cost_time = 0;
if (($order_list[$order_count - 1]["startx_y"] == "32.116682,118.784105" && $order_list[$order_count - 1]["endx_y"] == "32.011714,120.894448") || ($order_list[$order_count - 1]["startx_y"] == "32.011714,120.894448" && $order_list[$order_count - 1]["endx_y"] == "32.116682,118.784105")) {
$new_order_is_xiecheng = true;//如果最后一个订单是携程,变为真
}
writeLog("贺奕凯_新订单是否是携程:" . json_encode($new_order_is_xiecheng));
for ($i = 0; $i < $min_route_num - 1; $i++) {
//遍历路线数组
if ($i < $order_count - 1) {
$total_cost_time = $total_cost_time + $start_arr[$min_route_arr[$i]][$min_route_arr[$i + 1]];
} elseif ($i == $order_count) {
$total_cost_time = $total_cost_time + $middleTime + $end_arr[$min_route_arr[$i]][$min_route_arr[$i + 1]];
}
if ($i > $order_count) {
$total_cost_time = $total_cost_time + $end_arr[$min_route_arr[$i]][$min_route_arr[$i + 1]];
}
}
if ($total_cost_time > 360) {
if ($xiecheng_order) {
$can_seat_in = true;
$info = "总时间超过360分钟,携程订单为真";
} else {
if($bool_total_time){
//要算冗余和总时长
$can_seat_in = false;
$info = "总时间超过360分钟";
}else{
$can_seat_in =true;
$info = "总时间超过360分钟,但是不考虑";
}

}
}
for ($jj = 0; $jj < $order_count; $jj++) {
$ry_cost_time = 0;
for ($j = $jj; $j < $min_route_num - 1; $j++) {
if ($j < $order_count - 1) {
$ry_cost_time = $ry_cost_time + $start_arr[$min_route_arr[$j]][$min_route_arr[$j + 1]];
} elseif (($j + 1) == $order_count) {
$ry_cost_time = $ry_cost_time + $middleTime;
}
if ($j >= $order_count) {
$ry_cost_time = $ry_cost_time + $end_arr[$min_route_arr[$j]][$min_route_arr[$j + 1]];
}
if ($min_route_arr[$jj] == $min_route_arr[$j + 1]) {
if ($ry_cost_time > 60) {
if (($order_list[$jj]["startx_y"] == "32.116682,118.784105" && $order_list[$jj]["endx_y"] == "32.011714,120.894448") || ($order_list[$jj]["startx_y"] == "32.011714,120.894448" && $order_list[$jj]["endx_y"] == "32.116682,118.784105")) {
//这点是携程点
$can_seat_in = true;
// $info = "冗余时间超过30分钟";
// /*break;保证数据完整*/
} else {
//不是携程点
if ($new_order_is_xiecheng) {
//新订单是携程的
$can_seat_in = true;
} else {
//新订单不是携程的
$can_seat_in = false;
}
// $info = "冗余时间超过30分钟";
// /*break;保证数据完整*/
}
}
}
}
}
if (!$redundantTime_count) {
//特殊情况1,退票 不算冗余和时长
$can_seat_in = true;
}
if(!$bool_total_time){
//特殊情况2,cs系统 不算冗余和时长
$can_seat_in = true;
}
if ($can_seat_in) {
$can_seat_in_orderid_list = array();
for ($i = 0; $i < $min_route_num; $i++) {
$can_seat_in_orderid_list[$i] = $order_list[$min_route_arr[$i] - 1]["order_id"];
}
//$min_route_arr;行车路线
////$every_one_go_cost_tiem_arr=array();//每位乘客的接客耗时
//$every_one_send_cost_tiem_arr=array();//每位乘客的接客耗时
for ($i = 0; $i < $order_count; $i++) {
//计算每个订单接人的耗时
$every_one_go_cost_tiem_arr[$i] = 0;
for ($ii = $i; $ii < $order_count; $ii++) {
if ($ii == ($order_count - 1)) {
$every_one_go_cost_tiem_arr[$i] = $every_one_go_cost_tiem_arr[$i] + 0;
} else {
$every_one_go_cost_tiem_arr[$i] = $every_one_go_cost_tiem_arr[$i] + $start_arr[$min_route_arr[$ii]][$min_route_arr[$ii + 1]];
}
}
}
for ($i = $min_route_num - 1; $i > ($order_count - 1); $i--) {
$every_one_send_cost_tiem_arr[$i - $order_count] = 0;
for ($ii = $i; $ii > ($order_count - 1); $ii--) {
if ($ii == $order_count) {
$every_one_send_cost_tiem_arr[$i - $order_count] = $every_one_send_cost_tiem_arr[$i - $order_count] + 0;
} else {
$every_one_send_cost_tiem_arr[$i - $order_count] = $every_one_send_cost_tiem_arr[$i - $order_count] + $end_arr[$min_route_arr[$ii - 1]][$min_route_arr[$ii]];
}
}
}
$last_go = $min_route_arr[$order_count - 1];//最后一个接
$frist_send = $min_route_arr[$order_count];//第一个送
$last_go_where = $order_list[$last_go - 1]["startx_y"];
$frist_send_where = $order_list[$frist_send - 1]["endx_y"];
$time1 = commonUtils::baiduShortTime($last_go_where, $point_a["location"]) + commonUtils::baiduShortTime($point_a["location"], $frist_send_where);
$time2 = commonUtils::baiduShortTime($last_go_where, $point_b["location"]) + commonUtils::baiduShortTime($point_b["location"], $frist_send_where);
// $every_one_go_cost_tiem_arr=array();//每位乘客的接客耗时
////$every_one_send_cost_tiem_arr=array();//每位乘客的接客耗时
if ($xiecheng_order) {
//携程订单
$time_xiecheng = ceil(strtotime($time_on_the_way) / 60);//到携程的时间分钟
//$every_one_go_cost_tiem_arr 接人耗时数组
//$every_one_send_cost_tiem_arr 送人耗时数组
//$min_route_arr 行车队列 1423 1324
//$min_route_num 最短路径数组长度
writeLog("heyikai_到携程时间:" . json_encode($time_xiecheng));
writeLog("heyikai_接人耗时:" . json_encode($every_one_go_cost_tiem_arr));
writeLog("heyikai_送人耗时:" . json_encode($every_one_send_cost_tiem_arr));
$xiecheng_time_array = array();//携程时间数组
$xiecheng_number = 0;//记录第一个携程订单位置
// for ($temp_ii = 0; $temp_ii < $order_count; $temp_ii++) {
// if (($order_list[$temp_ii]["startx_y"] == "32.116682,118.784105" && $order_list[$temp_ii]["endx_y"] == "32.011714,120.894448") || ($order_list[$temp_ii]["startx_y"] == "32.011714,120.894448" && $order_list[$temp_ii]["endx_y"] == "32.116682,118.784105")) {
// $xiecheng_number = $temp_ii;//找到第一个携程订单
// writeLog("heyikai_第一个携程订单位置:".json_encode($xiecheng_number));
// break;
// }
// }
for ($temp_ii = 0; $temp_ii < $order_count; $temp_ii++) {
if (($order_list[$min_route_arr[$temp_ii] - 1]["startx_y"] == "32.116682,118.784105" && $order_list[$min_route_arr[$temp_ii] - 1]["endx_y"] == "32.011714,120.894448") || ($order_list[$min_route_arr[$temp_ii] - 1]["startx_y"] == "32.011714,120.894448" && $order_list[$min_route_arr[$temp_ii] - 1]["endx_y"] == "32.116682,118.784105")) {
$xiecheng_number = $temp_ii;//找到第一个携程订单
writeLog("heyikai_第一个携程订单位置:" . json_encode($xiecheng_number));
break;
}
}
$xiecheng_time_array[$xiecheng_number] = $time_xiecheng;//固定到携程时间
writeLog("heyikai_已经固定到携程订单时间:" . json_encode($xiecheng_time_array[$xiecheng_number]));
for ($temp_f = ($xiecheng_number - 1); $temp_f >= 0; $temp_f--) {
//计算携程前一点和以前的时间
$xiecheng_time_array[$temp_f] = $xiecheng_time_array[($temp_f + 1)] - $start_arr[$min_route_arr[$temp_f]][$min_route_arr[($temp_f + 1)]];
}
for ($temp_e = ($xiecheng_number + 1); $temp_e < $min_route_num; $temp_e++) {
//计算携程后一点和以后的时间
$xiecheng_time_array[$temp_e] = $xiecheng_time_array[($temp_e - 1)] + $start_arr[$min_route_arr[$temp_e - 1]][$min_route_arr[($temp_e)]];
}
//计算中间时间
$during_time = commonUtils::baiduShortTime($order_list[$min_route_arr[$order_count - 1] - 1]["startx_y"], $order_list[$min_route_arr[$order_count] - 1]["endx_y"]);
//确定第一个终点的时间
writeLog("heyikai_中间时间:" . json_encode($during_time));
writeLog("heyikai_中间起点:" . json_encode($order_list[$min_route_arr[$order_count - 1] - 1]["startx_y"]));
writeLog("heyikai_中间终点:" . json_encode($order_list[$min_route_arr[$order_count] - 1]["endx_y"]));
$xiecheng_time_array[$order_count] = $xiecheng_time_array[$order_count - 1] + $during_time;
for ($temp_temp_end = ($order_count + 1); $temp_temp_end < $min_route_num; $temp_temp_end++) {
//计算第一个点以后的时间
$xiecheng_time_array[$temp_temp_end] = $xiecheng_time_array[($temp_temp_end - 1)] + $end_arr[$min_route_arr[($temp_temp_end - 1)]][$min_route_arr[$temp_temp_end]];
}
$final_xiecheng = array();//携程最终返回
for ($temp_xiecheng_i = 0; $temp_xiecheng_i < $min_route_num; $temp_xiecheng_i++) {
$final_xiecheng[$temp_xiecheng_i]["time"] = date("Y-m-d H:i", $xiecheng_time_array[$temp_xiecheng_i] * 60);
$final_xiecheng[$temp_xiecheng_i]["order_id"] = $order_list[$min_route_arr[$temp_xiecheng_i] - 1]["order_id"];
}
writeLog("heyikai:" . json_encode($final_xiecheng));
return $final_xiecheng;
} else {
//不是携程订单
if ($go_where == $this->nj_nt_prod_id) {
//南京去南通方向
if ($time1 > $time2) {
//选point_b
$temp_time = $run_time - $point_b["nt"];
$temp_time_go = $temp_time - commonUtils::baiduShortTime($last_go_where, $point_b["location"]);
for ($i = 0; $i < $order_count; $i++) {
$every_one_go_cost_tiem_arr[$i] = $temp_time_go - $every_one_go_cost_tiem_arr[$i];
}
$temp_time_send = $temp_time + commonUtils::baiduShortTime($point_b["location"], $frist_send_where);
for ($i = 0; $i < $order_count; $i++) {
$every_one_send_cost_tiem_arr[$i] = $temp_time_send + $every_one_send_cost_tiem_arr[$i];
}
} else {
//选point_a
$temp_time = $run_time - $point_a["nt"];
$temp_time_go = $temp_time - commonUtils::baiduShortTime($last_go_where, $point_a["location"]);
for ($i = 0; $i < $order_count; $i++) {
$every_one_go_cost_tiem_arr[$i] = $temp_time_go - $every_one_go_cost_tiem_arr[$i];
}
$temp_time_send = $temp_time + commonUtils::baiduShortTime($point_a["location"], $frist_send_where);
for ($i = 0; $i < $order_count; $i++) {
$every_one_send_cost_tiem_arr[$i] = $temp_time_send + $every_one_send_cost_tiem_arr[$i];
}
}
} elseif ($go_where == $this->nt_nj_prod_id) {
//南通去南京方向
if ($time1 > $time2) {
//选point_b
$temp_time = $run_time - $point_b["nj"];
$temp_time_go = $temp_time - commonUtils::baiduShortTime($last_go_where, $point_b["location"]);
for ($i = 0; $i < $order_count; $i++) {
$every_one_go_cost_tiem_arr[$i] = $temp_time_go - $every_one_go_cost_tiem_arr[$i];
}
$temp_time_send = $temp_time + commonUtils::baiduShortTime($point_b["location"], $frist_send_where);
for ($i = 0; $i < $order_count; $i++) {
$every_one_send_cost_tiem_arr[$i] = $temp_time_send + $every_one_send_cost_tiem_arr[$i];
}
} else {
//选point_a
$temp_time = $run_time - $point_a["nj"];
$temp_time_go = $temp_time - commonUtils::baiduShortTime($last_go_where, $point_a["location"]);
for ($i = 0; $i < $order_count; $i++) {
$every_one_go_cost_tiem_arr[$i] = $temp_time_go - $every_one_go_cost_tiem_arr[$i];
}
$temp_time_send = $temp_time + commonUtils::baiduShortTime($point_a["location"], $frist_send_where);
for ($i = 0; $i < $order_count; $i++) {
$every_one_send_cost_tiem_arr[$i] = $temp_time_send + $every_one_send_cost_tiem_arr[$i];
}
}
} else {
return false;
}
for ($i = 0; $i < $order_count; $i++) {
$every_one_go_cost_tiem_arr[$i] = date("Y-m-d H:i", $every_one_go_cost_tiem_arr[$i] * 60);
}
for ($i = 0; $i < $order_count; $i++) {
$every_one_send_cost_tiem_arr[$i] = date("Y-m-d H:i", $every_one_send_cost_tiem_arr[$i] * 60);
}
$final_result = array();
for ($i = 0; $i < $min_route_num; $i++) {
if ($i < $order_count) {
//接人
$final_result[$i]["order_id"] = $can_seat_in_orderid_list[$i];
$final_result[$i]["time"] = $every_one_go_cost_tiem_arr[$i];
} else {
//送人
$final_result[$i]["order_id"] = $can_seat_in_orderid_list[$i];
$final_result[$i]["time"] = $every_one_send_cost_tiem_arr[$i - $order_count];
}

}
return $final_result;
}
} else {
return false;
}
}
}

/*
* 勿删
* $road1 = array("location" => "32.135283,120.230875,", "nt" => "77", "nj" => "129");//高速路1 广陵枢纽与沪陕高速公路交叉口(地址:江苏省泰州市泰兴市)to:高速路标记点到南通的最短时间 go:高速路标记点到南京的最短时间
$road2 = array("location" => "31.749506,120.140182", "nt" => "89", "nj" => "116");//高速路2 江苏省常州市武进区横林枢纽立交桥
*/
//测试
/*$test = new test();
//传入的订单数组
$order_list = array(
0 => array("order_id" => 10001, "num" => 2, "startx_y" => '32.037596,118.769413', "endx_y" => '31.978861,120.915932'),
1 => array("order_id" => 10002, "num" => 2, "startx_y" => '32.04072,118.753993', "endx_y" => '32.01604,120.863561'),
2 => array("order_id" => 10003, "num" => 1, "startx_y" => '32.034166,118.746134', "endx_y" => '31.98495,120.923472')
);

//新加入订单信息
$new_order = array("order_id" => "10004", "num" => "1", "startx_y" => "32.021622,118.728496", "endx_y" => "32.064859,120.815552");

//起点时间矩阵
$array_start = array(
1 => array(1 => 0, 2 => 7, 3 => 9, 4 => 11),
2 => array(1 => 6, 2 => 0, 3 => 8, 4 => 2),
3 => array(1 => 7, 2 => 10, 3 => 0, 4 => 25),
4 => array(1 => 7, 2 => 14, 3 => 10, 4 => 0)
);
//终点时间矩阵
$array_end = array(
1 => array(1 => 0, 2 => 5, 3 => 11, 4 => 5),
2 => array(1 => 3, 2 => 0, 3 => 8, 4 => 20),
3 => array(1 => 11, 2 => 5, 3 => 0, 4 => 12),
4 => array(1 => 15, 2 => 8, 3 => 11, 4 => 0)
);
$res = $test->Control($order_list, $new_order, $array_start, $array_end);
var_dump($res);*/


+ 32
- 0
ZZDZ/application/api/get_line_info.php View File

@@ -0,0 +1,32 @@
<?php
/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/8/25
* Time: 16:18
* 根据线路ID获取线路信息 (线路暂时固定)
*/
require_once __DIR__.'/common.php';
class lineInfo extends virtifyUsers
{
public function getLineInfo($prodId)
{
$pdo = conn();
$sql = "SELECT prod_id,prod_name FROM opera_product WHERE prod_id='{$prodId}' AND prod_type = 81 AND is_onsale = 1 AND cancel_flag = 0";
if (is_object($pdo)) {
$result = $pdo->query($sql);
$rowset = $result->fetchAll(PDO::FETCH_ASSOC);
$result->closeCursor();
foreach ($rowset as $v) {
$prod_id = $v['prod_id'];
$prod_name = $v['prod_name'];
}
$area = explode('-', $prod_name);
$arr = array('prod_id' => $prod_id, 'startArea' => $area[0], 'endArea' => $area[1]);
return json_encode($arr);
}
}
}
$prodId = "153052";
$lineInfo=new lineInfo();
$lineInfo->getLineInfo($prodId);

+ 74
- 0
ZZDZ/application/api/get_order_info.php View File

@@ -0,0 +1,74 @@
<?php
/**
* Created by PhpStorm.
* User: luocj
* Date: 2016/8/29
* Time: 13:48
*/
require_once __DIR__.'/common.php';
class OrderInfo extends virtifyUsers
{
function getOrderInfo($userId)
{
$pdo = conn();
//查询订单信息
$sql = "select ORDER_ID,ORDER_PRICE,ORDER_DESCRIPTION,CREATE_TIME,CUSTOMER_NAME,CUSTOMER_MOBILE from ORDER_MAIN where CANCEL_FLAG = 0 AND PARENT_ORDER_ID = 0 and CREATE_USER_ID = '{$userId}'";
$result = $pdo->query($sql);
$price_info = $result->fetchAll(PDO::FETCH_ASSOC);
foreach ($price_info as $k => $v) {
$list_order_id[] = $v['ORDER_ID'];
$res2[$v['ORDER_ID']] = $v;
//$res_name[$v['order_id']] = $v['order_description'];
}
$list_orderid = implode($list_order_id, ',');
$sql = "select DISTINCT ORDER_STATUS,PROD_START_STATION_RES_NAME,PROD_START_STATION_AREA_NAME,PROD_END_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,RUN_DATE,RUN_TIME,PARENT_ORDER_ID
FROM ORDER_MAIN WHERE cancel_flag = 0 AND parent_order_id in (" . $list_orderid . ") ";
$result = $pdo->query($sql);
$ticket_info = $result->fetchAll(PDO::FETCH_ASSOC);
echo "<pre>";
$children_info = array();
foreach ($ticket_info as $v) {
$children_info[$v['PARENT_ORDER_ID']] = $v;
}
$list = array();
foreach ($list_order_id as $v) {
$list[] = array(
'ORDER_ID' => $children_info[$v]['PARENT_ORDER_ID'],
'ORDER_STATUS' => $children_info[$v]['ORDER_STATUS'],
'PROD_START_STATION_RES_NAME' => $children_info[$v]['PROD_START_STATION_RES_NAME'],
'PROD_START_STATION_AREA_NAME' => $children_info[$v]['PROD_START_STATION_AREA_NAME'],
'PROD_END_STATION_RES_NAME' => $children_info[$v]['PROD_END_STATION_RES_NAME'],
'PROD_END_STATION_AREA_NAME' => $children_info[$v]['PROD_END_STATION_AREA_NAME'],
'RUN_DATE' => $children_info[$v]['RUN_DATE'],
'RUN_TIME' => $children_info[$v]['RUN_TIME'],
'ORDER_PRICE' => $res2[$v]['ORDER_PRICE'],
'ORDER_DESCRIPTION' => commonUtils::fomatStr($res2[$v]['ORDER_DESCRIPTION']), //order_description:普通座票(往返),2016-08-14,1|,如果需要觉得话,可以不用fomatStr处理即可
'CUSTOMER_NAME' => $res2[$v]['CUSTOMER_NAME'],
'CUSTOMER_MOBILE' => $res2[$v]['CUSTOMER_MOBILE'],
// 'CREATE_TIME' => $res2[$v]['CREATE_TIME'], //获取下单的时间
'TIME_DIFF' => $children_info[$v]['ORDER_STATUS']==145?(strtotime( $res2[$v]['CREATE_TIME'] )-strtotime(date("Y-m-d H:i:s",time()))):''
);

}
// return $list;
return json_encode($list);
}


}

$userId = isset($_POST['userID']) ? $_POST['userID'] : 46; //此处为测定userID,需要换成正式的
if (!$userId) {
return false;
}
$orderInfo = new OrderInfo();
$res = $orderInfo->getOrderInfo($userId);
//print_r($res);









+ 87
- 0
ZZDZ/application/api/get_run_list.php View File

@@ -0,0 +1,87 @@
<?php
/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/8/25
* Time: 20:18
* 根据出发地、目的地、日期获取班次信息
*/
require_once __DIR__.'/common.php';

class runList extends virtifyUsers
{
public function getRunList($PAGE, $PAGE_SIZE, $RUN_DATE, $RUN_LINE)
{
$pdo = conn();
$pdo1 = conn();
if($RUN_DATE==date("Y-m-d",time()))
{
$RUN_DATE=date("Y-m-d H:i",time());
}else
{
$RUN_DATE=date('Y-m-d H:i',strtotime($RUN_DATE));
}
$sql = "CALL SP_CHOICE_KICKET('1','" . $PAGE . "','" . $PAGE_SIZE . "','','','" . $RUN_DATE . "','','" . $RUN_LINE . "')";
if (is_object($pdo)) {
$stmt = $pdo->query($sql);
$i = 1;
if ($stmt) {
$data['code'] = '0';
$data['info'] = '';
do {
$rowset = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($i == 1) {
$data['currpage'] = $rowset[0]['currpage'];
$data['total_page'] = $rowset[0]['total_page'];
$data['total'] = $rowset[0]['total'];
$data['page_size'] = $rowset[0]['page_size'];
} else if ($i == 2) {
$ticket = array();
foreach ($rowset as $k => $v) { //遍历班次,车次,库存相加,班次归类。
$ticket_info = $v;
if (!isset($ticket[$v['run_id']])) {
$ticket[$v['run_id']] = $ticket_info;
$sql = "select prod_id from opera_product where parent_id = " . $ticket[$v['run_id']]['prod_id'] . " and ticket_mark = 1 and cancel_flag = 0";
$result = $pdo1->query($sql);
$ticket_id = $result->fetchAll(PDO::FETCH_ASSOC);
$result->closeCursor();
$ticket[$v['run_id']]['ticket_id'] = $ticket_id[0]['prod_id'];
} else {
$ticket[$v['run_id']]['stock'] += $v['stock'];
}
$ticket = array_values($ticket);
}
$data['total'] = count($ticket);
$data['total_page'] = ceil(count($ticket) / $data['page_size']);
$data['ticket'] = $ticket;
} else {
}
$i++;
} while ($stmt->nextRowset());
} else {
$data['code'] = '1';
$data['info'] = '查询失败';
}
if ($stmt) {
$stmt->closeCursor();
}
}
if (is_array($data)) {
return json_encode($data);
}
}
}

$RUN_LINE = $_POST['prod_id'];
$PAGE = isset($_POST['page']) ? $_POST['page'] : 1;
$PAGE_SIZE = isset($_POST['page_size']) ? $_POST['page_size'] : 5;
$RUN_DATE = isset($_POST['startDate']) ? $_POST['startDate'] : date('Y-m-d', time());
if (!$RUN_LINE) {
return false;
}
$runList = new runList();
$res = $runList->getRunList($PAGE, $PAGE_SIZE, $RUN_DATE, $RUN_LINE);
echo $res;




+ 109
- 0
ZZDZ/application/api/get_time_by_location.php View File

@@ -0,0 +1,109 @@
<?php
/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/9/7
* Time: 19:28
*/
require_once __DIR__ . '/common.php';
require_once __DIR__ . '/dispatch_algorithm.php';

class getTimeByLoc extends virtifyUsers
{
public static $NJ_NT_LINE_ID = "449860";
public static $NT_NJ_LINE_ID = "449865";

public function getTimeByLocation($prodID, $runID, $orderID, $num, $beginX_Y, $endX_Y, $run_date)
{
$mem = new Memcache();
$mem->connect('127.0.0.1', 11211);
$PoolStatus = $mem->get("orderPoolStatus[$runID]"); //添加runid标记是为了区别是哪个时间的班次
$unlock_orderlist = $mem->get("orderList[$runID]"); //拿到当前的未锁定的订单池进行进一步操作
$orderService = new createOrderService();
if ($PoolStatus) //存在订单状态池
{
foreach ($PoolStatus as $k => $v) {
if (isset($v['status']) && $v['status'] == 1) { //还有未锁定的订单池
$value = $unlock_orderlist[$k];
$pool_passager_num = $orderService->poolNum($value); //计算该订单池中总共的乘客数
if (!$value || $pool_passager_num + $num > 6) {//说明该订单池不能加入该订单
continue;
}
$begin_x_y = $orderService->timeMatrix($value, $beginX_Y, 1); //获取所有起点时间矩阵
$end_x_y = $orderService->timeMatrix($value, $endX_Y, 2); //获取所有终点时间矩阵
$new_order = array("order_id" => $orderID, "num" => $num, "startx_y" => $beginX_Y, "endx_y" => $endX_Y);
$da = new dispatch_algorithm();
$res = $da->dispatch($prodID, $value, $new_order, $begin_x_y, $end_x_y, $run_date, true);//调用调配订单算法
if (!$res) {
continue;
}
$temp_result = array();
$temp_i = 0;
foreach ($res as $res_temp) {
if ($res_temp["order_id"] == $orderID) {
//$temp_result[$temp_i]["order_id"] = $orderID;
$temp_result[$temp_i] = $res_temp["time"];
$temp_i++;
}
}
$result['code'] = '0';
$result['info'] = '时间预估成功';
$result['result'] = array(date("H:i", strtotime($temp_result[0])), date("H:i", strtotime($temp_result[1])));
$start1 = strtotime($temp_result[0]) + 5 * 60;
$start2 = strtotime($temp_result[0]) - 10 * 60;
$end1 = strtotime($temp_result[1]) + 5 * 60;
$end2 = strtotime($temp_result[1]) - 10 * 60;
$result['str_time'] = array(date("H:i", $start2) . '--' . date("H:i", $start1), date("H:i", $end2) . '--' . date("H:i", $end1));
return $result;
}
}
//如果该订单均不能符合当前存在的任意订单池,需要加车,那么只需要算当前这个订单的始终点时间
$stock = $orderService->stock($runID);
if ($stock['bus_num'] < 1) { //如果没有库存,虚拟一辆空车,也需要返回上下车时间
$result['code'] = '101';
$result['info'] = '无可派车辆';
}
$res = $orderService->firstOrderNeedTime($beginX_Y, $endX_Y, $run_date);
return $res;
} else { //不存在当前班次的订单池,直接创建新的订单池以及订单状态池
//这里还需要进行判断有没有可以派的车(即有没有超出规定车辆数量的限制) 需要从数据库读取当前
$stock = $orderService->stock($runID);
if ($stock['bus_num'] < 1) {
$result['code'] = '101';
$result['info'] = '无可派车辆';
}
//只需要算当前这个订单的始终点时间
$res = $orderService->firstOrderNeedTime($beginX_Y, $endX_Y, $run_date);
return $res;
}
}
}

$gtb = new getTimeByLoc();
$prodID = isset($_POST['prod_id']) ? $_POST['prod_id'] : false;
$runID = isset($_POST['run_id']) ? $_POST['run_id'] : false;
$num = isset($_POST['num']) ? $_POST['num'] : false;
$beginX_Y = isset($_POST['startx_y']) ? $_POST['startx_y'] : false;
$endX_Y = isset($_POST['endx_y']) ? $_POST['endx_y'] : false;
$run_date = isset($_POST['run_date']) ? $_POST['run_date'] : false;

//先判断是否属于规定的市区
if (!$beginX_Y || !$endX_Y) {
exit();
}
$start_area = commonUtils::GeocodingAPI($beginX_Y);
$end_area = commonUtils::GeocodingAPI($endX_Y);
if (($prodID == getTimeByLoc::$NJ_NT_LINE_ID && $start_area == "南京市" && $end_area == "南通市") || ($prodID == getTimeByLoc::$NT_NJ_LINE_ID && $start_area == "南通市" && $end_area == "南京市")) {
if ($prodID && $runID && $num && $beginX_Y && $endX_Y && $run_date) {
$orderID = date('Ymd') . str_pad(mt_rand(1, 99999), 5, '0', STR_PAD_LEFT);
$res = $gtb->getTimeByLocation($prodID, $runID, $orderID, $num, $beginX_Y, $endX_Y, $run_date);
echo json_encode($res);
}
} else {
$result['code'] = 1;
$result['info'] = "所选地点不在规划范围内";
echo json_encode($result);
}




+ 90
- 0
ZZDZ/application/custom_made/cancel_outtime_order.php View File

@@ -0,0 +1,90 @@
<?php
//载入配置文件和连接数据库
date_default_timezone_set('PRC');
require_once '/usr/share/nginx/XMWX/ZZDZ/config/Mysql.php';
require_once '/usr/share/nginx/XMWX/ZZDZ/application/api/cancel_order.php';
$pdo=conn();
$time = date('Y-m-d H:i:s', time()-600);


$sql="select order_id,create_time from order_main where create_time<'".$time."' and order_status = 145 and cancel_flag=0 and parent_order_id =0 and ORDER_BOOK_STATUS =1 and order_prod_type in (81,82)";

$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
if(false == $rowset) {die;}

foreach ($rowset as $v) {
$list[] =$v['order_id'];
}
foreach ($list as $v) {
$sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $v . ")";
$result = $pdo -> query($sql);
$list_d = Find($v);
if($list_d['prod_id'] == 449862 ||$list_d['prod_id'] == 449867 ){
$cancel_order = new cancelOrder();
writeLog('weiyixi#####auto_cancel##param##line_id#'.$list_d['line_id'].'#run_id#'.$list_d['run_id'].'#run_bus_order_id#'.$list_d['run_bus_order_id'].'#parent_order_id#'. $list_d['parent_order_id'].'#run_time#'. $list_d['run_time'].'#########');
$res = $cancel_order -> funCancelOrder($list_d['line_id'], $list_d['run_id'], $list_d['run_bus_order_id'], $list_d['parent_order_id'], $list_d['run_time']);
}
//exit();
}




function Find($order_id){
$pdo= conn();
$sql = "select order_description,order_price,order_pay_main_id "
. "from order_main "
. "where order_id=".$order_id;
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$order_price = $rowset[0];//订单总价格 订单票的数量
$sql = "SELECT DISTINCT
order_description,parent_order_id,run_date,run_id,run_time,run_bus_order_id,prod_id,parent_prod_id,PROD_START_STATION_AREA_NAME,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME
FROM `order_main`
where PARENT_ORDER_ID=".$order_id;
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$order_station = $rowset[0];//订单来往地址 订单时间 订单好
if(empty($order_station))
return false;
$array_order_desc=array();

$arr_temp = explode('|',$order_price['order_description']);
$arr=array();
foreach ($arr_temp as $k=>$v2) {
if(!empty($v2))
$array_order_desc[]= explode (',', $v2); //订单票 * 数量
}
$list = array();
//上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)//反的数组
$list['station'] = $order_station['PROD_START_STATION_AREA_NAME'].'('.$order_station['PROD_START_STATION_RES_NAME'].')'
.'-'.$order_station['PROD_END_STATION_AREA_NAME'].'('.$order_station['PROD_END_STATION_RES_NAME'].')';
$list['start_station']=$order_station['PROD_START_STATION_AREA_NAME'];
$list['end_station']=$order_station['PROD_END_STATION_AREA_NAME'];
$list['start_res_name'] = $order_station['PROD_START_STATION_RES_NAME'];
$list['end_res_name'] = $order_station['PROD_END_STATION_RES_NAME'];
$list['run_date'] = $order_station['run_date'];
$list['run_time'] = $order_station['run_date'].' '.$order_station['run_time'];
$list['count']='';
$list['tic_num'] = 0;
foreach ($array_order_desc as $v){
$list['count'] .= ' '.$v[0].' × '.$v[2];
$list['tic_num'] +=$v[2] ;
}
$list['order_price'] = $order_price['order_price'];
$sql = "select pay_serial_number from order_pay_detail where pay_main_id =".$order_price['order_pay_main_id'];
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$list['pay_num'] = $rowset[0]['pay_serial_number'];
$list['line_id'] = $order_station['parent_prod_id'];
$list['run_id'] = $order_station['run_id'];//run_bus_order_id
$list['run_bus_order_id'] = $order_station['run_bus_order_id'];//parent_order_id
$list['parent_order_id'] = $order_station['parent_order_id'];
$list['prod_id'] = $order_station['prod_id'];
return $list;
}


+ 13
- 0
ZZDZ/application/custom_made/control.php View File

@@ -0,0 +1,13 @@
<?php

header("Access-Control-Allow-Origin:*");
//载入配置文件和连接数据库
require_once __DIR__.'/../../config/Mysql.php';

$pdo = conn();
$type = $_POST['type'];
$type = str_replace("_", '/', $type);
//根据需求调用相应的文件获得数据
require_once '' . $type . '.php';

?>

+ 56
- 0
ZZDZ/application/custom_made/order/getposition.php View File

@@ -0,0 +1,56 @@
<?php
/*
* wechat 2.0
* Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
* Date: 2016.09.07
* Something is to pay QQ1062140302
*/

header("Access-Control-Allow-Origin:*");
// require_once '../../../config/Mysql.php';
// $pdo= conn1();
if(isset($_POST["bus_no"])){
$order_bus_no = $_POST["bus_no"];
$driver_name = $_POST['driver_name'];}
else{
$order_bus_no ='0';
$driver_name= '';
}

//$order_driver_name = $rowset[0]["SEND_DRIVER_NAME"];
$sql = "SELECT b.PROPERTY FROM base_resource a LEFT JOIN `base_resource_property` b on a.RES_ID =b.RES_ID where b.TYPE_ID=283 and a.RES_NAME ='".$order_bus_no."'";
//$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);

$sql_res = "SELECT res_id from base_resource where RES_NAME='".$driver_name."'";
$res_id = $pdo -> query($sql_res);
$res_id_a = $res_id -> fetchAll(PDO::FETCH_ASSOC);
$sql_phone = "SELECT pos_x,pos_y from run_bus_pos where driver_id='".$res_id_a[0]["res_id"]."' order by log_time desc";
$res_phone = $pdo -> query($sql_phone);
$pos_arr = $res_phone -> fetchAll(PDO::FETCH_ASSOC);
//$pdo = conn();
//$result_name = $pdo -> query($sql_name);
//$rowset_name = $result_name -> fetchAll(PDO::FETCH_ASSOC);


if(isset($rowset[0]['PROPERTY']) || 1){
$position = get_position('352477070120666');//$rowset[0]['PROPERTY']
$j = $position['j'];
$w = $position['w'];
$speed = $position['speed'];
}elseif(isset($pos_arr[0]['pos_x'])){
$j = $pos_arr[0]['pos_y'];
$w = $pos_arr[0]['pos_x'];
$speed = '0';
}else{
$j = '0';
$w = '0';
$speed = '0';
}

$signPackage['j'] =$j;
$signPackage['w'] =$w;
$signPackage['speed'] =$speed;

echo json_encode(array('code'=>'0','info'=>'','list'=>$signPackage));

+ 232
- 0
ZZDZ/application/custom_made/order/list.php View File

@@ -0,0 +1,232 @@
<?php
header("Access-Control-Allow-Origin:*");
/**
* User: Miracle
* Date: 2016/8/24
* Time: 11:00
* 出行详情接口
*/

date_default_timezone_set('PRC');
//$MAIN_CREATE_USER_ID=$_COOKIE['user_id'];
//获得用户名
//$member_id = $_COOKIE['user_id'];
//获得用户名
$member_id = '1';
$list_going = array();
require_once '../../../config/Mysql.php';
//即将出行数据列表
//当获得的用户名不为空
$disney_prod =get_dsnprod();
//苏州线路 152738 152745 西塘乌镇线路 152690 152703
$disney_prod = array_merge($disney_prod,array('152738','152745','152690','152703'));
if (!empty($member_id)) {
$sql = "SELECT ORDER_ID,ORDER_DESCRIPTION,ORDER_PRICE FROM ORDER_MAIN WHERE member_id=" . $member_id . " AND CANCEL_FLAG=0 AND PARENT_ORDER_ID=0 AND ORDER_STATUS in (146,147) and order_prod_type in (81,82) order by run_date DESC,RUN_TIME desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
//var_dump($rowset);

$i = 0;
foreach ($rowset as $temp) {
$order_id = $temp['ORDER_ID'];
$order_info = $temp["ORDER_DESCRIPTION"];
$temp_temp = explode(',', $order_info);
$seat_type = str_replace("票", "", $temp_temp[0]);
//座位类型
$seat_num = str_replace("|", "", $temp_temp[2]);
//座位数量
$sql = "SELECT order_status,parent_prod_id,RUN_ID,RUN_DATE,RUN_TIME,RUN_BUS_ORDER_ID,PROD_START_STATION_RES_NAME,PROD_START_STATION_AREA_NAME,PROD_END_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_TIME_MINUTES,PROD_START_STATION_TIME_MINUTES FROM ORDER_MAIN WHERE PARENT_ORDER_ID=" . $temp["ORDER_ID"] . " AND CANCEL_FLAG=0";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);

//var_dump($rowset);
$time = $rowset[0]["RUN_TIME"];
$date = $rowset[0]["RUN_DATE"];
$temp_time = $date . " " . $time;
$start_time = strtotime($temp_time);
$now_time = time();
if ($start_time >= $now_time) {
//将要出行的订单
$order_start_date = date("n月j日", $start_time);
//日期
$order_start_time = $time;
//时间
$weekarray = array("日", "一", "二", "三", "四", "五", "六");
//先定义一个数组
$start_week = "星期" . $weekarray[date("w",$start_time)];

if (date('Y-m-d', time()) == $date) {
$start_week = "今天";
}
$list_going[$i]["week"] = $start_week;

$list_going[$i]["year"] = $date;

$run_time_start = $rowset[0]["PROD_START_STATION_TIME_MINUTES"];
$run_time_end = $rowset[0]["PROD_END_STATION_TIME_MINUTES"];
$order_hour = floor(($run_time_end - $run_time_start) / 60);
//小时
$order_min = ($run_time_end - $run_time_start) % 60;
//分钟
$order_used_time = $order_hour . "时" . $order_min . "分";
//耗时
$order_start_res_name = $rowset[0]["PROD_START_STATION_RES_NAME"];
//起始res名字
$order_start_area_name = $rowset[0]["PROD_START_STATION_AREA_NAME"];
//起始地区名字
$order_end_res_name = $rowset[0]["PROD_END_STATION_RES_NAME"];
//终点res名字
$order_end_area_name = $rowset[0]["PROD_END_STATION_AREA_NAME"];
//检票状态
if($rowset[0]['order_status'] ==146){
$check ='0';
}else{
$check = '1';
}
//是否显示二维码
if(in_array($rowset[0]['parent_prod_id'], $disney_prod)){
$ercode = '1';
}else{
$ercode = '0';
}
//终点地区名字
$sql = "SELECT SEND_BUS_NO,SEND_DRIVER_NAME,SEND_DRIVER_MOBILE,run_id FROM RUN_BUS WHERE CANCEL_FLAG=0 AND RUN_ID=" . $rowset[0]["RUN_ID"] . " AND BUS_ORDER_ID=" . $rowset[0]["RUN_BUS_ORDER_ID"];
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);

//var_dump($rowset);
$order_bus_no = "";
//车牌号
$order_driver_name = "";
//司机名称
$driver_mobile='';
if (!empty($rowset[0]["SEND_BUS_NO"])) {
$driver_mobile = isset($rowset[0]['SEND_DRIVER_MOBILE'])?$rowset[0]['SEND_DRIVER_MOBILE']:'';
$order_bus_no = $rowset[0]["SEND_BUS_NO"];
$order_driver_name = $rowset[0]["SEND_DRIVER_NAME"];
//获取司机res_id
$sql_res = "SELECT res_id from base_resource where RES_NAME='".$rowset[0]["SEND_DRIVER_NAME"]."'";
$res_id = $pdo -> query($sql_res);
$res_id_a = $res_id -> fetchAll(PDO::FETCH_ASSOC);
$sql_phone = "SELECT pos_x,pos_y from run_bus_pos where driver_id='".$res_id_a[0]["res_id"]."' order by log_time desc";
$res_phone = $pdo -> query($sql_phone);
$pos_arr = $res_phone -> fetchAll(PDO::FETCH_ASSOC);
$sql = "SELECT b.PROPERTY FROM base_resource a LEFT JOIN `base_resource_property` b on a.RES_ID =b.RES_ID where b.TYPE_ID=283 and a.RES_NAME ='".$order_bus_no."'";
//$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$time_cut =strtotime($date.' '.$time) - time();
if(isset($rowset[0]['PROPERTY']) && $time_cut<1800){
$ifgps ='1';
}else if($time_cut<1800 && isset($pos_arr[0]['pos_x'])){
$ifgps ='1';
}else if($time_cut<1800){
$ifgps ='3';//没有gps
}else{
$ifgps = '0';//没有到时间
}
} else {
$ifgps ='2'; //没有排车
$order_bus_no = "暂未指派";
$order_driver_name = "暂未指派";
}
$list_going[$i]["ifgps"] = $ifgps;
$list_going[$i]["driver_mobile"] = $driver_mobile;
$list_going[$i]["order_id"] = $order_id;
$list_going[$i]["2bcode"] = $ercode;
$list_going[$i]["ifcheck"] = $check;
$list_going[$i]["order_driver_name"] = $order_driver_name;
$list_going[$i]["order_bus_no"] = $order_bus_no;
$list_going[$i]["order_end_area_name"] = $order_end_area_name;
$list_going[$i]["order_end_res_name"] = $order_end_res_name;
$list_going[$i]["order_start_area_name"] = $order_start_area_name;
$list_going[$i]["order_start_res_name"] = $order_start_res_name;
$list_going[$i]["order_used_time"] = $order_used_time;
$list_going[$i]["order_start_time"] = $order_start_time;
$list_going[$i]["order_start_date"] = $order_start_date;
$list_going[$i]["seat_num"] = $seat_num;
$list_going[$i]["seat_type"] = $seat_type;
$i++;

}
}
if (empty($list_going)) {
$jason_array = array();
$jason_array["code"] = "0";
$jason_array["info"] = array();
$jason_array["list"] = "";
echo json_encode($jason_array);
exit();
} else {
$jason_array = array();
$jason_array["code"] = "0";
$jason_array["info"] = "查询成功";
$temp_temp_temp = strtotime($list_going["0"]["year"]) - 86400 + 64800;
if (time() > $temp_temp_temp) {
$list_going["0"]["year"] = "即将出行";
}
$jason_array["list"] = $list_going;
echo json_encode($jason_array);
exit();
}

} else {
//输入用户名为空
$jason_array = array();
$jason_array["code"] = "1";
$jason_array["info"] = "查询失败";
$jason_array["list"] = "";
echo json_encode($jason_array);
exit();
}
function get_dsnprod(){
$msg_pdo = conn();
$msg_sql = "CALL SP_GET_MESSAGE_TEMPLATE('1')";
$content = '';
if (is_object($msg_pdo)) {
$msg_result = $msg_pdo -> query($msg_sql);
$i = 1;
$data = array();
if ($msg_result) {
$data['code'] = "0";
$data['info'] = "";
do {
$row = $msg_result -> fetchAll(PDO::FETCH_ASSOC);
if ($i == 1) {
$data['seat'] = isset($row) ? $row : array();
} else if ($i == 2) {
$data['run_info'] = isset($row) ? $row : array();
} else if ($i == 3) {
$data['driver'] = isset($row) ? $row : array();
} else if($i==4){
$data['dsn_prod']=isset($row) ? $row : array();
}else if($i==5){
$data['zhou_su_prod']=isset($row) ? $row : array();
}
$i++;
} while($msg_result->nextRowset());
}
$json_obj = json_decode(json_encode($data), TRUE);
}
foreach($data['dsn_prod'] as $temp){
$dsn_arr_prod[]=$temp['prod_id'];
}
return $dsn_arr_prod;

}

+ 169
- 0
ZZDZ/application/custom_made/order/order_list.php View File

@@ -0,0 +1,169 @@
<?php
/**
* User: Miracle
* Date: 2016/8/20
* Time: 11:30
* 订单列表接口
*/
//require_once '../../Common/Mysql.php';
//$member_id = $_COOKIE['user_id'];
//获得用户名
$member_id = '1';
if (!is_null($member_id)) {
$sql = "SELECT ORDER_ID,ORDER_DESCRIPTION,ORDER_PRICE FROM ORDER_MAIN WHERE member_id=" . $member_id . " AND order_status in (145,146) and order_prod_type in(81,82) AND CANCEL_FLAG=0 AND PARENT_ORDER_ID=0 order by create_time desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
$list_going = array();
//进行中数据列表
$i = 0;

foreach ($rowset as $temp) {
$temp_ORDER_ID = $temp["ORDER_ID"];
//父订单ID
$temp_ORDER_PRICE = (int)$temp["ORDER_PRICE"];
//父订单价格
$temp_ORDER_DESCRIPTION = $temp["ORDER_DESCRIPTION"];
//父订单详情
$temp_temp = explode(',', $temp_ORDER_DESCRIPTION);
$temp_SEAT_TYPE = str_replace("票", "", $temp_temp[0]);
//座位类型
$temp_SEAT_NUM = str_replace("|", "", $temp_temp[2]);
//座位数量
//通过父订单查询子订单
$sql = "SELECT ORDER_STATUS,PROD_START_STATION_AREA_NAME,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME,PROD_START_STATION_DATE,PROD_START_STATION_TIME FROM ORDER_MAIN WHERE PARENT_ORDER_ID=" . $temp_ORDER_ID . " AND (order_status=145 or order_status=146) AND CANCEL_FLAG=0 order by create_time desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
$temp_ORDER_START_STATION_NAME = $rowset[0]["PROD_START_STATION_AREA_NAME"] . "(" . $rowset[0]["PROD_START_STATION_RES_NAME"] . ")";
$temp_ORDER_END_STATION_NAME = $rowset[0]["PROD_END_STATION_AREA_NAME"] . "(" . $rowset[0]["PROD_END_STATION_RES_NAME"] . ")";
$temp_ORDER_DATE = $rowset[0]["PROD_START_STATION_DATE"] . "日" . $rowset[0]["PROD_START_STATION_TIME"] . "出发";
$list_going[$i]["ORDER_ID"] = $temp_ORDER_ID;
$list_going[$i]["ORDER_PRICE"] = $temp_ORDER_PRICE;
$list_going[$i]["STAT_TYPE"] = $temp_SEAT_TYPE;
$list_going[$i]["STAT_NUM"] = $temp_SEAT_NUM;
$list_going[$i]["ORDER_START_STATION_NAME"] = $temp_ORDER_START_STATION_NAME;
$list_going[$i]["ORDER_END_STATION_NAME"] = $temp_ORDER_END_STATION_NAME;
$list_going[$i]["ORDER_DATE"] = $temp_ORDER_DATE;
$list_going[$i]["PROD_START_STATION_AREA_NAME"] = $rowset[0]["PROD_START_STATION_AREA_NAME"];
$list_going[$i]["PROD_START_STATION_RES_NAME"] = $rowset[0]["PROD_START_STATION_RES_NAME"];
$list_going[$i]["PROD_END_STATION_AREA_NAME"] = $rowset[0]["PROD_END_STATION_AREA_NAME"];
$list_going[$i]["PROD_END_STATION_RES_NAME"] = $rowset[0]["PROD_END_STATION_RES_NAME"];
$time = $rowset[0]["PROD_START_STATION_TIME"];
$date = $rowset[0]["PROD_START_STATION_DATE"];
$temp_time = $date . " " . $time;
$start_time = strtotime($temp_time);
$order_start_date = date("n月j日", $start_time);
$list_going[$i]["DATE"] = $order_start_date;
$list_going[$i]["TIME"] = $time;
if ($rowset[0]["ORDER_STATUS"] == 145) {
$list_going[$i]["ORDER_STATUS_info"] = "待支付";
$list_going[$i]["ORDER_STATUS"] = "145";
$list_going[$i]["CAN_DO"] = "1";
} else {
$list_going[$i]["ORDER_STATUS_info"] = "已出票";
$list_going[$i]["ORDER_STATUS"] = "146";
///////////////////////////////////////////
// $back_list["order_status_info"]="已出票";
$temp_now_time = time();
$temp_start_time = $rowset[0]["PROD_START_STATION_DATE"] . " " . $rowset[0]["PROD_START_STATION_TIME"];
$temp_start_time = strtotime($temp_start_time);
if (($temp_start_time - $temp_now_time) < 1800) {
$list_going[$i]["CAN_DO"] = "0";
} else {
$list_going[$i]["CAN_DO"] = "1";
}
}
$i++;
}
$list_completed = array();
//已完成中数据列表
//查询已完成的订单
$sql = "SELECT ORDER_ID,ORDER_DESCRIPTION,ORDER_PRICE FROM ORDER_MAIN WHERE member_id=" . $member_id . " AND order_status in (148,147) and order_prod_type in(81,82) AND CANCEL_FLAG=0 AND PARENT_ORDER_ID=0 order by create_time desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
$list_completed = array();
$i = 0;
foreach ($rowset as $temp) {
$temp_ORDER_ID = $temp["ORDER_ID"];
//父订单ID
$temp_ORDER_PRICE = $temp["ORDER_PRICE"];
//父订单价格
$temp_ORDER_DESCRIPTION = $temp["ORDER_DESCRIPTION"];
//父订单详情
$temp_temp = explode(',', $temp_ORDER_DESCRIPTION);
$temp_SEAT_TYPE = str_replace("票", "", $temp_temp[0]);
//座位类型
$temp_SEAT_NUM = str_replace("|", "", $temp_temp[2]);
//座位数量
//通过父订单查询子订单
$sql = "SELECT PROD_START_STATION_AREA_NAME,ORDER_STATUS,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME,PROD_START_STATION_DATE,PROD_START_STATION_TIME FROM ORDER_MAIN WHERE PARENT_ORDER_ID=" . $temp_ORDER_ID . " AND ( order_status=148 or order_status=147 )AND CANCEL_FLAG=0 order by create_time desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
//var_dump($rowset);
$temp_ORDER_START_STATION_NAME = $rowset[0]["PROD_START_STATION_AREA_NAME"] . "(" . $rowset[0]["PROD_START_STATION_RES_NAME"] . ")";
$temp_ORDER_END_STATION_NAME = $rowset[0]["PROD_END_STATION_AREA_NAME"] . "(" . $rowset[0]["PROD_END_STATION_RES_NAME"] . ")";
$temp_ORDER_DATE = $rowset[0]["PROD_START_STATION_DATE"] . "日" . $rowset[0]["PROD_START_STATION_TIME"] . "出发";
//echo $temp_ORDER_START_STATION_NAME;
//echo $temp_ORDER_END_STATION_NAME;
//echo $temp_ORDER_DATE;
$list_completed[$i]["ORDER_ID"] = $temp_ORDER_ID;
$list_completed[$i]["ORDER_PRICE"] = (int)$temp_ORDER_PRICE;
$list_completed[$i]["STAT_TYPE"] = $temp_SEAT_TYPE;
$list_completed[$i]["STAT_NUM"] = $temp_SEAT_NUM;
$list_completed[$i]["ORDER_START_STATION_NAME"] = $temp_ORDER_START_STATION_NAME;
$list_completed[$i]["ORDER_END_STATION_NAME"] = $temp_ORDER_END_STATION_NAME;
$list_completed[$i]["ORDER_DATE"] = $temp_ORDER_DATE;
// $list_completed[$i]["ORDER_STATUS"] = "148";
// $list_completed[$i]["ORDER_STATUS_info"] = "已完成";
if ($rowset[0]["ORDER_STATUS"] == 148) {
$list_completed[$i]["ORDER_STATUS_info"] = "已取消";
$list_completed[$i]["ORDER_STATUS"] = "148";
} else {
$list_completed[$i]["ORDER_STATUS_info"] = "已完成";
$list_completed[$i]["ORDER_STATUS"] = "147";
}
$list_completed[$i]["PROD_START_STATION_AREA_NAME"] = $rowset[0]["PROD_START_STATION_AREA_NAME"];
$list_completed[$i]["PROD_START_STATION_RES_NAME"] = $rowset[0]["PROD_START_STATION_RES_NAME"];
$list_completed[$i]["PROD_END_STATION_AREA_NAME"] = $rowset[0]["PROD_END_STATION_AREA_NAME"];
$list_completed[$i]["PROD_END_STATION_RES_NAME"] = $rowset[0]["PROD_END_STATION_RES_NAME"];
$time = $rowset[0]["PROD_START_STATION_TIME"];
$date = $rowset[0]["PROD_START_STATION_DATE"];
$temp_time = $date . " " . $time;
$start_time = strtotime($temp_time);
$order_start_date = date("n月j日", $start_time);
$list_completed[$i]["DATE"] = $order_start_date;
$list_completed[$i]["TIME"] = $time;
$i++;
}
$jason_array = array();
if (empty($list_going) || empty($list_completed)) {
$jason_array["code"] = '0';
$jason_array["info"] = "沒有数据";
$jason_array["goning"] = $list_going;
$jason_array["completed"] = $list_completed;
echo json_encode($jason_array);
exit();
} else {
$jason_array["code"] = "0";
$jason_array["info"] = "返回成功";
$jason_array["goning"] = $list_going;
$jason_array["completed"] = $list_completed;
echo json_encode($jason_array);
exit();
}
} else {
$jason_array = array();
$jason_array["code"] = "1";
$jason_array["info"] = "没有输入";
$jason_array["goning"] = $list_going;
$jason_array["completed"] = $list_completed;
echo json_encode($jason_array);
exit();
}

+ 159
- 0
ZZDZ/application/custom_made/order/orderdetailinfo.php View File

@@ -0,0 +1,159 @@
<?php
/**
* User: Miracle
* Date: 2016/8/22
* Time: 09:00
* 订单详情接口
*/
date_default_timezone_set('PRC');
//require_once '../../../config/Mysql.php';
$ORDER_ID = isset($_POST['order_id']) ? $_POST['order_id'] : '';
//$ORDER_ID = 240388;
$is_back = 0;
//默认不是往返车辆
if (!empty($ORDER_ID)) {
//判断时间差
$sql = "SELECT CREATE_TIME from order_main WHERE ORDER_ID = " . $ORDER_ID;
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
if(!isset($rowset[0]["CREATE_TIME"])){
echo json_encode(array('code'=>1,'info'=>'未知订单号'));
die;
}
$CREATE_TIME = $rowset[0]["CREATE_TIME"];
$NOW_TIME = time();
$CREATE_TIME = strtotime($CREATE_TIME);
$CREATE_TIME = $CREATE_TIME + 600;
//时间差
$time_left = $CREATE_TIME - $NOW_TIME;
//去程订单详情
$go_list = array();
//返程订单详情
$back_list = array();
//判断是否存在往返订单
//单程票
$sql = "SELECT ORDER_ID,ORDER_DESCRIPTION,ORDER_STATUS,ORDER_PRICE,CUSTOMER_MOBILE,CUSTOMER_NAME FROM ORDER_MAIN WHERE CANCEL_FLAG=0 AND PARENT_ORDER_ID=0 AND ORDER_ID=" . $ORDER_ID;
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
// echo $is_back;
// echo $main_to_order_id;
// echo $main_back_order_id;
//var_dump($rowset);
$contact_name = $rowset[0]["CUSTOMER_NAME"];
//联系人姓名
$contact_mobile = $rowset[0]["CUSTOMER_MOBILE"];
//联系人电话
$go_ORDER_DESCRIPTION = $rowset[0]["ORDER_DESCRIPTION"];
//去程订单详情
$temp_temp = explode(',', $go_ORDER_DESCRIPTION);
$seat_type = str_replace("票", "", $temp_temp[0]);
//座位类型
$seat_num = str_replace("|", "", $temp_temp[2]);
//座位数量
$total_price = $rowset[0]["ORDER_PRICE"];
//订单总价
$order_status = $rowset[0]["ORDER_STATUS"];
//订单状态
//查询去程子订单
$sql = "SELECT CUSTOMER_MEMO,PROD_START_STATION_AREA_NAME,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME,PROD_START_STATION_DATE,PROD_START_STATION_TIME,ORDER_PRICE FROM ORDER_MAIN WHERE CANCEL_FLAG=0 AND PARENT_ORDER_ID=" . $ORDER_ID;
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
$rowset = $rowset[0];
// var_dump($rowset);
$start_date = $rowset["PROD_START_STATION_DATE"];
//出发日期
$start_time = $rowset["PROD_START_STATION_TIME"];
//出发时间
$start_area_name = $rowset["PROD_START_STATION_AREA_NAME"];
//出发地区名
$start_res_name = $rowset["PROD_START_STATION_RES_NAME"];
//出发res名字
$end_area_name = $rowset["PROD_END_STATION_AREA_NAME"];
$end_res_name = $rowset["PROD_END_STATION_RES_NAME"];
$price = $rowset["ORDER_PRICE"];
//单价
$str_cus_memo = $rowset["CUSTOMER_MEMO"];
//乘客信息
$arr_str_cus_memo = explode('/', $str_cus_memo);
//var_dump($arr_str_cus_memo);
$customer_info = array();
$i = 0;
foreach ($arr_str_cus_memo as $temp) {
if (!is_null($temp)) {
$temp_temp = explode('*', $temp);
$customer_info[$i]["name"] = $temp_temp[0];
$customer_info[$i]["id_num"] = isset($temp_temp[1])?$temp_temp[1]:'';
$len = 4;
$id_num_f = substr($temp_temp[1], 0, $len);
$id_num_l = substr($temp_temp[1], 14, $len);
$id_num_encrypt = $id_num_f . "**********" . $id_num_l;
$customer_info[$i]["id_num_encrypt"] = $id_num_encrypt;
$i++;
}
}
//var_dump($customer_info);
$go_list["contact_name"] = $contact_name;
$go_list["contact_mobile"] = $contact_mobile;
$go_list["seat_type"] = $seat_type;
$go_list["seat_num"] = $seat_num;
$go_list["total_price"] = (int)$total_price;
$go_list["order_status"] = $order_status;
$go_list["start_date"] = $start_date;
$go_list["start_time"] = $start_time;
$go_list["start_area_name"] = $start_area_name;
$go_list["start_res_name"] = $start_res_name;
$go_list["end_area_name"] = $end_area_name;
$go_list["end_res_name"] = $end_res_name;
$go_list["price"] = (int)$price;
$go_list["customer_info"] = $customer_info;
$go_list["time_left"] = $time_left;
$go_list["order_id"]= $ORDER_ID;
if($order_status==145){
$go_list["order_status_info"]="未支付";
$go_list["can_do"] = "1";
$back_list["order_status"] = "145";
}else if($order_status==146){
$go_list["order_status_info"]="已出票";
$temp_now_time=time();
$temp_start_time=$start_date." ".$start_time;
$temp_start_time=strtotime($temp_start_time);
if(($temp_start_time-$temp_now_time)<1800){
$go_list["can_do"] = "0";
}else{
$go_list["can_do"] = "1";
}
$back_list["order_status"] = "146";
}else if($order_status==147){
$go_list["order_status_info"]="已完成";
$go_list["can_do"] = "1";
$back_list["order_status"] = "147";
}else{
$go_list["order_status_info"]="已取消";
$go_list["can_do"] = "1";
$back_list["order_status"] = "148";
}
$jason_array = array();
$jason_array["code"] = "0";
$jason_array["info"] = "返回成功";
$jason_array["go_list"] = $go_list;
echo json_encode($jason_array);
exit();
} else {
//输入order_id为空
$jason_array = array();
$jason_array["code"] = "1";
$jason_array["info"] = "没有输入";
$jason_array["go_list"] = "";
$jason_array["back_list"] = "";
$jason_array["order_id"] = "";
$jason_array["is_back"] = 0;
$jason_array["time_left"] = 0;
echo json_encode($jason_array);
exit();
}

+ 169
- 0
ZZDZ/application/custom_made/order/orderlist.php View File

@@ -0,0 +1,169 @@
<?php
header("Access-Control-Allow-Origin:*");
/**
* User: Miracle
* Date: 2016/8/20
* Time: 11:30
* 订单列表接口
*/
//require_once '../../Common/Mysql.php';
$member_id = $_COOKIE['user_id'];
//获得用户名
if (!is_null($member_id)) {
$sql = "SELECT ORDER_ID,ORDER_DESCRIPTION,ORDER_PRICE FROM ORDER_MAIN WHERE member_id=" . $member_id . " AND order_status in (145,146) and parent_prod_id in(449860,449865) and order_prod_type in(81,82) AND CANCEL_FLAG=0 AND PARENT_ORDER_ID=0 order by create_time desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
$list_going = array();
//进行中数据列表
$i = 0;

foreach ($rowset as $temp) {
$temp_ORDER_ID = $temp["ORDER_ID"];
//父订单ID
$temp_ORDER_PRICE = (int)$temp["ORDER_PRICE"];
//父订单价格
$temp_ORDER_DESCRIPTION = $temp["ORDER_DESCRIPTION"];
//父订单详情
$temp_temp = explode(',', $temp_ORDER_DESCRIPTION);
$temp_SEAT_TYPE = str_replace("票", "", $temp_temp[0]);
//座位类型
$temp_SEAT_NUM = str_replace("|", "", $temp_temp[2]);
//座位数量
//通过父订单查询子订单
$sql = "SELECT ORDER_STATUS,PROD_START_STATION_AREA_NAME,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME,PROD_START_STATION_DATE,PROD_START_STATION_TIME FROM ORDER_MAIN WHERE PARENT_ORDER_ID=" . $temp_ORDER_ID . " AND (order_status=145 or order_status=146) AND CANCEL_FLAG=0 order by create_time desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
$temp_ORDER_START_STATION_NAME = $rowset[0]["PROD_START_STATION_AREA_NAME"] . "(" . $rowset[0]["PROD_START_STATION_RES_NAME"] . ")";
$temp_ORDER_END_STATION_NAME = $rowset[0]["PROD_END_STATION_AREA_NAME"] . "(" . $rowset[0]["PROD_END_STATION_RES_NAME"] . ")";
$temp_ORDER_DATE = $rowset[0]["PROD_START_STATION_DATE"] . "日" . $rowset[0]["PROD_START_STATION_TIME"] . "出发";
$list_going[$i]["ORDER_ID"] = $temp_ORDER_ID;
$list_going[$i]["ORDER_PRICE"] = $temp_ORDER_PRICE;
$list_going[$i]["STAT_TYPE"] = $temp_SEAT_TYPE;
$list_going[$i]["STAT_NUM"] = $temp_SEAT_NUM;
$list_going[$i]["ORDER_START_STATION_NAME"] = $temp_ORDER_START_STATION_NAME;
$list_going[$i]["ORDER_END_STATION_NAME"] = $temp_ORDER_END_STATION_NAME;
$list_going[$i]["ORDER_DATE"] = $temp_ORDER_DATE;
$list_going[$i]["PROD_START_STATION_AREA_NAME"] = $rowset[0]["PROD_START_STATION_AREA_NAME"];
$list_going[$i]["PROD_START_STATION_RES_NAME"] = $rowset[0]["PROD_START_STATION_RES_NAME"];
$list_going[$i]["PROD_END_STATION_AREA_NAME"] = $rowset[0]["PROD_END_STATION_AREA_NAME"];
$list_going[$i]["PROD_END_STATION_RES_NAME"] = $rowset[0]["PROD_END_STATION_RES_NAME"];
$time = $rowset[0]["PROD_START_STATION_TIME"];
$date = $rowset[0]["PROD_START_STATION_DATE"];
$temp_time = $date . " " . $time;
$start_time = strtotime($temp_time);
$order_start_date = date("n月j日", $start_time);
$list_going[$i]["DATE"] = $order_start_date;
$list_going[$i]["TIME"] = $time;
if ($rowset[0]["ORDER_STATUS"] == 145) {
$list_going[$i]["ORDER_STATUS_info"] = "待支付";
$list_going[$i]["ORDER_STATUS"] = "145";
$list_going[$i]["CAN_DO"] = "1";
} else {
$list_going[$i]["ORDER_STATUS_info"] = "已出票";
$list_going[$i]["ORDER_STATUS"] = "146";
///////////////////////////////////////////
// $back_list["order_status_info"]="已出票";
$temp_now_time = time();
$temp_start_time = $rowset[0]["PROD_START_STATION_DATE"] . " " . $rowset[0]["PROD_START_STATION_TIME"];
$temp_start_time = strtotime($temp_start_time);
if (($temp_start_time - $temp_now_time) < 3600) {
$list_going[$i]["CAN_DO"] = "0";
} else {
$list_going[$i]["CAN_DO"] = "1";
}
}
$i++;
}
$list_completed = array();
//已完成中数据列表
//查询已完成的订单
$sql = "SELECT ORDER_ID,ORDER_DESCRIPTION,ORDER_PRICE FROM ORDER_MAIN WHERE member_id=" . $member_id . " AND order_status in (148,147) and parent_prod_id in(449860,449865) and order_prod_type in(81,82) AND CANCEL_FLAG=0 AND PARENT_ORDER_ID=0 order by create_time desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
$list_completed = array();
$i = 0;
foreach ($rowset as $temp) {
$temp_ORDER_ID = $temp["ORDER_ID"];
//父订单ID
$temp_ORDER_PRICE = $temp["ORDER_PRICE"];
//父订单价格
$temp_ORDER_DESCRIPTION = $temp["ORDER_DESCRIPTION"];
//父订单详情
$temp_temp = explode(',', $temp_ORDER_DESCRIPTION);
$temp_SEAT_TYPE = str_replace("票", "", $temp_temp[0]);
//座位类型
$temp_SEAT_NUM = str_replace("|", "", $temp_temp[2]);
//座位数量
//通过父订单查询子订单
$sql = "SELECT PROD_START_STATION_AREA_NAME,ORDER_STATUS,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME,PROD_START_STATION_DATE,PROD_START_STATION_TIME FROM ORDER_MAIN WHERE PARENT_ORDER_ID=" . $temp_ORDER_ID . " AND ( order_status=148 or order_status=147 )AND CANCEL_FLAG=0 order by create_time desc";
$pdo = conn();
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
//var_dump($rowset);
$temp_ORDER_START_STATION_NAME = $rowset[0]["PROD_START_STATION_AREA_NAME"] . "(" . $rowset[0]["PROD_START_STATION_RES_NAME"] . ")";
$temp_ORDER_END_STATION_NAME = $rowset[0]["PROD_END_STATION_AREA_NAME"] . "(" . $rowset[0]["PROD_END_STATION_RES_NAME"] . ")";
$temp_ORDER_DATE = $rowset[0]["PROD_START_STATION_DATE"] . "日" . $rowset[0]["PROD_START_STATION_TIME"] . "出发";
//echo $temp_ORDER_START_STATION_NAME;
//echo $temp_ORDER_END_STATION_NAME;
//echo $temp_ORDER_DATE;
$list_completed[$i]["ORDER_ID"] = $temp_ORDER_ID;
$list_completed[$i]["ORDER_PRICE"] = (int)$temp_ORDER_PRICE;
$list_completed[$i]["STAT_TYPE"] = $temp_SEAT_TYPE;
$list_completed[$i]["STAT_NUM"] = $temp_SEAT_NUM;
$list_completed[$i]["ORDER_START_STATION_NAME"] = $temp_ORDER_START_STATION_NAME;
$list_completed[$i]["ORDER_END_STATION_NAME"] = $temp_ORDER_END_STATION_NAME;
$list_completed[$i]["ORDER_DATE"] = $temp_ORDER_DATE;
// $list_completed[$i]["ORDER_STATUS"] = "148";
// $list_completed[$i]["ORDER_STATUS_info"] = "已完成";
if ($rowset[0]["ORDER_STATUS"] == 148) {
$list_completed[$i]["ORDER_STATUS_info"] = "已取消";
$list_completed[$i]["ORDER_STATUS"] = "148";
} else {
$list_completed[$i]["ORDER_STATUS_info"] = "已完成";
$list_completed[$i]["ORDER_STATUS"] = "147";
}
$list_completed[$i]["PROD_START_STATION_AREA_NAME"] = $rowset[0]["PROD_START_STATION_AREA_NAME"];
$list_completed[$i]["PROD_START_STATION_RES_NAME"] = $rowset[0]["PROD_START_STATION_RES_NAME"];
$list_completed[$i]["PROD_END_STATION_AREA_NAME"] = $rowset[0]["PROD_END_STATION_AREA_NAME"];
$list_completed[$i]["PROD_END_STATION_RES_NAME"] = $rowset[0]["PROD_END_STATION_RES_NAME"];
$time = $rowset[0]["PROD_START_STATION_TIME"];
$date = $rowset[0]["PROD_START_STATION_DATE"];
$temp_time = $date . " " . $time;
$start_time = strtotime($temp_time);
$order_start_date = date("n月j日", $start_time);
$list_completed[$i]["DATE"] = $order_start_date;
$list_completed[$i]["TIME"] = $time;
$i++;
}
$jason_array = array();
if (empty($list_going) || empty($list_completed)) {
$jason_array["code"] = '0';
$jason_array["info"] = "沒有数据";
$jason_array["goning"] = $list_going;
$jason_array["completed"] = $list_completed;
echo json_encode($jason_array);
exit();
} else {
$jason_array["code"] = "0";
$jason_array["info"] = "返回成功";
$jason_array["goning"] = $list_going;
$jason_array["completed"] = $list_completed;
echo json_encode($jason_array);
exit();
}
} else {
$jason_array = array();
$jason_array["code"] = "1";
$jason_array["info"] = "没有输入";
$jason_array["goning"] = $list_going;
$jason_array["completed"] = $list_completed;
echo json_encode($jason_array);
exit();
}

+ 106
- 0
ZZDZ/application/custom_made/order/refund.php View File

@@ -0,0 +1,106 @@
<?php
/*
* wechat 2.0
* Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
* Date: 2016.09.07
* Something is to pay QQ1062140302
*/
if (ALLOW_ORIGIN)
header("Access-Control-Allow-Origin:*");
date_default_timezone_set('PRC');
require_once __DIR__.'/../../api/cancel_order.php';
$order_id = isset($_POST['order_id']) ? $_POST['order_id'] : "454259";

$pdo = conn();
$list = Find($order_id);
$time_cut = strtotime($list['run_time'])-time();
if($time_cut<=3600){
$code ='1';
$info = 'fail';
$massge = '开车前30分钟禁止退票';
$list = "";
}else{

$sql = "UPDATE order_main SET ORDER_STATUS =148,ORDER_VALID_STATUS = 0 WHERE order_id = " . $order_id ." OR parent_order_id = " .$order_id.";"
. "update run_bus set SALED_COUNT = SALED_COUNT - ".$list['tic_num']." where run_id = ".$list['run_id']." and bus_order_id = ".$list['run_bus_order_id'].";"
. "update run_stock set SALED_COUNT = SALED_COUNT - ".$list['tic_num']." where run_id =".$list['run_id']." and SEAT_TYPE = 72 and SEQ_ID = 1;"
. "update run_prod set SALED_COUNT = SALED_COUNT - ".$list['tic_num']." where run_id =".$list['run_id']." and prod_id = ".$list['prod_id'];
$result = $pdo -> query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$result -> closeCursor();
if(!isset($rowset[0]['errorinfo'])){
$sql = " insert into order_refund(`order_id`,`price`,`pay_serial_number`) values(".$order_id.",".$list['order_price'].",'".$list['pay_num']."')";
$pdo ->query($sql);
$code = '0';
$info = 'success';
$massge = '订单已取消';
$cancel_order = new cancelOrder();
$res = $cancel_order -> funCancelOrder($list['line_id'], $list['run_id'], $list['run_bus_order_id'], $list['parent_order_id'], $list['run_time']);
}else{
$code = '1';
$info =$rowset[0]['errorinfo'];
$massge = $rowset[0]['errorinfo'];
}


}
$data['code']=$code;
$data['info']=$massge;
echo json_encode($data);die;

function Find($order_id){
$pdo= conn();
$sql = "select order_description,order_price,order_pay_main_id "
. "from order_main "
. "where order_id=".$order_id;
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$order_price = $rowset[0];//订单总价格 订单票的数量
$sql = "SELECT DISTINCT
order_description,parent_order_id,run_date,run_id,run_time,run_bus_order_id,prod_id,parent_prod_id,PROD_START_STATION_AREA_NAME,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME
FROM `order_main`
where PARENT_ORDER_ID=".$order_id;
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$order_station = $rowset[0];//订单来往地址 订单时间 订单好
if(empty($order_station))
return false;
$array_order_desc=array();

$arr_temp = explode('|',$order_price['order_description']);
$arr=array();
foreach ($arr_temp as $k=>$v2) {
if(!empty($v2))
$array_order_desc[]= explode (',', $v2); //订单票 * 数量
}
$list = array();
//上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)//反的数组
$list['station'] = $order_station['PROD_START_STATION_AREA_NAME'].'('.$order_station['PROD_START_STATION_RES_NAME'].')'
.'-'.$order_station['PROD_END_STATION_AREA_NAME'].'('.$order_station['PROD_END_STATION_RES_NAME'].')';
$list['start_station']=$order_station['PROD_START_STATION_AREA_NAME'];
$list['end_station']=$order_station['PROD_END_STATION_AREA_NAME'];
$list['start_res_name'] = $order_station['PROD_START_STATION_RES_NAME'];
$list['end_res_name'] = $order_station['PROD_END_STATION_RES_NAME'];
$list['run_date'] = $order_station['run_date'];
$list['run_time'] = $order_station['run_date'].' '.$order_station['run_time'];
$list['count']='';
$list['tic_num'] = 0;
foreach ($array_order_desc as $v){
$list['count'] .= ' '.$v[0].' × '.$v[2];
$list['tic_num'] +=$v[2] ;
}
$list['order_price'] = $order_price['order_price'];
$sql = "select pay_serial_number from order_pay_detail where pay_main_id =".$order_price['order_pay_main_id'];
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$list['pay_num'] = $rowset[0]['pay_serial_number'];
$list['line_id'] = $order_station['parent_prod_id'];
$list['run_id'] = $order_station['run_id'];//run_bus_order_id
$list['run_bus_order_id'] = $order_station['run_bus_order_id'];//parent_order_id
$list['parent_order_id'] = $order_station['parent_order_id'];
$list['prod_id'] = $order_station['prod_id'];
return $list;
}

+ 521
- 0
ZZDZ/application/custom_made/order/submit.php View File

@@ -0,0 +1,521 @@
<?php
/*
* wechat 2.0
* Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
* Date: 2016.7.12
* Something is to pay QQ1062140302
*/
date_default_timezone_set('PRC');
require_once __DIR__.'/../../api/common.php';
require_once __DIR__.'/../../api/create_order.php';
require_once __DIR__.'/../../api/cancel_order.php';

class submit extends virtifyUsers
{
//提交订单流程
public function execSubmit($prod_list, $customer_info, $start_name, $end_name, $startx_y, $endx_y, $line_id,$pdo)
{
//获取要提交的详细信息
$prod_info = $this -> get_prod_info($prod_list,$pdo);

$ticket_id = $prod_info['ticket_id'];//票种ID
$tic_num = $prod_info['tic_num'];//订票数量
$run_id = $prod_info['run_id'];//班次ID
$userid = $prod_info['userid'];//用户ID
$member_id = $prod_info['member_id'];//会员号
$run_date = $prod_info['run_date'];//发车日期
$run_time = $prod_info['run_time'];//发车时间
$run_date_time = $prod_info['run_date_time'];//检验订单所需时间

//判断会员号
if (!$member_id) {
echo json_encode(array("code" => '1', "iflogin" => 1, "info" => "请关注公众号:蜘蛛出行"));
exit;
}

//判断购票数量
if ($tic_num == 0) {
echo json_encode(array("code" => '1', "info" => "订票数量不可为0"));
exit;
}
//检查订单
$order_result =$this->check_order($startx_y, $endx_y, $line_id, $run_id, $tic_num, $start_name, $end_name,$run_date_time);
writeLog("check_order:".json_encode($order_result));
//检查订单完全失败
if (!$order_result) {
echo json_encode(array("code" => '120', "info" => "不可预订"));
exit;
}
$cust_info = $this->explode_cust_info($customer_info);
$cust_name = $cust_info['name'];
$cust_phone = $cust_info['phone'];
//交易还有机会,电话联系
if ($order_result['code'] == 101) {
//将数据存入order_man_contact
$sql_temp = "INSERT into order_man_contact(name,phone,run_id,start_station,end_station) VALUES('" . $cust_name . "','" . $cust_phone . "'," . $run_id . ",'" . $start_name . "','" . $end_name . "')";
$result_temp = $pdo->exec($sql_temp);
echo json_encode(array("code" => '101', "info" => "提交成功,30分钟内电话联系确认订单"));
exit;
}

//检查订单成功
$order_result = $order_result['result'];
$order_id = $order_result['order_id'];//订单ID
$bus_no = $order_result['bus_no'];//车号
$start_time = substr($order_result['start_time'],-5);//开始时间
$end_time = substr($order_result['end_time'],-5);//结束时间
$order_from_org_id = 0;//订单渠道ID
$top_org_id = 0;//顶级订单渠道ID
$outside_order_id = isset($_POST['outside_order_id']) ? $_POST['outside_order_id'] : '1';//外部订单渠道ID

//获取票种价格
$sql_price = "select cus_price from opera_product_price where prod_id =" . $ticket_id;
$result_price = $pdo->query($sql_price);
$row_p = $result_price->fetchAll(PDO::FETCH_ASSOC);

$price_list = $ticket_id . ',' . $row_p[0]['cus_price'];//票种价格完整信息

$sql = "CALL sp_make_order_for_business('" . $userid . "','" . $prod_list . "','" . $customer_info . "','1','0','" . $start_name . "','" . $end_name . "','" . $start_time . "','" . $end_time . "','" . $bus_no . "','" . $member_id . "','" . $order_id . "')";
writeLog("sp_make_order_for_business---san: " . $sql);
//提交order_main表
$rowset = $this->create_order($sql, $price_list,$pdo);
//order_main提交失败
if(!$rowset || $rowset[0]['errcode']){
//启动退票算法
$cancel_order = new cancelOrder();
$res = $cancel_order -> funCancelOrder($line_id, $run_id, $bus_no, $order_id, $run_date_time);
if($res){
$sql_temp = "INSERT into order_man_contact(name,phone,run_id,start_station,end_station) VALUES('" . $cust_name . "','" . $cust_phone . "'," . $run_id . ",'" . $start_name . "','" . $end_name . "')";
$result_temp = $pdo->exec($sql_temp);
echo json_encode(array('code' => '1', 'info' => '您的订单正在审核中,30分钟客服人员将会致电您'));
exit;
}else{
echo json_encode(array('code' => '1', 'info' => '退票算法错误'));//退票算法和order_main表插入均失败
exit;
}
}

//获取订单详情
$order_info = $this -> get_order_info($order_id,$pdo);

$pay_main_id = $order_info[0]['order_pay_main_id'];//支付方式

//修改订单
$this -> update_order_info($order_id,$run_id,$bus_no,$member_id,$pay_main_id,$pdo);

echo json_encode(array('code' => '0', 'info' => 'http://xmwx.zhizhuchuxing.cn/wechat/WxPay/realpay/onlinePay.php?orderid=' . $order_id . '&fx=11&code2=dzbs'));
exit();

}

//获取要提交订单的详细信息
public function get_prod_info($prod_list,$pdo){
$ticket_id = substr($prod_list, strpos($prod_list, 'm') + 1, strpos($prod_list, 'p') - 2);//票种ID
$tic_num = substr($prod_list, strpos($prod_list, 'p') + 1, strpos($prod_list, '|') - strpos($prod_list, 'p') - 1);//乘客数量
$run_id = substr(substr($prod_list, strpos($prod_list, 'r') + 1), 0, -1);//班次ID

//$beginX_Y = isset($_POST['startx_y']) ? $_POST['startx_y'] : false;
$userid = 0;//用户ID
$member_id = isset($_COOKIE['user_id']) ? $_COOKIE['user_id'] : '0';//会员号ID

$sql_time = "select run_date,run_time from run_main where run_id =" . $run_id;
$result_time = $pdo->query($sql_time);
$row_t = $result_time->fetchAll(PDO::FETCH_ASSOC);

$run_date = $row_t[0]['run_date'];//出发日期
$run_time = $row_t[0]['run_time'];//出发时间
$run_date_time = $run_date . " " . $run_time;
$prod_info['ticket_id'] = $ticket_id;
$prod_info['tic_num'] = $tic_num;
$prod_info['run_id'] = $run_id;
$prod_info['userid'] = $userid;
$prod_info['member_id'] = $_COOKIE['user_id'];
$prod_info['run_date'] = $run_date;
$prod_info['run_time'] = $run_time;
$prod_info['run_date_time'] = $run_date_time;
return $prod_info;
}
//解析乘客信息
public function explode_cust_info($cust_info){
$cust_info_temp = explode(',', $cust_info );
$temp['name'] = $cust_info_temp['1'];
$temp['phone']= $cust_info_temp['3'];
return $temp;
}


//检验订单
public function check_order($startx_y, $endx_y, $line_id, $run_id, $tic_num, $start_name, $end_name,$run_date_time)
{
$co = new createOrder();
$time = commonUtils::baiduShortTime($startx_y, $endx_y);
if (!$startx_y || !$endx_y) {
$result['status'] = 111; //状态码:111为经纬度不能为空)
$result['info'] = "经纬度不能为空";
echo json_encode($result);
exit();
}
if ($time > 360) //总时长不能超过360分钟
{
$result['status'] = 101; //状态码:101为总时长不符合要求(超过360分钟)
$result['info'] = "总时长不能超过360分钟";
echo json_encode($result);
exit();
}
if ($tic_num > 6) {
$result['status'] = 108; //状态码:人数不能超过6人
$result['info'] = "每个订单人数不能超过6人";
echo json_encode($result);
exit();
}

//先判断是否属于规定的市区
$start_area = commonUtils::GeocodingAPI($startx_y);
$end_area = commonUtils::GeocodingAPI($endx_y);
if (($line_id == "449860" && $start_area == "南京市" && $end_area == "南通市") || ($line_id == "449865" && $start_area == "南通市" && $end_area == "南京市")) {
if ($line_id && $run_id && $tic_num && $startx_y && $endx_y && $run_date_time) {
$orderID = commonUtils::produceOrderId($tic_num); //获取订单号
$res = $co->calShortTime($line_id, $run_id, $orderID, $tic_num, $startx_y, $start_name, $endx_y, $end_name, $run_date_time);
return $res;
}else{
$result['code'] = '1';
$result['info'] = "订单提交信息不全";
echo json_encode($result);
exit();
}
} else {
$result['code'] = '1';
$result['info'] = "所选地点不在规划范围内";
echo json_encode($result);
exit();
}

}

//..短信模板-改为17:30后OK,当天下单也OK
public function get_msg_info($ORDER_ID)
{
$msg_pdo = conn();
$msg_sql = "CALL SP_GET_MESSAGE_TEMPLATE('" . $ORDER_ID . "')";
$content = '';
if (is_object($msg_pdo)) {
$msg_result = $msg_pdo->query($msg_sql);
$i = 1;
$data = array();
if ($msg_result) {
$data['code'] = "0";
$data['info'] = "";
do {
$row = $msg_result->fetchAll(PDO::FETCH_ASSOC);
if ($i == 1) {
$data['seat'] = isset($row) ? $row : array();
} else if ($i == 2) {
$data['run_info'] = isset($row) ? $row : array();
} else if ($i == 3) {
$data['driver'] = isset($row) ? $row : array();
} else if ($i == 4) {
$data['dsn_prod'] = isset($row) ? $row : array();
} else if ($i == 5) {
$data['zhou_su_prod'] = isset($row) ? $row : array();
}
$i++;
} while ($msg_result->nextRowset());
}
$json_obj = json_decode(json_encode($data), TRUE);
$seat = isset($json_obj['seat'][0]) ? $json_obj['seat'][0] : array();
$run_info = isset($json_obj['run_info'][0]) ? $json_obj['run_info'][0] : array();
$driver = isset($json_obj['driver'][0]) ? $json_obj['driver'][0] : array();
$dsn_prod = isset($json_obj['dsn_prod']) ? $json_obj['dsn_prod'] : array();
$zhou_su_prod = isset($json_obj['zhou_su_prod']) ? $json_obj['zhou_su_prod'] : array();
$bus_res_id = isset($json_obj['driver'][0]) ? $json_obj['driver'][0]["bus_res_id"] : 0;
$short_url = false;
if ($bus_res_id != 0) {
$ary_sell_ary = array(916, 917);
if (in_array($bus_res_id, $ary_sell_ary)) {
$ticket_url = TICKET_QR_URL . $ORDER_ID;
$short_url = sinaShortenUrl($ticket_url);
}
}
$extra_message = "";
if ($short_url != false) {
$extra_message = "点击以下链接获取您的电子票扫码上车:{$short_url}";
}

//出票成功
// $content = "您预订的{出发日期 出发时间}{出发地}-{目的地}{票种名}{张数}张,已购票成功。乘车订单号为{订单号},请凭订单号或绑定微信(微信服务号“蜘蛛出行”)扫码上车,车牌号{车牌号},司机电话{司机姓司机电话}。";
// 得到明天的时间
date_default_timezone_set('PRC');
//解决时区问题
$tomorrow = date("Y-m-d", strtotime("+1 day"));
$now_time = date('H:i:s', time());
//判断当前时间是否在17:30:00之后
$cur_date = date('Y-m-d', time());
//迪士尼特殊情况parent_prod_id

// $dsn_arr_prod = array(152752, 152759, 152763, 152770, 152777, 152784, 152791, 152801, 152808, 152815, 152822, 152832, 152842, 152852, 152859, 152866, 152873, 152877, 152884, 152891, 152898, 152905, 152915, 152922, 152929, 152936, 152946, 152956, 152966, 152973, 152980, 152990, 153003, 153016, 153023, 153033, 153034, 153044, 153057, 153070, 153083, 153090, 153100, 153110);
$dsn_arr_prod = array(); //用来保存迪士尼产品的prod_id
foreach ($dsn_prod as $temp) {
$dsn_arr_prod[] = $temp['prod_id'];
}

$zhou_su_arr_prod = array();
foreach ($zhou_su_prod as $temp) {
$zhou_su_arr_prod[] = $temp['prod_id'];
}

$new_message_array = array(448569, 448568);
if (in_array($run_info['parent_prod_id'], $new_message_array)) {
$content = "您预订的{出发日期}{出发地}-{目的地}{票种名}{张数}张,已成功出票,请在{出发时间}前十五分钟到达{上车站点}。出行前一天下午的18:00左右将会有导游和您联系,预祝您旅途愉快。";
} elseif (($now_time > "18:30:00" && $run_info['start_date'] == $tomorrow) || $cur_date == $run_info['start_date']) {//17:30之后的订单或者下单时间为今天出行为今天下午 发送短信模板
// if("18:30:00">"17:30:00" && $run_info['start_date']==$tomorrow){ //17:30之后的订单 发送短信模板
// $content = "您预订的{出发日期 出发时间}{出发地}-{目的地}{票种名}{张数}张,已购票成功。乘车订单号为{订单号},请凭订单号或绑定微信(微信服务号“蜘蛛出行”)扫码上车,车牌号{车牌号},司机电话{司机姓司机电话}。";
$content = "您预订的{出发日期}{出发地}-{目的地}{票种名}{张数}张,已成功出票,请在{出发时间}前三十分钟到达{上车站点}。您的乘车订单号为{订单号},车牌号{车牌号},司机电话{司机姓司机电话},请凭短信订单号乘车{$extra_message},预祝您旅途愉快。";
if (in_array($run_info['parent_prod_id'], $dsn_arr_prod)) {
$content = "您预订的{出发日期}{上车站点}-{下车站点}{票种名}{张数}张,已成功出票,请在{出发时间}前三十分钟到达{上车站点}。您的乘车订单号为{订单号}。请凭短信订单号乘车{$extra_message},预祝您旅途愉快。(如需咨询请致电:021-33280578)【zhizhuchuxing】Congratulations! Your ticket from hotel to Disney has been approved. Your order number is {订单号}. Please keep it and arrive at the place before {出发时间}. Enjoy your trip and have a nice day! If you have any questions, please call: 021-33280578.";
$content = str_replace("{上车站点}", $run_info['res_name'], $content);
$content = str_replace("{下车站点}", $run_info['end_res_name'], $content);
$content = str_replace("{订单号}", $ORDER_ID, $content);
}
} else {
// $content = "您预订的{出发日期 出发时间}{出发地}-{目的地}{票种名}{张数}张,已购票成功。乘车订单号为{订单号},请凭订单号或绑定微信(微信服务号“蜘蛛出行”)扫码上车。";
$content = "您预订的{出发日期}{出发地}-{目的地}{票种名}{张数}张,已成功出票,请在{出发时间}前三十分钟到达{上车站点}。您的乘车订单号为{订单号},请凭短信订单号乘车。出行前一天下午的18:30会将车牌号与司机电话发送给您,预祝您旅途愉快。";
if (in_array($run_info['parent_prod_id'], $dsn_arr_prod)) {
$ticket_url = TICKET_QR_URL . $ORDER_ID;
$short_url = sinaShortenUrl($ticket_url);
$extra_content = "";
if ($short_url != false) {
$extra_content = "或点击以下链接获取乘车二维码扫码上车(" . $short_url . ")";
}
$content = "您预订的{出发日期}{上车站点}-{下车站点}{票种名}{张数}张,已成功出票,请在{出发时间}前三十分钟到达{上车站点}。您的乘车订单号为{订单号}。请凭短信订单号乘车{$extra_content},预祝您旅途愉快。(如需咨询请致电:021-33280578)【zhizhuchuxing】Congratulations! Your ticket from hotel to Disney has been approved. Your order number is {订单号}. Please keep it and arrive at the place before {出发时间}. Enjoy your trip and have a nice day! If you have any questions, please call: 021-33280578.";
$content = str_replace("{上车站点}", $run_info['res_name'], $content);
$content = str_replace("{下车站点}", $run_info['end_res_name'], $content);
$content = str_replace("{订单号}", $ORDER_ID, $content);
}
}
// $content = "您预订的{出发日期 出发时间}{出发地}-{目的地}{票种名}{张数}张,已购票成功。乘车订单号为{订单号},请凭订单号或绑定微信(微信服务号“蜘蛛出行”)扫码上车。";
if ($seat) {
$seat_x = isset($seat['seat_x']) ? $seat['seat_x'] : "";
$seat_y = isset($seat['seat_y']) ? $seat['seat_y'] : "";
$seat_name = isset($seat['seat_name']) ? $seat['seat_name'] : "";
$order_main_id = isset($seat['order_main_id']) ? $seat['order_main_id'] : "";
} else {

}
if ($run_info) {
$order_count = $run_info['order_count'];
$start_date = $run_info['start_date'];
$start_time = $run_info['start_time'];
$parent_order_id = $run_info['parent_order_id'];
$end_date = $run_info['end_date'];
$start_area = $run_info['start_area'];
$end_area = $run_info['end_area'];
$res_name = $run_info['res_name'];
$parent_prod_id = $run_info['parent_prod_id'];
$prod_name = $run_info['prod_name'];
$prod_name = "标准票";
$customer_name = $run_info['customer_name'];
$customer_mobile = $run_info['customer_mobile'];
$start_end_date = $start_date . "," . $start_time;
$content = str_replace("{出发日期}", $start_date, $content);
$content = str_replace("{出发时间}", $start_time, $content);
$content = str_replace("{上车站点}", $res_name, $content);
$content = str_replace("{出发地}", $start_area, $content);
$content = str_replace("{目的地}", $end_area, $content);
$content = str_replace("{票种名}", $prod_name, $content);
$content = str_replace("{张数}", $order_count, $content);
$content = str_replace("{订单号}", $ORDER_ID, $content);
} else {
$content = str_replace("{出发日期}", "", $content);
$content = str_replace("{出发时间}", "", $content);
$content = str_replace("{出发地}", "", $content);
$content = str_replace("{目的地}", "", $content);
$content = str_replace("{票种名}", "", $content);
$content = str_replace("{张数}", "", $content);
$content = str_replace("{订单号}", "", $content);
}
if ($driver) {
$bus_no = isset($driver['bus_no']) ? $driver['bus_no'] : "";
$driver_name = isset($driver['driver_name']) ? $driver['driver_name'] : "";
$driver_mobile = isset($driver['driver_mobile']) ? $driver['driver_mobile'] : "";

if ($bus_no == "") {
$content = str_replace(",车牌号{车牌号}", "", $content);
} else {
$content = str_replace("{车牌号}", $bus_no, $content);
}
if ($driver_name == "") {
$content = str_replace(",司机电话{司机姓司机电话},", "。", $content);
} else {
$driver_xing = mb_substr($driver_name, 0, 1, 'utf-8');
$driver_name_mobile = $driver_xing . $driver_mobile;
$content = str_replace("{司机姓司机电话}", $driver_name_mobile, $content);
}
} else {
$content = str_replace("车牌号{车牌号},", "", $content);
$content = str_replace("司机电话{司机姓司机电话},", "", $content);
}
/*
if( $now_time < "18:30:00" ) {
//判断是不是苏州或周庄
// 判断如果不是迪士尼的票就不发短信
if (!in_array($run_info['parent_prod_id'], $dsn_arr_prod) && !in_array($run_info['parent_prod_id'], $zhou_su_arr_prod)) {
return array("", "-1", "不是迪士尼、苏州、周庄的票,目前不发送短信");
}
}*/
$content .= "【重要提示】:因G20峰会影响,7月1号开始实名登记安检,出行时请所有游客携带有效证件(身份证或户口本),凭有效证件上车,如被查出无有效证件,导致无法出行,责任自行承担,谢谢配合!";
return array(isset($customer_name) ? $customer_name : "", isset($customer_mobile) ? $customer_mobile : "", isset($content) ? $content : "短信错误,联系客服!!!");
}
}

//发短信
public function send_msg($ORDER_ID)
{
$send_pdo = conn();
$order_id = $ORDER_ID;
$res_content = get_msg_info($order_id);
$name = $res_content[0];
$tel = $res_content[1];
$content = $res_content[2];
writeLog("短信模板内容:【" . $content . "】");

//..发短信先取消
$response = sendTelMessage($tel, $name, $content, $order_id);
writeLog(json_encode($response));

$comment_type = 0;
$comment_text = "";
$send_success = (int)$response;
$sql1 = "CALL HT_ADD_MSG_COMMENT(2,'addmsg'," . $order_id . "," . $comment_type . ",'" . $comment_text . "','" . $tel . "','" . $content . "','" . date("Y-m-d H:i:s") . "',{$send_success})";
$result1 = $send_pdo->query($sql1);
$rowset1 = $result1->fetchAll(PDO::FETCH_ASSOC);
$result1->closeCursor();
writeLog("hotel_order_status.php HT_ADD_MSG_COMMENT()::" . $sql1);
//insert order extra
$hotelPrice = isset($_GET['hotelPrice']) ? $_GET['hotelPrice'] : "";
$doorPrice = isset($_GET["doorPrice"]) ? $_GET["doorPrice"] : "";

if ($hotelPrice != "" || $doorPrice != "") {
$sqlInsert = " INSERT INTO order_extra_info (order_id,hotel_price,gate_price) VALUE(" . $ORDER_ID . ",'" . $hotelPrice . "','" . $doorPrice . "') ";
writeLog("insert extra info: " . $sqlInsert);
$result = $send_pdo->exec($sqlInsert);
}
}

//创建订单
public function create_order($sql, $price_list,$pdo)
{
if (is_object($pdo)) {
$result = $pdo->query($sql);

if (!$result) {
return false;
}
// echo json_encode(array('aa'=>$sql));die;
$rowset_create = $result->fetchAll(PDO::FETCH_ASSOC);
$result->closeCursor();
writeLog('下订单成功');
writeLog(json_encode($rowset_create));

if (is_array($rowset_create) && $rowset_create[0]['errcode'] == 0 && SEND_MESSAGE == true) {
//下订单成功再修改价格
writeLog('change_price.php' . json_encode($_POST));

$sql_up_price = "call SP_CHANGE_PRICE(" . $rowset_create[0]['order_id'] . ",'" . $price_list . "')";
//$sql="update order_main set order_price ='".$price_arr[$k]."' where PROD_ID=".$v." and PARENT_ORDER_ID=".$ordid." and RUN_ID>0";
$result_up_price = $pdo->query($sql_up_price);
$rowset_up_price = $result_up_price->fetchAll(PDO::FETCH_ASSOC);
writeLog("change_price.php sql:: " . $sql_up_price . "::rowset ::" . json_encode($rowset_up_price));
$result_up_price->closeCursor();
}
}
return $rowset_create;
}

//获取订单详情
public function get_order_info($order_id,$pdo)
{
//根据订单号查找订单详情
$sql = "SELECT
a.order_id,
a.create_time,
a.order_price,
a.order_pay_main_id,
a.customer_name,
a.customer_mobile,
count(b.order_id) AS num,
b.PROD_START_STATION_DATE AS run_date,
b.PROD_START_STATION_TIME AS run_time,
b.PROD_START_STATION_AREA_NAME AS start_area,
b.PROD_END_STATION_AREA_NAME AS end_area,
b.PROD_START_STATION_RES_NAME AS start_res,
b.PROD_END_STATION_RES_NAME AS end_res
FROM
order_main a,
order_main b
WHERE
a.order_id = b.PARENT_ORDER_ID
AND a.order_id = " . $order_id . "
GROUP BY
a.order_id";

$result = $pdo->query($sql);
$order_info = $result->fetchAll(PDO::FETCH_ASSOC);

return $order_info;
}

//修改订单详情
public function update_order_info($order_id,$run_id,$bus_no,$member_id,$pay_main_id,$pdo)
{
$sql_pay = "UPDATE order_pay_detail
SET pay_type_id_1 = 278
WHERE
pay_main_id = " . $pay_main_id;

$sql_cancel = "UPDATE order_main
SET ORDER_BOOK_STATUS = 1,
member_id = " . $member_id . "
WHERE
order_id = " . $order_id . "
OR parent_order_id = " . $order_id;

$sql_check = "INSERT into order_check_tickets(order_id,run_id,bus_no,check_status,check_time,check_station)
VALUES(" . $order_id . "," . $run_id . "," . $bus_no . ",1,'" . date("Y-m-d H:i:s",time()) . "',0)";

$result = $pdo->exec($sql_cancel);
$result = $pdo->exec($sql_pay);
$result = $pdo->exec($sql_check);
}
}

$prod_list = isset($_POST['prod_list'])?$_POST['prod_list']:'';//购票信息
$customer_info = isset($_POST['customer_info'])?$_POST['customer_info']:'';//乘客信息
$start_name = isset($_POST['start_name'])?$_POST['start_name']:'';//起点地名
$end_name = isset($_POST['end_name'])?$_POST['end_name']:'';//终点地名
$startx_y = isset($_POST['startx_y'])?$_POST['startx_y']:'';//起点纬经度
$endx_y = isset($_POST['endx_y'])?$_POST['endx_y']:'';//终点纬经度
$line_id = isset($_POST['line_id'])?$_POST['line_id']:'';;//线路ID

$start_time = isset($_POST['start_time'])?$_POST['start_time']:'';//开始时间
$end_time = isset($_POST['end_time'])?$_POST['end_time']:'';//结束时间
//判断是否有时间

if(empty($start_time) || empty($end_time)){
echo json_encode(array('code' => '1', 'info' => '开始和结束时间均不能为空'));
exit();
}
//if($start_time < date('Y-m-d H:i',time()+3600)){
// echo json_encode(array('code' => '1', 'info' => '发车前停止售票'));
// exit();
//}

$submit = new submit();
$res = $submit->execSubmit($prod_list, $customer_info, $start_name, $end_name, $startx_y, $endx_y, $line_id,$pdo);

?>

+ 524
- 0
ZZDZ/application/custom_made/order/submitforout.php View File

@@ -0,0 +1,524 @@
<?php
/*
* wechat 2.0
* Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
* Date: 2016.7.12
* Something is to pay QQ1062140302
*/

require_once __DIR__.'/../../api/common.php';
require_once __DIR__.'/../../api/create_order.php';
require_once __DIR__.'/../../api/cancel_order.php';

class submit extends virtifyUsers
{
//提交订单流程
public function execSubmit($prod_list, $customer_info, $start_name, $end_name, $startx_y, $endx_y, $line_id,$pdo)
{
//获取要提交的详细信息
$prod_info = $this -> get_prod_info($prod_list,$pdo);

$ticket_id = $prod_info['ticket_id'];//票种ID
$tic_num = $prod_info['tic_num'];//订票数量
$run_id = $prod_info['run_id'];//班次ID
$userid = $prod_info['userid'];//用户ID
$member_id = $prod_info['member_id'];//会员号
$run_date = $prod_info['run_date'];//发车日期
$run_time = $prod_info['run_time'];//发车时间
$run_date_time = $prod_info['run_date_time'];//检验订单所需时间

//判断会员号
if (!$member_id) {
echo json_encode(array("code" => '1', "iflogin" => 1, "info" => "请关注公众号:蜘蛛出行"));
exit;
}

//判断购票数量
if ($tic_num == 0) {
echo json_encode(array("code" => '1', "info" => "订票数量不可为0"));
exit;
}
//检查订单
$order_result =$this->check_order($startx_y, $endx_y, $line_id, $run_id, $tic_num, $start_name, $end_name,$run_date_time);
writeLog("check_order:".json_encode($order_result));
//检查订单完全失败


if (!$order_result) {
echo json_encode(array("code" => '120', "info" => "不可预订"));
exit;
}
$cust_info = $this->explode_cust_info($customer_info);
$cust_name = $cust_info['name'];
$cust_phone = $cust_info['phone'];
//交易还有机会,电话联系
if ($order_result['code'] == 101) {
//将数据存入order_man_contact
$sql_temp = "INSERT into order_man_contact(name,phone,run_id,start_station,end_station) VALUES('" . $cust_name . "','" . $cust_phone . "'," . $run_id . ",'" . $start_name . "','" . $end_name . "')";
$result_temp = $pdo->exec($sql_temp);
echo json_encode(array("code" => '101', "info" => "提交成功,电话联系"));
exit;
}

//检查订单成功
$order_result = $order_result['result'];
$order_id = $order_result['order_id'];//订单ID
$bus_no = $order_result['bus_no'];//车号
$start_time = substr($order_result['start_time'],-5);//开始时间
$end_time = substr($order_result['end_time'],-5);//结束时间
$order_from_org_id = 0;//订单渠道ID
$top_org_id = 0;//顶级订单渠道ID
$outside_order_id = isset($_POST['outside_order_id']) ? $_POST['outside_order_id'] : '1';//外部订单渠道ID

//获取票种价格
$sql_price = "select cus_price from opera_product_price where prod_id =" . $ticket_id;
$result_price = $pdo->query($sql_price);
$row_p = $result_price->fetchAll(PDO::FETCH_ASSOC);

$price_list = $ticket_id . ',' . $row_p[0]['cus_price'];//票种价格完整信息

$sql = "CALL sp_make_order_for_business('" . $userid . "','" . $prod_list . "','" . $customer_info . "','1','0','" . $start_name . "','" . $end_name . "','" . $start_time . "','" . $end_time . "','" . $bus_no . "','" . $member_id . "','" . $order_id . "')";
writeLog("sp_make_order_for_business---san: " . $sql);
//提交order_main表
$rowset = $this->create_order($sql, $price_list,$pdo);
//order_main提交失败
if(!$rowset || $rowset[0]['errcode']){
//启动退票算法
$cancel_order = new cancelOrder();
$res = $cancel_order -> funCancelOrder($line_id, $run_id, $bus_no, $order_id, $run_date_time);
if($res){
$sql_temp = "INSERT into order_man_contact(name,phone,run_id,start_station,end_station) VALUES('" . $cust_name . "','" . $cust_phone . "'," . $run_id . ",'" . $start_name . "','" . $end_name . "')";
$result_temp = $pdo->exec($sql_temp);
echo json_encode(array('code' => '1', 'info' => '您的订单正在审核中,15分钟客服人员将会致电您'));
exit;
}else{
echo json_encode(array('code' => '1', 'info' => '退票算法错误'));//退票算法和order_main表插入均失败
exit;
}
}

//获取订单详情
$order_info = $this -> get_order_info($order_id,$pdo);

$pay_main_id = $order_info[0]['order_pay_main_id'];//支付方式

//修改订单
$this -> update_order_info($order_id,$run_id,$bus_no,$member_id,$pay_main_id,$pdo);

//发短信
//$this -> send_msg($order_id);
echo json_encode(array('code' => '0', 'info' => '提交成功', 'order_id' => $order_id));
exit();

}

//获取要提交订单的详细信息
public function get_prod_info($prod_list,$pdo){
$ticket_id = substr($prod_list, strpos($prod_list, 'm') + 1, strpos($prod_list, 'p') - 2);//票种ID
$tic_num = substr($prod_list, strpos($prod_list, 'p') + 1, strpos($prod_list, '|') - strpos($prod_list, 'p') - 1);//乘客数量
$run_id = substr(substr($prod_list, strpos($prod_list, 'r') + 1), 0, -1);//班次ID

//$beginX_Y = isset($_POST['startx_y']) ? $_POST['startx_y'] : false;
$userid = 0;//用户ID
$member_id =1;// isset($_COOKIE['user_id']) ? $_COOKIE['user_id'] : '0';//会员号ID

$sql_time = "select run_date,run_time from run_main where run_id =" . $run_id;
$result_time = $pdo->query($sql_time);
$row_t = $result_time->fetchAll(PDO::FETCH_ASSOC);

$run_date = $row_t[0]['run_date'];//出发日期
$run_time = $row_t[0]['run_time'];//出发时间
$run_date_time = $run_date . " " . $run_time;
$prod_info['ticket_id'] = $ticket_id;
$prod_info['tic_num'] = $tic_num;
$prod_info['run_id'] = $run_id;
$prod_info['userid'] = $userid;
$prod_info['member_id'] =1;// $_COOKIE['user_id'];
$prod_info['run_date'] = $run_date;
$prod_info['run_time'] = $run_time;
$prod_info['run_date_time'] = $run_date_time;
return $prod_info;
}
//解析乘客信息
public function explode_cust_info($cust_info){
$cust_info_temp = explode(',', $cust_info );
$temp['name'] = $cust_info_temp['1'];
$temp['phone']= $cust_info_temp['3'];
return $temp;
}


//检验订单
public function check_order($startx_y, $endx_y, $line_id, $run_id, $tic_num, $start_name, $end_name,$run_date_time)
{
$co = new createOrder();
$time = commonUtils::baiduShortTime($startx_y, $endx_y);
if (!$startx_y || !$endx_y) {
$result['status'] = 111; //状态码:111为经纬度不能为空)
$result['info'] = "经纬度不能为空";
echo json_encode($result);
exit();
}
if ($time > 360) //总时长不能超过360分钟
{
$result['status'] = 101; //状态码:101为总时长不符合要求(超过360分钟)
$result['info'] = "总时长不能超过360分钟";
echo json_encode($result);
exit();
}
if ($tic_num > 6) {
$result['status'] = 108; //状态码:人数不能超过6人
$result['info'] = "每个订单人数不能超过6人";
echo json_encode($result);
exit();
}

//先判断是否属于规定的市区
$start_area = commonUtils::GeocodingAPI($startx_y);
$end_area = commonUtils::GeocodingAPI($endx_y);
if (($line_id == "449860" && $start_area == "南京市" && $end_area == "南通市") || ($line_id == "449865" && $start_area == "南通市" && $end_area == "南京市")) {
if ($line_id && $run_id && $tic_num && $startx_y && $endx_y && $run_date_time) {
$orderID = commonUtils::produceOrderId($tic_num); //获取订单号
$res = $co->calShortTime($line_id, $run_id, $orderID, $tic_num, $startx_y, $start_name, $endx_y, $end_name, $run_date_time);
return $res;
}else{
$result['code'] = '1';
$result['info'] = "订单提交信息不全";
echo json_encode($result);
exit();
}
} else {
$result['code'] = '1';
$result['info'] = "所选地点不在规划范围内";
echo json_encode($result);
exit();
}

}

//..短信模板-改为17:30后OK,当天下单也OK
public function get_msg_info($ORDER_ID)
{
$msg_pdo = conn();
$msg_sql = "CALL SP_GET_MESSAGE_TEMPLATE('" . $ORDER_ID . "')";
$content = '';
if (is_object($msg_pdo)) {
$msg_result = $msg_pdo->query($msg_sql);
$i = 1;
$data = array();
if ($msg_result) {
$data['code'] = "0";
$data['info'] = "";
do {
$row = $msg_result->fetchAll(PDO::FETCH_ASSOC);
if ($i == 1) {
$data['seat'] = isset($row) ? $row : array();
} else if ($i == 2) {
$data['run_info'] = isset($row) ? $row : array();
} else if ($i == 3) {
$data['driver'] = isset($row) ? $row : array();
} else if ($i == 4) {
$data['dsn_prod'] = isset($row) ? $row : array();
} else if ($i == 5) {
$data['zhou_su_prod'] = isset($row) ? $row : array();
}
$i++;
} while ($msg_result->nextRowset());
}
$json_obj = json_decode(json_encode($data), TRUE);
$seat = isset($json_obj['seat'][0]) ? $json_obj['seat'][0] : array();
$run_info = isset($json_obj['run_info'][0]) ? $json_obj['run_info'][0] : array();
$driver = isset($json_obj['driver'][0]) ? $json_obj['driver'][0] : array();
$dsn_prod = isset($json_obj['dsn_prod']) ? $json_obj['dsn_prod'] : array();
$zhou_su_prod = isset($json_obj['zhou_su_prod']) ? $json_obj['zhou_su_prod'] : array();
$bus_res_id = isset($json_obj['driver'][0]) ? $json_obj['driver'][0]["bus_res_id"] : 0;
$short_url = false;
if ($bus_res_id != 0) {
$ary_sell_ary = array(916, 917);
if (in_array($bus_res_id, $ary_sell_ary)) {
$ticket_url = TICKET_QR_URL . $ORDER_ID;
$short_url = sinaShortenUrl($ticket_url);
}
}
$extra_message = "";
if ($short_url != false) {
$extra_message = "点击以下链接获取您的电子票扫码上车:{$short_url}";
}

//出票成功
// $content = "您预订的{出发日期 出发时间}{出发地}-{目的地}{票种名}{张数}张,已购票成功。乘车订单号为{订单号},请凭订单号或绑定微信(微信服务号“蜘蛛出行”)扫码上车,车牌号{车牌号},司机电话{司机姓司机电话}。";
// 得到明天的时间
date_default_timezone_set('PRC');
//解决时区问题
$tomorrow = date("Y-m-d", strtotime("+1 day"));
$now_time = date('H:i:s', time());
//判断当前时间是否在17:30:00之后
$cur_date = date('Y-m-d', time());
//迪士尼特殊情况parent_prod_id

// $dsn_arr_prod = array(152752, 152759, 152763, 152770, 152777, 152784, 152791, 152801, 152808, 152815, 152822, 152832, 152842, 152852, 152859, 152866, 152873, 152877, 152884, 152891, 152898, 152905, 152915, 152922, 152929, 152936, 152946, 152956, 152966, 152973, 152980, 152990, 153003, 153016, 153023, 153033, 153034, 153044, 153057, 153070, 153083, 153090, 153100, 153110);
$dsn_arr_prod = array(); //用来保存迪士尼产品的prod_id
foreach ($dsn_prod as $temp) {
$dsn_arr_prod[] = $temp['prod_id'];
}

$zhou_su_arr_prod = array();
foreach ($zhou_su_prod as $temp) {
$zhou_su_arr_prod[] = $temp['prod_id'];
}

$new_message_array = array(448569, 448568);
if (in_array($run_info['parent_prod_id'], $new_message_array)) {
$content = "您预订的{出发日期}{出发地}-{目的地}{票种名}{张数}张,已成功出票,请在{出发时间}前十五分钟到达{上车站点}。出行前一天下午的18:00左右将会有导游和您联系,预祝您旅途愉快。";
} elseif (($now_time > "18:30:00" && $run_info['start_date'] == $tomorrow) || $cur_date == $run_info['start_date']) {//17:30之后的订单或者下单时间为今天出行为今天下午 发送短信模板
// if("18:30:00">"17:30:00" && $run_info['start_date']==$tomorrow){ //17:30之后的订单 发送短信模板
// $content = "您预订的{出发日期 出发时间}{出发地}-{目的地}{票种名}{张数}张,已购票成功。乘车订单号为{订单号},请凭订单号或绑定微信(微信服务号“蜘蛛出行”)扫码上车,车牌号{车牌号},司机电话{司机姓司机电话}。";
$content = "您预订的{出发日期}{出发地}-{目的地}{票种名}{张数}张,已成功出票,请在{出发时间}前三十分钟到达{上车站点}。您的乘车订单号为{订单号},车牌号{车牌号},司机电话{司机姓司机电话},请凭短信订单号乘车{$extra_message},预祝您旅途愉快。";
if (in_array($run_info['parent_prod_id'], $dsn_arr_prod)) {
$content = "您预订的{出发日期}{上车站点}-{下车站点}{票种名}{张数}张,已成功出票,请在{出发时间}前三十分钟到达{上车站点}。您的乘车订单号为{订单号}。请凭短信订单号乘车{$extra_message},预祝您旅途愉快。(如需咨询请致电:021-33280578)【zhizhuchuxing】Congratulations! Your ticket from hotel to Disney has been approved. Your order number is {订单号}. Please keep it and arrive at the place before {出发时间}. Enjoy your trip and have a nice day! If you have any questions, please call: 021-33280578.";
$content = str_replace("{上车站点}", $run_info['res_name'], $content);
$content = str_replace("{下车站点}", $run_info['end_res_name'], $content);
$content = str_replace("{订单号}", $ORDER_ID, $content);
}
} else {
// $content = "您预订的{出发日期 出发时间}{出发地}-{目的地}{票种名}{张数}张,已购票成功。乘车订单号为{订单号},请凭订单号或绑定微信(微信服务号“蜘蛛出行”)扫码上车。";
$content = "您预订的{出发日期}{出发地}-{目的地}{票种名}{张数}张,已成功出票,请在{出发时间}前三十分钟到达{上车站点}。您的乘车订单号为{订单号},请凭短信订单号乘车。出行前一天下午的18:30会将车牌号与司机电话发送给您,预祝您旅途愉快。";
if (in_array($run_info['parent_prod_id'], $dsn_arr_prod)) {
$ticket_url = TICKET_QR_URL . $ORDER_ID;
$short_url = sinaShortenUrl($ticket_url);
$extra_content = "";
if ($short_url != false) {
$extra_content = "或点击以下链接获取乘车二维码扫码上车(" . $short_url . ")";
}
$content = "您预订的{出发日期}{上车站点}-{下车站点}{票种名}{张数}张,已成功出票,请在{出发时间}前三十分钟到达{上车站点}。您的乘车订单号为{订单号}。请凭短信订单号乘车{$extra_content},预祝您旅途愉快。(如需咨询请致电:021-33280578)【zhizhuchuxing】Congratulations! Your ticket from hotel to Disney has been approved. Your order number is {订单号}. Please keep it and arrive at the place before {出发时间}. Enjoy your trip and have a nice day! If you have any questions, please call: 021-33280578.";
$content = str_replace("{上车站点}", $run_info['res_name'], $content);
$content = str_replace("{下车站点}", $run_info['end_res_name'], $content);
$content = str_replace("{订单号}", $ORDER_ID, $content);
}
}
// $content = "您预订的{出发日期 出发时间}{出发地}-{目的地}{票种名}{张数}张,已购票成功。乘车订单号为{订单号},请凭订单号或绑定微信(微信服务号“蜘蛛出行”)扫码上车。";
if ($seat) {
$seat_x = isset($seat['seat_x']) ? $seat['seat_x'] : "";
$seat_y = isset($seat['seat_y']) ? $seat['seat_y'] : "";
$seat_name = isset($seat['seat_name']) ? $seat['seat_name'] : "";
$order_main_id = isset($seat['order_main_id']) ? $seat['order_main_id'] : "";
} else {

}
if ($run_info) {
$order_count = $run_info['order_count'];
$start_date = $run_info['start_date'];
$start_time = $run_info['start_time'];
$parent_order_id = $run_info['parent_order_id'];
$end_date = $run_info['end_date'];
$start_area = $run_info['start_area'];
$end_area = $run_info['end_area'];
$res_name = $run_info['res_name'];
$parent_prod_id = $run_info['parent_prod_id'];
$prod_name = $run_info['prod_name'];
$prod_name = "标准票";
$customer_name = $run_info['customer_name'];
$customer_mobile = $run_info['customer_mobile'];
$start_end_date = $start_date . "," . $start_time;
$content = str_replace("{出发日期}", $start_date, $content);
$content = str_replace("{出发时间}", $start_time, $content);
$content = str_replace("{上车站点}", $res_name, $content);
$content = str_replace("{出发地}", $start_area, $content);
$content = str_replace("{目的地}", $end_area, $content);
$content = str_replace("{票种名}", $prod_name, $content);
$content = str_replace("{张数}", $order_count, $content);
$content = str_replace("{订单号}", $ORDER_ID, $content);
} else {
$content = str_replace("{出发日期}", "", $content);
$content = str_replace("{出发时间}", "", $content);
$content = str_replace("{出发地}", "", $content);
$content = str_replace("{目的地}", "", $content);
$content = str_replace("{票种名}", "", $content);
$content = str_replace("{张数}", "", $content);
$content = str_replace("{订单号}", "", $content);
}
if ($driver) {
$bus_no = isset($driver['bus_no']) ? $driver['bus_no'] : "";
$driver_name = isset($driver['driver_name']) ? $driver['driver_name'] : "";
$driver_mobile = isset($driver['driver_mobile']) ? $driver['driver_mobile'] : "";

if ($bus_no == "") {
$content = str_replace(",车牌号{车牌号}", "", $content);
} else {
$content = str_replace("{车牌号}", $bus_no, $content);
}
if ($driver_name == "") {
$content = str_replace(",司机电话{司机姓司机电话},", "。", $content);
} else {
$driver_xing = mb_substr($driver_name, 0, 1, 'utf-8');
$driver_name_mobile = $driver_xing . $driver_mobile;
$content = str_replace("{司机姓司机电话}", $driver_name_mobile, $content);
}
} else {
$content = str_replace("车牌号{车牌号},", "", $content);
$content = str_replace("司机电话{司机姓司机电话},", "", $content);
}
/*
if( $now_time < "18:30:00" ) {
//判断是不是苏州或周庄
// 判断如果不是迪士尼的票就不发短信
if (!in_array($run_info['parent_prod_id'], $dsn_arr_prod) && !in_array($run_info['parent_prod_id'], $zhou_su_arr_prod)) {
return array("", "-1", "不是迪士尼、苏州、周庄的票,目前不发送短信");
}
}*/
return array(isset($customer_name) ? $customer_name : "", isset($customer_mobile) ? $customer_mobile : "", isset($content) ? $content : "短信错误,联系客服!!!");
}
}

//发短信
public function send_msg($ORDER_ID)
{
$send_pdo = conn();
$order_id = $ORDER_ID;
$res_content = $this -> get_msg_info($order_id);
$name = $res_content[0];
$tel = $res_content[1];
$content = $res_content[2];
writeLog("短信模板内容:【" . $content . "】");

//..发短信先取消
$response = $this -> sendTelMessage($tel, $name, $content, $order_id);
writeLog(json_encode($response));

$comment_type = 0;
$comment_text = "";
$send_success = (int)$response;
$sql1 = "CALL HT_ADD_MSG_COMMENT(2,'addmsg'," . $order_id . "," . $comment_type . ",'" . $comment_text . "','" . $tel . "','" . $content . "','" . date("Y-m-d H:i:s") . "',{$send_success})";
$result1 = $send_pdo->query($sql1);
$rowset1 = $result1->fetchAll(PDO::FETCH_ASSOC);
$result1->closeCursor();
writeLog("hotel_order_status.php HT_ADD_MSG_COMMENT()::" . $sql1);
//insert order extra
$hotelPrice = isset($_GET['hotelPrice']) ? $_GET['hotelPrice'] : "";
$doorPrice = isset($_GET["doorPrice"]) ? $_GET["doorPrice"] : "";

if ($hotelPrice != "" || $doorPrice != "") {
$sqlInsert = " INSERT INTO order_extra_info (order_id,hotel_price,gate_price) VALUE(" . $ORDER_ID . ",'" . $hotelPrice . "','" . $doorPrice . "') ";
writeLog("insert extra info: " . $sqlInsert);
$result = $send_pdo->exec($sqlInsert);
}
}

//创建订单
public function create_order($sql, $price_list,$pdo)
{
if (is_object($pdo)) {
$result = $pdo->query($sql);

if (!$result) {
return false;
}
// echo json_encode(array('aa'=>$sql));die;
$rowset_create = $result->fetchAll(PDO::FETCH_ASSOC);
$result->closeCursor();
writeLog('下订单成功');
writeLog(json_encode($rowset_create));

if (is_array($rowset_create) && $rowset_create[0]['errcode'] == 0 && SEND_MESSAGE == true) {
//下订单成功再修改价格
writeLog('change_price.php' . json_encode($_POST));

$sql_up_price = "call SP_CHANGE_PRICE(" . $rowset_create[0]['order_id'] . ",'" . $price_list . "')";
//$sql="update order_main set order_price ='".$price_arr[$k]."' where PROD_ID=".$v." and PARENT_ORDER_ID=".$ordid." and RUN_ID>0";
$result_up_price = $pdo->query($sql_up_price);
$rowset_up_price = $result_up_price->fetchAll(PDO::FETCH_ASSOC);
writeLog("change_price.php sql:: " . $sql_up_price . "::rowset ::" . json_encode($rowset_up_price));
$result_up_price->closeCursor();
}
}
return $rowset_create;
}

//获取订单详情
public function get_order_info($order_id,$pdo)
{
//根据订单号查找订单详情
$sql = "SELECT
a.order_id,
a.create_time,
a.order_price,
a.order_pay_main_id,
a.customer_name,
a.customer_mobile,
count(b.order_id) AS num,
b.PROD_START_STATION_DATE AS run_date,
b.PROD_START_STATION_TIME AS run_time,
b.PROD_START_STATION_AREA_NAME AS start_area,
b.PROD_END_STATION_AREA_NAME AS end_area,
b.PROD_START_STATION_RES_NAME AS start_res,
b.PROD_END_STATION_RES_NAME AS end_res
FROM
order_main a,
order_main b
WHERE
a.order_id = b.PARENT_ORDER_ID
AND a.order_id = " . $order_id . "
GROUP BY
a.order_id";

$result = $pdo->query($sql);
$order_info = $result->fetchAll(PDO::FETCH_ASSOC);

return $order_info;
}

//修改订单详情
public function update_order_info($order_id,$run_id,$bus_no,$member_id,$pay_main_id,$pdo)
{
$sql_pay = "UPDATE order_pay_detail
SET pay_type_id_1 = 278
WHERE
pay_main_id = " . $pay_main_id;

$sql_cancel = "UPDATE order_main
SET ORDER_BOOK_STATUS = 1,
member_id = " . $member_id . "
WHERE
order_id = " . $order_id . "
OR parent_order_id = " . $order_id;

$sql_check = "INSERT into order_check_tickets(order_id,run_id,bus_no,check_status,check_time,check_station)
VALUES(" . $order_id . "," . $run_id . "," . $bus_no . ",1,'" . date("Y-m-d H:i:s",time()) . "',0)";

$result = $pdo->exec($sql_cancel);
$result = $pdo->exec($sql_pay);
$result = $pdo->exec($sql_check);
}
}

$prod_list = isset($_POST['prod_list'])?$_POST['prod_list']:'';//购票信息
$customer_info = isset($_POST['customer_info'])?$_POST['customer_info']:'';//乘客信息
$start_name = isset($_POST['start_name'])?$_POST['start_name']:'';//起点地名
$end_name = isset($_POST['end_name'])?$_POST['end_name']:'';//终点地名
$startx_y = isset($_POST['startx_y'])?$_POST['startx_y']:'';//起点纬经度
$endx_y = isset($_POST['endx_y'])?$_POST['endx_y']:'';//终点纬经度
$line_id = isset($_POST['line_id'])?$_POST['line_id']:'';;//线路ID

$start_time = isset($_POST['start_time'])?$_POST['start_time']:'';//开始时间
$end_time = isset($_POST['end_time'])?$_POST['end_time']:'';//结束时间
//判断是否有时间
if(empty($start_time) || empty($end_time)){
echo json_encode(array('code' => '1', 'info' => '开始和结束时间均不能为空'));
exit();
}

$submit = new submit();
$res = $submit->execSubmit($prod_list, $customer_info, $start_name, $end_name, $startx_y, $endx_y, $line_id,$pdo);

?>

+ 135
- 0
ZZDZ/application/custom_made/order/xiecheng_order.php View File

@@ -0,0 +1,135 @@
<?php
require_once __DIR__.'/../../../config/Mysql.php';
require_once __DIR__.'/../../api/common.php';
require_once __DIR__.'/../../api/create_order.php';

$pdo = conn();

$value['order_id'] = 474293;//,474265
$list_d = Find($value['order_id'],$pdo);
if($value['order_id'] == 474272 || $value['order_id'] ==474293){
$startx_y = '31.991326,120.892807';
$endx_y ='32.116818,118.784015';
$line_id = $list_d['line_id'] ;
$run_id = $list_d['run_id'];
$tic_num = $list_d['tic_num'] ;
$start_name =$list_d['start_res_name'];
$end_name = $list_d['end_res_name'];
$run_date_time = $list_d['run_time'];
}else{
$startx_y = '32.116818,118.784015'; //南京dao 南通
$endx_y ='31.991326,120.892807';
$line_id = $list_d['line_id'] ;
$run_id = $list_d['run_id'];
$tic_num = $list_d['tic_num'] ;
$start_name =$list_d['start_res_name'];
$end_name = $list_d['end_res_name'];
$run_date_time = $list_d['run_time'];
}
$order_result = check_order($startx_y, $endx_y, $line_id, $run_id, $tic_num, $start_name, $end_name,$run_date_time,$value['order_id']);
var_dump($order_result);
echo $value['order_id']."->".$order_result['result']['order_id']."<br>";
writeLog("check_order:".json_encode($order_result));


//检验订单
function check_order($startx_y, $endx_y, $line_id, $run_id, $tic_num, $start_name, $end_name,$run_date_time,$order_id)
{
$co = new createOrder();
$time = commonUtils::baiduShortTime($startx_y, $endx_y);
if (!$startx_y || !$endx_y) {
$result['status'] = 111; //状态码:111为经纬度不能为空)
$result['info'] = "经纬度不能为空";
echo json_encode($result);
exit();
}
if ($time > 360) //总时长不能超过360分钟
{
$result['status'] = 101; //状态码:101为总时长不符合要求(超过360分钟)
$result['info'] = "总时长不能超过360分钟";
echo json_encode($result);
exit();
}
if ($tic_num > 6) {
$result['status'] = 108; //状态码:人数不能超过6人
$result['info'] = "每个订单人数不能超过6人";
echo json_encode($result);
exit();
}
//先判断是否属于规定的市区
$start_area = commonUtils::GeocodingAPI($startx_y);
$end_area = commonUtils::GeocodingAPI($endx_y);
if (($line_id == "449860" && $start_area == "南京市" && $end_area == "南通市") || ($line_id == "449865" && $start_area == "南通市" && $end_area == "南京市")) {
if ($line_id && $run_id && $tic_num && $startx_y && $endx_y && $run_date_time) {
$orderID = $order_id; //获取订单号
$res = $co->calShortTime($line_id, $run_id, $orderID, $tic_num, $startx_y, $start_name, $endx_y, $end_name, $run_date_time);
return $res;
}else{
$result['code'] = '1';
$result['info'] = "订单提交信息不全";
echo json_encode($result);
exit();
}
} else {
$result['code'] = '1';
$result['info'] = "所选地点不在规划范围内";
echo json_encode($result);
exit();
}
}

function Find($order_id,$pdo){
$sql = "select order_description,order_price,order_pay_main_id "
. "from order_main "
. "where order_id=".$order_id;
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$order_price = $rowset[0];//订单总价格 订单票的数量
$sql = "SELECT DISTINCT
order_description,parent_order_id,run_date,run_id,run_time,run_bus_order_id,prod_id,parent_prod_id,PROD_START_STATION_AREA_NAME,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME
FROM `order_main`
where PARENT_ORDER_ID=".$order_id;
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$order_station = $rowset[0];//订单来往地址 订单时间 订单好
if(empty($order_station))
return false;
$array_order_desc=array();

$arr_temp = explode('|',$order_price['order_description']);
$arr=array();
foreach ($arr_temp as $k=>$v2) {
if(!empty($v2))
$array_order_desc[]= explode (',', $v2); //订单票 * 数量
}
$list = array();
//上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)//反的数组
$list['station'] = $order_station['PROD_START_STATION_AREA_NAME'].'('.$order_station['PROD_START_STATION_RES_NAME'].')'
.'-'.$order_station['PROD_END_STATION_AREA_NAME'].'('.$order_station['PROD_END_STATION_RES_NAME'].')';
$list['start_station']=$order_station['PROD_START_STATION_AREA_NAME'];
$list['end_station']=$order_station['PROD_END_STATION_AREA_NAME'];
$list['start_res_name'] = $order_station['PROD_START_STATION_RES_NAME'];
$list['end_res_name'] = $order_station['PROD_END_STATION_RES_NAME'];
$list['run_date'] = $order_station['run_date'];
$list['run_time'] = $order_station['run_date'].' '.$order_station['run_time'];
$list['count']='';
$list['tic_num'] = 0;
foreach ($array_order_desc as $v){
$list['count'] .= ' '.$v[0].' × '.$v[2];
$list['tic_num'] +=$v[2] ;
}
$list['order_price'] = $order_price['order_price'];
$sql = "select pay_serial_number from order_pay_detail where pay_main_id =".$order_price['order_pay_main_id'];
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$list['pay_num'] = $rowset[0]['pay_serial_number'];
$list['line_id'] = $order_station['parent_prod_id'];
$list['run_id'] = $order_station['run_id'];//run_bus_order_id
$list['run_bus_order_id'] = $order_station['run_bus_order_id'];//parent_order_id
$list['parent_order_id'] = $order_station['parent_order_id'];
$list['prod_id'] = $order_station['prod_id'];
return $list;
}

?>

+ 81
- 0
ZZDZ/application/custom_made/test_cancel.php View File

@@ -0,0 +1,81 @@
<?php
//载入配置文件和连接数据库
date_default_timezone_set('PRC');
require_once '/usr/share/nginx/XMWX/ZZDZ/config/Mysql.php';
require_once '/usr/share/nginx/XMWX/ZZDZ/application/api/cancel_order.php';
$pdo=conn();
$time = date('Y-m-d H:i:s', time()-600);
$arrr = array(467129);
//465700 run565794
foreach ($arrr as $v){
$list_d = Find($v);
echo $list_d['prod_id'];
if($list_d['prod_id'] == 449860 ||$list_d['prod_id'] == 449865 ||$list_d['prod_id'] == 449862 ){
$cancel_order = new cancelOrder();
$res = $cancel_order -> funCancelOrder($list_d['line_id'], $list_d['run_id'], $list_d['run_bus_order_id'], $list_d['parent_order_id'], $list_d['run_time']);
var_dump($res);echo 111;
}
}





function Find($order_id){
$pdo= conn();
$sql = "select order_description,order_price,order_pay_main_id "
. "from order_main "
. "where order_id=".$order_id;
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$order_price = $rowset[0];//订单总价格 订单票的数量
$sql = "SELECT DISTINCT
order_description,parent_order_id,run_date,run_id,run_time,run_bus_order_id,prod_id,parent_prod_id,PROD_START_STATION_AREA_NAME,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME
FROM `order_main`
where PARENT_ORDER_ID=".$order_id;
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$order_station = $rowset[0];//订单来往地址 订单时间 订单好
if(empty($order_station))
return false;
$array_order_desc=array();

$arr_temp = explode('|',$order_price['order_description']);
$arr=array();
foreach ($arr_temp as $k=>$v2) {
if(!empty($v2))
$array_order_desc[]= explode (',', $v2); //订单票 * 数量
}
$list = array();
//上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)//反的数组
$list['station'] = $order_station['PROD_START_STATION_AREA_NAME'].'('.$order_station['PROD_START_STATION_RES_NAME'].')'
.'-'.$order_station['PROD_END_STATION_AREA_NAME'].'('.$order_station['PROD_END_STATION_RES_NAME'].')';
$list['start_station']=$order_station['PROD_START_STATION_AREA_NAME'];
$list['end_station']=$order_station['PROD_END_STATION_AREA_NAME'];
$list['start_res_name'] = $order_station['PROD_START_STATION_RES_NAME'];
$list['end_res_name'] = $order_station['PROD_END_STATION_RES_NAME'];
$list['run_date'] = $order_station['run_date'];
$list['run_time'] = $order_station['run_date'].' '.$order_station['run_time'];
$list['count']='';
$list['tic_num'] = 0;
foreach ($array_order_desc as $v){
$list['count'] .= ' '.$v[0].' × '.$v[2];
$list['tic_num'] +=$v[2] ;
}
$list['order_price'] = $order_price['order_price'];
$sql = "select pay_serial_number from order_pay_detail where pay_main_id =".$order_price['order_pay_main_id'];
$result=$pdo->query($sql);
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$list['pay_num'] = $rowset[0]['pay_serial_number'];
$list['line_id'] = $order_station['parent_prod_id'];
$list['run_id'] = $order_station['run_id'];//run_bus_order_id
$list['run_bus_order_id'] = $order_station['run_bus_order_id'];//parent_order_id
$list['parent_order_id'] = $order_station['parent_order_id'];
$list['prod_id'] = $order_station['prod_id'];
return $list;
}


+ 294
- 0
ZZDZ/application/service/createOrderService.php View File

@@ -0,0 +1,294 @@
<?php
/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/9/7
* Time: 19:57
*/
require_once __DIR__ . '/../api/common.php';

class createOrderService extends virtifyUsers
{
/**
*插入run_bus_station_view的函数
* @param type $run_id RUN_ID
* @param type $bus_no 车号
* @param type $prod_id prod_id
* @param type $order_id 该车次的订单号 123,123,123。。。。
* @param type $station 该车经过的站名 按经过顺序 上海,某某酒店,第三站点
* @param type $lat_long 该车站点的经纬度 按站点顺序 31.54565,1215656456;31.57685745,121.545654
* @param type $station_type 该车经过站点的 类型 1,1,0,1 上车站0 下车站1
* @param type $station_time 该车经过各个站点的时间点 按经过顺序 12:10,15:20,18:30
*/
public function set_run_station($run_id, $bus_no, $prod_id, $order_id, $station, $lat_long, $station_type, $station_time)
{
$pdo = conn();
$sql = "SELECT id from run_bus_station_view where run_id = '" . $run_id . "' and bus_no='" . $bus_no . "'";
$result = $pdo->query($sql);
$row = $result->fetchAll(PDO::FETCH_ASSOC);
if (!isset($row[0]['id'])) {
$sql = "INSERT into run_bus_station_view(run_id,bus_no,prod_id,order_id,station,lat_long,station_type,station_time,update_time) VALUES(" . $run_id . ",'" . $bus_no . "','" . $prod_id . "','" . $order_id . "','" . $station . "','" . $lat_long . "','" . $station_type . "','" . $station_time . "',NOW());";
writeLog("更新run_bus_station_view的sql语句" . json_encode($sql));
$result = $pdo->query($sql);
if (!$result) {
return false;
}
} else {
$sql = "UPDATE run_bus_station_view set cancel_flag =0,order_id='" . $order_id . "',station='" . $station . "',lat_long='" . $lat_long . "',station_type='" . $station_type . "',station_time='" . $station_time . "',update_time=NOW() where run_id =" . $run_id . " and bus_no =" . $bus_no;
$result = $pdo->query($sql);
writeLog("更新run_bus_station_view的sql语句" . json_encode($sql));
if (!$result) {
return FALSE;
}
}
return true;
}

/**
* 更新订单的开始时间和结束时间
* @param $order_id
* @param $start_time
* @param $end_time
*/
public function update_order_time($order_id, $start_time, $end_time)
{
$pdo = conn();
$sql = "update order_main set PROD_START_STATION_TIME = '" . $start_time . "',PROD_END_STATION_TIME = '" . $end_time . "' where order_id =" . $order_id . " or parent_order_id =" . $order_id;
$pdo->exec($sql);
}

/**
* @param $runid 班次ID
* @return int 返回库存量
*/
public function stock($runid)
{
$pdo = conn();
$sql = "select seat_count,saled_count,BUS_ORDER_ID from run_bus where cancel_flag = 0 AND run_id = " . $runid . " ORDER BY BUS_ORDER_ID ASC ";
$result = $pdo->query($sql);
$stock = $result->fetchAll(PDO::FETCH_ASSOC);
writeLog($sql);
$run_stock = 0;
$bus_num = 0;
$blank_car_order = false;
foreach ($stock as $key => $value) {
if ($value['saled_count'] <= 0) {
$bus_num++;
}
$run_stock += ($value['seat_count'] - $value['saled_count']);
if ($value['saled_count'] <= 0 && $blank_car_order == false) {
$blank_car_order = $value['BUS_ORDER_ID'];
}
}
$stock = array("bus_num" => $bus_num, "run_stock" => $run_stock, "next_blank_car" => $blank_car_order); //返回的是车辆剩余信息和座位剩余信息
return $stock;
}

/* public function add_stock($runid, $bus_order_id, $num)
{
$pdo = conn();
$sql = "update run_bus set SALED_COUNT = SALED_COUNT+{$num} where RUN_ID = " . $runid . " AND BUS_ORDER_ID = {$bus_order_id} AND CANCEL_FLAG = 0 ";
$result = $pdo->exec($sql);
}*/

/**
*生成时间矩阵
* @param $orderList 未锁定的订单池
* @param $beginX_Y 上车点纬经度
* @param $endX_Y 下车点纬经度
* @return array|bool 返回时间矩阵
*/
public function timeMatrix($orderList, $X_Y, $tag)
{
//读取订单池的订单
$count = count($orderList); //此订单进入之前订单池已经有的订单个数
$str_beginX_Y = "";
//$str_endX_Y = "";
foreach ($orderList as $k => $v) {
if ($tag == 1) {
$str_beginX_Y .= $v['startx_y'] . '|';

} else {
$str_beginX_Y .= $v['endx_y'] . '|';
}

}
//通过新的经纬度和订单池里面的订单经纬度计算出新的时间矩阵
$str_beginX_Y .= $X_Y;
//var_dump($str_beginX_Y);
$data = array('origins' => $str_beginX_Y, 'destinations' => $str_beginX_Y, 'output' => 'json', 'tactics' => 11, 'ak' => commonUtils::$AK);
$res = commonUtils::send_get(commonUtils::$URL, $data);
$shortTimeList = json_decode($res, true);
$time = array();
if (isset($shortTimeList['status']) && $shortTimeList['status'] == 0) {
$i = 1;
$j = 1;
foreach ($shortTimeList['result'] as $v) {
$time[$j][$i] = ceil(($v['duration']['value']) / 60);
if ($i % ($count + 1) == 0) { //生成2*(count+1)乘以2*(count+1)的时间矩阵
$j++;
$i = 0;
}
if ($i == $j) //将对角线元素置为零(由于上面的if,对角线的最后一个元素不会被置为0)
{
$time[$j][$i] = 0;
}
$max = ($count + 1);
if (isset($time[$max][$max])) { //将对角线最后一个元素也置为0
$time[$max][$max] = 0;
}
/* if ($j > ($count + 1) && $j <= $max && $i <= ($count + 1)) { //将矩阵的左下角不符合情况的值置为0
$time[$j][$i] = -1;
if (isset($time[$j][0])) {
unset($time[$j][0]); //该方法会在$j>订单数的数组中多加入一个键值为0的元素,所以在此处进行处理
}
}*/
$i++;
}
return $time; //产生时间矩阵
}
}

/**
* 根据订单池查询订单池内的人数
* @param $orderPool
*/
public function poolNum($orderPool)
{
$poolNum = 0;
foreach ($orderPool as $item) {
$poolNum += $item['num'];
}
return $poolNum;
}

/**
*用于输入上车点和下车点后返回上车时间和下车时间
* @param $orderID
* @param $beginX_Y
* @param $endX_Y
* @param $run_date
* @return mixed
*/

public function firstOrderNeedTime($beginX_Y, $endX_Y, $run_date)
{
if (($beginX_Y == "32.116682,118.784105" && $endX_Y == "32.011714,120.894448") || ($beginX_Y == "32.011714,120.894448" && $endX_Y == "32.116682,118.784105")) {
$time = commonUtils::baiduShortTime($beginX_Y, $endX_Y);
$start1 = strtotime($run_date) + 5 * 60;
$start2 = strtotime($run_date) - 10 * 60;
$end1 = (strtotime($run_date) + $time * 60) + 5 * 60;
$end2 = (strtotime($run_date) + $time * 60) - 10 * 60;
$result['code'] = 0;
$result['result'] = array($run_date, date("Y-m-d H:i", strtotime($run_date) + $time * 60));
$result['str_time'] = array(date("H:i", $start2) . '--' . date("H:i", $start1), date("H:i", $end2) . '--' . date("H:i", $end1));
return $result;
} else {
$time = commonUtils::baiduShortTime($beginX_Y, $endX_Y);
$temp_time_on_the_way = strtotime($run_date) + 210 * 60;
$arrive = date("Y-m-d H:i", $temp_time_on_the_way);
$receive_time = date("Y-m-d H:i", $temp_time_on_the_way - $time * 60);
$result['code'] = 0;
$result['result'] = array($receive_time, $arrive);
$start1 = $temp_time_on_the_way + 5 * 60;
$start2 = $temp_time_on_the_way - 10 * 60;
$end1 = ($temp_time_on_the_way - $time * 60) + 5 * 60;
$end2 = ($temp_time_on_the_way - $time * 60) - 10 * 60;
$result['str_time'] = array(date("H:i", $end2) . '--' . date("H:i", $end1), date("H:i", $start2) . '--' . date("H:i", $start1));
return $result;
}
}

/**
*用于每个车的第一个订单生效后的调配顺序
* @param $orderID
* @param $beginX_Y
* @param $endX_Y
* @param $run_date
* @return mixed
*/

public function firstOrderTime($orderID, $beginX_Y, $endX_Y, $run_date)
{
//说明是携程下进来的订单
if (($beginX_Y == "32.116682,118.784105" && $endX_Y == "32.011714,120.894448") || ($beginX_Y == "32.011714,120.894448" && $endX_Y == "32.116682,118.784105")) {
$time = commonUtils::baiduShortTime($beginX_Y, $endX_Y);
$temp_time_on_the_way = strtotime($run_date);
$arrive = date("Y-m-d H:i", $temp_time_on_the_way + $time * 60);
$result = array(0 => array("order_id" => $orderID, "time" => $run_date), 1 => array("order_id" => $orderID, "time" => $arrive));
} else { //c端的订单
$time = commonUtils::baiduShortTime($beginX_Y, $endX_Y);
$temp_time_on_the_way = strtotime($run_date) + 210 * 60;
$arrive = date("Y-m-d H:i", $temp_time_on_the_way);
$receive_time = date("Y-m-d H:i", $temp_time_on_the_way - $time * 60);
$result = array(0 => array("order_id" => $orderID, "time" => $receive_time), 1 => array("order_id" => $orderID, "time" => $arrive));
}
return $result;
}

/**
* 向run_bus_station_view表中插入数据
* @param $mem
* @param $orderService
* @param $runID
* @param $res
* @param $bus_order_num
* @param $prodID
*/
function makeOrder($mem, $runID, $res, $bus_order_num, $prodID)
{
if ($res == false) {
$pdo = conn();
$sql = "UPDATE run_bus_station_view set cancel_flag =1,update_time=NOW() where run_id =" . $runID . " and bus_no =" . $bus_order_num;
$result = $pdo->query($sql);
return true;
}
$station = "";
$lat_long = "";
$station_type = "";
$station_time = "";
$order_id_list = "";
$order_arr = $mem->get("orderList[$runID]");
$order_index_array = array();
foreach ($order_arr as $bus_id => $orderlist) {
$orderNum = count($orderlist);
foreach ($orderlist as $num => $orderInfo) {
$orderInfo["bus_id"] = $bus_id;
$orderInfo["start_num"] = $num;
$orderInfo["bus_order_count"] = $orderNum;
$order_index_array[$orderInfo["order_id"]] = $orderInfo;

}
}
$start_flag = false;
foreach ($res as $id => $arr) {
if (!isset($order_index_array[$arr['order_id']])) {
continue;
}
$order_info = $order_index_array[$arr['order_id']];
if (!isset($order_info["meet_flag"]) || $order_info["meet_flag"] != 1) {
$order_info["meet_flag"] = 1;
$order_index_array[$arr['order_id']] = $order_info;
$order_id_list .= $arr['order_id'] . ";";
$station .= $order_info['begin_name'] . ";";
$lat_long .= $order_info['startx_y'] . ";";
$station_type .= "0" . ";";
$station_time .= $arr['time'] . ";";
} else {
$order_id_list .= $arr['order_id'] . ";";
$station .= $order_info['end_name'] . ";";
$lat_long .= $order_info['endx_y'] . ";";
$station_type .= "1" . ";";
$station_time .= $arr['time'] . ";";
}
}

$order_id_list = rtrim($order_id_list, ';');
$station = rtrim($station, ';');
$lat_long = rtrim($lat_long, ';');
$station_type = rtrim($station_type, ';');
$station_time = rtrim($station_time, ';');
$res = $this->set_run_station($runID, $bus_order_num, $prodID, $order_id_list, $station, $lat_long, $station_type, $station_time);
return $res;
}
}

+ 113
- 0
ZZDZ/application/utils/commonUtils.php View File

@@ -0,0 +1,113 @@
<?php

/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/8/25
* Time: 16:07
*/
require_once __DIR__.'/../api/common.php';
class commonUtils extends virtifyUsers
{
public static $AK = "qnG9Q2oSgfGlwLUBeYBp7gTvFUCk31me"; //百度访问应用AK
public static $URL = "http://api.map.baidu.com/routematrix/v2/driving";
public static $GeocodingUrl = "http://api.map.baidu.com/geocoder/v2/";

//发送HTTP请求
static function httpsPost($url, $param = array())
{
$ch = curl_init(); // 初始化一个 cURL 对象
curl_setopt($ch, CURLOPT_URL, $url); // 设置需要抓取的URL
curl_setopt($ch, CURLOPT_HEADER, 0); // // 设置header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // 设置cURL 参数,要求结果保存到字符串中还是输出到屏幕上。
// 如果你想PHP去做一个正规的HTTP POST,设置这个选项为一个非零值。这个POST是普通的 application/x-www-from-urlencoded 类型,多数被HTML表单使用。
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($param)); // 传递一个作为HTTP “POST”操作的所有数据的字符串。//http_build_query:生成 URL-encode 之后的请求字符串
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-type:application/x-www-form-urlencoded;charset=utf-8'
));
$rtn = curl_exec($ch); // 运行cURL,请求网页
if ($errno = curl_errno($ch)) {
throw new Exception ('Curl Error(' . $errno . '):' . curl_error($ch));
}
curl_close($ch); // 关闭URL请求
return $rtn; // 返回获取的数据
}

//发送get参数(链接,参数数组)
static function send_get($url, $get_data)
{
$url_param = http_build_query($get_data);
$result = file_get_contents($url . "?{$url_param}");
return $result;
}

//获取订单信息中对ordermain表中order_description字段的解析
static function fomatStr($str)
{
$format_str = str_replace('|', '', $str);
$arr_str = explode(',', $format_str);
return $arr_str[2];
}

//调用百度API获取两个坐标(经纬度)之间的最小时间
static function baiduShortTime($origins, $destinations)
{
$data = array('origins' => $origins, 'destinations' => $destinations, 'output' => 'json', 'tactics' => 11, 'ak' => commonUtils::$AK);
//var_dump($data);exit();
$res = commonUtils::send_get(commonUtils::$URL, $data);
$shortTimeList = json_decode($res, true);
if (isset($shortTimeList['status']) && $shortTimeList['status'] == 0) {
foreach ($shortTimeList['result'] as $res) {
if (count($shortTimeList['result']) > 1) {
$time[] = ceil(($res['duration']['value']) / 60);
} else {
$time = ceil(($res['duration']['value']) / 60);
}

}
return $time;
} else {
return false;
}
}

/**
* 提供从地址到经纬度坐标或者从经纬度坐标到地址的转换服务
*/
static function GeocodingAPI($location)
{
$data = array('location' => $location, 'output' => 'json', 'tactics' => 11, 'ak' => commonUtils::$AK);
$res = commonUtils::send_get(commonUtils::$GeocodingUrl, $data);
$addressList = json_decode($res, true);
if (isset($addressList['status']) && $addressList['status'] == 0) {
$res = $addressList['result']['addressComponent'];
//$country = $res['country'];
//$province = $res['province'];
$city = $res['city'];
return $city;
} else {
return false;
}
}

/**
* 生成订单号
* @param $num
*/
static function produceOrderId($num)
{
require_once __DIR__.'/../../config/Mysql.php';
$pdo = conn();
$sql = "SELECT FUNC_GET_UNIQUE_ID(1,{$num}) AS order_id";
if (is_object($pdo)) {
$result = $pdo->query($sql);
$json = $result->fetchAll(PDO::FETCH_ASSOC);
$result->closeCursor();
}
return $json[0]['order_id'];
}

}

+ 188
- 0
ZZDZ/bbbb.html View File

@@ -0,0 +1,188 @@

<!DOCTYPE HTML>
<html style="height:100%;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, minimal-ui" />
<title>高德地图</title>
</head>
<link rel="stylesheet" type="text/css" href="public/css/main.css"/>
<link rel="stylesheet" type="text/css" href="public/css/master.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-base.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-box.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-color.css"/>
<link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
<style type="text/css" rel="stylesheet">
header{position:absolute;height:60px;top:0;width:100%;background-color:#F4F4F4;z-index:999;text-align:center;line-height:60px;color:#666666;font-weight:bold;border-bottom:1px solid #BBBBBB;}
header div:nth-child(1){position:absolute;z-index:1000;width:40px;cursor:pointer;}
header div:nth-child(1) img{width:40px;height:40px;margin-left:3px;margin-top:10px;}
header div:nth-child(2){width:100%}
html body{height:100%;margin:0;font-family: "微软雅黑";}
#map{height:100%!important;position:absolute;top:0px;width:100%;font-family: "微软雅黑";}
.float_div{cursor:pointer;border-radius:3px;text-align:center;line-height:50px;background-color:#008CFF;width:60px;height:45px;position:absolute;z-index:888;right:5px;color: #fff;}
#localtion{bottom:80px;}
#panner{background-color:#272822;opacity:0.8;width:100%;height:140px;position:absolute;bottom:0;z-index:17;font-size:12px;color:#fff;}
#visit{bottom:20px;}
.amap-geolocation-con{
position: fixed!important;
}
</style>
<body>
<div style="width: 100%;height: 0.5rem;position: fixed;z-index: 2;top: 0;background-color: rgba(0,0,0,0.6);line-height: 0.5rem;">
<img style="width: 0.12rem;margin-left: 0.2rem;" src="public/images/img_pro_d.png"/>
<span style="color: #ccc;font-size: 0.14rem;margin-left: 0.05rem;" id="bus_name">罗师傅</span>
<span style="color: #eee;font-size: 0.14rem;margin-left: 0.1rem;" id="bus_num">沪A12345</span>
<a id="call_phone" href="tel:"><img style="text-align: right;height: 0.5rem;float: right;" src="public/images/ic_call.png"/></a>
</div>
<div style="display: none;" id="panner">
<div id="r_title"><b>定位结果:</b></div>
<div id="result"></div>
</div>
<!--<div class="float_div" id="visit">
监控
</div>-->
<div id="map"></div>
</body>
<script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
<script language="javascript" src="http://webapi.amap.com/maps?v=1.3&key=5aa97c3a4c10064f8cfbace9f139ac49"></script>
<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
<script type="text/javascript">
// var bus_num = getStorage("bus_num");
// var bus_name = getStorage("bus_name");
// var bus_phone = getStorage("bus_phone");
// $("#call_phone").attr("href","tel:"+bus_phone);
// $("#bus_name").text(bus_name);
// $("#bus_num").text(bus_num);
var jing = "";
var wei = "";
(function (){
var mapHeight = document.body.clientHeight - 200;
document.getElementById('map').style.height = mapHeight + 'px';
var map = new AMap.Map('map',{zoom:13,resizeEnable: true,panToLocation:true}), geolocation = null, result = document.getElementById('result');
setInterval(show1,5000);
map.plugin('AMap.Geolocation', function () {
geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位,默认:无穷大
maximumAge: 0, //定位结果缓存0毫秒,默认:0
convert: true, //自动偏移坐标,偏移后的坐标为高德坐标,默认:true
showButton: true, //显示定位按钮,默认:true
buttonPosition: 'LB', //定位按钮停靠位置,默认:'LB',左下角
buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
showMarker: true, //定位成功后在定位到的位置显示点标记,默认:true
showCircle: true, //定位成功后用圆圈表示定位精度范围,默认:true
panToLocation: false, //定位成功后将定位到的位置作为地图中心点,默认:true
zoomToAccuracy:false, //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoom:15
});
map.addControl(geolocation);
geolocation.getCurrentPosition();
AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
});
watchPosition ();
/*
*获取当前位置信息
*/
function getCurrentPosition () {
geolocation.getCurrentPosition();
};
/*
*监控当前位置并获取当前位置信息
*/
function watchPosition () {
geolocation.watchPosition();
};
/*
*解析定位结果
*/
function onComplete (data) {
var str = '<p>定位成功</p>';
str += '<p>经度:' + data.position.getLng() + '</p>';
str += '<p>纬度:' + data.position.getLat() + '</p>';
str += '<p>精度:' + data.accuracy + ' 米</p>';
str += '<p>是否经过偏移:' + (data.isConverted ? '是' : '否') + '</p>';
result.innerHTML = str;
};
/*
*解析定位错误信息
*/
function onError (data) {
var str = '<p>定位失败</p>';
str += '<p>错误信息:'
switch(data.info) {
case 'PERMISSION_DENIED':
str += '浏览器阻止了定位操作';
break;
case 'POSITION_UNAVAILBLE':
str += '无法获得当前位置';
break;
case 'TIMEOUT':
str += '定位超时';
break;
default:
str += '未知错误';
break;
}
str += '</p>';
result.innerHTML = str;
};
function show1(){
map.clearMap();
geolocation.getCurrentPosition();
$.ajax({
url:base_api+"application/custom_made/control.php",
type:'post',
dataType: "json",
data:{bus_no:"沪DC1720",type:"order_getposition"},
success : function(data) {
console.log(data);
if(data.code=="0"){
jing = data.list.j;
wei = data.list.w;
// marker.setMap(position(jing,wei))
marker = new AMap.Marker({
map: map,
position: [jing,wei],
icon: new AMap.Icon({
size: new AMap.Size(40, 40), //图标大小
image: "public/images/car.png",
imageOffset: new AMap.Pixel(0, 0)
})
});
// marker.setPosition(new AMap.LngLat( data.list.j,data.list.w));
// jing = data.list.j;
// wei = data.list.w;
//更新点标记位置
}else{
alert(data.info);
}
}
});
}
document.getElementById('visit').onclick = function(){
watchPosition();
};
})();
</script>
</html>

+ 111
- 0
ZZDZ/bus_line.html View File

@@ -0,0 +1,111 @@

<!DOCTYPE HTML>
<html style="height:100%;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, minimal-ui" />
<title>高德地图JavaScript API</title>
</head>
<style type="text/css" rel="stylesheet">
header{position:absolute;height:60px;top:0;width:100%;background-color:#F4F4F4;z-index:999;text-align:center;line-height:60px;color:#666666;font-weight:bold;border-bottom:1px solid #BBBBBB;}
header div:nth-child(1){position:absolute;z-index:1000;width:40px;cursor:pointer;}
header div:nth-child(1) img{width:40px;height:40px;margin-left:3px;margin-top:10px;}
header div:nth-child(2){width:100%}
html body{height:100%;margin:0;font-family: "微软雅黑";}
#map{position:absolute;top:60px;width:100%;font-family: "微软雅黑";}
.float_div{cursor:pointer;border-radius:3px;text-align:center;line-height:50px;background-color:#008CFF;width:60px;height:45px;position:absolute;z-index:888;right:5px;color: #fff;}
#localtion{bottom:80px;}
#panner{background-color:#272822;opacity:0.8;width:100%;height:140px;position:absolute;bottom:0;z-index:17;font-size:12px;color:#fff;}
#visit{bottom:20px;}
</style>
<body>
<div id="map"></div>
</body>
<script language="javascript" src="http://webapi.amap.com/maps?v=1.3&key=e8496e8ac4b0f01100b98da5bde96597"></script>
<script type="text/javascript">
(function (){
var mapHeight = document.body.clientHeight - 200;
document.getElementById('map').style.height = mapHeight + 'px';
var map = new AMap.Map('map'), geolocation = null, result = document.getElementById('result');
map.plugin('AMap.Geolocation', function () {
geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位,默认:无穷大
maximumAge: 0, //定位结果缓存0毫秒,默认:0
convert: true, //自动偏移坐标,偏移后的坐标为高德坐标,默认:true
showButton: true, //显示定位按钮,默认:true
buttonPosition: 'LB', //定位按钮停靠位置,默认:'LB',左下角
buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
showMarker: true, //定位成功后在定位到的位置显示点标记,默认:true
showCircle: true, //定位成功后用圆圈表示定位精度范围,默认:true
panToLocation: true, //定位成功后将定位到的位置作为地图中心点,默认:true
zoomToAccuracy:true //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
});
map.addControl(geolocation);
AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
});
/*
*获取当前位置信息
*/
function getCurrentPosition () {
geolocation.getCurrentPosition();
};
/*
*监控当前位置并获取当前位置信息
*/
function watchPosition () {
geolocation.watchPosition();
};
/*
*解析定位结果
*/
function onComplete (data) {
var str = '<p>定位成功</p>';
str += '<p>经度:' + data.position.getLng() + '</p>';
str += '<p>纬度:' + data.position.getLat() + '</p>';
str += '<p>精度:' + data.accuracy + ' 米</p>';
str += '<p>是否经过偏移:' + (data.isConverted ? '是' : '否') + '</p>';
result.innerHTML = str;
};
/*
*解析定位错误信息
*/
function onError (data) {
var str = '<p>定位失败</p>';
str += '<p>错误信息:'
switch(data.info) {
case 'PERMISSION_DENIED':
str += '浏览器阻止了定位操作';
break;
case 'POSITION_UNAVAILBLE':
str += '无法获得当前位置';
break;
case 'TIMEOUT':
str += '定位超时';
break;
default:
str += '未知错误';
break;
}
str += '</p>';
result.innerHTML = str;
};
document.getElementById('localtion').onclick = function(){
getCurrentPosition();
};
document.getElementById('visit').onclick = function(){
watchPosition();
};
})();
</script>
</html>


+ 23
- 0
ZZDZ/calendar.html View File

@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>选择日期</title>
<link rel="stylesheet" href="public/css/main.css" />
<link rel="stylesheet" href="public/css/ui-base.css" />
<link rel="stylesheet" href="public/css/ui-box.css" />
<link rel="stylesheet" href="public/css/ui-color.css" />
<link rel="stylesheet" href="public/css/calendar.css" />
<link rel="stylesheet" href="public/css/master.css" />
</head>
<body>
<div class="calendar">
<div class="month clearfix fire aonelist"></div>
</div>
</body>
<script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/calendar.js" type="text/javascript" charset="utf-8"></script>
</html>

+ 13
- 0
ZZDZ/config/Config.php View File

@@ -0,0 +1,13 @@
<?php
/*
Author:XM
Compeny:Spiders Travel
*/
require_once 'Config_errinfo.php';
define("ENV", "dev");
if(ENV =="dev"){
require_once 'ConfigDev.php';
}else if(ENV=="pro"){
require_once '"ConfigPro.php';
}
define( "TICKET_QR_URL", "http://ticket.zhizhuchuxing.com/ticket.php?orderid=" );

+ 31
- 0
ZZDZ/config/ConfigDev.php View File

@@ -0,0 +1,31 @@
<?php
/*
Author:XM
Compeny:Spiders Travel
*/
define("MYSQL_HOST", "180.168.4.58");
define("MYSQL_USER", "root");
define("MYSQL_PASSWORD", "123456");
define("MYSQL_DB", "waice");
//define("MYSQL_DB", "ctsdata_test");
define("MYSQL_PORT", 8090);
define("TOKEN", "xm-zzcx8888!@#");
define("ALLOW_ORIGIN", true);
define("SEND_MESSAGE", true);
define('APPID', 'wxadfcc2db38e68fbf');
define('APPSECRET', '44495dd2477a8cbd213f24b875b6771c');


define("MYSQL_HOST2", "139.196.199.238");
define("MYSQL_USER2", "root");
define("MYSQL_PASSWORD2", "123456");
define("MYSQL_DB2", "disney");
define("MYSQL_PORT2", 3306);

define("MEMCACHE_HOST", "139.224.30.29");
define("MEMCACHE_PORT", "11211");
define("MEMCACHE_USER", "memcached");
define("API_GPS_ACCOUNT", "15618818219");
define("API_GPS_PASSWORD", "123456");



+ 5
- 0
ZZDZ/config/ConfigPro.php View File

@@ -0,0 +1,5 @@
<?php
/*
Author:XM
Compeny:Spiders Travel
*/

+ 16
- 0
ZZDZ/config/Config_errinfo.php View File

@@ -0,0 +1,16 @@
<?php
$CODE = array(
0 => '返回数据成功',
1 => '程序错误,请联系系统管理员',
2 => '没有符合条件的班次',
3 => '没有符合出发地目的地的数据',
4 => '没有符合查询的线路及票种',
5 => '没有线路-站点信息',
6 => '数据表中无站点信息',
7 => '没有班次',
8 => '没有票种销售情况',
9 => '线路已删除',
10 => '',
11 => ''
)
?>

+ 178
- 0
ZZDZ/config/Function.php View File

@@ -0,0 +1,178 @@
<?php
/*
Author:XM
Compeny:Spiders Travel
*/
function writeLog($log){
$dir=__DIR__."/../Log/";
if (!is_dir($dir)){
mkdir($dir);
}
$filename=$dir.date("Y-m-d").".log";
file_put_contents($filename, date("Y-m-d H:i:s")."\t".$log.PHP_EOL,FILE_APPEND);
}
function makeSign($array){
$str='';
foreach ($array as $v){
$str.=$v;
}
return sha1($str.TOKEN);
}
//获取唯一的id
function getUniqeId(){
$pdo= conn();
$result=$pdo->query("select FUNC_GET_UNIQUE_ID('1','1') id");
$rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
$pdo=NULL;
return $rowset[0]['id'];
}


function getUserId(){
if (isset($_COOKIE['xm_data'])){
$xm_data=$_COOKIE['xm_data'];
$data=unserialize($xm_data);
$id=$data['id'];
$user=$data['user'];
$checkToken=$data['token'];
$list=$data['list'];
$token=makeSign(array($id,$user,serialize($list)));
if ($checkToken == $token){
return $id;
}else{
return false;
}
}else{
return false;
}
}
function httpRequest($url,$data=null){
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
if (!empty($data)){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output=curl_exec($ch);
curl_close($ch);
return $output;
}
//function sendTelMessage($phones,$user_name,$content,$order_id){
// if (SEND_MESSAGE ==true){
// //$url='http://www.mxtong.net.cn/GateWay/Services.asmx/DirectSend?UserID=995596&Account=alert&Password=zzcx8888&Phones='.$phones.'&Content='.$content.'【蜘蛛行】&SendTime=&SendType=1&PostFixNumber=';
// $url='http://hprpt2.eucp.b2m.cn:8080/sdkproxy/sendsms.action?cdkey=8SDK-EMY-6699-RISUM&password=175348&phone='.$phones.'&message=【蜘蛛行】'.$content;
// $response=httpRequest($url);
// writeLog('url'.$url."返回值".$response);
// }else{
// return array("未开启短信通知");
// }
// return $response;
//}
function sendTelMessage($phones,$user_name,$content,$order_id){
$send_data = array();
$send_data["cdkey"] = "8SDK-EMY-6699-RISUM";
$send_data["password"] = "175348";
$send_data["phone"] = $phones;
$send_data["message"] = '【蜘蛛行】'.$content;
if (SEND_MESSAGE ==true){
//$url='http://www.mxtong.net.cn/GateWay/Services.asmx/DirectSend?UserID=995596&Account=alert&Password=zzcx8888&Phones='.$phones.'&Content='.$content.'【蜘蛛行】&SendTime=&SendType=1&PostFixNumber=';
$url='http://hprpt2.eucp.b2m.cn:8080/sdkproxy/sendsms.action';
//echo $url;
$response=httpRequest($url,$send_data);
// echo $response;die();
writeLog('url'.$url."返回值".$response);
}else{
return array("未开启短信通知");
}
return $response;
}
function getDispAreaNameForCtrip( $city_name ) {
$suzhou_array = array("拙政园","观前街");
if( in_array($city_name, $suzhou_array) ) {
return "苏州";
}

if( mb_strlen($city_name) <= 2 ) { return $city_name;}
$last_word = mb_substr($city_name,-1,1);
$cut_word = array("市","区","镇");
if( in_array($last_word,$cut_word) ) {
return mb_substr($city_name,0,mb_strlen($city_name)-1);
}
return $city_name;
}
function set_memcache( $key, $value ) {
$mem = new Memcache;
$mem->connect( MEMCACHE_HOST, MEMCACHE_PORT );
$mem->set( $key, $value, 0, 3600*24*7 );
}
function get_memcache( $key ) {
$mem = new Memcache;
$mem->connect( MEMCACHE_HOST, MEMCACHE_PORT );
$value = $mem->get( $key );
return $value;
}
function clear_memcache() {
$mem = new Memcache;
$mem->connect( MEMCACHE_HOST, MEMCACHE_PORT );
$mem->flush();
}



function get_position($imeis){
$unix_time = time();
$signature = md5(md5(API_GPS_PASSWORD).$unix_time);
$url='http://api.gpsoo.net/1/auth/access_token?account='.API_GPS_ACCOUNT.'&time='.$unix_time.'&signature='.$signature;
$html = file_get_contents($url);
$return_array = json_decode($html,true);
$access_token = $return_array["access_token"];
//获取经纬度等
$common_url = 'access_token='.$access_token.'&account='.API_GPS_ACCOUNT.'&time='.$unix_time;

$url1 = 'http://api.gpsoo.net/1/devices/tracking?'.$common_url.'&map_type=BAIDU&target='.API_GPS_ACCOUNT.'&imeis='.$imeis;
$html1 = file_get_contents($url1);
$return_array1 = json_decode($html1,true);
$j = $return_array1['data'][0]['lng'];
$w = $return_array1['data'][0]['lat'];
$speed =$return_array1['data'][0]['speed'];

//convert_baidumap_to_tencentmap($w,$j);
return array('j'=>$j,'w'=>$w,'speed'=>$speed);
}
//$test_time = date("Y-m-d H:i:s", 1924912800);echo $test_time."<hr />";
//获取账户信息

function convert_baidumap_to_tencentmap( &$lat, &$lng ) {
$x_pi = 3.14159265358979324 * 3000.0 / 180.0;
$x = $lng - 0.0065;
$y = $lat - 0.006;
$z = sqrt(($x*$x+$y*$y)) - 0.00002 * sin($y * $x_pi);
$theta = atan2($y,$x) - 0.000003 * cos($x * $x_pi);
$lng = $z * cos($theta);
$lat = $z * sin($theta);
}

function getposition($busno){
$base_url = "http://test.hstsp.cn:8077/data/";
$account_id = "hdgps";
$account_pwd = md5("123456");
$login_url = $base_url."login/tokenDuration.do?account={$account_id}&passwd={$account_pwd}";
$result = httpRequest( $login_url );
$result_array = json_decode($result,true);
$token_str = $result_array["tokenStr"];
$check_car_no = urlencode($busno);
$get_car_id_url = $base_url."LogisticalCar/queryCarId.do?tokenStr={$token_str}&plateCodes={$check_car_no}";
$result =httpRequest( $get_car_id_url );
$result_array = json_decode($result,true);
$car_id =$result_array["Data"][0]["id"];
$get_car_info_url = $base_url."VehicleMonitor/queryMultiVehicleLocation.do?tokenStr={$token_str}&vehicleIds=". $car_id."&mapType=1";
$result = httpRequest( $get_car_info_url );
$result_array = json_decode($result,true);
return $result_array;
}

+ 36
- 0
ZZDZ/config/Mysql.php View File

@@ -0,0 +1,36 @@
<?php
/*
Author:XM
Compeny:Spiders Travel
*/
require_once __DIR__.'/Config.php';
require_once __DIR__.'/Function.php';
require_once __DIR__.'/sinaAPI.php';
function conn1(){
$port=defined('MYSQL_PORT')?MYSQL_PORT:3306;
try {
$pdo=new PDO("mysql:host=".MYSQL_HOST.";port=".$port.";dbname=".MYSQL_DB, MYSQL_USER, MYSQL_PASSWORD,array(PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8"));
return $pdo;
}catch (PDOException $e){
writeLog('new PDO failed:'.$e->getMessage());
}
}
function conn(){
$port=defined('MYSQL_PORT')?MYSQL_PORT:3306;
try {
$pdo=new PDO("mysql:host=".MYSQL_HOST.";port=".$port.";dbname=waice", MYSQL_USER, MYSQL_PASSWORD,array(PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8"));
// $pdo=new PDO("mysql:host=".MYSQL_HOST.";port=".$port.";dbname=ctsdata", MYSQL_USER, MYSQL_PASSWORD,array(PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8"));
return $pdo;
}catch (PDOException $e){
writeLog('new PDO failed:'.$e->getMessage());
}
}
function conn2(){
$port=defined('MYSQL_PORT2')?MYSQL_PORT2:3306;
try {
$pdo=new PDO("mysql:host=".MYSQL_HOST2.";port=".$port.";dbname=".MYSQL_DB2, MYSQL_USER2, MYSQL_PASSWORD2,array(PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8"));
return $pdo;
}catch (PDOException $e){
writeLog('new PDO failed:'.$e->getMessage());
}
}

+ 86
- 0
ZZDZ/config/sinaAPI.php View File

@@ -0,0 +1,86 @@
<?php
/**
* Created by PhpStorm.
* User: Steven
* Date: 2016/8/4
* Time: 14:25
*/
//Sina App_Key
define('SINA_APPKEY', '31641035');
//获取请求结果
function curlQuery($url) {
//设置附加HTTP头
$addHead = array(
"Content-type: application/json"
);
//初始化curl,当然,你也可以用fsockopen代替
$curl_obj = curl_init();
//设置网址
curl_setopt($curl_obj, CURLOPT_URL, $url);
//附加Head内容
curl_setopt($curl_obj, CURLOPT_HTTPHEADER, $addHead);
//是否输出返回头信息
curl_setopt($curl_obj, CURLOPT_HEADER, 0);
//将curl_exec的结果返回
curl_setopt($curl_obj, CURLOPT_RETURNTRANSFER, 1);
//设置超时时间
curl_setopt($curl_obj, CURLOPT_TIMEOUT, 15);
//执行
$result = curl_exec($curl_obj);
//关闭curl回话
curl_close($curl_obj);
return $result;
}
//简单处理下url,sina对于没有协议(http://)开头的和不规范的地址会返回错误
function filterUrl($url = '') {
$url = trim(strtolower($url));
$url = trim(preg_replace('/^http:\//', '', $url));
if ($url == '')
return false;
else
return urlencode('http://' . $url);
}
//根据长网址获取短网址
function sinaShortenUrl($long_url) {
$access_url = "https://api-ssl.bitly.com/v3/shorten?access_token=".BITACCESSTOKEN."&longUrl=".$long_url;
$result = httpRequest($access_url);
$return_result = json_decode($result,true);
if( $return_result["status_code"] == 200 ) {
$url = $return_result["data"]["url"];
$return_url = str_replace("http://", "https://", $url);
return $return_url;
} else {
return false;
}

//拼接请求地址,此地址你可以在官方的文档中查看到
$url = 'http://api.t.sina.com.cn/short_url/shorten.json?source=' . SINA_APPKEY . '&url_long=' . $long_url;
//获取请求结果
$result = curlQuery($url);
//下面这行注释用于调试,
//print_r($result);exit();
//解析json
$json = json_decode($result);
//异常情况返回false
if (isset($json->error) || !isset($json[0]->url_short) || $json[0]->url_short == '')
return false;
else
return $json[0]->url_short;
}
//根据短网址获取长网址,此函数重用了不少sinaShortenUrl中的代码,以方便你阅读对比,你可以自行合并两个函数
function sinaExpandUrl($short_url) {
//拼接请求地址,此地址你可以在官方的文档中查看到
$url = 'http://api.t.sina.com.cn/short_url/expand.json?source=' . SINA_APPKEY . '&url_short=' . $short_url;
//获取请求结果
$result = curlQuery($url);
//下面这行注释用于调试
//print_r($result);exit();
//解析json
$json = json_decode($result);
//异常情况返回false
if (isset($json->error) || !isset($json[0]->url_long) || $json[0]->url_long == '')
return false;
else
return $json[0]->url_long;
}
?>

+ 15
- 0
ZZDZ/dzbs_list.php View File

@@ -0,0 +1,15 @@
<?php

/*
* wechat 2.0
* Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
* Date: 2016.8.31
* Something is to pay QQ1062140302
*/


header("Access-Control-Allow-Origin:*");
include '../wechat/WxPay/realpay/login_wechat2.0.php';
header('location:http://xmwx.zhizhuchuxing.cn/ZZDZ2/order_menu.html');
die;


+ 15
- 0
ZZDZ/dzbs_login.php View File

@@ -0,0 +1,15 @@
<?php

/*
* wechat 2.0
* Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
* Date: 2016.8.31
* Something is to pay QQ1062140302
*/


header("Access-Control-Allow-Origin:*");
include '../wechat/WxPay/realpay/login_wechat2.0.php';
header('location:http://xmwx.zhizhuchuxing.cn/ZZDZ2/index.html');
die;


+ 100
- 0
ZZDZ/index.html View File

@@ -0,0 +1,100 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>城际商务车</title>
<link rel="stylesheet" type="text/css" href="public/css/main.css"/>
<link rel="stylesheet" type="text/css" href="public/css/master.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-base.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-box.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-color.css"/>
<style type="text/css">
.bus{
width: 0.8rem;
position: absolute;
top: 0.44rem;
left: 0.24rem;
z-index: 2;
}
.search{
/*background-image: linear-gradient(to right, #3b4058,#455256),linear-gradient(#3d434f, #3d434f);*/
background-color: #5cc4bb;
}
.line_change{
border-bottom: 1px solid #F0F2F6;
}
.high_light{
background-color: #f7f8fa;
}
.guanzhu{
color: #FFF;
font-size: 0.14rem;
text-align: center;
line-height: 0.63rem;
}
</style>
</head>
<body>
<img class="bus" src="public/images/ic_car.png"/>
<div class="ub ub-ver">
<img style="width: 100%;" src="public/images/b1_bg.png"/>
</div>
<div style="position: relative;top: -0.98rem;" class="ub ui_m_a15 white_bccolor ub-ver ui_radiu_all">
<div class="ub line_change ui_p_l20 ui_p_r20 ub-ac" id="line1" style="padding-top: 0.17rem;padding-bottom: 0.17rem;" ontouchstart="selectNanjing('nj')">
<div class="ub ub-f1 ub-ac">
<div class="ulev2">南京</div>
<div style="width: 0.4rem;height:0rem;border: 1px solid #EEE; margin-left: 0.05rem; margin-right: 0.05rem; "></div>
<div class="ulev2">南通</div>
</div>
<div style="margin-right: 0.1rem;color: #999;" id="">¥88体验价</div>
<img id="nanjingimg" style="width: 0.15rem;margin-top: 0.04rem;" src="public/images/ic_select_dis.png"/>
</div>
<div class="ub line_change ui_p_l20 ui_p_r20 ub-ac" id="line2" style="padding-top: 0.17rem;padding-bottom: 0.17rem;" ontouchstart="selectNantong('nt')">
<div class="ub ub-f1 ub-ac">
<div class="ulev2">南通</div>
<div style="width: 0.4rem;height:0rem;border: 1px solid #EEE; margin-left: 0.05rem; margin-right: 0.05rem; "></div>
<div class="ulev2">南京</div>
</div>
<div style="margin-right: 0.1rem;color: #999;" id="">¥88体验价</div>
<img id="nantongimg" style="width: 0.15rem;margin-top: 0.04rem;" src="public/images/ic_select_dis.png"/>
</div>
<div id="select_time" class="ub ui_p_l15 ui_p_r20 ui_p_t20 ui_p_b20" style="border-left: solid 0.05rem #3d434f;border-bottom: 1px solid #E5E5E5;">
<div class="ub-f1"><span id="run_date" class="ulev2 ui_m_r10">9月28日</span><span id="run_day" class="commongray_color ulev1">今天</span></div>
<img style="width: 0.08rem;position: relative;top:0.02rem;right: 0.03rem;" src="public/images/ic_enter.png"/>
</div>
</div>
<div id="query" style="position: relative;top: -0.98rem;padding-top: 0.13rem; padding-bottom: 0.13rem;" class="ub ub-ver ui_p_l15 ui_p_r15 ui_radiu_all white_color ub-ac search ui_m_a15 ulev4" onclick="searchInfo()">查&nbsp;&nbsp;&nbsp;&nbsp;询</div>
<div style="position: relative;top: -0.98rem;" class="ub ub-ver ui_m_t05 ui_m_b15 ui_m_l15 ui_m_t15">
<div class="ui_m_b05 ui_m_t05" ><span style="color: #3d434f;" class="ulev0 ui_m_r10">南京途经站</span><span style="color: #3d434f;" class="ulev1">(南站仙林线):</span></div>
<div class="ulev1 commongray_color ui_p_b10">南京南站-马群-仙鹤门-仙林中心</div>
<div class="ui_m_b05 ui_m_t05"><span style="color: #3d434f;" class="ulev0 ui_m_r10">南京途经站</span><span style="color: #3d434f;" class="ulev1">(元通浦口线):</span></div>
<div class="ulev1 commongray_color ui_p_b10">五塘广场-元通-南工大地铁站-浦口明发广场-葛塘</div>
<div class="ui_m_b05 ui_m_t05">南通途经站:</div>
<div class="ulev1 commongray_color ui_p_b10">九华收费站-九圩港公交站-校西客运站-政务中心-中南世纪城</div>
</div>
<div style="position: relative;bottom: 0.18rem;margin-top: 0.6rem; color: #999999;" class="ub ub-ver ub-ac">客服热线:400-8788-376</div>
<div id="code_show" style="position: fixed;width: 0.46rem;height: 0.46rem;border-radius: 50%;background: rgba(0,0,0,0.3);left: 0.15rem;bottom: 0.2rem;display: none;" class="">
<img style="width: 0.22rem;margin-left: 0.12rem;margin-top: 0.12rem;" src="public/images/ic_erweima_gre.png"/>
</div>
<div id="code" style="position: fixed;bottom: 0;left: 0;top: 0;right: 0;background-color: rgba(0, 0, 0, 0.7);z-index: 100;display: none;" class="">
<div style="width: 2.56rem;height: 3.1rem;margin: 1.3rem auto 0;" class="">
<div class="ub-img1 guanzhu uc-tl1 uc-tr1" style="width: 2.56rem;height: 0.66rem;background-color: #fff;background-image: url(public/images/Combined_Shape.png);" id="">
长按二维码,立即关注“蜘蛛出行”
</div>
<div class="uc-bl1 uc-br1" style="width: 2.56rem;height: 2.44rem;background-color: #fff;" id="">
<img style="width: 2.56rem;height: 2.44rem;" src="public/images/tuisong_er.png"/>
</div>
</div>
<div id="close_btn" style="margin-top:0.2rem;text-align: center;" class="ub ub-ver b-ac">
<img style="width: 0.3rem;" src="public/images/ic_close.png"/>
</div>
</div>
</body>
<script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/index.js" type="text/javascript" charset="utf-8"></script>
</html>

+ 90
- 0
ZZDZ/order_detail.html View File

@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>订单详情</title>
<link rel="stylesheet" type="text/css" href="public/css/main.css"/>
<link rel="stylesheet" type="text/css" href="public/css/master.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-base.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-box.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-color.css"/>
<link rel="stylesheet" type="text/css" href="public/css/bus_css/query_result.css"/>
<link rel="stylesheet" href="public/css/wechat.min.css" />
<style type="text/css">
</style>
</head>
<body class="bg_color">
<div class="lightyellow_color ub ui_p_t10 ui_p_b10 ub-ac ui_hide" id="title_div_go">
<img class="ui_p_l25 ui_p_r05" src="public/images/img_time.png" style="width: 0.1rem;position: relative;top: 0.02rem;">
<div class="ub-ac" id="title_content_go">
<span style="font-size: 0.13rem;">支付剩余时间:</span>
<span style="font-size: 0.13rem;" id="minute_show_go">00分</span><span style="font-size: 0.13rem;" id="second_show_go">00秒</span>
</div>
</div>
<div class="ub ub-ver white_bg_color ui_m_a15 ui_radiu_all ui_hide" id="detail_order">
<div class="ub ub-ae ui_p_r15 ui_p_l15 ui_p_t20 ui_p_b05 ui_line_b">
<div class="ub-f1 commongray_color">订单号:[order_id]</div>
<div class="ub-f1 text_right main_font_color ulev1">[待支付]</div>
</div>
<div class="ub ub-ae ui_m_r15 ui_m_l15 ui_p_t10 ui_p_b10 ui_line_b">
<div class="ub-f1 ub ub-ver">
<div class="ui_p_b05 ui_p_t05" style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">
<span class="fontgreen_color ulev3">[南京]</span>
<span>[出发站点]</span>
</div>
<div class="ui_p_b05 ui_p_t05" style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">
<span class="fontgreen_color ulev3">[南通]</span>
<span>[目的站点]</span>
</div>
</div>
<div>
<span class="ulev1">¥</span>
<span class="ulev9">[59]</span>
</div>
</div>
<div class="ub ui_p_a15 ub-ae ui_line_b">
<div class="ub-f1 ub ub-ver">
<div class="ulev2 fontmiddle_color">[07:45]</div>
<div class="fontmiddle_color">
<span class="ui_m_r05 fontmiddle_color">[8月24日]</span>
<span class="fontmiddle_color" id="todayweek">今天</span>
</div>
</div>
<div>
<span class="fontmiddle_color ulev2">[n]</span>
<span class="fontmiddle_color ulev2">人</span>
</div>
</div>
<div class="ub ui_p_a15 ub-ae ui_line_b">
<div class="commongray_color ui_m_r10">联系人</div>
<div class="ub-f1 fontmiddle_color ulev1">[毛东东]</div>
<div class="commongray_color">[18621904917]</div>
</div>
<div class="replace ui_hide" id="repalace"></div>
<!--支付-->
<!--<div class="main_color text_middle white_color ulev2 ui_radiu_bottom" style="padding-top: 0.11rem;padding-bottom: 0.11rem;">去支付</div>-->
<!--退票-->
<!--<div style="display: none;" class="ub ui_radiu_bottom">
<div class="ub-f1"></div>
<div style="border: 1px solid #3d434f;color: #3d434f;border-radius: 0.03rem;padding: 0.06rem 0.27rem;margin-top: 0.07rem;margin-bottom: 0.06rem;" class="ulev1 ui_m_r15">退票</div>
</div>-->
</div>
<div id="loadingToast" class="weui_loading_toast" style="display: none;">
<div class="weui_mask_transparent"></div>
<div class="weui_toast">
<div class="weui_loading">
<img style="width: 0.4rem;" src="public/images/loading2.gif">
</div>
<p class="weui_toast_content">数据加载中</p>
</div>
</div>
<script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/order_detail.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>

+ 104
- 0
ZZDZ/order_list.html View File

@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>订单列表</title>
<link rel="stylesheet" type="text/css" href="public/css/main.css"/>
<link rel="stylesheet" type="text/css" href="public/css/master.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-base.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-box.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-color.css"/>
<link rel="stylesheet" href="public/css/bus_css/order_list.css" />
<link rel="stylesheet" href="public/css/wechat.min.css" />
</head>
<body class="bg_color">
<!--
作者:yimazsq@163.com
时间:2016-09-05
描述:订单列表
-->
<!--头部切换-->
<div style="border-bottom: 1px solid #e5e5e5;" class="ub layer_background ui_p_t15 text_middle">
<div style="font-size: 0.16rem;" class="ub-f1 ui_m_l40 ui_m_r40 title_line_selected" id="going" onclick="selectStatus(0)">进行中</div>
<div style="font-size: 0.16rem;" class="ub-f1 ui_m_l40 ui_m_r40 title_line" id='completed' onclick="selectStatus(1)">已完成</div>
</div>
<!--进行中-->
<div id="wait_pay" class="ui_hide">
<div class="wait_pay ui_solid_gray ui_m_t05" >
<div onclick="goToDetail([order_id],0)">
<div class="order_title ub ui_line_b ub-ae ui_p_b05">
<div class="ub-f1 ui_p_t15 ui_p_l15">
<span class="commongray_color" style="font-size: 0.11rem;">订单号:</span>
<span class="commongray_color" style="font-size: 0.11rem;">[185518]</span>
</div>
<div class="ub-f1 payred_color text_right ui_p_r15 ulev1" style="padding-top: 0.1rem;">[待支付]</div>
</div>
<div class="order_middle ub ub-ae ui_m_l15 ui_m_r15 ui_line_b">
<div class="ub-f3 ub ub-ver ui_p_t10 ui_p_b10" style="width: 1%;">
<div class="ui_p_t05 ui_p_b05" style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">
<span class="ulev3 main_font_color ">[南京]</span>
<span style="">[出发站点]</span>
</div>
<div class="ui_p_t05 ui_p_b05" style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">
<span class="ulev3 main_font_color ">[南通]</span>
<span>[目的站点]</span>
</div>
</div>
<div class="ub-f1 text_right ui_p_t10 ui_p_b10" style="width: 1%;">
<span class="ulev1">¥</span><span style="font-size: 0.32rem;">[35]</span>
</div>
</div>
<div class="order_down ub ub-ae ui_p_t10 ui_p_b10 ui_line_b">
<div class="ub-f4 ub ub-ver ui_p_l15" style="width: 1%;">
<div class="ulev2 " style="color: #666666">[07:45]</div>
<div style="font-size: 0.11rem;color: #666666;">[8月24日 今天]</div>
</div>
<div class="ub-f1 text_right ui_p_r15" style="width: 1%">
<span class="ulev2">[n]</span><span class="ulev2">人</span>
</div>
</div>
</div>
<div id="pay_style">
<!--<div class="main_color text_middle white_color ulev2 ui_hide" id="pay" style="padding-top: 0.11rem;padding-bottom: 0.11rem;">去支付</div>
<div class="ub ui_hide" id="refund">
<div class="ub-f1"></div>
<div style="border: 1px solid #3d434f;color: #3d434f;border-radius: 0.03rem;padding: 0.06rem 0.27rem;margin-top: 0.07rem;margin-bottom: 0.06rem;" class="ulev1 ui_m_r15">退票</div>
</div>-->
<div class="replace ui_hide" id="repalace"></div>
</div>
</div>
</div>
<!--无相关信息-->
<div style="margin-top: 1.3rem;z-index: 5;" id="hasnoinfo" class="ui_hide">
<div class="hasnoinfo ub ub-ver">
<div class="ub-f1 text_middle ui_m_b20">
<img src="public/images/img_null_l.png" style="width: 0.6rem"/>
</div>
<div class=" ub ub-ver">
<div class="ulev0 ui_p_l05 text_middle">还没有相关订单,赶紧预定吧!</div>
</div>
</div>
<div class="ui_line_a_c ui_p_t10 ui_p_b10 fontmiddle_color ui_radiu_all ui_m_t25 success_btn text_middle ui_m_l20 ui_m_r20" onclick="seeTheOrder()">去预定</div>
</div>
<div id="loadingToast" class="weui_loading_toast" style="display: none;">
<div class="weui_mask_transparent"></div>
<div class="weui_toast">
<div class="weui_loading">
<img style="width: 0.4rem;" src="public/images/loading2.gif">
</div>
<p class="weui_toast_content">数据加载中</p>
</div>
</div>
</body>
<script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/order_list.js" type="text/javascript" charset="utf-8"></script>
</html>

+ 26
- 0
ZZDZ/order_menu.html View File

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>我的菜单</title>
<link rel="stylesheet" type="text/css" href="public/css/main.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-base.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-box.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-color.css"/>
</head>
<body class="bg_color">
<div class="ub ub-ac ui_p_t20 ui_p_b20 ui_line_b ui_p_l15 white_bg_color" onclick="throughBusOrder()">
<div class="ub-f1" style="font-size: 0.15rem;">巴士订单</div>
<img class="ui_m_r15" src="public/images/ic_enter.png" style="width: 0.08rem;"/>
</div>
<div class="ub ub-ac ui_p_t20 ui_p_b20 ui_p_l15 ui_line_b white_bg_color" onclick="cityBusOrder()">
<div class="ub-f1" style="font-size: 0.15rem;">城际商务车订单</div>
<img class="ui_m_r15" src="public/images/ic_enter.png" style="width: 0.08rem;"/>
</div>
</body>
<script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/order_menu.js" type="text/javascript" charset="utf-8"></script>
</html>

+ 53
- 0
ZZDZ/order_success.html View File

@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!--<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">-->
<title>提交成功</title>
<link rel="stylesheet" type="text/css" href="public/css/main.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-base.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-box.css"/>
<link rel="stylesheet" type="text/css" href="public/css/ui-color.css"/>
<link rel="stylesheet" href="public/css/bus_css/fill_order.css" />
</head>
<style>
.success_btn {
margin-left: 0.39rem;
margin-right: 0.39rem;
text-align: center;
}
.success {
padding-top: 0.6rem;
padding-bottom: 0.35rem;
}
</style>
<body class="bg_color">
<!--
作者:yimazsq@163.com
时间:2016-08-23
描述:支付成功
-->
<div class="success ub text_left ui_line_b_d">
<span class="ub-f1 text_right" style=" margin-left: 0.39rem;">
<img src="public/images/img_chenggong.png" style="width: 0.4rem">
</span>
<div class="ub-f4 ub ub-ver ui_p_l10">
<div class="ulev3 ui_p_l05">下单成功!</div>
<div class="commongray_color ui_p_l05 ui_p_t05" style="font-size: 0.11rem;">客服会在30分钟内与您进行确认!</div>
</div>
</div>
<div id="return_index" style="border: 1px solid #999999;" class=" ui_p_t10 ui_p_b10 fontmiddle_color ui_radiu_all ui_m_t15 success_btn ulev2">返回首页</div>
</body>
<script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$("#return_index").click(function(){
window.location.href="index.html";
});
</script>
</html>

+ 49
- 0
ZZDZ/pay_success.html View File

@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!--<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">-->
<title>支付成功</title>
<link rel="stylesheet" href="public/css/main.css" />
<link rel="stylesheet" href="public/css/ui-base.css" />
<link rel="stylesheet" href="public/css/ui-box.css" />
<link rel="stylesheet" href="public/css/ui-color.css" />
<link rel="stylesheet" href="public/css/bus_css/fill_order.css" />
</head>
<style>
.success_btn {
margin-left: 0.39rem;
margin-right: 0.39rem;
text-align: center;
}
.success {
padding-top: 0.6rem;
padding-bottom: 0.35rem;
}
</style>
<body class="bg_color">
<!--
作者:yimazsq@163.com
时间:2016-09-07
描述:支付成功
-->
<div class="success ub text_left ui_line_b_d">
<span class="ub-f1 text_right" style=" margin-left: 0.39rem;">
<img src="public/images/img_chenggong.png" style="width: 0.4rem">
</span>
<div class="ub-f4 ub ub-ver ui_p_l10">
<div class="ulev3 ui_p_l05">预订成功!</div>
<div class="commongray_color ui_p_l05 ui_p_t05" style="font-size: 0.11rem;">请按时上车</div>
</div>
</div>
<div style="border: 1px solid #999999;" class=" ui_p_t10 ui_p_b10 fontmiddle_color ui_radiu_all ui_m_t35 success_btn ulev2" onclick="seeTheOrder()">查看订单</div>
<div style="border: 1px solid #999999;" class=" ui_p_t10 ui_p_b10 fontmiddle_color ui_radiu_all ui_m_t15 success_btn ulev2" onclick="bookAgain()">返回查询</div>
</body>
<script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/pay_success.js" type="text/javascript" charset="utf-8"></script>
</html>

+ 64
- 0
ZZDZ/public/css/baidu.css View File

@@ -0,0 +1,64 @@
.tangram-suggestion {
border: 0!important;
font-family: Arial, Helvetica, "Microsoft YaHei", sans-serif;
background: #F0F2F6!important;
cursor: default;
}

.tangram-suggestion table {
width: 100%;
font-size: 12px;
cursor: default;
}

.tangram-suggestion table tr td {
overflow: hidden;
height: 32px;
padding: 0!important;
font-style: normal;
line-height: 32px;
text-decoration: none;
color: #666;
cursor: pointer;
padding-top: 0.05rem!important;
padding-bottom: 0.05rem!important;
padding-left: 0!important;
padding-right: 0!important;
margin-left: 0!important;
margin-right: 0!important;
border-bottom: 1px solid #e5e5e5!important;
}

.tangram-suggestion .route-icon {
overflow: hidden;
padding-left: -0.05rem!important;
font-style: normal;
font-size: 0.15rem!important;
background: url(http://webmap1.map.bdstatic.com/wolfman/static/common/images/ui3/tools/suggestion-icon_013979b.png) no-repeat -0px -12px!important;
}

.tangram-suggestion-current {
background: #ebebeb;
}

.tangram-suggestion-prepend {
padding: 2px;
font: 12px verdana;
color: #c0c0c0;
}

.tangram-suggestion-append {
padding: 2px;
font: 12px verdana;
text-align: right;
color: #c0c0c0;
}

.tangram-suggestion-grey {
color: #c0c0c0;
}
.tangram-suggestion-main{
width: 83%!important;
}

+ 106
- 0
ZZDZ/public/css/bus_css/fill_order.css View File

@@ -0,0 +1,106 @@
.wchat{
width: 0.15rem;
height: 0.15rem;
}

.title_title{
position: fixed;
top: 0rem;
z-index: 3;
width: 100%;
}

.line_line{
height: 0.8rem;
position: relative;
top: 0.14rem;
left: 0.27rem;
}

.baid_map{
width: 0.6rem;
padding-top: 0.04rem;
}

.go{
width: 0.27rem;
position: absolute;
right: 0.3rem;
top: 0.28rem;
}

.success{
padding-top: 0.6rem;
padding-bottom: 0.3rem;
}

.success_btn{
margin-left: 0.35rem;
margin-right: 0.35rem;
text-align: center;
}
.wechatbg{
background-color: #3d434f;
}
.wechatbg_img{
margin-top: 0.06rem;
width: 0.12rem;
margin-right: 0.18rem;
}
.wechatbg_div1{
color: #999;
font-family: "微软雅黑";
}
.wechatbg_div2{
color: #fff;
font-family: "微软雅黑";
}
.wechat_bor{
border-bottom: 1px solid #e5e5e5;
}
.wechat_passenger{
}
.wechat_passenger_div{
width: 1rem;
border: 1px solid #fff;
text-align: center;
padding: 0.03rem;
border-radius: 0.03rem;
}
.wechat_passenger_img{
width: 0.12rem;
margin-top: 0.03rem;
margin-right: 0.05rem;
}
.wechat_passenger_span{
color: #fff;
}
.wechat_passenger_sub{
text-align: right;
color: #fff;
font-size: 0.14rem;
}
.hiddens{
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
}
.wechat_no_img{
width: 0.4rem;
margin-top: 0.4rem;
}
.wechat_no_div{
color: #999;
margin-top: 0.05rem;
}
.wechat_no_img2{
width: 0.14rem;
margin-top: 0.045rem;
}
.wechat_no_div2{
border: 1px solid #999;
padding: 0.05rem 0.5rem;
margin-top: 0.1rem;
border-radius: 0.03rem;
}

+ 23
- 0
ZZDZ/public/css/bus_css/order_list.css View File

@@ -0,0 +1,23 @@
.title_line_selected{
border-bottom: solid 3px black;
margin: 0 0.45rem;
color: black;
padding-bottom: 0.10rem;
font-weight:bold;
}

.title_line{
margin: 0 0.45rem;
color: #666666;
}

.wait_pay{
border-radius: 3px;
background-color: #ffffff;
border: solid 1px #e5e5e5;
margin: 0.05rem 0.1rem;
}

.order_title{
}

+ 8
- 0
ZZDZ/public/css/bus_css/query_result.css View File

@@ -0,0 +1,8 @@
.today {
border-radius: 0.03rem;
background-image: linear-gradient(to right, #8dcbd2, #8dd6d8 48%, #97ddc9);
color: white;
}
.border_bom{
border-bottom: 1px solid #f0f2f6;
}

+ 63
- 0
ZZDZ/public/css/calendar.css View File

@@ -0,0 +1,63 @@


.month_title{
padding-top: 0.15rem;
padding-bottom: 0.15rem;
border-bottom: 1px dashed #e5e5e5;
}

.current_year{
color: #5cc4bb;
font-size: 0.14rem;
margin-left: 0.05rem;
}

.current_month{
color: #5cc4bb;
font-size: 0.32rem;
padding-left: 0.25rem;
padding-top: 0.15rem;
}

.aweek{
color: #5cc4bb;
font-size: 0.14rem;
/*float: left;*/
/*padding: 0.16rem;*/
/*width: 0.457rem;
height: 0.457rem;
text-align: center;
line-height: 0.457rem;*/
}

.aday{
float: left;
color: #666666;
width: 0.478rem;
height: 0.478rem;
text-align: center;
line-height: 0.478rem;
border-radius: 50%;
font-size: 0.14rem;
}

.disday{
color: rgb(207,207,207);
}

.calendar{
margin-bottom: 0.2rem;
}

.select_day{
background-color: #5cc4bb;
font-size: 0.16rem;
color: #fff;
}
.select_go_day{
background-color: #94dcd4;
}

+ 446
- 0
ZZDZ/public/css/main.css View File

@@ -0,0 +1,446 @@
/*padding - top*/
.ui_p_t05{
padding-top: 0.05rem;
}

.ui_p_t10{
padding-top: 0.1rem;
}

.ui_p_t15{
padding-top: 0.15rem;
}

.ui_p_t20{
padding-top: 0.2rem;
}

.ui_p_t25{
padding-top: 0.25rem;
}

.ui_p_t30{
padding-top: 0.3rem;
}

.ui_p_t35{
padding-top: 0.35rem;
}

.ui_p_t40{
padding-top: 0.4rem;
}

/*padding - bottom*/
.ui_p_b05{
padding-bottom: 0.05rem;
}

.ui_p_b10{
padding-bottom: 0.1rem;
}

.ui_p_b15{
padding-bottom: 0.15rem;
}

.ui_p_b20{
padding-bottom: 0.2rem;
}

.ui_p_b25{
padding-bottom: 0.25rem;
}

.ui_p_b30{
padding-bottom: 0.3rem;
}

.ui_p_b35{
padding-bottom: 0.35rem;
}

.ui_p_b40{
padding-bottom: 0.4rem;
}

/*padding-left*/
.ui_p_l05{
padding-left: 0.05rem;
}

.ui_p_l10{
padding-left: 0.1rem;
}

.ui_p_l15{
padding-left: 0.15rem;
}

.ui_p_l20{
padding-left: 0.2rem;
}

.ui_p_l25{
padding-left: 0.25rem;
}

.ui_p_l30{
padding-left: 0.3rem;
}

.ui_p_l35{
padding-left: 0.35rem;
}

.ui_p_l40{
padding-left: 0.4rem;
}

/*padding-right*/
.ui_p_r05{
padding-right: 0.05rem;
}

.ui_p_r10{
padding-right: 0.1rem;
}

.ui_p_r15{
padding-right: 0.15rem;
}

.ui_p_r20{
padding-right: 0.2rem;
}

.ui_p_r25{
padding-right: 0.25rem;
}

.ui_p_r30{
padding-right: 0.3rem;
}

.ui_p_r35{
padding-right: 0.35rem;
}

.ui_p_r40{
padding-right: 0.4rem;
}
.ui_p_a05{
padding: 0.05rem;
}
.ui_p_a10{
padding: 0.1rem;
}
.ui_p_a15{
padding: 0.15rem;
}
.ui_p_a20{
padding: 0.2rem;
}
.ui_p_a25{
padding: 0.25rem;
}
.ui_p_a30{
padding: 0.3rem;
}
.ui_p_a35{
padding: 0.35rem;
}
.ui_p_a40{
padding: 0.4rem;
}
/*margin-top*/
.ui_m_t05{
margin-top: 0.05rem;
}

.ui_m_t10{
margin-top: 0.1rem;
}

.ui_m_t15{
margin-top: 0.15rem;
}

.ui_m_t20{
margin-top: 0.2rem;
}

.ui_m_t25{
margin-top: 0.25rem;
}

.ui_m_t30{
margin-top: 0.3rem;
}

.ui_m_t35{
margin-top: 0.35rem;
}

.ui_m_t40{
margin-top: 0.4rem;
}

/*margin-bottom*/
.ui_m_b05{
margin-bottom: 0.05rem;
}

.ui_m_b10{
margin-bottom: 0.1rem;
}

.ui_m_b15{
margin-bottom: 0.15rem;
}

.ui_m_b20{
margin-bottom: 0.2rem;
}

.ui_m_b25{
margin-bottom: 0.25rem;
}

.ui_m_b30{
margin-bottom: 0.3rem;
}

.ui_m_b35{
margin-bottom: 0.35rem;
}

.ui_m_b40{
margin-bottom: 0.4rem;
}

/*margin-left*/
.ui_m_l05{
margin-left: 0.05rem;
}

.ui_m_l10{
margin-left: 0.1rem;
}

.ui_m_l15{
margin-left: 0.15rem;
}

.ui_m_l20{
margin-left: 0.2rem;
}

.ui_m_l25{
margin-left: 0.25rem;
}

.ui_m_l30{
margin-left: 0.3rem;
}

.ui_m_l35{
margin-left: 0.35rem;
}

.ui_m_l40{
margin-left: 0.4rem;
}

/*margin-right*/
.ui_m_r05{
margin-right: 0.05rem;
}

.ui_m_r10{
margin-right: 0.1rem;
}

.ui_m_r15{
margin-right: 0.15rem;
}

.ui_m_r20{
margin-right: 0.2rem;
}

.ui_m_r25{
margin-right: 0.25rem;
}

.ui_m_r30{
margin-right: 0.3rem;
}

.ui_m_r35{
margin-right: 0.35rem;
}

.ui_m_r40{
margin-right: 0.4rem;
}
.ui_m_a05{
margin: 0.05rem;
}
.ui_m_a10{
margin: 0.1rem;
}
.ui_m_a15{
margin: 0.15rem;
}
.ui_m_a20{
margin: 0.2rem;
}
.ui_m_a25{
margin: 0.25rem;
}
.ui_m_a30{
margin: 0.3rem;
}
.ui_m_a35{
margin: 0.35rem;
}
.ui_m_a40{
margin: 0.4rem;
}

/*左右margin 0.2rem*/
.ui_m_lr20{
margin: 0 0.1rem;
}

/*隐藏*/
.ui_hide{
display: none !important;
}
/*左上 圆角*/
.ui_radiu_top_l {
-webkit-border-top-left-radius: 0.05rem;
border-top-left-radius: 0.05rem
}
/*右上 圆角*/
.ui_radiu_top_r {
-webkit-border-top-right-radius: .6rem;
border-top-right-radius: .6rem
}
/*左下 圆角*/
.ui_radiu_bottom_l {
-webkit-border-bottom-left-radius: 0.05rem;
border-bottom-left-radius: 0.05rem;
}
/*右下 圆角*/
.ui_radiu_bottom_r {
-webkit-border-bottom-right-radius:0.05rem;
border-bottom-right-radius: 0.05rem;
}
/*上 圆角*/
.ui_radiu_top {
-webkit-border-top-left-radius: 0.05rem;
border-top-left-radius: 0.05rem;
-webkit-border-top-right-radius: 0.05rem;
border-top-right-radius: 0.05rem;
}
/*下 圆角*/
.ui_radiu_bottom {
-webkit-border-bottom-left-radius: 0.03rem;
border-bottom-left-radius: 0.03rem;
-webkit-border-bottom-right-radius: 0.03rem;
border-bottom-right-radius: 0.03rem;
}
/*右 圆角*/
.ui_radiu_right {
-webkit-border-top-right-radius: 0.05rem;
border-top-right-radius: 0.05rem;
-webkit-border-bottom-right-radius: 0.05rem;
border-bottom-right-radius: 0.05rem;
}
/*左 圆角*/
.ui_radiu_left {
-webkit-border-top-left-radius: 0.05rem;
border-top-left-radius: 0.05rem;
-webkit-border-bottom-left-radius: 0.05rem;
border-bottom-left-radius: 0.05rem;
}
/*all 圆角*/
.ui_radiu_all {
-webkit-border-radius: 0.03rem;
border-radius: 0.03rem;
}

/*边框线*/
.ui_line1 {
border: 1px solid #999;
}

.ui_line2 {
border: 1px solid #333;
}

.ui_line_t {
border-top: 1px solid;
}
.ui_line_b {
border-bottom: 1px solid #E5E5E5;
}

.ui_solid_gray{
border: solid 1px #e5e5e5;
}

.ui_dotted_gray{
border: dotted 1px #e5e5e5;
}



.ui_line_l {
border-left: 1px solid;
}

.ui_line_r {
border-right: 1px solid;
}

/*文本居右*/
.text_right{
text-align: right;
}

/*文本居中*/
.text_middle{
text-align: center;
}

/*文本居左*/
.text_left{
text-align: left;
}

/*定位底部*/
.bottom_screen{
position: fixed !important;
bottom: 0;
width: 100%;
}

/*按钮*/
.ui_btn{
width: 0.60rem;
height: 0.30rem;
line-height: 0.30rem;
border:1px solid darkseagreen;
}

/*边线*/
.ui_btn_border{
border:1px solid darkseagreen;
}
/*白色背景加透明度*/
.opa{
background-color: rgb(246, 247, 249);
}

+ 474
- 0
ZZDZ/public/css/master.css View File

@@ -0,0 +1,474 @@
body{
position: relative;
background:#f6f6f6;
}


.clearfix:after {
content: ".";
display: block;
height: 0;
font-size: 0;
clear: both;
visibility: hidden;
}

.content{
position: relative;
margin:0 auto;
width: 3.2rem;
}
.content .warp{
width:9.125rem;
padding-left: 0.4375rem;
padding-right: 0.4375rem;
}
.content .marwarp{
width:9.125rem;
margin:0 auto;
}

.content .amonth{
background: #fff;

}

.content .amonth>.aday{
margin-bottom: 1px;
float: left;
width: 0.445rem;
height: 0.445rem;
margin-left:1px;
text-align: center;
line-height: 0.445rem;
font-size: 0.16rem;
}
.content .amonth>.disday{

background:#f5f5f5;
}

.content .amonth>.thisday{
border-radius: 5px;
background: #ff8800;
}
.content .amonth>.aweek{
float: left;
width: 0.445rem;
height: 0.445rem;
margin-left:1px;
text-align: center;
line-height: 0.445rem;
font-size: 0.16rem;
background: #e1e1e1;
border-radius: 3px;

}
.content .amonth>.showdate{
height: 0.5rem;
line-height: 0.5rem;
text-align: center;
font-size: 0.16rem;
}
.content .amonth>.showdate>.monthleft{
padding-right: 0.5rem;
}
.content .amonth>.showdate>.monthright{
padding-left: 0.5rem;
}


/*选择票种界面*/
.content .asell_list .sell_info{
float: right;
}
.content .asell_list .sell_info>img{
margin-right: 0.5em;
}

.content .asell_list>.ticket_title{
background: #fff;
height: 0.4375rem;
padding-top: 0.4375rem;
padding-bottom :0.4375rem;
font-size: 0.4375rem;
line-height: 0.4375rem;
border-top:1px solid #e2e2e2;
border-bottom:1px solid #e2e2e2;
}
.content .asell_list>.ticket_title>img{
height: 0.4375rem;
}
.content .asell_list .sel_ticket{
background: #fff;
border-top:1px solid #e2e2e2;
border-bottom:1px solid #e2e2e2;
}
.content .asell_list .sel_tickettitle{
background: #fff;
font-size: 0.40625rem;
line-height: 0.40625rem;
padding-bottom: 0.234375rem;
padding-top: 0.234375rem;
/*border-top: 1px solid #e2e2e2e2e2e2;*/
border-bottom: 1px solid #e2e2e2;
}
.content .asell_list .sel_tickettitle>.sell_info{
font-size: 0.34375rem;
line-height: 0.40625rem;
}
.content .asell_list .sel_tickettitle>.sell_info>img{
height: 0.40625rem;
}
.content .asell_list .sel_tickettitle>img{
height: 0.34375rem;
}

.content .asell_list>.sel_ticket>.ticket_list>.ticket_man{

background: #fff;
float: left;
font-size: 0.375rem;
line-height: 0.5625rem;

}
.content .asell_list>.sel_ticket>.ticket_list>.ticket_price{
float: left;
font-size: 0.4375rem;
color: #ff8800;
margin-left: 0.9375rem;
line-height: 0.5625rem;
}
.content .asell_list>.sel_ticket>.ticket_list>.ticket_num{
float: right;

}
.content .asell_list>.sel_ticket>.ticket_list>.ticket_num>img{
float: left;
height: 0.5625rem;
border: 1px solid #e2e2e2;

}
.content .asell_list>.sel_ticket>.ticket_list>.ticket_num>input{
float: left;
height: 0.5625rem;
width: 0.75rem;
border: 0;
border-top:1px solid #e2e2e2;
border-bottom:1px solid #e2e2e2;
text-align: center;
font-size: 0.375rem;
line-height: 0.5625rem;
outline: none;

}
.content .asell_list>.sel_ticket>.ticket_list{

padding-bottom: 0.4375rem;
padding-top: 0.4375rem;
/*border-top: 1px solid #e2e2e2;*/
border-bottom: 1px dashed #e2e2e2;
}
.content .asell_list>.sel_ticket>.ticket_list:last-child{
border-bottom: 0;
}

.content .asell_list .sel_goback{
background: #fff;
font-size: 0.40625rem;
line-height: 1.03125rem;
padding-top:0.171875rem;
padding-bottom:0.171875rem;
border-top:1px solid #e2e2e2;
border-bottom:1px solid #e2e2e2;

}

.content .asell_list .sel_goback .goback_date{
float: left;
font-size: 0.40625rem;
line-height: 1.03125rem;

}
.content .asell_list .sel_goback .goback_time1{
float: left;

}
.content .asell_list .sel_goback .goback_time1>img{
margin-top: 0.1875rem;
margin-left: 0.125rem;
margin-right: 0.125rem;
float: left;
width: 0.21875rem;

}
.content .asell_list .sel_goback .goback_time1>.goback_timeinfo{
float: left;
}
.content .asell_list .sel_goback .goback_time1>.goback_timeinfo>p{
line-height: 0.515625rem;
font-size: 0.375rem;
}
.content .asell_list .sel_goback .goback_time1>.goback_timeinfo>.go{
color: #ff8800;
}
.content .asell_list .sel_goback .goback_time1>.goback_timeinfo>.back{
color: #00be96;
}
.content .asell_list .sel_goback .goback_time1>.goback_timeinfo>.go>.agodata{
margin-right: 0.5em;
}
.content .asell_list .sel_goback .goback_time1>.goback_timeinfo>.back>.backtime{
margin-right: 0.5em;
}

.content .asell_list .sel_goback .goback_time2{
float: left;
}

.content .asell_list .sel_goback .goback_time2>.goback_timeinfo>.onego{
text-indent: 0.5em;
color: #ff8800;
float: left;
}


.content .asell_list .sel_goback .goback_time3>.goback_timeinfo>.onego{
text-indent: 0.5em;
color: #00be96;
float: left;
}

.content .asell_list .sel_goback:before{
content: "";
float: right;
width: 0.1875rem;
height: 0.375rem;
margin-top:0.375rem;
background-image:url(../images/icon-more.png);
background-size: 100% 100%;

}


.content .aonelist{
background: #fff;

}
.content .cartime {
background: #fff;
}
.content .cartime li{
float: left;
font-size: 0.375rem;
padding:0.1875rem 0.25rem;
line-height: 0.375rem;
border: 0.03125rem solid #e0e0e0;
background: #f5f5f5;
border-radius: 0.09375rem;
margin-left: 0.75rem;
margin-bottom: 0.34375rem;
margin-top: 0.34375rem;

}
.content .cartime li.sel{
border: 0.03125rem solid #e59801;
background: #fda801;
color: #fff ;
}
.content .cartime li.disable{
border: 0.03125rem solid #fafafa;
background: #efefef;
color: #6e6e6e;
}
/*.content .cartime li.nosel{}*/


.content .asell_list .writeinfo{
height: 3rem;
position: relative;
}
.content .asell_list .writeinfo:after{
content: "";
position: absolute;
}

.content .asell_list .alist{
border-bottom:1px solid #e2e2e2;
border-top:1px solid #e2e2e2;
background: #fff;
}
.content .asell_list .alist>div.title{
background: #fff;
font-size: 0.40625rem;
line-height: 0.40625rem;
padding-bottom: 0.28125rem;
padding-top: 0.28125rem;
}
.content .asell_list .alist>div.content{
font-size: 0.375rem;
line-height:1.0625rem;
height: 1.0625rem;
padding-top:1px;
padding-bottom:1px;

}
.content .asell_list .writeinfo{
height: 3rem;
position: relative;
}
.content .asell_list .writeinfo>img{
position: absolute;
right: 0;
width: 0.375rem;
}
.content .asell_list .writeinfo>textarea{
background: #f6f6f6;
width: 100%;
height: 100%;
border: 0;
}
.content .asell_list .writeinfo>textarea:focus{
outline: none;
}


.content .borderbot{
border-bottom:1px solid #e2e2e2;
}
.content .borderbotda{
border-bottom:1px dashed #e2e2e2;
}

.content .fire{
margin-bottom:0.140625rem;
}
.content .name{
outline:none;
background:#fff;
padding:0;
border: 0;
font-size: 0.375rem;
/*line-height: 0.375rem;*/
width: 100%;
height: 100%;
line-height: 1.0625rem;
/*border-bottom: 1px dashed #e2e2e2;*/
}

.content .phone:focus{
outline:none;


}

.content .name:focus{
outline:none;


}

.content .phone{
background:#fff;
outline:none;
padding:0;
border: 0;
font-size: 0.375rem;
/*line-height: 0.375rem;*/
width: 100%;
height: 100%;
line-height: 1.0625rem;
/*border-bottom: 1px dashed #e2e2e2;*/
}
.content .idcard:focus{
outline:none;


}
.content .idcard{
background:#fff;
outline:none;
padding:0;
border: 0;
font-size: 0.375rem;
/*line-height: 0.375rem;*/
width: 100%;
height: 100%;
line-height: 1.0625rem;
/*border-bottom: 1px dashed #e2e2e2;*/
}



.content .buy{
position: fixed;
bottom: 0;

}
.content .buy .buyprice{

height: 1.25rem;
width: 4.375rem;
line-height: 1.25rem;
text-align: center;
font-size: 0.5625rem;
float: left;
color: #ff8800;
background: #fff;
border-top: 1px solid #e2e2e2;

}
.content .buy .pay{
height: 1.25rem;
width: 5.625rem;
font-size: 0.5rem;
color: #fff;
line-height: 1.25rem;
background:#ff8800;
float: left;
text-align: center;
border-top: 1px solid #ff8800;
}

#detailsone{
position: absolute;
top: 0.0rem;
left: 0rem;
background: rgba(0,0,0,0.8);
width: 100%;
display: none;
}
.dscontent{
position: relative;
width: 10rem;
margin:0 auto;
}
#x{
font-size: 0.5625rem;
color: red;
font-weight: 600;
position: absolute;
right: 0.3125rem;
top: 0.15625rem;
}
#detailcontent{
position: absolute;
top:0.625rem;
width:9.9475rem;
left:0.46875rem;
color: #fff;
font-size: 0.5625rem;
}




.placesel{; opacity:1; filter: Alpha(Opacity=80);
-moz-animation:myfirst 1s linear infinite alternate;/* Firefox */
-webkit-animation:myfirst 1s linear infinite alternate; /* Safari 和 Chrome */
-o-animation:myfirst 1s linear infinite alternate;
animation:myfirst 1s linear infinite alternate;}
@keyframes myfirst{from {background:#ff8800;opacity:0.8; filter: Alpha(Opacity=80);}
to {background:#ff8800;opacity:0.2; filter: Alpha(Opacity=20);}
}

+ 44
- 0
ZZDZ/public/css/reset.css View File

@@ -0,0 +1,44 @@
@charset "utf-8";
/*
Document : CSS样式初始化
Created on : 2013. 8. 6,15:41:00
Author :
Description:
CSS样式表的初始化,全局样式设置。部分样式属性请根据具体页面重置其属性
导入方式:<link href="css/common.css" rel="stylesheet" type="text/css" />
*/
/* reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,textarea,p,blockquote,th,td,input,select,textarea,button {margin:0;padding:0} /* 初始化标签在所有浏览器中的margin、padding值 */
fieldset,img {border:0 none} /* 重置fieldset(表单分组)、图片的边框为0*/
dl,ul,ol,menu{list-style:none} /* 重置类表前导符号为onne,menu在HTML5中有效 */
blockquote, q {quotes: none} /* 重置嵌套引用的引号类型 */
blockquote:before, blockquote:after,q:before, q:after {content:'';content:none} /* 重置嵌套引用*/
input,select,textarea,button {vertical-align:middle} /* 重置表单控件垂直居中*/
button {border:0 none;background-color:transparent;cursor:pointer} /* 重置表单button按钮效果 */
body {background:#fff} /* 重置body 页面背景为白色 */
body,th,td,input,select,textarea,button {font-size:0.12rem;line-height:1 ;font:normal 0.12rem/1.5 'arial', 'Tahoma','simsun','宋体';color:#333333} /* 重置页面文字属性 */
a {color:#333333;text-decoration:none; display:block;} /* 重置链接a标签 */
a:active, a:hover {text-decoration:none; color:#e60012;} /* 重置链接a标签的鼠标滑动效果 */
address,caption,cite,code,dfn,em,var {font-style:normal;font-weight:normal} /* 重置样式标签的样式 */
caption {display:none;} /* 重置表格标题为隐藏 */
table {width:100%;border-collapse:collapse;border-spacing:0;table-layout:fixed;} /* 重置table属性 */
img{vertical-align:top;} /* 图片在当前行内的垂直位置 */

/* 页面设置 */

/* 取消a标签点击后的虚线框 */
a {outline: none;}
a:active {star:expression(this.onFocus=this.blur());}
li,dd,dt,span,h3{ cursor:default;}

/* 设置页面文字等在拖动鼠标选中情况下的背景色与文字颜色 */
/*
::selection {color: #fff;background-color: #4C6E78;}
::-moz-selection {color: #fff;background-color: #4C6E78;}
*/

#flashMessage {
color: #FF0000;
padding: 15px 0;
text-align: center;
}

+ 494
- 0
ZZDZ/public/css/ui-base.css View File

@@ -0,0 +1,494 @@
* {
margin: 0;
padding: 0;
font-size: 0.12rem;
color: #333;
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,STHeiti,"Microsoft Yahei",sans-serif;
}

/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/

button, html input[type="button"], /* 1 */
input[type="reset"], input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer
}
.clg_input {
}
a {
text-decoration: none;
}
input, textarea {
outline: none;
display: inline-block;
box-sizing: border-box;
background: transparent;
border: 0;
height: 0.2rem;
}

div {
outline: 0 !important;
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
position: relative;
}

ul, li {
list-style: none;
}

.uc-tl {
-webkit-border-top-left-radius: .6rem;
border-top-left-radius: .6rem
}

.uc-tr {
-webkit-border-top-right-radius: .6rem;
border-top-right-radius: .6rem
}

.uc-bl {
-webkit-border-bottom-left-radius: .6rem;
border-bottom-left-radius: .6rem
}

.uc-br {
-webkit-border-bottom-right-radius: .6rem;
border-bottom-right-radius: .6rem
}

.uc-t {
-webkit-border-top-left-radius: .6rem;
border-top-left-radius: .6rem;
-webkit-border-top-right-radius: .6rem;
border-top-right-radius: .6rem
}

.uc-b {
-webkit-border-bottom-left-radius: .6rem;
border-bottom-left-radius: .6rem;
-webkit-border-bottom-right-radius: .6rem;
border-bottom-right-radius: .6rem
}

.uc-r {
-webkit-border-top-right-radius: .6rem;
border-top-right-radius: .6rem;
-webkit-border-bottom-right-radius: .6rem;
border-bottom-right-radius: .6rem
}

.uc-l {
-webkit-border-top-left-radius: .6rem;
border-top-left-radius: .6rem;
-webkit-border-bottom-left-radius: .6rem;
border-bottom-left-radius: .6rem
}

.uc-a {
-webkit-border-radius: .6rem;
border-radius: .6rem
}

.uc-n {
-webkit-border-radius: 0;
border-radius: 0
}

.uc-tl1 {
-webkit-border-top-left-radius: 0.03rem;
border-top-left-radius: 0.03rem
}

.uc-tr1 {
-webkit-border-top-right-radius: 0.03rem;
border-top-right-radius: 0.03rem
}

.uc-bl1 {
-webkit-border-bottom-left-radius: 0.03rem;
border-bottom-left-radius: 0.03rem
}

.uc-br1 {
-webkit-border-bottom-right-radius: 0.03rem;
border-bottom-right-radius: 0.03rem
}

.uc-t1 {
-webkit-border-top-left-radius: 0.3rem;
border-top-left-radius: 0.3rem;
-webkit-border-top-right-radius: 0.3rem;
border-top-right-radius: 0.3rem
}

.uc-b1 {
-webkit-border-bottom-left-radius: 0.3rem;
border-bottom-left-radius: 0.3rem;
-webkit-border-bottom-right-radius: 0.3rem;
border-bottom-right-radius: 0.3rem
}

.uc-r1 {
-webkit-border-top-right-radius: 0.3rem;
border-top-right-radius: 0.3rem;
-webkit-border-bottom-right-radius: 0.3rem;
border-bottom-right-radius: 0.3rem
}

.uc-l1 {
-webkit-border-top-left-radius: 0.3rem;
border-top-left-radius: 0.3rem;
-webkit-border-bottom-left-radius: 0.3rem;
border-bottom-left-radius: 0.3rem
}

.uc-a1 {
-webkit-border-radius: 0.3rem;
border-radius: 0.3rem
}
.uc-a3 {
-webkit-border-radius: 0.4rem;
border-radius: 0.4rem
}
.uc-a2 {
-webkit-border-radius: 1.2rem;
border-radius: 1.2rem
}
.uc-tl, .uc-tr, .uc-bl, .uc-br, .uc-t, .uc-b, .uc-r, .uc-l, .uc-a, .uc-n, .uc-tl1, .uc-tr1, .uc-bl1, .uc-br1, .uc-t1, .uc-b1, .uc-r1, .uc-l1, .uc-a1, .uc-a2, .uc-a3 {
-webkit-background-clip: padding-box;
background-clip: padding-box
}

.us {
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
box-shadow: 0 1px 4px rgba(0, 0, 0, .3)
}
.us1 {
-webkit-box-shadow: 0 1px 4px rgba(120, 120, 120, .3);
box-shadow: 0 1px 4px rgba(120, 120, 120, .3)
}
.us-i {
-webkit-box-shadow: inset 0px 2px 3px rgba(0, 0, 0, .4);
box-shadow: inset 0px 2px 3px rgba(0, 0, 0, .4)
}

.uts {
text-shadow: 0px 2px 2px #000;
}

.um, .um body {
height: 100%;
padding: 0px;
margin: 0px;
font-family: "Helvetica Neue", Helvetica;
}

.um-vp {
margin: 0;
padding: 0;
overflow-x: hidden;
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-user-select: none
}

.um-vp .up {
top: 0;
left: 0;
width: 100%;
min-height: 100%;
max-height: 100%;
position: absolute;
border: 0
}

.uh, .uf {
display: block;
width: 100%;
font-size: 1rem;
}

.up .uh, .up .uf, .pos_re {
position: relative
}

.uh .ut, .uf .ut {
padding: .72rem 1rem .72rem;
margin: 0;
}

.ufl {
float: left !important;
}
.ufr {
float: right !important;
}

.ulev0 {
font-size: 0.12rem;
}

.ulev1 {
font-size: 0.14rem;
}

.ulev2 {
font-size: 0.16rem;
}

.ulev3 {
font-size: 0.18rem;
}

.ulev4 {
font-size: 0.20rem;
}
.ulev5 {
font-size: 0.22rem;
}
.ulev6 {
font-size: 0.24rem;
}
.ulev7 {
font-size: 0.26rem;
}
.ulev8 {
font-size: 0.28rem;
}
.ulev9 {
font-size: 0.30rem;
}
.ulim {
max-width: 5rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}

.uinl {
display: inline-block;
position: relative;
}

.uinn {
padding: 0.15rem;
}
.uinn1 {
padding: 0.1rem 0.15rem;
}
.uinn2 {
padding: 0.5rem 1rem;
}
.uinn3 {
padding: 0.2rem;
}
.uinn4 {
padding: 0 0.1rem;
}
.uinn5 {
padding: 0.75rem 0.5rem;
}
.uinn6 {
padding: 0.1rem;
}
.uinn8 {
padding: 0.05rem;
}
.uinn7 {
padding: 0.66rem 0.375rem;
}
.uinn9 {
padding: 0.15rem 0rem;
}
.uinn10 {
padding: 0.1rem 0rem;
}
.umh1 {
min-height: 1rem;
}

.umh2 {
min-height: 1.2rem;
}

.umh3 {
min-height: 1.5rem;
}

.umh4 {
min-height: 2rem;
}
.umh5 {
min-height: 3rem;
}
.umh6 {
min-height: 4rem;
}
.umh7 {
min-height: 1.8rem;
}
.umw1 {
min-width: 1rem;
}
.umw1-5 {
min-width: 1.5rem;
}

.umw2 {
min-width: 2rem;
}

.umw3 {
min-width: 3rem;
}

.umw4 {
min-width: 4rem;
}

.tx-l {
text-align: left;
}
.tx-r {
text-align: right;
}
.tx-c {
text-align: center;
}

.ut-s {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap !important;
outline: 0 !important
}

.ut-m {
text-overflow: ellipsis;
overflow: hidden;
white-space: normal !important;
outline: 0 !important
}

.uba {
border: 1px solid;
}
.uba1 {
border: 2px solid;
}
.uba2 {
border: 3px solid;
}

.ubt {
border-top: 1px solid;
}
.ubb {
border-bottom: 1px solid;
}

.ubl {
border-left: 1px solid;
}

.ubr {
border-right: 1px solid;
}

.uhide {
display: none !important;
}

.umar-b {
margin-bottom: 0.2rem;
}
.umar-t {
margin-top: 0.2rem;
}
.umar-l {
margin-left: 0.2rem;
}
.umar-r {
margin-right: 0.2rem;
}
.umar-b15 {
margin-bottom: 0.15rem;
}
.umar-t15 {
margin-top: 0.15rem;
}
.umar-l15 {
margin-left: 0.15rem;
}
.umar-r15 {
margin-right: 0.15rem;
}
.umar-a15 {
margin: 0.15rem;
}
.umar-a {
margin: 0.05rem 0.15rem;
}
.umar-a1 {
margin: 0rem 0.15rem;
}

.umar-a-15{
margin: 0.15rem;
}

.uof {
overflow: hidden;
}
.uof-x {
overflow-x: hidden;
}
.uof-y {
overflow-y: hidden;
}

.uabs {
position: absolute;
left: 0;
top: 0;
}

.uabs-r {
position: absolute;
right: 0;
top: 0;
}

.utra {
-webkit-transition: all 300ms ease-in 100ms
}
.line1 {
-webkit-line-clamp: 1;
}
.line2 {
-webkit-line-clamp: 2;
}

.line3 {
-webkit-line-clamp: 3;
}

.ani-act {
transform: scale(0.95,0.97);
-webkit-transform: scale(0.95,0.97);
-webkit-transition-duration: 300ms;
opacity: .7;
}

.uh_ios7 .uh {
padding: 1rem 0 0;
}

+ 164
- 0
ZZDZ/public/css/ui-box.css View File

@@ -0,0 +1,164 @@
.ub
{
display: -webkit-box;
display: -moz-box;
display: box;
position:relative;
}
/*以反方向显示 div 框的子元素*/
.ub-rev
{
-webkit-box-direction:reverse;
-moz-box-direction:reverse;
box-direction:reverse;
}

.ub-fh
{
width:100%;
}

.ub-fv
{
height:100%;
}

.ub-con
{
position:absolute;
width:100%;
height:100%;
}
/*通过使用 box-align and box-pack 属性,居中 div 框的子元素*/
.ub-ac
{
-webkit-box-align:center;
-moz-box-align:center;
box-align:center;
}
/*通过使用 box-align and box-pack :end属性,右下 div 框的子元素*/
.ub-ae
{
-webkit-box-align:end;
-moz-box-align:end;
box-align:end;
}

.ub-pc
{
-webkit-box-pack:center;
-moz-box-pack:center;
box-pack:center;
}
.ub-pe
{
-webkit-box-pack:end;
-moz-box-pack:end;
box-pack:end;
}
/*不知道*/
.ub-pj
{
-webkit-box-pack:justify;
-moz-box-pack:justify;
box-pack:justify;
}
/*从上向下垂直排列子元素。*/
.ub-ver
{
-webkit-box-orient:vertical;
-moz-box-orient:vertical;
box-orient:vertical;
}
/*box-flex主要让子容器针对父容器的宽度按一定规则进行划分*/
.ub-f1
{
position:relative;
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
}

.ub-f2
{
position:relative;
-webkit-box-flex: 2;
-moz-box-flex: 2;
box-flex: 2;
}

.ub-f3
{
position:relative;
-webkit-box-flex: 3;
-moz-box-flex: 3;
box-flex: 3;
}

.ub-f4
{
position:relative;
-webkit-box-flex: 4;
-moz-box-flex: 4;
box-flex: 4;
}

.ub-img
{
/*把图像图像扩展至最大尺寸,以使其宽度和高度完全适应内容区域。*/
-webkit-background-size:contain;
background-size:contain;
/*背景图像将仅显示一次。*/
background-repeat:no-repeat;
background-position:center;
}

.ub-img1
{
/*把背景图像扩展至足够大,以使背景图像完全覆盖背景区域。
背景图像的某些部分也许无法显示在背景定位区域中。*/
-webkit-background-size:cover;
background-size:cover;
background-repeat:no-repeat;
background-position:center;
}
.ub-img2
{
background-repeat:repeat-x;
/*宽高*/
background-size:auto 100%
}
.ub-img3
{
background-repeat:repeat-y;
background-size:100% auto
}

.ub-img4
{
-webkit-background-size:100% auto;
background-size:100% auto;
background-repeat:no-repeat;
background-position:center;
}
.ub-img5
{
-webkit-background-size:auto 100%;
background-size:auto 100%;
background-repeat:no-repeat;
background-position:center;
}

.ub-img6
{
background-repeat:no-repeat;
background-position:center;
}
.ub-img7
{
-webkit-background-size:100% 100%;
background-size:100% 100%;
background-repeat:no-repeat;
background-position:center;
}


+ 110
- 0
ZZDZ/public/css/ui-color.css View File

@@ -0,0 +1,110 @@
/*背景色*/
.bg_color{
background-color: #F0F2F6;
}

/*深绿 主色调*/
.main_color{
background-color: #5cc4bb;
}
.main_font_color{
color: #5cc4bb;
}

.fontgreen_color{
color: #5cc4bb;
}

/*字体浅灰色*/
.lightgray_color{
color: rgb(207,207,207);
}

/*字体中度灰色*/
.commongray_color{
color: #999999;
}
/*字体最浅灰色*/
.light_color{
color: #cccccc;
}

.layergray_bc{
background-color: #999999;
}

.fontmiddle_color{
color: #666666;
}

/*字体浅黑色*/
.lightblack_color{
color: #333333;
}

/*字体深黑色*/
.darkblack_color{
color: #1b1a20;
}

.white_color{
color: #ffffff;
}
.white_bg_color{
background-color: #ffffff;
}

/*黄色字体*/
.yellow_color{
color: #ffca50;
}

/*浅黄色背景*/
.lightyellow_color{
background-color: #fffee2;
}

/*layer层字体*/
.layer_color{
color: #50576e;
}
.white_bccolor{
background-color: white;
}

/*layer层背景*/
.layer_background{
background-color: #ffffff;
}

/*待支付颜色*/
.payred_color{
color: #ff6d6d;
}
/*分割线颜色*/
.line_color_b{
border-bottom-color: #e5e5e5;
}
.line_color_t{
border-top-color: #e5e5e5;
}

.font_blue_color{
color: #0076ff;
}
/*余票紧张*/
.red_font{
color: #ff6d6d;
}
/*余票充足*/
.grey_font{
color: #666666;
}
.ui_line_b_d{
border-bottom: 1px dashed #e5e5e5;
}

.ui_line_a_c{
border: 1px solid #666666;
}


+ 5
- 0
ZZDZ/public/css/wechat.min.css
File diff suppressed because it is too large
View File


BIN
ZZDZ/public/images/Combined_Shape.png View File

Before After
Width: 530  |  Height: 132  |  Size: 19 KiB

BIN
ZZDZ/public/images/b1_banner.png View File

Before After
Width: 750  |  Height: 162  |  Size: 16 KiB

BIN
ZZDZ/public/images/b1_bg.png View File

Before After
Width: 750  |  Height: 326  |  Size: 359 KiB

BIN
ZZDZ/public/images/car.png View File

Before After
Width: 32  |  Height: 32  |  Size: 2.0 KiB

BIN
ZZDZ/public/images/ic_call.png View File

Before After
Width: 160  |  Height: 80  |  Size: 1.6 KiB

BIN
ZZDZ/public/images/ic_car.png View File

Before After
Width: 159  |  Height: 95  |  Size: 27 KiB

BIN
ZZDZ/public/images/ic_change.png View File

Before After
Width: 60  |  Height: 60  |  Size: 2.4 KiB

BIN
ZZDZ/public/images/ic_close.png View File

Before After
Width: 50  |  Height: 50  |  Size: 1.2 KiB

BIN
ZZDZ/public/images/ic_enter.png View File

Before After
Width: 16  |  Height: 31  |  Size: 752 B

BIN
ZZDZ/public/images/ic_enter2.png View File

Before After
Width: 16  |  Height: 28  |  Size: 721 B

BIN
ZZDZ/public/images/ic_erweima_gre.png View File

Before After
Width: 44  |  Height: 44  |  Size: 1.1 KiB

BIN
ZZDZ/public/images/ic_return_d.png View File

Before After
Width: 15  |  Height: 25  |  Size: 392 B

BIN
ZZDZ/public/images/ic_return_gr.png View File

Before After
Width: 15  |  Height: 25  |  Size: 437 B

BIN
ZZDZ/public/images/ic_return_n.png View File

Before After
Width: 15  |  Height: 25  |  Size: 399 B

BIN
ZZDZ/public/images/ic_return_n_l.png View File

Before After
Width: 15  |  Height: 25  |  Size: 412 B

BIN
ZZDZ/public/images/ic_search.png View File

Before After
Width: 27  |  Height: 27  |  Size: 932 B

BIN
ZZDZ/public/images/ic_select_dis.png View File

Before After
Width: 34  |  Height: 34  |  Size: 930 B

BIN
ZZDZ/public/images/ic_select_nor.png View File

Before After
Width: 42  |  Height: 42  |  Size: 1.2 KiB

BIN
ZZDZ/public/images/ic_select_nor2.png View File

Before After
Width: 34  |  Height: 34  |  Size: 974 B

BIN
ZZDZ/public/images/ic_select_sel.png View File

Before After
Width: 42  |  Height: 42  |  Size: 1.2 KiB

BIN
ZZDZ/public/images/ic_time.png View File

Before After
Width: 20  |  Height: 20  |  Size: 502 B

BIN
ZZDZ/public/images/ic_wenhao.png View File

Before After
Width: 28  |  Height: 28  |  Size: 905 B

BIN
ZZDZ/public/images/img_chenggong.png View File

Before After
Width: 72  |  Height: 72  |  Size: 4.2 KiB

BIN
ZZDZ/public/images/img_gantanhao.png View File

Before After
Width: 27  |  Height: 28  |  Size: 721 B

BIN
ZZDZ/public/images/img_line.png View File

Before After
Width: 12  |  Height: 108  |  Size: 468 B

BIN
ZZDZ/public/images/img_line_ga.png View File

Before After
Width: 108  |  Height: 12  |  Size: 490 B

BIN
ZZDZ/public/images/img_line_gr.png View File

Before After
Width: 108  |  Height: 12  |  Size: 508 B

BIN
ZZDZ/public/images/img_null_l.png View File

Before After
Width: 64  |  Height: 46  |  Size: 2.1 KiB

BIN
ZZDZ/public/images/img_pro_d.png View File

Before After
Width: 23  |  Height: 25  |  Size: 648 B

BIN
ZZDZ/public/images/img_pulldown.png View File

Before After
Width: 25  |  Height: 15  |  Size: 386 B

BIN
ZZDZ/public/images/img_time.png View File

Before After
Width: 20  |  Height: 20  |  Size: 502 B

BIN
ZZDZ/public/images/loading2.gif View File

Before After
Width: 300  |  Height: 300  |  Size: 59 KiB

BIN
ZZDZ/public/images/tuisong_er.png View File

Before After
Width: 530  |  Height: 490  |  Size: 40 KiB

BIN
ZZDZ/public/images/tuisong_er1.png View File

Before After
Width: 490  |  Height: 490  |  Size: 42 KiB

BIN
ZZDZ/public/images/tuisong_er2.png View File

Before After
Width: 430  |  Height: 430  |  Size: 36 KiB

+ 197
- 0
ZZDZ/public/js/calendar.js View File

@@ -0,0 +1,197 @@

//当前时间
var tmonth = new Date();

var year = tmonth.getFullYear();

var month = tmonth.getMonth();

var dom = $('.month');
//中间变量 记录
var tttmonth = '';

var tyear = '';


window.onload = function(){
!dom.hasClass("amonth")&&dom.addClass("amonth");
//当前日期
var date1 = new Date(year,month);
//当前月份
var tomonth = new Date().getMonth();
//
var today = new Date().getDate();
var dayhtml = [];
var week = ["日","一","二","三","四","五","六"];
for (var t=1;t<=3;t++){
dayhtml.push('<div style="clear:both">');
var date = date1;
month = date.getMonth()+t-1;
if (month>=11) {
tyear = year+1;
tttmonth = month-12 ;
// month = 0;
}else{
tyear =year;
tttmonth = month;
}
if(tttmonth==-1){
tttmonth=11;
tyear = year;
}
dayhtml.push('<div class="month_title"><span class="current_month">'+(tttmonth+1)+'月'+'</span><span class="current_year">'+tyear+'</span></div>')
// dayhtml.push();
// $.each(week,function(i,v){
// dayhtml.push('<div class="aweek" style="float:left">'+week[i]+'</div>')
// });
var str = '';
$.each(week,function(i,v){
str += '<div class="aweek ub-f1 text_middle ui_p_t15 ui_p_b15">'+week[i]+'</div>';
});
dayhtml.push('<div class="ub" style="margin-left:0.2rem;margin-right:0.2rem;">'+str+'</div>')
var nextdate = new Date(year,month)
var firstweek = nextdate.getDay();
// var firstweek = month.getDay();
// var first = month.getDay();
var allday = new Date(parseInt(year),(parseInt(month)+1),0).getDate();
var daystr = '<div style="margin-left:0.2rem;margin-right:0.2rem;">';
for(var i = 0;i<firstweek;i++){
daystr+='<div class="aday"></div>'
};
var data_cur_str=''; //日期str
var data_cur=''; //日期-
// 得到去程日期
var go_run_date=getPar('go_date');
// var date1 = new Date(go_run_date.replace(/\-/g, '/'));
// // 判断日期是否合理
// var date1 = new Date(start_date.replace(/\-/g, '/'));
// var date2 = new Date(end_date.replace(/\-/g, '/'));
// if (date1>date2 || end_date=="") {
// $('#id-date-picker-2').val(start_date);
// }
if (month==tomonth){
for(i=1;i<=allday;i++){
var t_m=(tttmonth+1);
var t_m_str=t_m;
var t_d_str=i;
if(t_m<=9){
t_m_str="0"+t_m;
}
if(i<=9){
t_d_str="0"+i;
}
data_cur_str=t_m_str+"月"+t_d_str+'日';
data_cur=tyear+"-"+(Array(2).join(0)+(tttmonth+1)).slice(-2)+"-"+(Array(2).join(0)+i).slice(-2);
var run_day=go_run_date.substring(8);
if(i<parseInt(run_day)){
daystr+='<div class="aday disday">'+i+'</div>';
}else{
if(i==today){
// if(getPar('from')=="fill_order"){
// daystr+='<div class="aday disday">'+i+'</div>';
// }else{
daystr+='<div data-cur-str="'+data_cur_str+'" data-cur="'+data_cur+'" class="aday canday today">今天</div>';
// }
}
else if(i<today){
daystr+='<div class="aday disday">'+i+'</div>';
}else{
daystr+='<div data-cur-str="'+data_cur_str+'" data-cur="'+data_cur+'"class="aday canday">'+i+'</div>';
}
}
}
}else if(month<tomonth){
for(i=1;i<=allday;i++){
daystr+='<div class="aday disday">'+i+'</div>'
}
}else{
for(i=1;i<=allday;i++){
var t_m=(tttmonth+1);
var t_m_str=t_m;
var t_d_str=i;
if(t_m<=9){
t_m_str="0"+t_m;
}
if(i<=9){
t_d_str="0"+i;
}
data_cur_str=t_m_str+"月"+t_d_str+'日';
data_cur=tyear+"-"+(Array(2).join(0)+(tttmonth+1)).slice(-2)+"-"+(Array(2).join(0)+i).slice(-2);
daystr+='<div data-cur-str="'+data_cur_str+'" data-cur="'+data_cur+'"class="aday canday">'+i+'</div>'
}
}
daystr += "</div>";
dayhtml.push(daystr);
dayhtml.push('</div>');
}
dom.html(dayhtml.join(""))


//选中去程的日期
$(".canday").each(function(index,domE){
if($(this).attr('data-cur')==getPar('go_date')){
$(this).removeClass('select_day');
$(this).removeClass('select_go_day');
$(this).addClass('select_go_day');
};
})

$(".canday").on("click",function(){
$(".canday").removeClass('select_day');
$(this).addClass('select_day');
//判断从哪个页面跳转过来
var from=getPar('from');
//出行预订
if(from=="index"){
var data_cur=$(this).attr('data-cur');
var data_cur_str=$(this).attr('data-cur-str');
var tt=getDateTime(4);
var listURL='index.html?guanzhu=1&run_date='+data_cur+"&run_date_str="+data_cur_str+"&tt="+tt;
listURL=encodeURI(listURL);
window.location.href=listURL;
}else if(from=="query_result"){
var prod_id = getPar("prod_id")
var data_cur=$(this).attr('data-cur');
var data_cur_str=$(this).attr('data-cur-str');
var listURL='query_result.html?time='+data_cur+"&prod_id="+prod_id;
listURL=encodeURI(listURL);
window.location.href=listURL;
}
//订单详情
if(from=="fill_order"){
// go_ticket_id='+go_ticket_id+'&go_date='+go_date+'&back=back'+'&from=fill_order';
var go_ticket_id=getPar('go_ticket_id');
var go_date=getPar('go_date');
var data_cur=$(this).attr('data-cur');
var data_cur_str=$(this).attr('data-cur-str');
var tt=getDateTime(4);
var listURL="search_results.html?go_date="+data_cur+"&go_ticket_id="+go_ticket_id+"&tt="+tt;
listURL=encodeURI(listURL);
window.location.href=listURL;
}

})

}

+ 153
- 0
ZZDZ/public/js/index.js View File

@@ -0,0 +1,153 @@
var run_date=getPar('run_date'); //出发日期
var run_date_str=getPar('run_date_str');
var month = new Date().getMonth();
var today = new Date().getDate();
//var today = 15;
var year = new Date().getFullYear();

var startarea = '';


$(document).ready(function(){
ifattention();
startarea = getStorage("start_add");
if(startarea=="nj"){
$('#nanjingimg').attr('src','public/images/ic_select_nor2.png');
$('#nantongimg').attr('src','public/images/ic_select_dis.png');
}else if(startarea=="nt"){
$('#nantongimg').attr('src','public/images/ic_select_nor2.png');
$('#nanjingimg').attr('src','public/images/ic_select_dis.png');
}else{
$('#nantongimg').attr('src','public/images/ic_select_dis.png');
$('#nanjingimg').attr('src','public/images/ic_select_dis.png');
}
if(run_date){
//alert(run_date)
$('#run_date').text(run_date_str);
}else{
//alert(run_date)
var cur_date_m_d=getDateTime(0);
cur_date_m_d=cur_date_m_d.substring(5);
cur_date_m_d=cur_date_m_d.replace('-','月');
cur_date_m_d=cur_date_m_d+'日';
run_date=getDateTime(0);
//run_date = "2016-09-15";
$('#run_date').text(cur_date_m_d);
//$('#run_date').text("09月15日");
}
var year = getMonthAndDayByDate(run_date,'year');
var month = getMonthAndDayByDate(run_date,'month');
var day = getMonthAndDayByDate(run_date,'day');
var str = year+ '/' +month +'/'+day;
var week = getWeekDay(str);
$('#run_day').text(run_date==getDateTime(0)?'今天':week);
})

$("#select_time").click(function(){
setStorage("start_add",startarea);
window.location.href="calendar.html?from=index";
})

//$("#query").click(function(){
// var go_add = $("#start_add").text();
// var prod_id = "";
// var go_date = "";
// if(run_date==""){
// go_date = year+'-'+month+'-15';
// // go_date = year+'-'+month+'-'+today;
//
// }else{
// go_date = run_date;
// }
// if(go_add=="南京"){
// prod_id = "449860";
// }else if(go_add=="南通"){
// prod_id = "449865";
// }
// window.location.href="query_result.html?prod_id="+prod_id+"&time="+go_date;
//
//})

function selectNanjing(nanjing){
startarea = nanjing;
$('#nanjingimg').attr('src','public/images/ic_select_nor2.png');
$('#nantongimg').attr('src','public/images/ic_select_dis.png');
$('#line1').addClass('high_light');
$('#line2').removeClass('high_light');
}

function selectNantong(nantong){
startarea = nantong;
$('#nantongimg').attr('src','public/images/ic_select_nor2.png');
$('#nanjingimg').attr('src','public/images/ic_select_dis.png');
$('#line1').removeClass('high_light');
$('#line2').addClass('high_light');
}


function searchInfo(){
if (startarea != 'nj'&&startarea != 'nt') {
alert('请选择出发线路');
return;
}else{
var prod_id = startarea;
var go_date = "";
if(run_date==""){
go_date = year+'-'+month+'-15';
// go_date = year+'-'+month+'-'+today;
}else{
go_date = run_date;
}
clearStorage("start_add");
window.location.href="query_result.html?prod_id="+prod_id+"&time="+go_date;
}
}

$("#close_btn").click(function(){
$("#code").hide();
});

$("#code_show").click(function(){
$("#code").show();
});

function ifattention(){
$.ajax({
url:"http://xmwx.zhizhuchuxing.cn/ZZDZ2/application/custom_made/control.php", //请求地址
data:{type:"order_isregister"},
type: "post",
dataType: "json",
success: function (data) {
console.log(data);
if(data.code == 0){
if(data.if_attention == 0){
var guanzhu = getStorage('guanzhu');

if(guanzhu==1){
}else{
setStorage("guanzhu","1")
$("#code").show();
}
$("#code_show").show();
}else{
$("#code").hide();
$("#code_show").hide();
}
}else{
alert(data.info);
}
}
});
}

+ 4
- 0
ZZDZ/public/js/jquery-2.2.4.min.js
File diff suppressed because it is too large
View File


+ 230
- 0
ZZDZ/public/js/main.js View File

@@ -0,0 +1,230 @@
var base_api="http://dz.zhizhuchuxing.com/";

base_api = '';

//设置字符串类型的本地缓存
function setStorage(objName, objValue){
var sto = window.localStorage;
if (sto)
sto.setItem(objName, objValue);
}
//读取字符串类型的本地缓存
function getStorage(objName){
var ret = '';
var sto = window.localStorage;
if (sto)
ret = sto.getItem(objName);
return ret;
}

//清除本地缓存,如没指定名称则为清空所有缓存
function clearStorage(objName){
var sto = window.localStorage;
if (sto) {
if (objName)
sto.removeItem(objName);
else
sto.clear();
}
}
//设置Json类型的本地缓存
function setStorJson(objName, json){
if (json)
setStorage(objName, JSON.stringify(json));
}
//读取Json类型的本地缓存
function getStorJson(objName){
var ret = null;
var str = getStorage(objName);
if (str)
ret = JSON.parse(str);
return ret;
}
function iflogin(){
$.ajax({
type:"post",
url:base_api+"./zz-fx/control.php",
data:{type:"distribut_iflogin"},
dataType: "json",
success: function (data) {
console.log(data);
if(data.iflogin == 1){
//alert("用户未登录,请先登录");
window.wxc.xcConfirm("用户未登录,请先登录", window.wxc.xcConfirm.typeEnum.info,{
onOk:function(){
window.location.href="login.html"
}
});
}else{
return;
}
},
fail: function (date) {
// 此处放失败后执行的代码
}
});
}
//打印日志
function ZZLog(str){
var isLog=true;
if(isLog){
console.log(str);
}
}

//获取时间
function getDateTime(nTypeFlag) {
var tNowTime = new Date();
var myYear = ';' + tNowTime.getFullYear() + ';';
var myMonth = ';' + (tNowTime.getMonth() + 1 - 0) + ';';
var myDay = ';' + tNowTime.getDate() + ';';
var myHour = ';' + tNowTime.getHours() + ';';
var myMinu = ';' + tNowTime.getMinutes() + ';';
var mySecond = ';' + tNowTime.getSeconds() + ';';

if(myMonth.length < 4) myMonth = '0' + myMonth;
if(myDay.length < 4) myDay = '0' + myDay;
if(myHour.length < 4) myHour = '0' + myHour;
if(myMinu.length < 4) myMinu = '0' + myMinu;
if(mySecond.length < 4) mySecond = '0' + mySecond;

var cNewTimeStr;
switch(nTypeFlag + 1 - 1) {
case 0:
cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
break;
case 1:
cNewTimeStr = myYear + myMonth + myDay;
break;
case 2:
cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
break;
case 3:
cNewTimeStr = myHour + myMinu + mySecond;
break;
case 4:
cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
break;
case 5:
cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
break;
case 6:
cNewTimeStr = myYear;
break;
case 7:
cNewTimeStr = myYear + '-' + myMonth;
break;
case 8: //得到上一个月的今天
var date = getDateTime(0);
var arr = date.split('-');
var year = arr[0]; //获取当前日期的年份
var month = arr[1]; //获取当前日期的月份
var day = arr[2]; //获取当前日期的日
var days = new Date(year, month, 0);
days = days.getDate(); //获取当前日期中月的天数
var year2 = year;
var month2 = parseInt(month) - 1;
if(month2 == 0) {
year2 = parseInt(year2) - 1;
month2 = 12;
}
var day2 = day;
var days2 = new Date(year2, month2, 0);
days2 = days2.getDate();
if(day2 > days2) {
day2 = days2;
}
if(month2 < 10) {
month2 = '0' + month2;
}
cNewTimeStr = year2 + '-' + month2 + '-' + day2;
break;
case 9: //得到下一个月的今天
var date = getDateTime(0);
var arr = date.split('-');
var year = arr[0]; //获取当前日期的年份
var month = arr[1]; //获取当前日期的月份
var day = arr[2]; //获取当前日期的日
var days = new Date(year, month, 0);
days = days.getDate(); //获取当前日期中的月的天数
var year2 = year;
var month2 = parseInt(month) + 1;
if(month2 == 13) {
year2 = parseInt(year2) + 1;
month2 = 1;
}
var day2 = day;
var days2 = new Date(year2, month2, 0);
days2 = days2.getDate();
if(day2 > days2) {
day2 = days2;
}
if(month2 < 10) {
month2 = '0' + month2;
}

var t2 = year2 + '-' + month2 + '-' + day2;
return t2;
break;
case 10:
cNewTimeStr = myYear +'/' +myMonth +'/'+ myDay;
break;
case 11:
if (myMonth != 10 || myMonth != 11 || myMonth != 12) {
myMonth = myMonth.substring(1,myMonth.length-1);
}
cNewTimeStr = myMonth +'月'+ myDay+'日';
break;
default:
cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
break;
}

cNewTimeStr = cNewTimeStr.replace(/;/g, "");

return cNewTimeStr;

}
//得到url上的参数
function getPar(par){
var local_url = document.location.href;
local_url = decodeURI(local_url);
var get = local_url.indexOf(par +"=");
if(get == -1){
return "";
}
var get_par = local_url.slice(par.length + get + 1);
var nextPar = get_par.indexOf("&");
if(nextPar != -1){
get_par = get_par.slice(0, nextPar);
}
return get_par;
}

//js判断一个日期是星期几 传入 年/月/日
function getWeekDay(day){
var a = new Array("日", "一", "二", "三", "四", "五", "六");
var week = new Date(day).getDay();
var str = "星期"+ a[week];
return str;
}
//截取日期参数
function getMonthAndDayByDate(datestr,info){
var dateAry = datestr.split('-');
var cNewTimeStr;
switch(info){
case 'year':
cNewTimeStr = dateAry[0];
break;
case 'month':
cNewTimeStr = dateAry[1];
break;
default:
cNewTimeStr = dateAry[2];
break;
}
return cNewTimeStr;
}

+ 112
- 0
ZZDZ/public/js/master.js View File

@@ -0,0 +1,112 @@

//当前时间
var tmonth = new Date();

var year = tmonth.getFullYear();

var month = tmonth.getMonth();

var dom = $('.month');
//中间变量 记录
var tttmonth = '';

var tyear = '';


window.onload = function(){
!dom.hasClass("amonth")&&dom.addClass("amonth");
//当前日期
var date1 = new Date(year,month);
//当前月份
var tomonth = new Date().getMonth();
//
var today = new Date().getDate();
var dayhtml = [];
var week = ["日","一","二","三","四","五","六"];
for (var t=1;t<=3;t++){
dayhtml.push('<div style="clear:both">');
var date = date1;
month = date.getMonth()+t-1;
console.log(month);
if (month>=11) {
tyear = year+1;
tttmonth = month-12 ;
// month = 0;
}else{
tyear =year;
tttmonth = month;
}
if(tttmonth==-1){
tttmonth=11;
tyear = year;
}
dayhtml.push('<div class="month_title"><span class="current_month">'+(tttmonth+1)+'月'+'</span><span class="current_year">'+tyear+'</span></div>')
// dayhtml.push();
// $.each(week,function(i,v){
// dayhtml.push('<div class="aweek" style="float:left">'+week[i]+'</div>')
// });
var str = '';
$.each(week,function(i,v){
str += '<div class="aweek ub-f1 text_middle ui_p_t15 ui_p_b15">'+week[i]+'</div>';
});
dayhtml.push('<div class="ub" style="margin-left:0.2rem;margin-right:0.2rem;">'+str+'</div>')
var nextdate = new Date(year,month)
var firstweek = nextdate.getDay();
// var firstweek = month.getDay();
// var first = month.getDay();
var allday = new Date(parseInt(year),(parseInt(month)+1),0).getDate();
var daystr = '<div style="margin-left:0.2rem;margin-right:0.2rem;">';
for(var i = 0;i<firstweek;i++){
daystr+='<div class="aday"></div>'
};
if (month==tomonth){
for(i=1;i<=allday;i++){
if(i==today){
daystr+='<div class="aday canday today">今天</div>'
}
else if(i<today){
daystr+='<div class="aday disday">'+i+'</div>'
}else{
daystr+='<div class="aday canday">'+i+'</div>'
}
}
}else if(month<tomonth){
for(i=1;i<=allday;i++){
daystr+='<div class="aday disday">'+i+'</div>'
}
}else{
for(i=1;i<=allday;i++){
daystr+='<div class="aday canday">'+i+'</div>'
}
}
daystr += "</div>";
dayhtml.push(daystr);
dayhtml.push('</div>');
}
dom.html(dayhtml.join(""))

$(".canday").on("click",function(){
$(".canday").removeClass('select_day');
$(this).addClass('select_day');
// $(".canday").removeClass('thisday');
// $(this).next().addClass("placesel");
// $(this).addClass("thisday");
})

}

+ 181
- 0
ZZDZ/public/js/order_detail.js View File

@@ -0,0 +1,181 @@
//Author:zhangsq
//Date:20160907
//Description:订单详情、

var order_id = '';
//倒计时
var intDiff = '';
//detail html()
var detailHTML = '';

window.onload = function(){
$("#loadingToast").show();
detailHTML = $('#detail_order').html();
order_id = getPar('order_id');
httpData(order_id);
}

//请求数据
function httpData(order_id){
var url=base_api+"./application/custom_made/control.php";
var parm={
type:"order_orderdetailinfo",
order_id:order_id
}
ZZLog(parm);
$.post(url,parm,function(data){
$("#loadingToast").hide();
data=JSON.parse(data);
ZZLog(data);
if (data.code == 0) {
intDiff = data.go_list.time_left > 0? data.go_list.time_left : 0;
reloadData(data);
}
});
}

//加载数据
function reloadData(data){
var newHTML = '';
var list = data.go_list;
var tempHTML = detailHTML;
tempHTML=tempHTML.replace('[185518]',list.order_id);
tempHTML=tempHTML.replace('[59]',list.total_price);

if (list.order_status == "145") {
$('#title_div_go').removeClass('ui_hide');
timer(intDiff,'minute_show_go','second_show_go');
tempHTML=tempHTML.replace('[待支付]',list.order_status_info);
var cstr = '<div class="main_color text_middle white_color ulev2" id="pay" style="padding-top: 0.11rem;padding-bottom: 0.11rem;" onclick="goToPay('+list.order_id+')">去支付</div>';
tempHTML=tempHTML.replace('<div class="replace ui_hide" id="repalace"></div>',cstr);
}else if (list.order_status == "146") {
tempHTML=tempHTML.replace('[待支付]',list.order_status_info);
if (list.can_do == "0") {
$('#repalace').addClass('ui_hide');
$('#title_div_go').removeClass('ui_hide');
$('#title_content_go').html('订单超时已取消')
var cstr='<div class="ub" id="bookAway"><div class="ub-f1"></div><div style="border: 1px solid #5cc4bb;color: #5cc4bb;border-radius: 0.03rem;padding: 0.06rem 0.27rem;margin-top: 0.07rem;margin-bottom: 0.06rem;" class="ulev1 ui_m_r15" onclick="bookAway()">重新购票</div></div>';
tempHTML=tempHTML.replace('<div class="replace ui_hide" id="repalace"></div>',cstr);
}else{
var cstr='<div class="ub" id="refund"><div class="ub-f1"></div><div style="border: 1px solid #3d434f;color: #3d434f;border-radius: 0.03rem;padding: 0.06rem 0.27rem;margin-top: 0.07rem;margin-bottom: 0.06rem;" class="ulev1 ui_m_r15" onclick="refundTicket('+list.order_id+')">退票</div></div>';
tempHTML=tempHTML.replace('<div class="replace ui_hide" id="repalace"></div>',cstr);
}
}else{
tempHTML=tempHTML.replace('[待支付]',list.order_status_info);
$('#repalace').addClass('ui_hide');
}
tempHTML=tempHTML.replace(/\[order_id]/g,list.order_id);
tempHTML=tempHTML.replace('[南京]',list.start_area_name);
tempHTML=tempHTML.replace('[南通]',list.end_area_name);
tempHTML=tempHTML.replace('[出发站点]',list.start_res_name);
tempHTML=tempHTML.replace('[目的站点]',list.end_res_name);
tempHTML=tempHTML.replace('[n]',list.seat_num);
var datestr = list.start_date;
var nowdate = getDateTime(0);
var year = getMonthAndDayByDate(datestr,'year');
var month = getMonthAndDayByDate(datestr,'month');
var day = getMonthAndDayByDate(datestr,'day');
if (datestr == nowdate) {
tempHTML=tempHTML.replace('[8月24日]',month+'月'+day+'日');
$('#todayweek').html('今天');
} else{
tempHTML=tempHTML.replace('[8月24日]',month+'月'+day+'日');
var newdate = year+'/'+month+'/'+day;
var week = getWeekDay(newdate);
$('#todayweek').html(week);
}
tempHTML=tempHTML.replace('[07:45]',list.start_time);
tempHTML=tempHTML.replace('[毛东东]',list.contact_name);
tempHTML=tempHTML.replace('[18621904917]',list.contact_mobile);
newHTML+=tempHTML;
$('#detail_order').html(newHTML);
$('#detail_order').removeClass('ui_hide');
if (datestr == nowdate) {
$('#todayweek').html('今天');
} else{
var newdate = year+'/'+month+'/'+day;
var week = getWeekDay(newdate);
$('#todayweek').html(week);
}
}



//倒计时
function timer(intDiff,minstr,secstr){
window.setInterval(function(){
var day=0,
hour=0,
minute=0,
second=0;//时间默认值
if(intDiff > 0){
day = Math.floor(intDiff / (60 * 60 * 24));
hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
}
if (minute <= 9) minute = '0' + minute;
if (second <= 9) second = '0' + second;
$('#'+minstr).html(minute+'分');
$('#'+secstr).html(second+'秒');
intDiff--;
}, 1000);
}

//重新预订
function bookAway(){
window.location.href = './index.html';
}

//支付
function goToPay(order_id){
var minute = $('#minute_show_go').html();;
var second = $('#second_show_go').html();
if (minute == '00分' && second == '00秒') {
alert('支付已超时,请重新购票!');
return false;
}else{
window.location.href = 'http://xmwx.zhizhuchuxing.cn/wechat/WxPay/realpay/onlinePay.php?orderid='+order_id+'&fx=11&code2=dzbs';
}
}

//退票
function refundTicket(order_id){
var r=confirm("确定要退票吗?");
if (r==true){
$("#loadingToast").show();
$.ajax({
url:base_api+'application/custom_made/control.php', //请求地址
type: "post",
data:{
type:"order_refund",
order_id:order_id
},//请求方式
async:false,
dataType: "json",
success: function (data) {
console.log(data);
if(data.code == 0){
$("#loadingToast").hide();
alert('退票成功!');
window.location.href = "./order_list.html";
}else{
$("#loadingToast").hide();
alert(data.info);
}
}
});
}
else{
return;
}
}

+ 148
- 0
ZZDZ/public/js/order_list.js View File

@@ -0,0 +1,148 @@
//Author:zhangsq
//Date:20160906
//Description:订单列表


var orderHTML = '';
//已完成
var didHTML = '';
var inghave = '';
//记录得到的数组
var inglist = '';
var didlist = '';

window.onload = function(){
$("#loadingToast").show();
orderHTML = $('#wait_pay').html();
var url=base_api+"./application/custom_made/control.php";
var data = {
type:'order_orderlist'
}
var parm=data;
ZZLog(parm)
$.post(url,parm,function(data){
data=JSON.parse(data);
ZZLog(data);
if (data.code == 0) {
$("#loadingToast").hide();
$('#wait_pay').removeClass('ui_hide');
didhasno = data.goning.length;
inghave = data.completed.length;
inglist = data.goning;
didlist = data.completed;
selectStatus(0);
}else{
$("#loadingToast").hide();
$('#wait_pay').removeClass('ui_hide');
alert(data.info);
}
});
}

//加载数据
function reloadData(list,sel){
// var list = '';
// if (sel == 0) {
// list = data.goning;
// } else{
// list = data.completed;
// }
var newHTML = '';
for(var i=0;i<list.length;i++){
var tempHTML = orderHTML;
tempHTML=tempHTML.replace('[185518]',list[i].ORDER_ID);
tempHTML=tempHTML.replace('[35]',list[i].ORDER_PRICE);

if (list[i].ORDER_STATUS == "145") {
tempHTML=tempHTML.replace('<div class="ub-f1 payred_color text_right ui_p_r15 ulev1" style="padding-top: 0.1rem;">[待支付]</div>','<div class="ub-f1 payred_color text_right ui_p_r15 ulev1" style="padding-top: 0.1rem;">'+list[i].ORDER_STATUS_info+'</div>');
var cstr = '<div class="main_color text_middle white_color ulev2" id="pay" style="padding-top: 0.11rem;padding-bottom: 0.11rem;" onclick="goToPay('+list[i].ORDER_ID+')">去支付</div>';
tempHTML=tempHTML.replace('<div class="replace ui_hide" id="repalace"></div>',cstr);
}else if (list[i].ORDER_STATUS == "146") {
tempHTML=tempHTML.replace('<div class="ub-f1 payred_color text_right ui_p_r15 ulev1" style="padding-top: 0.1rem;">[待支付]</div>','<div class="ub-f1 main_font_color text_right ui_p_r15 ulev1" style="padding-top: 0.1rem;">'+list[i].ORDER_STATUS_info+'</div>');
if (list[i].CAN_DO == "0") {
$('#repalace').addClass('ui_hide');
}else{
var cstr='<div class="ub" id="refund"><div class="ub-f1"></div><div style="border: 1px solid #3d434f;color: #3d434f;border-radius: 0.03rem;padding: 0.06rem 0.27rem;margin-top: 0.07rem;margin-bottom: 0.06rem;" class="ulev1 ui_m_r15" onclick="refundTicket('+list[i].ORDER_ID+')">退票</div></div>';
tempHTML=tempHTML.replace('<div class="replace ui_hide" id="repalace"></div>',cstr);
}
}else{
tempHTML=tempHTML.replace('<div class="ub-f1 payred_color text_right ui_p_r15 ulev1" style="padding-top: 0.1rem;">[待支付]</div>','<div class="ub-f1 fontmiddle_color text_right ui_p_r15 ulev1" style="padding-top: 0.1rem;">'+list[i].ORDER_STATUS_info+'</div>');
$('#repalace').addClass('ui_hide');
}
tempHTML=tempHTML.replace(/\[order_id]/g,list[i].ORDER_ID);
tempHTML=tempHTML.replace('[南京]',list[i].PROD_START_STATION_AREA_NAME);
tempHTML=tempHTML.replace('[南通]',list[i].PROD_END_STATION_AREA_NAME);
tempHTML=tempHTML.replace('[出发站点]',list[i].PROD_START_STATION_RES_NAME);
tempHTML=tempHTML.replace('[目的站点]',list[i].PROD_END_STATION_RES_NAME);
tempHTML=tempHTML.replace('[n]',list[i].STAT_NUM);
tempHTML=tempHTML.replace('[8月24日 今天]',list[i].DATE);
tempHTML=tempHTML.replace('[07:45]',list[i].TIME);
newHTML+=tempHTML;
}
$('#wait_pay').html(newHTML);
}




//订单状态的切换和筛选
function selectStatus(selectStatus){
if (selectStatus == 0) {
$('#going').addClass('title_line_selected');
$('#going').removeClass('title_line');
$('#completed').addClass('title_line');
$('#completed').removeClass('title_line_selected');
if (didhasno == 0) {
$('#hasnoinfo').removeClass('ui_hide');
}else{
$('#hasnoinfo').addClass('ui_hide');
}
selectStatus = 0;
var datalist = inglist;
reloadData(datalist,selectStatus);
} else{
$('#completed').addClass('title_line_selected');
$('#completed').removeClass('title_line');
$('#going').addClass('title_line');
$('#going').removeClass('title_line_selected');
if (inghave == 0) {
$('#hasnoinfo').removeClass('ui_hide');
}else{
$('#hasnoinfo').addClass('ui_hide');
}
selectStatus = 1;
var datalist = didlist;
reloadData(datalist,selectStatus);
}
}

//跳转订单详情页面
function goToDetail(order_id,order_status){
window.location.href = './order_detail.html?order_id='+order_id;
}

//跳转支付页面
function goToPay(order_id){
window.location.href = './order_detail.html?order_id='+order_id;
}

//跳转退票
function refundTicket(order_id){
window.location.href = './order_detail.html?order_id='+order_id;
}


//预订
function seeTheOrder(){
window.location.href = './index.html';
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save