<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
<title>Management platform</title>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/Public/Admin/images/favicon.ico" >
<LINK rel="Shortcut Icon" href="/Public/Admin/images/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/html5.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="/Public/h-ui_v2.3/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/Public/h-ui_v2.3/skin/default/skin.css" rel="stylesheet" type="text/css" id="skin" />
<link href="/Public/h-ui_v2.3/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Public/static/jquery-2.0.3.min.js"></script>

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->


<!-- 页面header钩子，一般用于加载插件CSS文件和代码 -->
<?php echo hook('pageHeader');?>

</head>
<body>

	<!-- 主体 -->
	

	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> Home <span class="c-gray en">&gt;</span> <?php echo ($meta_title); ?>
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="refresh" ><i class="Hui-iconfont">&#xe68f;</i></a>
		<a class="btn btn-secondary radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:history.go(-1);" title="back" ><i class="Hui-iconfont">&#xe66b;</i></a>
	</nav>

	<?php if(($timeoutNum) > "0"): ?><div class="Huialert Huialert-danger"><i class="Hui-iconfont">&#xe6a6;</i><?php echo ($timeoutNum); ?> overtime orders, please process them as soon as possible！<a class="ml-15" href="<?php echo U('index?order_status=timeout');?>">Click to view>></a> </div><?php endif; ?>
	<div class="pd-20 text-c">
		<div class="text-c">
			<form action="<?php echo U();?>" method="post">
		        Date：
				<input type="text" class="input-text Wdate"  placeholder="from" style="width:120px;" value="<?php echo I('start_date');?>"   name="start_date" > --
    			<input type="text" class="input-text Wdate"  placeholder="to" style="width:120px;" value="<?php echo I('end_date');?>"   name="end_date" >
		        <span class="select-box inline">
			        <select class="select" size="1" name="mch_id">
			          <option value="" selected>select agent</option>
			          <?php if(is_array($mchList)): $i = 0; $__LIST__ = $mchList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($data["id"]); ?>" <?php if(($data["id"]) == $mch_id): ?>selected<?php endif; ?> ><?php echo ($data["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
			        </select>
		        </span>
		        <span class="select-box inline">
			        <select class="select" size="1" name="mac_id">
			          <option value="" selected>select machine</option>
			          <?php if(is_array($macList)): $i = 0; $__LIST__ = $macList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($data["id"]); ?>" <?php if(($data["id"]) == $mac_id): ?>selected<?php endif; ?> ><?php echo ($data["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
			        </select>
		        </span>
		        <span class="select-box inline">
			        <select class="select" size="1" name="order_status">
			          <option value="" selected>order state</option>
			          <?php if(is_array($orderStatus)): $i = 0; $__LIST__ = $orderStatus;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>" <?php if(($key) == $order_status): ?>selected<?php endif; ?> ><?php echo ($data); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
			        </select>
		        </span>
				keyword：
				<input type="text" class="input-text" style="width:180px" placeholder="order no. or mobile" id="keywords" name="keywords" value="<?php echo ($keywords); ?>">
				<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> Search</button>
				<button type="button" class="btn btn-success radius" id="export_selected" style="float: right;" ><i class="Hui-iconfont">&#xe640;</i> Download</button>
			</form>
			<form id="txt_export_selected"action="<?php echo U('txt_export_selected');?>" method="post" target="_blank" style="display:none;">
				<input type="hidden" name="ids" >
			</form>
			
		</div>

		<div class="mt-20">
			<table class="table table-border table-bordered table-hover table-bg ">
				<thead>
					<tr class="text-c">
						<th width="25"><input type="checkbox" name="" value=""></th>
						<th width="50">ID</th>
						<th>No.</th>
						<th>amount</th>
						<!-- <th>会员优惠</th> -->
						<th>machine</th>
						<th>box</th>
						<th>source</th>
						<th>create time</th>
						<th>mobile</th>
						<th class="">wash state</th>
						<th>order state</th>
						<th width="100" class="c-red">operation<br>（cautious）</th>
					</tr>
				</thead>
				<tbody>
					<?php if(is_array($_list)): $i = 0; $__LIST__ = $_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="text-c">
					<td><input class="ids" type="checkbox" name="ids[]" value="<?php echo ($vo["id"]); ?>"></td>
					<td><?php if(($demo) == "1"): echo ($_total-10*($p-1)-$i+1); else: echo ($vo["id"]); endif; ?></td>
					<td><?php echo ($vo["out_trade_no"]); ?><a href="<?php echo U('view',array('id'=>$vo['id']));?>"  class="ml-5" style="text-decoration:none" title="view"><i class="Hui-iconfont">&#xe695;</i></a></td>
					<td><?php echo ($vo["total_fee"]); ?></td>
					<!-- <td><?php echo ($vo["discount"]); ?></td> -->
					<td><?php echo get_machine($vo['mac_id'],'title');?></td>
					<td><?php echo ($vo["box"]); ?></td>
					<td><?php echo get_order_source($vo['source']);?></td>
					<td><?php echo (date('Y-m-d H:i:s',$vo["createtime"])); ?></td>
					<td><?php echo ($vo["mobile"]); ?></td>
					<td class="td-status ">
						<?php switch($vo["wash_status"]): case "1": ?><span class="label label-success radius">washed</span><?php break;?>
						    <?php default: ?><span class="label label-defaunt radius">wating<a href="<?php echo U('setField?model=Order&field=wash_status&val=1&id='.$vo['id']);?>" style="text-decoration:none" class="ml-5 ajax-get-confirm" title="marked as completed"><i class="Hui-iconfont">&#xe615;</i></a></span><?php endswitch;?>
					</td>
					<td>
						<?php echo getOrderStatus($vo['status'],$vo['pay_status'],$vo['yuyue']);?> <?php echo ($vo['status']); ?>
						<?php if(($vo["status"]) == "3"): ?><a href="<?php echo U('sendSms?id='.$vo['id']);?>" style="text-decoration:none" class="ml-5 ajax-get-confirm" title="send fetch code"><i class="Hui-iconfont">&#xe63b;</i></a><?php endif; ?>
					</td>
					<td class="f-14 product-brand-manage">
						<?php if(($vo["pay_status"]) == "1"): if(($vo["status"]) != "10"): ?><a href="<?php echo U('finish?id='.$vo['id']);?>" style="text-decoration:none" class="ml-5 ajax-get-confirm" title="marked as completed"><i class="Hui-iconfont">&#xe615;</i></a>
							<a href="<?php echo U('openBox?id='.$vo['id']);?>" style="text-decoration:none" class="ml-5 ajax-get-confirm" title="open box"><i class="Hui-iconfont">&#xe605;</i></a>
							<a href="<?php echo U('printBarcode?id='.$vo['id']);?>" style="text-decoration:none" class="ml-5 ajax-get-confirm" title="print barcode"><i class="Hui-iconfont">&#xe652;</i></a><?php endif; endif; ?>
						<a target="_blank" class="btn btn-success radius" href="<?php echo U('txt_export',array('id'=>$vo['id']));?>" ><i class="Hui-iconfont">&#xe640;</i> Download</a>
					</td>

				</tr><?php endforeach; endif; else: echo "" ;endif; ?>
				<tr>
					<td colspan="12">Total：<?php echo ($total_fee); ?> THB</td>
				</tr>

				</tbody>
			</table>
		</div>
		<div class="page">
	        <?php echo ($_page); ?>
	    </div>
	</div>


	<!-- /主体 -->
	
	<!-- 底部 -->
	<script type="text/javascript" src="/Public/h-ui_v2.3/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/h-ui_v2.3/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/Public/Common/js/common.js"></script>
<script type="text/javascript">

</script>


<script type="text/javascript" src="/Public/h-ui_v2.3/lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript">
		$(function(){
		    $(".Wdate").click(function(){
		        WdatePicker();
		    });
		});
	</script>

	<script type="text/javascript">
		$(function(){
			$('#export_selected').click(function() {
				var IDs = $('input[name="ids[]"]:checked').map(function(){
					return $(this).val();
				}).get();
				if(IDs.length == 0){
					return;
				}
				$('#txt_export_selected input').val(IDs.join());
				$('#txt_export_selected').submit();
			});
			
		});
	</script>

 <!-- 用于加载js代码 -->
<!-- 页面footer钩子，一般用于加载插件JS文件和JS代码 -->
<?php echo hook('pageFooter', 'widget');?>
<div class="hidden"><!-- 用于加载统计代码等隐藏元素 -->
	
</div>

	<!-- /底部 -->

</body>
</html>