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.
 
 
 
 
 

192 lines
9.2 KiB

  1. <?php
  2. require_once './php_include/Config.php';
  3. require_once './php_include/class.db.inc';
  4. require_once './php_include/disney.inc';
  5. $disp_per_page = 10;
  6. if( !isset($_GET["curpage"]) || $_GET["curpage"] < 1 ) {
  7. $_GET["curpage"] = 1;
  8. }
  9. $url_param_array = array();
  10. $extra_sql_array = array();
  11. if( !isset($_GET["search_order_no"]) || mb_strlen($_GET["search_order_no"]) <= 0 ) {
  12. $_GET["search_order_no"] = "";
  13. } else {
  14. $extra_sql_array[] = ' order_serial_no like "%%'.$_GET["search_order_no"].'%%" ';
  15. $url_param_array[] = 'search_order_no='.$_GET["search_order_no"];
  16. }
  17. if( !isset($_GET["search_pay_no"]) || mb_strlen($_GET["search_pay_no"]) <= 0 ) {
  18. $_GET["search_pay_no"] = "";
  19. } else {
  20. $extra_sql_array[] = ' pay_no like "%%'.$_GET["search_pay_no"].'%%" ';
  21. $url_param_array[] = 'search_pay_no='.$_GET["search_pay_no"];
  22. }
  23. if( !isset($_GET["search_org_id"]) || mb_strlen($_GET["search_org_id"]) <= 0 || $_GET["search_org_id"] == "" || $_GET["search_org_id"] < 1) {
  24. $_GET["search_org_id"] = 0;
  25. } else {
  26. $extra_sql_array[] = ' org_id = '.$_GET["search_org_id"].' ';
  27. $url_param_array[] = 'search_org_id='.$_GET["search_org_id"];
  28. }
  29. if( !isset($_GET["search_create_date"]) || mb_strlen($_GET["search_create_date"]) <= 0 ) {
  30. $_GET["search_create_date"] = "";
  31. } else {
  32. $extra_sql_array[] = ' create_time like "%%'.$_GET["search_create_date"].'%%" ';
  33. $url_param_array[] = 'search_create_date='.$_GET["search_create_date"];
  34. }
  35. if( !isset($_GET["search_cus_name"]) || mb_strlen($_GET["search_cus_name"]) <= 0 ) {
  36. $_GET["search_cus_name"] = "";
  37. } else {
  38. $extra_sql_array[] = ' cus_name like "%%'.$_GET["search_cus_name"].'%%" ';
  39. $url_param_array[] = 'cus_name='.$_GET["cus_name"];
  40. }
  41. if( !isset($_GET["search_cus_mobile"]) || mb_strlen($_GET["search_cus_mobile"]) <= 0 ) {
  42. $_GET["search_cus_mobile"] = "";
  43. } else {
  44. $extra_sql_array[] = ' cus_mobile like "%%'.$_GET["search_cus_mobile"].'%%" ';
  45. $url_param_array[] = 'cus_mobile='.$_GET["cus_mobile"];
  46. }
  47. $url_param = count($url_param_array) > 0 ? implode("&",$url_param_array) : 'guid=ON';
  48. $limit = " ORDER BY create_time DESC LIMIT ".(($_GET["curpage"]-1)*$disp_per_page).",".$disp_per_page;
  49. //DB
  50. $objDbh = new Db;
  51. $objDbh->setAccount(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
  52. $objDisney = new DbDisney($objDbh);
  53. $extra_sql = count($extra_sql_array) > 0 ? implode( " AND ", $extra_sql_array ): false;
  54. $order_array = $objDisney->getActiceOrderCommonArray( $extra_sql, $limit );
  55. $all_count = $objDisney->getActiveOrderCommonCount( $extra_sql );
  56. $org_array = $objDisney->getBaseOrgArray();
  57. $org_temp_array = array();
  58. foreach( $org_array as $org_info ) {
  59. $org_temp_array[$org_info["org_id"]] = $org_info;
  60. }
  61. $org_array = $org_temp_array;
  62. $max_page = ceil($all_count/$disp_per_page);
  63. $url_base = $page_name."?".$url_param;
  64. ?>
  65. <html lang="en">
  66. <head>
  67. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  68. <link href="/css/disney/main.css" rel="stylesheet" type="text/css" />
  69. <script language="javascript">
  70. function update_order_comment( order_id, order_serial_no ) {
  71. var comment_id = "comment_" + order_id;
  72. var comment_txt = document.getElementById(comment_id).value;
  73. if (window.ActiveXObject){
  74. var request = new ActiveXObject("Microsoft.XMLHTTP");
  75. }else{
  76. var request = new XMLHttpRequest();
  77. }
  78. var url = "http://xmwx.zhizhuchuxing.cn/update_order_comment.php?odr=" + order_serial_no;
  79. var postData = "";
  80. postData = "odc=" + comment_txt;
  81. request.open("POST", url, true);
  82. request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  83. request.onreadystatechange = function() {
  84. if(request.readyState == 4 && request.status == 200) {
  85. if(request.responseText == '1') {
  86. } else {
  87. alert('备注更新失败');
  88. }
  89. }
  90. }
  91. request.send(postData);
  92. }
  93. </script>
  94. </head>
  95. <body >
  96. <br /><br />
  97. <CENTER>
  98. <span style="font-size:25px;">迪士尼订单汇总</span>
  99. <br /><br />
  100. <br /><br />
  101. <form name="searchform" action="<?php echo $page_name;?>" method="GET">
  102. 订单编号:<input type="text" name="search_order_no" style="width:150px;" value="<?php echo $_GET["search_order_no"];?>" />
  103. 支付单号:<input type="text" name="search_pay_no" style="width:150px;" value="<?php echo $_GET["search_pay_no"];?>" />
  104. 下单日期:<input type="text" name="search_create_date" style="width:100px;" value="<?php echo $_GET["search_create_date"];?>" />
  105. 订单源:<select name="search_org_id">
  106. <?php $selected_tag = $_GET["search_org_id"] == 0 ? 'selected="selected" ' : ''; ?>
  107. <option value ="0" <?php echo $selected_tag;?> >-</option>
  108. <?php
  109. foreach( $org_array as $org_info ) {
  110. $selected_tag = $_GET["search_org_id"] == $org_info["org_id"] ? 'selected="selected" ' : '';
  111. echo '<option value ="'.$org_info["org_id"].'" '.$selected_tag.'>'.$org_info["org_name"].'</option>';
  112. }
  113. ?>
  114. </select>
  115. 用户姓名:<input type="text" name="search_cus_name" style="width:60px;" value="<?php echo $_GET["search_cus_name"];?>" />
  116. 用户手机:<input type="text" name="search_cus_mobile" style="width:100px;" value="<?php echo $_GET["search_cus_mobile"];?>" />
  117. <input type="submit" value="检索" />
  118. </form>
  119. <?php if( $order_array != false && count($order_array) > 0 ) { ?>
  120. <br />
  121. <table border="1">
  122. <tr><td style="width:120px;text-align:center;font-weight:bolder;">订单编号</td><td style="width:180px;text-align:center;font-weight:bolder;">订单内容</td><td style="text-align:center;font-weight:bolder;">订单金额</td><td style="text-align:center;font-weight:bolder;">订单源</td><td style="text-align:center;font-weight:bolder;">下单时间</td><td style="text-align:center;font-weight:bolder;">支付信息</td><td style="text-align:center;font-weight:bolder;">用户信息</td><td style="width:200px;text-align:center;font-weight:bolder;">备注</td></tr>
  123. <?php foreach( $order_array as $order_info ) {
  124. echo '<tr>';
  125. echo '<td>'.$order_info["order_serial_no"].'</td>';
  126. echo '<td>'.$order_info["prod_name"]."<br />";
  127. echo $order_info["start_day"];
  128. if( mb_strlen($order_info["start_time"]) > 0 ) {
  129. echo " ".$order_info["start_time"];
  130. }
  131. if( $order_info["prod_id"] == 1 || $order_info["prod_id"] == 2 || $order_info["prod_id"] == 18 || $order_info["prod_id"] == 16 ) {
  132. echo "-".$order_info["end_day"]." ".$order_info["end_time"];
  133. if( mb_strlen($order_info["start_time2"]) > 0 ) {
  134. echo "<br />".$order_info["start_day2"]." ".$order_info["start_time2"]."-".$order_info["end_day2"]." ".$order_info["end_time2"];
  135. }
  136. }
  137. echo '</td>';
  138. echo '<td>'.$order_info["order_price"].'</td>';
  139. if( isset($org_array[$order_info["org_id"]]) ) {
  140. echo '<td>'.$org_array[$order_info["org_id"]]["org_name"].'</td>';
  141. } else {
  142. echo '<td>-</td>';
  143. }
  144. echo '<td>'.$order_info["create_time"].'</td>';
  145. if( $order_info['is_payed'] == 1 ) {
  146. echo '<td>'.$_ary_pay_type[$order_info['pay_type']].'<br />支付号:'.$order_info["pay_no"] . '</td>';
  147. } else if( $order_info['order_user_id'] > 0 ){
  148. echo '<td>酒店代收现金</td>';
  149. } else {
  150. echo '<td>未支付</td>';
  151. }
  152. echo '<td>'.$order_info["cus_name"].'<br />'.$order_info["cus_mobile"].'<br />'.$order_info["cus_iden"].'</td>';
  153. echo '<td><textarea rows="4" style="width:100%;" id="comment_'.$order_info["id"].'" name="comment_'.$order_info["id"].'" onblur="update_order_comment('.$order_info["id"].', '.$order_info["order_serial_no"].');">'.$order_info["comment"].'</textarea></td>';
  154. echo '</tr>';
  155. } ?>
  156. </table><br /><br />
  157. <?php
  158. //pages
  159. if( $max_page > 1) {
  160. if( $_GET["curpage"] > 1 ) {
  161. echo ' <a href="'.$url_base.'&curpage='.($_GET["curpage"]-1).'">&#60;&#60;</a> ';
  162. }
  163. for( $page_temp = 1; $page_temp <= $max_page; $page_temp++ ) {
  164. if( $page_temp == $_GET["curpage"] ) {
  165. echo ' '.$page_temp.' ';
  166. } else {
  167. echo ' <a href="' . $url_base . '&curpage=' . $page_temp . '">'.$page_temp.'</a> ';
  168. }
  169. }
  170. if( $_GET["curpage"] < $max_page ) {
  171. echo ' <a href="'.$url_base.'&curpage='.($_GET["curpage"]+1).'">&#62;&#62;</a> ';
  172. }
  173. }
  174. ?>
  175. </CENTER>
  176. <?php } else { echo "没有匹配的数据"; } ?>
  177. </body>
  178. </html>