<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase2.php');?>
<style>
	.layui-input-block {
		margin-left: 70px;
	}
	.layui-form-label {
		width: 50px;
		padding: 9px;
	}
</style>
<div class="layui-card">
	<div class="layui-card-body">
		<div style="padding:0 10px 10px 0;">
			<form class="layui-form">
				<div class="layui-inline w150">
					<label class="layui-form-label">广告位</label>
					<div class="layui-input-block">
						<select class="layui-input" name="pa_id" lay-search>
							<option value="">--所有--</option>
							<?php if (!empty($place)) { ?>
								<?php foreach($place as $id => $name){?>
									<option value="<?php echo $id;?>"<?php if($id == $Params['pa_id']) echo ' selected';?>><?php echo $name;?></option>
								<?php }?>
							<?php } ?>

						</select>
					</div>
				</div>

			  <div class="layui-inline w200">
				<label class="layui-form-label">品牌</label>
				<div class="layui-input-block">
					<select class="layui-input" name="ard_word" lay-search>
						<option value="">--所有--</option>
						<?php if (!empty($brand)) { ?>
							<?php foreach($brand as $id => $name){?>
						         <option value="<?php echo $id;?>"<?php if($id == $Params['ard_word']) echo ' selected';?>><?php echo $name;?></option>
						<?php }?>
						<?php } ?>
						
				   </select>
				</div>
			  </div>

			  <div class="layui-inline w150">
				<label class="layui-form-label">省份</label>
				<div class="layui-input-block">
					<select class="layui-input" name="ard_pct_id" lay-search>
						<option value="">--所有--</option>
						<?php if (!empty($address)) { ?>
							<?php foreach($address as $id => $name){?>
						         <option value="<?php echo $id;?>"<?php if(is_numeric($Params['ard_pct_id']) && $id == $Params['ard_pct_id']) echo ' selected';?>><?php echo $name;?></option>
						<?php }?>
						<?php } ?>
						
				   </select>
				</div>
			  </div>
			  <div class="layui-inline">
			  	<label class="layui-form-label">车辆类型</label>
				<div class="layui-input-block">
					<input type="radio" name="ard_modtype" value="" <?php if(!$Params['ard_modtype']) echo ' checked';?> title="所有">
					<input type="radio" name="ard_modtype" <?php if('cv' == $Params['ard_modtype']) echo ' checked';?> value='cv' title="乘用车">
					<input type="radio" name="ard_modtype" <?php if('pc' == $Params['ard_modtype']) echo ' checked';?> value='pc' title="商用车">
				</div>
			  </div>

			  <div class="layui-inline" style="width: 215px;">
				<label class="layui-form-label">时间选择</label>
				<div class="layui-input-block">
					<input type="text"  autocomplete="off" name="ard_date" id="betime" class="layui-input" value="<?php echo $Params['ard_date'];?>" placeholder=" ~ ">
				</div>
			  </div>

			  <div class="layui-inline">
				<label class="layui-form-label">按省</label>
				  <div class="layui-input-block">
					  <input type="checkbox" name="grouppct" <?php if($Params['grouppct'] == 'on') echo "checked='checked'" ?> lay-skin="switch" lay-text="ON|OFF">
				  </div>
			  </div>

			  <div class="layui-inline">
				<label class="layui-form-label">按品牌</label>
				  <div class="layui-input-block">
					  <input type="checkbox" name="groupmake" <?php if($Params['groupmake'] == 'on') echo "checked='checked'" ?> lay-skin="switch" lay-text="ON|OFF">
				  </div>
			  </div>

			  <div class="layui-inline">
				<label class="layui-form-label">按广告位</label>
				  <div class="layui-input-block">
					  <input type="checkbox" name="grouppa" <?php if($Params['grouppa'] == 'on') echo "checked='checked'" ?> lay-skin="switch" lay-text="ON|OFF">
				  </div>
			  </div>
			  <div class="layui-inline">
				<label class="layui-form-label">按时间</label>
				  <div class="layui-input-block">
					  <input type="checkbox" name="groupdate" <?php if($Params['groupdate'] == 'on') echo "checked='checked'" ?> lay-skin="switch" lay-text="ON|OFF">
				  </div>
			  </div>
			  <div class="layui-inline">
				<label class="layui-form-label">按类型</label>
				  <div class="layui-input-block">
					  <input type="checkbox" name="groupmodtype" <?php if($Params['groupmodtype'] == 'on') echo "checked='checked'" ?> lay-skin="switch" lay-text="ON|OFF">
				  </div>
			  </div>
			 &nbsp; &nbsp; &nbsp;
			  <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 YpTable" style="width:550px;">
		  <thead class="Filter Sortable">
			<tr>
			    <th class="Sort" width="100px"><span>广告位</span></th>
			    <th class="Sort" width="60px" sort="float"><span>年月</span></th>
				<th class="Sort" width="80px"><span>地区</span></th>
				<th class="Sort" width="80px"><span>品牌</span></th>
				<th class="Sort" width="80px"><span>类型</span></th>
				<th class="Sort" width="60px" sort="float"><span>展现数</span></th>
				<th class="Sort" width="60px" sort="float"><span>点击数</span></th>
			    <th class="Sort" width="60px" sort="float"><span>点击率</span></th>
			</tr>
			<tr class="filter-tr">
				<td><input type="text" class="FilterTxt layui-input"></td>
				<td><input type="text" class="FilterTxt layui-input"></td>
				<td><input type="text" class="FilterTxt layui-input"></td>
				<td><input type="text" class="FilterTxt layui-input"></td>
				<td><input type="text" class="FilterTxt layui-input"></td>
				<td><input type="text" class="FilterTxt layui-input"></td>
				<td><input type="text" class="FilterTxt layui-input"></td>
				<td><input type="text" class="FilterTxt layui-input"></td>
			</tr>
		  </thead>
		  <tbody>
		     <?php $i = 0; ?>
			<?php foreach($list as $index => $v){?>
			<tr>
			    <td><?php echo $v['pa_name']; ?></td>
				<td><?php echo empty($Params['groupdate'])? '': $v['ard_date'];?></td>
				<td><?php echo empty($Params['grouppct'])? '': $address[$v['ard_pct_id']];?></td>
				<td><?php echo empty($Params['groupmake'])? '': $brand[$v['ard_word']];?></td>
				<td><?php echo empty($Params['groupmodtype'])? '': $modtype[$v['ard_modtype']];?></td>
				<td><?php echo $v['ard_show'] ?></td>
				<td><?php echo $v['ard_click']; ?></td>
				<td><?php echo (number_format($v['ard_click'] / $v['ard_show'],4)*100).'%'; ?></td>
			</tr>
			<?php }?>
		  </tbody>
		</table>
		<?php echo $page;?>
	</div>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
<script>
layui.use(['table', 'laydate','form'], function(){
  var table = layui.table,laydate = layui.laydate,form = layui.form;
	laydate.render({
      elem: '#betime'
      ,range: '~'
      ,type:'month' 
    });
	form.render()
});
</script>
