You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

195 lines
4.8 KiB

  1. <?php
  2. /*
  3. Author:XM
  4. Compeny:Spiders Travel
  5. */
  6. //$_POST['status']==1?$status="待支付":($_POST['status']==2?$status="已出票":($_POST['status']==3?$status="已完成":($_POST['status']==4?$status="已取消":$status="待支付")));
  7. if($_POST){
  8. $method=$_POST['method'];
  9. if ($method=='exist_ticket'){
  10. $orderid=$_POST['orderid'];
  11. $json=array("order_no"=>1605201515);
  12. $json['line_info']=array(
  13. array(
  14. 'line_code'=>'SHWZ - J01',
  15. 'line_name'=>'(上海 - 乌镇 - 萧山)',
  16. 'start_area'=>'上海(黄埔集散)',
  17. 'end_area'=>'乌镇(西栅牌坊)',
  18. 'tickets'=>array(
  19. array(
  20. 'start_time'=>'2016.05.20 07:00',
  21. 'car_number'=>'00001111',
  22. 'seat'=>'普通',
  23. 'ticket_name'=>'成人',
  24. 'seat_number'=>2,
  25. 'if_print'=>0,
  26. 'if_meal'=>1,
  27. 'if_bounce'=>0,
  28. 'price'=>100
  29. ),
  30. array(
  31. 'start_time'=>'2016.05.20 07:00',
  32. 'car_number'=>'00001111',
  33. 'seat'=>'普通',
  34. 'ticket_name'=>'儿童',
  35. 'seat_number'=>3,
  36. 'if_print'=>0,
  37. 'if_meal'=>0,
  38. 'if_bounce'=>1,
  39. 'price'=>50
  40. )
  41. )
  42. ),
  43. array(
  44. 'line_code'=>'SHWZ - J02',
  45. 'line_name'=>'(上海 - 普陀)',
  46. 'start_area'=>'上海(黄埔集散)',
  47. 'end_area'=>'普陀',
  48. 'tickets'=>array(
  49. array(
  50. 'start_time'=>'2016.05.20 07:00',
  51. 'car_number'=>'1111',
  52. 'seat'=>'普通',
  53. 'ticket_name'=>'成人',
  54. 'seat_number'=>2,
  55. 'if_print'=>0,
  56. 'if_meal'=>0,
  57. 'if_bounce'=>1,
  58. 'price'=>80
  59. ),
  60. array(
  61. 'start_time'=>'2016.05.20 07:00',
  62. 'car_number'=>'1111',
  63. 'seat'=>'普通',
  64. 'ticket_name'=>'儿童',
  65. 'seat_number'=>3,
  66. 'if_print'=>0,
  67. 'if_meal'=>0,
  68. 'if_bounce'=>0,
  69. 'if_ticket_left'=>0,
  70. 'price'=>50
  71. ),
  72. array(
  73. 'start_time'=>'2016.05.20 07:00',
  74. 'car_number'=>'1111',
  75. 'seat'=>'普通',
  76. 'ticket_name'=>'儿童',
  77. 'seat_number'=>4,
  78. 'if_print'=>1,
  79. 'if_meal'=>0,
  80. 'if_bounce'=>0,
  81. 'price'=>50
  82. )
  83. )
  84. ),
  85. array(
  86. 'line_code'=>'SHWZ - J04',
  87. 'line_name'=>'(上海 - 舟山)',
  88. 'start_area'=>'上海(黄埔集散)',
  89. 'end_area'=>'舟山',
  90. 'tickets'=>array(
  91. array(
  92. 'start_time'=>'2016.05.20 07:00',
  93. 'car_number'=>'222',
  94. 'seat'=>'普通',
  95. 'ticket_name'=>'成人',
  96. 'seat_number'=>2,
  97. 'if_print'=>0,
  98. 'if_meal'=>0,
  99. 'if_bounce'=>1,
  100. 'price'=>120
  101. )
  102. )
  103. )
  104. );
  105. }else if($method=='bounce'){
  106. $json=array("errcode"=>0,"errinfo"=>"退票成功");
  107. }else if($method=='meal'){
  108. $json=array("errcode"=>0,"errinfo"=>"改签显示");
  109. $json['line_info']=array(
  110. 'line_code'=>'SHWZ - J04',
  111. 'line_name'=>'(上海 - 舟山)',
  112. 'start_area'=>'上海(黄埔集散)',
  113. 'end_area'=>'舟山',
  114. 'start_time'=>'2016.05.21',
  115. 'departure_station'=>array(
  116. '黄埔集散07:00',
  117. '黄埔集散07:30',
  118. '黄埔集散08:00'
  119. ),
  120. 'destination_station'=>array(
  121. '舟山11:00',
  122. '舟山12:00',
  123. '舟山13:00',
  124. '舟山14:00'
  125. ),
  126. 'seat'=>'普通',
  127. 'ticket_name'=>'成人',
  128. 'price'=>120,
  129. 'in_stock'=>1000,
  130. );
  131. }else if($method=='confirm_meal'){
  132. $json=array("errcode"=>0,"errinfo"=>"改签成功");
  133. }else if($method=='meal_tickets'){
  134. $json=array("errcode"=>0,"errinfo"=>"改签票显示");
  135. $json['line_info']=array(
  136. 'line_code'=>'SHWZ - J04',
  137. 'line_name'=>'(上海 - 舟山)',
  138. 'start_area'=>'上海(黄埔集散)',
  139. 'end_area'=>'舟山',
  140. 'start_time'=>'2016.05.20 07:00',
  141. 'car_number'=>'222',
  142. 'seat'=>'普通',
  143. 'ticket_name'=>'成人',
  144. 'seat_number'=>10,
  145. 'if_print'=>0,
  146. 'if_meal'=>0,
  147. 'if_bounce'=>0,
  148. 'price'=>130
  149. );
  150. }else if($method=='search'){
  151. $json=array("errcode"=>0,"errinfo"=>"查询成功");
  152. $json['line_info']=array(
  153. 'line_code'=>'SHWZ - J04',
  154. 'line_name'=>'(上海 - 舟山)',
  155. 'start_area'=>'上海(黄埔集散)',
  156. 'end_area'=>'舟山',
  157. 'start_time'=>'2016.05.21',
  158. 'departure_station'=>array(
  159. '黄埔集散07:00',
  160. '黄埔集散07:30',
  161. '黄埔集散08:00'
  162. ),
  163. 'destination_station'=>array(
  164. '舟山11:00',
  165. '舟山12:00',
  166. '舟山13:00',
  167. '舟山14:00'
  168. ),
  169. 'seat'=>'普通',
  170. 'ticket_name'=>'成人',
  171. 'price'=>120,
  172. 'in_stock'=>100,
  173. );
  174. }
  175. }
  176. //$json=array("errcode"=>0,"errinfo"=>"success");
  177. echo json_encode($json);