<?php if (!defined('ROOT')) exit; ?>
<!DOCTYPE html>
<html>

	<head>
		<?php include 'Inc_files.php';?>
		<link rel="stylesheet" type="text/css" href="/static/Member/css/style.css" />
		<link rel="stylesheet" type="text/css" href="/static/Member/css/index.css" />
	</head>
	<body>
		<?php include 'Inc_header.php';?>
			
		<dl class="container" id="content">
			<dd class="row clearfix">
				<?php include 'Inc_menu.php';?>
				<div class="col-sm-10 col-md-10 column">
					<div id="right">
						<div class="title">
							<span>订单列表</span>
							<!--<input type="text" class="fr" name="search" id="search" />-->
						</div>
						<div class="caozuo">
							<!--<button><a href="/member/cash/add">新增</a></button>-->
							<button>删除</button>

							<div class="fr">
								<select name="type">
									<option value="0">请选择分类</option>
									<?php 
										foreach($type as $k => $v){
									?>
										<option value="<?php echo $k?>" <?php if($k == I('type')){ echo 'selected="selected"'; }?>><?php echo $v;?></option>
									<?php 		
										}
									?>
								</select>
								<input type="text" name="name" id="no" value="<?php echo I('no')?>" placeholder="请输入订单号" />
								<button id="search">搜索</button>
							</div>

						</div>

						<table cellspacing="0" cellpadding="0" width="100%">
							<col style="width: 50px" />
							<col style="width: 100px" />
							<col style="" />
							<col style="" />
							<col style="" />
							<col style="" />
							<col style="width: 120px" />
							<tr>
								<th><input type="checkbox" name="all" id="all" /></th>
								<th>ID</th>
								<th>订单号</th>
								<th>金额</th>
								<th>插件名称</th>
								<th>地址</th>
								<th>提现时间</th>
								<th>操作</th>
							</tr>
							<?php
								foreach($list as &$v){
							?>
							<tr> 
								<td><input type="checkbox" /></td>
								<td><?php echo $v["id"]?></td>
								<td><?php echo $v["order_no"]?></td>
								<td><?php echo $v["amount"]?></td>
								<td><?php echo $v["name"]?></td>
								<td><?php echo $v["url"]?></td>
								<td><?php echo date("Y-m-d H:i:s",$v["ctime"])?></td>
								<td>
									<button>编辑</button>
									<button>删除</button>
								</td>
							</tr>

							<?php
								}
							?>
						</table>
					</div>
				</div>
			</dd>
		</dl>

		<?php include 'Inc_boot.php';?>
		<script type="text/javascript">
			jQuery(document).on('click','#search',function () {
				var type = jQuery("select[name=type] option:selected").val();
				var no = jQuery("#no").val();
				if(type > 0 && no != ''){
					location.href = "/member/chajian/lists/no/" + no + "/type/" + type;   
				}else if(type > 0 && no == ''){
					location.href = "/member/chajian/lists/type/" + type;   
				}else if(type == 0 && no != ''){
					location.href = "/member/chajian/lists/no/" + no;   
				}else if(type == 0 && no == ''){
					location.href = "/member/chajian/lists";   
				}
				          
			})
		</script>
	</body>

</html>