<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase2.php');?>
<div class="layui-card">
	<div class="layui-card-body">
		<div style="padding:0 10px 10px 0;">
			<form class="layui-form">
			  <div class="layui-inline">
				<label class="layui-form-label">推广人</label>
				<div class="layui-input-block">
					<input type="text" name="tg_mobile" class="layui-input" value="<?php echo $Params['tg_mobile'];?>">
				</div>
			  </div>
			  <div class="layui-inline">
				<label class="layui-form-label">状态</label>
				<div class="layui-input-block">
					<select name="th_status">
						<option value="">不限</option>
						<?php foreach($statusArr as $k=>$v){?>
						<option value="<?php echo $k;?>"<?php if(isset($Params['th_status']) && $Params['th_status'] === $k) echo ' selected'; ?>><?php echo $v;?></option>
						<?php }?>
					</select>
				</div>
			  </div>
			  <div class="layui-inline">
				<label class="layui-form-label">类型</label>
				<div class="layui-input-block">
					<select name="th_style">
						<option value="">不限</option>
						<?php foreach($styleArr as $k=>$v){?>
							<?php if($k != 'tixian'){?>
							<option value="<?php echo $k;?>"<?php if(isset($Params['th_style']) && $Params['th_style'] === $k) echo ' selected'; ?>><?php echo $v;?></option>
							<?php }?>
						<?php }?>
					</select>
				</div>
			  </div>
			  <div class="layui-inline">
				<label class="layui-form-label">推广说明</label>
				<div class="layui-input-block">
					<input type="text" name="th_txt" class="layui-input" value="<?php echo $Params['th_txt'];?>">
				</div>
			  </div>
			  <div class="layui-inline">
				<label class="layui-form-label">推广时间</label>
				<div class="layui-input-block">
					<input type="text" name="betime" id="betime" class="layui-input" value="<?php echo $Params['betime'];?>" placeholder=" ~ "  autocomplete="off">
				</div>
			  </div>
			  <div class="layui-inline">
				<button class="layui-btn act-btn" type="submit">
				  <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
				</button>
			  </div>
			</form>
		</div>
		<table class="layui-table"  style="width:600px">
			<tr>
			  <th width="120">类型</th>
			  <th>全部</th>
			  <th>通过</th>
			  <th>通过金额</th>
			  <th>待审核</th>
			  <th>待审金额</th>
			  <th>不通过</th>
			</tr>
			<?php foreach($tjArr as $k => $v ){ ?>
			<tr>
				<th><?php if($k == 'total') echo '合计'; else echo $styleArr[$k];?></th>
				<td><?php echo $v['all'];?></td>
				<td><?php echo $v['ok'];?></td>
				<td><?php echo sprintf("%.2f", $v['ok_money']);?></td>
				<td><?php echo $v['wait'];?></td>
				<td><?php echo sprintf("%.2f", $v['wait_money']);?></td>
				<td><?php echo $v['not'];?></td>
			</tr>
			<?php }?>
		</table>
		<table class="layui-table" style="width:1200px">
		  <thead>
			<tr>
			  <th width="115">推广时间</th>
			  <th width="90">推广人</th>
			  <th width="60">状态</th>
			  <th width="50">佣金</th>
			  <th width="120">推广类型</th>
			  <th>推广说明</th>
			  <th width="115">通过时间</th>
			  <th>审核备注</th>
			</tr>
		 </thead>
		 <tbody>
			<?php foreach($lists as $k => $v ){ ?>
			<tr>
				<td><?php echo date('Y-m-d H:i', $v['th_atime']);?></td>
				<td><a href="<?php echo mvc::$cfg['ADMIN_URI'];?>pjl/TgList?tg_mobile=<?php echo $v['tg_mobile'];?>" class="a_blue"><?php echo $v['tg_mobile'];?></a></td>
				<td>
					<a href="<?php echo mvc::$cfg['ADMIN_URI'];?>pjl/TgList?th_status=<?php echo $v['th_status'];?>"  <?php if($v['th_status'] == 1) echo ' class="green"'; else if($v['th_status'] == -1) echo ' class="gray2"'; else echo ' class="red"';?>><?php echo $statusArr[$v['th_status']];?></a>
				</td>
				<td><?php echo sprintf('%.2f', $v['th_money']);?></td>
				<td><a href="<?php echo mvc::$cfg['ADMIN_URI'];?>pjl/TgList?th_style=<?php echo $v['th_style'];?>" class="a_blue"><?php echo $styleArr[$v['th_style']];?></a></td>
				<td><?php echo $v['th_txt'];?></td>
				<td><?php if($v['th_ok_time'] > 0) echo date('Y-m-d H:i', $v['th_ok_time']);?></td>
				<td><?php echo $v['th_remark'];?></td>
			</tr>
			<?php }?>
		  </tbody>
		</table>
		<?php echo $Page;?>
	</div>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
<script>
layui.use(['table', 'form','laydate'], function(){
  var table = layui.table,form = layui.form,laydate = layui.laydate;
	
	laydate.render({
      elem: '#betime'
      ,range: '~'
	  ,max:0
    });
});
</script>