<?php include $this->admin_tpl('meta','admin');?>
<title>留言管理 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 模块管理 <span class="c-gray en">&gt;</span> 留言管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
  <div> 
		<form action="<?php echo U('search');?>" method="get">
		  <span class="select-box inline">
		 	<select name="ischeck" class="select">
		 		<option value="99">审核状态</option>
		 		<option <?php if(isset($_GET["ischeck"]) && $_GET["ischeck"]=='0'){echo "selected";} ?> value="0">未审核</option>
		 		<option <?php if(isset($_GET["ischeck"]) && $_GET["ischeck"]=='1'){echo "selected";} ?> value="1">已审核</option>
		 	</select>
		 </span>
		 <span class="select-box inline">
		 	<select name="isread" class="select">
		 		<option value="99">阅读状态</option>
		 		<option <?php if(isset($_GET["isread"]) && $_GET["isread"]=='0'){echo "selected";} ?> value="0">未读</option>
		 		<option <?php if(isset($_GET["isread"]) && $_GET["isread"]=='1'){echo "selected";} ?> value="1">已读</option>
		 	</select>
		 </span>
		 <span class="select-box inline">
			<select name="type" class="select">
				<option <?php if(isset($_GET["type"]) && $_GET["type"]=='1'){echo "selected";} ?> value="1">留言主题</option>
				<option <?php if(isset($_GET["type"]) && $_GET["type"]=='2'){echo "selected";} ?> value="2">联系人</option>		
			</select>
		</span>
		 <input type="text" name="searinfo"  class="input-text" style="width:170px" value="<?php if(isset($_GET['searinfo'])) echo $_GET['searinfo'];?>"><button name="dosubmit" class="btn btn-success" type="submit" value="1"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
		</form>	
  </div>

	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="l"><a href="javascript:;" onclick="yzm_dels('id')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a></span>
	</div>
	<form method="post" action="<?php echo U('del');?>" id="myform">
	<table class="table table-border table-bordered table-bg table-hover yzm-table-sort">
		<thead>
			<tr class="text-c">
				<th width="35"><input type="checkbox"></th>
				<th width="50">ID<?php echo field_order('id');?></th>
				<th style="text-align:left">留言主题</th>
				<th width="200" style="text-align:left">联系人</th>
				<th width="100">IP地址<?php echo field_order('ip');?></th>
				<th width="150">留言日期<?php echo field_order('booktime');?></th>
				<th width="70">状态<?php echo field_order('isread');?></th>
				<th width="70">审核<?php echo field_order('ischeck');?></th>	
			</tr>
		</thead>
		<tbody>
			<?php 
			   foreach($data as $val){
			 ?>
			<tr class="text-c">
				<td><input type="checkbox" value="<?php echo $val['id']?>" name="id[]"></td>
				<td><?php echo $val['id']?></td>
				<td style="text-align:left"><a href="javascript:;" onclick="yzm_open_full('查看留言','<?php echo U('read',array('id'=>$val['id']));?>')" ><?php echo $val['title'];?></a> <span class="yzmcms_small"><?php echo $val['ispc'] ? '<i class="Hui-iconfont" title="来自PC端">&#xe64f;</i>' : '<i class="Hui-iconfont" title="来自移动端">&#xe696;</i>';?></span></td>
				<td style="text-align:left"><?php echo $val['name'];?></td>
				<td><?php echo $val['ip'];?></td>
				<td><?php echo date('Y-m-d H:i:s',$val['booktime']);?></td>
				<td><?php echo $val['isread'] ? '已读' : '<span class="c-red">未读</span>'; ?></td>
				<td>
					<?php if($val['ischeck']){ ?>
					<span class="yzm-status-enable" data-field="ischeck" data-id="<?php echo $val['id']?>" onclick="yzm_change_status(this,'<?php echo U('toggle');?>')"><i class="yzm-iconfont">&#xe81f;</i>是</span>
					<?php }else{ ?>
					<span class="yzm-status-disable" data-field="ischeck" data-id="<?php echo $val['id']?>" onclick="yzm_change_status(this,'<?php echo U('toggle');?>')"><i class="yzm-iconfont">&#xe601;</i>否</span>
					<?php } ?>
				</td>
			</tr>
			<?php 
			   }		 
			?>	
		</tbody>
	</table>
	<?php if(!$data){ ?><div class="yzm_no_data"><i class="Hui-iconfont">&#xe6e0;</i> 暂无数据</div><?php } ?>
	</form>
	<div id="page"><span class="page_left">共<?php echo $total?>条记录，共<?php echo $page->total()?>页，当前显示第<?php echo $page->getpage()?>页</span>
  <span class="page_right"><?php echo $page->getfull();?></span></div>
</div>
<?php include $this->admin_tpl('footer','admin');?>
</body>
</html>