<?php 
	$this->display(tpl('head',true));
?>
<style>
	.layui-table thead tr th{
		text-align: center;
	}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  	<legend>广告列表</legend>
</fieldset>
<table class="layui-table" cellspacing="0" cellpadding="0" border="0"  lay-filter="demoEvent">
	<thead>
		<tr>
			<th width="40">Id</th>
			<th>广告位名称</th>
			<th width="100">广告类型</th>
			<th width="130">操作</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach($data AS $row) { 
			if($row['ad_type']=="images"){
				$row['ad_type']="图片类型";
			}elseif($row['ad_type']=="text"){
				$row['ad_type']="文字类型";
			}else{
				$row['ad_type']="代码类型";
			}
		?>
			
		<tr>
			<td align="center"><?php echo $row['id'] ?></td>
			<td><?php echo $row['name'] ?></td>
			<td align="center"><?php echo $row['ad_type'] ?></td>
			<td align="center">
				<a class="layui-btn layui-btn-sm layui-btn-warm" href="<?php echo PLUGIN_ACTION ?>index/buy/tag/<?php echo $row['tag'] ?>">购买</a>
			</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<div class="page">
	<?php echo $Get_Page ?>
</div>
<?php 
	$this->display(tpl('foot',true));
?>
