 
<?php
require_once('../system/inc.php');
require_once('../system/safe.php');
?>
<!DOCTYPE html>
<html lang="zh-cn">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<title>
							<? echo $system_name?>-订单查询中心		</title>

		<link href="/work/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
		<link href="/work/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet">
		<link href="/work/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">

		<link rel="stylesheet" href="/work/jquery.dtGrid.min.css">

		<link rel="stylesheet" href="/work/jwxh.css?var=1462614701">

		<script src="/work/jquery/1.12.0/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/work/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/Public/js/jquery.dtGrid.v1.1.9/jquery.dtGrid.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/Public/js/jquery.dtGrid.v1.1.9/i18n/zh-cn.js" type="text/javascript" charset="utf-8"></script>

	 
		<style>
			.navbar-fixed-top,
			.navbar-fixed-bottom {
				z-index: 0;
			}
			
			.menu,
			footer {
				background-color: #40cfe8
			}
			
			#login h2,
			.vertical-center .panel-title {
				background-color: #19d8eb
			}
			
			.btn {
				background-color: #2dd9ae!important
			}
			
			.div_url {
				padding-right: 12px;
				padding-left: 12px;
				max-width: 165px
			}
			
			.thumbnail a {
				height: 180px
			}
			
			.alert-danger {
				color: #007e94;
				background-color: #b4eef8;
				border-color: #40d0e8;
				background-image: none
			}
			
			.table > thead > tr:hover, .table > tbody > tr:hover, .table > tfoot > tr:hover, .dt-grid-extra-columns > td > p:hover {
			  background: #40d0e8;
			}
			
		.alert-danger1 {				color: #007e94;
				background-color: #b4eef8;
				border-color: #40d0e8;
				background-image: none
}
        </style>
	</head>

	<body>

		<!--顶部-->
			<header>
				<div class="container-fluid menu">
					<div class="container">
						<div class="row">
							<div class="col-lg-8 col-md-8 col-sm-8 col-xs-6"><h2><?php echo $system_name?>-订单查询中心</h2></div>
							<div class="col-lg-4 col-md-4 col-sm-4 col-xs-6 text-right">
								<div class="top_nav">
									<a href="/" class="" target="_blank">到社区首页</a>								</div>
							</div>
						</div>
					</div>
				</div>
			</header>
		
		<div class="container">
				<!--公告-->
				<div class="alert alert-danger alert-dismissable">
					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
						&times;
					</button> <?php echo $system_cgg?>				</div>
	</div>		
		<!--内容-->
		<div class="container jwxh_main_div">

			<div class="row">
				<div class="col-md-12">
					
					    
							<div class="jwxh_main_div_nav_tabs">
							<div class="tab-content">
							<div class="tab-pane active">
								<!-- 订单列表区开始 -->
								<div class="div_search">
									<form class="form-inline" method="get" role="form">
										<div class="form-group">
											<label class="control-label" for="name">请输入QQ,帐号,关键ID：</label>
											<input type="text" class="form-control" name="key" style="height: 100%; padding: 6px 12px;" id="sokey_word" placeholder="QQ,帐号,订单号">&nbsp;
										</div>
										
										<select class="form-control" style="max-width:220px;" name="sid" id="sokey_goods_id">
										
										
											<option value="0">不限制业务类型,搜索全部</option>
											<?php
						$result = mysql_query('select * from xiaoyewl_shop order by id desc ');
						while($row = mysql_fetch_array($result)){
						?>
 										<option <?PHP if ($_GET['sid'] == $row['id']) { echo "selected" ;}?> value="<?php echo $row['id']?>"><?php echo $row['s_name']?></option>
 					
                                    	<?php
							}
						?>
										
										
																	</select>
										
 										
										<input name="提交"  style="height: 35px;display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 14px;font-weight: 400;line-height: 1.42857143;"   class="btn"   type="submit" value="点击搜索相关订单">
									</form>
								</div>
								<div id="dtGridContainer_orders" class="dt-grid-container" ajax_change_order_status="/index.php?m=home&amp;c=order&amp;a=order_action"> <span>
								  <p style="padding: 5px 0; background-color: white;" class="alert-danger1">系统将列出符合搜索条件的订单,当前数量可能不准确,数据仅供参考,若需准确数量请手动查询实际数量!</p>
								  </span>
								  
								  <? if ($_GET['提交'] == '点击搜索相关订单' and  $_GET['key'] == '') {
								  
								  			alert_href('请输入搜索内容!','/chadan'); 
											
									 		
								  }?>

							  
								  
								  
                                    <table class="dt-grid table table-condensed" id="dt_grid_41b403b3cfc5ed81fecb4900b86238a9" style="">
                                      <thead>
                                        <tr class="dt-grid-headers">
                                          <th class="extra-column visible-xs ">&nbsp;</th>
                                          <th columnno="0" columnid="goods_id" class="dt-grid-header   can-sort" style="text-align: left;"> 商品 </th>
                                          <th columnno="1" columnid="aa" class="dt-grid-header   can-sort" style="text-align: left;"> 订单号 </th>
                                          <th columnno="2" columnid="need_num_0" class="dt-grid-header hidden-xs   can-sort" style="text-align: left;">QQ号 </th>
                                          <th columnno="2" columnid="need_num_0" class="dt-grid-header hidden-xs   can-sort" style="text-align: left;"> 下单数量 </th>
                                          <th columnno="3" columnid="add_time" class="dt-grid-header hidden-xs   can-sort" style="text-align: left;"> 下单日期 </th>
                                          <th columnno="4" columnid="start_num" class="dt-grid-header hidden-xs   can-sort" style="text-align: left;"> 初始数量 </th>
                                          <th columnno="5" columnid="now_num" class="dt-grid-header   can-sort" style="text-align: left;"> 当前数量 </th>
                                          <th columnno="6" columnid="order_state" class="dt-grid-header   can-sort" style="text-align: left;"> 订单状态 </th>
                                        </tr>
                                      </thead>
                                      <tbody>
									  
									  	<?php
						
							 
							 
								if ($_GET['sid'] == '0'){
  									 
									$sql = 'select * from xiaoyewl_order where  oid like "%'.$_GET['key'].'%"  or qq like "%'.$_GET['key'].'%"  or  hyname like "%'.$_GET['key'].'%"   order by id desc , id desc'; 									
 									 $pager = page_handle('page',20,mysql_num_rows(mysql_query($sql)));
									$result = mysql_query($sql.' limit '.$pager[0].','.$pager[1].'');
								}elseif ($_GET['sid'] != '0'){
  										
									$sql = 'select * from xiaoyewl_order where  oid like "%'.$_GET['key'].'%"  and  sid = '.$_GET['sid'].'     or qq like "%'.$_GET['key'].'%"  and  sid = '.$_GET['sid'].'    or hyname like "%'.$_GET['key'].'%"  and  sid = '.$_GET['sid'].'   order by id desc , id desc'; 									
									$pager = page_handle('page',20,@mysql_num_rows(mysql_query($sql)));
									$result = mysql_query($sql.' limit '.$pager[0].','.$pager[1].'');
								}
								 
							 
								
								
							while($row= @mysql_fetch_array($result)){
						
						 $key1=str_replace($_GET['key'],"<font color=red> ".$_GET['key']."</font>",$row['oid']);
						 $qq=str_replace($_GET['key'],"<font color=red> ".$_GET['key']."</font>",$row['qq']);
  							?>
                                        <tr class="dt-grid-row" datano="0">
                                          <td class="extra-column extra-column-event visible-xs " datano="0">&nbsp;</td>
                                          <td datano="0" columnno="0" class="dt-grid-cell  text-left" style=""><? 
		  
		
  $result1 = mysql_query('select * from xiaoyewl_shop where id = "'.$row['sid'].'" ');
  $row1 = mysql_fetch_array($result1);
   $shop_name = $row1['s_name'];
  	 ;
 		
		 echo "<font >".$shop_name ."</font>";
						 
		  
		  ?> </td>
                                          <td datano="0" columnno="1" class="dt-grid-cell  text-left" style="">
										  <?PHP echo $key1?>										   </td>
                                          <td datano="0" columnno="2" class="dt-grid-cell hidden-xs  text-left" style=""><? echo $qq?></td>
                                          <td datano="0" columnno="2" class="dt-grid-cell hidden-xs  text-left" style="">
										  <?PHP echo $row['xd_num']?>										   </td>
                                          <td datano="0" columnno="3" class="dt-grid-cell hidden-xs  text-left" style="">
										  <?PHP echo $row['sj']?>										   </td>
                                          <td datano="0" columnno="4" class="dt-grid-cell hidden-xs  text-left" style="">
										  <?PHP echo $row['cs_num']?>										   </td>
                                          <td datano="0" columnno="5" class="dt-grid-cell  text-left" style="">
										  <?PHP echo $row['dq_num']?>										   </td>
                                          <td datano="0" columnno="6" class="dt-grid-cell  text-left" style="">
										  <?PHP echo $row['zt']?>										   </td>
                                        </tr>
                                        <tr id="dt_grid_41b403b3cfc5ed81fecb4900b86238a9_extra_columns_0" class="dt-grid-extra-columns hidden">
                                          <td datano="0" colspan="9"><p datano="0" columnno="0" class="dt-grid-cell hidden "> 业务类型 : 特快人气 </p>
                                              <p datano="0" columnno="1" class="dt-grid-cell hidden "> 下单参数(1) : 3081662 </p>
                                            <p datano="0" columnno="2" class="dt-grid-cell visible-xs "> 下单数量 : 20000 </p>
                                            <p datano="0" columnno="3" class="dt-grid-cell visible-xs "> 下单日期 : 2016-12-28 19:32:48 </p>
                                            <p datano="0" columnno="4" class="dt-grid-cell visible-xs "> 初始数量 : 2902122 </p>
                                            <p datano="0" columnno="5" class="dt-grid-cell hidden "> 当前数量 : 2922137 </p>
                                            <p datano="0" columnno="6" class="dt-grid-cell hidden "> 订单状态 : 已完成 </p></td>
                                        </tr>

                                        <tr id="dt_grid_41b403b3cfc5ed81fecb4900b86238a9_extra_columns_19" class="dt-grid-extra-columns hidden">
                                          <td datano="19" colspan="9"><p datano="19" columnno="0" class="dt-grid-cell hidden "> 业务类型 : 帐号+数量(QQ厘米秀)(类型) </p>
                                              <p datano="19" columnno="1" class="dt-grid-cell hidden "> 下单参数(1) : 3081662 </p>
                                            <p datano="19" columnno="2" class="dt-grid-cell visible-xs "> 下单数量 : 100 </p>
                                            <p datano="19" columnno="3" class="dt-grid-cell visible-xs "> 下单日期 : 2016-09-01 12:21:57 </p>
                                            <p datano="19" columnno="4" class="dt-grid-cell visible-xs "> 初始数量 : 0 </p>
                                            <p datano="19" columnno="5" class="dt-grid-cell hidden "> 当前数量 : 12950 </p>
                                            <p datano="19" columnno="6" class="dt-grid-cell hidden "> 订单状态 : 已完成 </p></td>
                                        </tr>
												<?php } ?>		
                                      </tbody>
                                    </table>
							 
							  </div>
								 
								<blockquote>&nbsp;	</blockquote>
								<div id="dtGridToolBarContainer_orders" class="dt-grid-toolbar-container">
									
								</div>

							 
								<!-- 订单列表区结束 -->
									
					    </div>
					    
					  </div>
					</div>
					
				</div>
			</div>

		</div>

		<!--底部-->
			<footer class="navbar-fixed-bottom">
				<div class="container">
					<div class="row">
						<div class="col-md-8 col-sm-6 col-xs-6"><span><?php echo $system_copyright ?> </span>
						</div>
						<div style="display:none" class="col-md-4 col-sm-6 col-xs-6 text-right">备案号</div>
					</div>
				</div>
			</footer>

		<div style="display:none;">
			
		</div>
				
</body>
	
</html>