|
- <?php
- require_once './php_include/Config.php';
- require_once './php_include/class.db.inc';
- require_once './php_include/disney.inc';
-
- $disp_per_page = 10;
-
- if( !isset($_GET["curpage"]) || $_GET["curpage"] < 1 ) {
- $_GET["curpage"] = 1;
- }
- $url_param_array = array();
- $extra_sql_array = array();
- if( !isset($_GET["search_order_no"]) || mb_strlen($_GET["search_order_no"]) <= 0 ) {
- $_GET["search_order_no"] = "";
- } else {
- $extra_sql_array[] = ' order_serial_no like "%%'.$_GET["search_order_no"].'%%" ';
- $url_param_array[] = 'search_order_no='.$_GET["search_order_no"];
- }
- if( !isset($_GET["search_pay_no"]) || mb_strlen($_GET["search_pay_no"]) <= 0 ) {
- $_GET["search_pay_no"] = "";
- } else {
- $extra_sql_array[] = ' pay_no like "%%'.$_GET["search_pay_no"].'%%" ';
- $url_param_array[] = 'search_pay_no='.$_GET["search_pay_no"];
- }
- if( !isset($_GET["search_org_id"]) || mb_strlen($_GET["search_org_id"]) <= 0 || $_GET["search_org_id"] == "" || $_GET["search_org_id"] < 1) {
- $_GET["search_org_id"] = 0;
- } else {
- $extra_sql_array[] = ' org_id = '.$_GET["search_org_id"].' ';
- $url_param_array[] = 'search_org_id='.$_GET["search_org_id"];
- }
- if( !isset($_GET["search_create_date"]) || mb_strlen($_GET["search_create_date"]) <= 0 ) {
- $_GET["search_create_date"] = "";
- } else {
- $extra_sql_array[] = ' create_time like "%%'.$_GET["search_create_date"].'%%" ';
- $url_param_array[] = 'search_create_date='.$_GET["search_create_date"];
- }
-
- if( !isset($_GET["search_cus_name"]) || mb_strlen($_GET["search_cus_name"]) <= 0 ) {
- $_GET["search_cus_name"] = "";
- } else {
- $extra_sql_array[] = ' cus_name like "%%'.$_GET["search_cus_name"].'%%" ';
- $url_param_array[] = 'cus_name='.$_GET["cus_name"];
- }
- if( !isset($_GET["search_cus_mobile"]) || mb_strlen($_GET["search_cus_mobile"]) <= 0 ) {
- $_GET["search_cus_mobile"] = "";
- } else {
- $extra_sql_array[] = ' cus_mobile like "%%'.$_GET["search_cus_mobile"].'%%" ';
- $url_param_array[] = 'cus_mobile='.$_GET["cus_mobile"];
- }
- $url_param = count($url_param_array) > 0 ? implode("&",$url_param_array) : 'guid=ON';
-
-
- $limit = " ORDER BY create_time DESC LIMIT ".(($_GET["curpage"]-1)*$disp_per_page).",".$disp_per_page;
- //DB
- $objDbh = new Db;
- $objDbh->setAccount(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
- $objDisney = new DbDisney($objDbh);
- $extra_sql = count($extra_sql_array) > 0 ? implode( " AND ", $extra_sql_array ): false;
- $order_array = $objDisney->getActiceOrderCommonArray( $extra_sql, $limit );
- $all_count = $objDisney->getActiveOrderCommonCount( $extra_sql );
- $org_array = $objDisney->getBaseOrgArray();
- $org_temp_array = array();
- foreach( $org_array as $org_info ) {
- $org_temp_array[$org_info["org_id"]] = $org_info;
- }
- $org_array = $org_temp_array;
- $max_page = ceil($all_count/$disp_per_page);
-
- $url_base = $page_name."?".$url_param;
- ?>
-
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link href="/css/disney/main.css" rel="stylesheet" type="text/css" />
- <script language="javascript">
- function update_order_comment( order_id, order_serial_no ) {
- var comment_id = "comment_" + order_id;
- var comment_txt = document.getElementById(comment_id).value;
- if (window.ActiveXObject){
- var request = new ActiveXObject("Microsoft.XMLHTTP");
- }else{
- var request = new XMLHttpRequest();
- }
- var url = "http://wx.zhizhuchuxing.com/update_order_comment.php?odr=" + order_serial_no;
- var postData = "";
- postData = "odc=" + comment_txt;
- request.open("POST", url, true);
- request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- request.onreadystatechange = function() {
- if(request.readyState == 4 && request.status == 200) {
- if(request.responseText == '1') {
- } else {
- alert('备注更新失败');
- }
- }
- }
- request.send(postData);
- }
- </script>
- </head>
- <body >
- <br /><br />
- <CENTER>
- <span style="font-size:25px;">迪士尼订单汇总</span>
- <br /><br />
- <br /><br />
- <form name="searchform" action="<?php echo $page_name;?>" method="GET">
- 订单编号:<input type="text" name="search_order_no" style="width:150px;" value="<?php echo $_GET["search_order_no"];?>" />
- 支付单号:<input type="text" name="search_pay_no" style="width:150px;" value="<?php echo $_GET["search_pay_no"];?>" />
- 下单日期:<input type="text" name="search_create_date" style="width:100px;" value="<?php echo $_GET["search_create_date"];?>" />
- 订单源:<select name="search_org_id">
- <?php $selected_tag = $_GET["search_org_id"] == 0 ? 'selected="selected" ' : ''; ?>
- <option value ="0" <?php echo $selected_tag;?> >-</option>
- <?php
- foreach( $org_array as $org_info ) {
- $selected_tag = $_GET["search_org_id"] == $org_info["org_id"] ? 'selected="selected" ' : '';
- echo '<option value ="'.$org_info["org_id"].'" '.$selected_tag.'>'.$org_info["org_name"].'</option>';
- }
- ?>
- </select>
- 用户姓名:<input type="text" name="search_cus_name" style="width:60px;" value="<?php echo $_GET["search_cus_name"];?>" />
- 用户手机:<input type="text" name="search_cus_mobile" style="width:100px;" value="<?php echo $_GET["search_cus_mobile"];?>" />
- <input type="submit" value="检索" />
- </form>
-
-
- <?php if( $order_array != false && count($order_array) > 0 ) { ?>
- <br />
- <table border="1">
- <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>
- <?php foreach( $order_array as $order_info ) {
- echo '<tr>';
- echo '<td>'.$order_info["order_serial_no"].'</td>';
- echo '<td>'.$order_info["prod_name"]."<br />";
- echo $order_info["start_day"];
- if( mb_strlen($order_info["start_time"]) > 0 ) {
- echo " ".$order_info["start_time"];
- }
- if( $order_info["prod_id"] == 1 || $order_info["prod_id"] == 2 || $order_info["prod_id"] == 18 || $order_info["prod_id"] == 16 ) {
- echo "-".$order_info["end_day"]." ".$order_info["end_time"];
- if( mb_strlen($order_info["start_time2"]) > 0 ) {
- echo "<br />".$order_info["start_day2"]." ".$order_info["start_time2"]."-".$order_info["end_day2"]." ".$order_info["end_time2"];
- }
- }
- echo '</td>';
- echo '<td>'.$order_info["order_price"].'</td>';
- if( isset($org_array[$order_info["org_id"]]) ) {
- echo '<td>'.$org_array[$order_info["org_id"]]["org_name"].'</td>';
- } else {
- echo '<td>-</td>';
- }
- echo '<td>'.$order_info["create_time"].'</td>';
- if( $order_info['is_payed'] == 1 ) {
- echo '<td>'.$_ary_pay_type[$order_info['pay_type']].'<br />支付号:'.$order_info["pay_no"] . '</td>';
- } else if( $order_info['order_user_id'] > 0 ){
- echo '<td>酒店代收现金</td>';
- } else {
- echo '<td>未支付</td>';
- }
- echo '<td>'.$order_info["cus_name"].'<br />'.$order_info["cus_mobile"].'<br />'.$order_info["cus_iden"].'</td>';
- 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>';
- echo '</tr>';
- } ?>
- </table><br /><br />
- <?php
- //pages
- if( $max_page > 1) {
- if( $_GET["curpage"] > 1 ) {
- echo ' <a href="'.$url_base.'&curpage='.($_GET["curpage"]-1).'"><<</a> ';
- }
- for( $page_temp = 1; $page_temp <= $max_page; $page_temp++ ) {
- if( $page_temp == $_GET["curpage"] ) {
- echo ' '.$page_temp.' ';
- } else {
- echo ' <a href="' . $url_base . '&curpage=' . $page_temp . '">'.$page_temp.'</a> ';
- }
- }
- if( $_GET["curpage"] < $max_page ) {
- echo ' <a href="'.$url_base.'&curpage='.($_GET["curpage"]+1).'">>></a> ';
- }
- }
- ?>
- </CENTER>
-
- <?php } else { echo "没有匹配的数据"; } ?>
- </body>
- </html>
-
-
|