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.
 
 
 
 
 
 

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