<?php include $this->admin_tpl('meta', 'admin');?>
<title>消息管理 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="yzm-iconfont yzm-iconai-home"></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="yzm-iconfont yzm-iconshuaxin"></i></a></nav>
<div class="page-container">
  <div> 
    <form action="<?php echo U('search');?>" method="get" id="search">
	 <input type="hidden" value="<?php echo ROUTE_M;?>" name="m">
	 <input type="hidden" value="<?php echo ROUTE_C;?>" name="c">
	 <input type="hidden" value="search" name="a">
     时间：<input type="text" class="input-text laydate-icon" style="width:170px;height:30px;" id="start" name="start" <?php if(isset($_GET['start']) && $_GET['start'] != '') echo 'value="'.$_GET['start'].'"'; ?>>
     至 <input type="text" class="input-text laydate-icon" style="width:170px;height:30px;" id="end" name="end" value="<?php if(isset($_GET['end']) &&  $_GET['end'] != '') echo $_GET['end']; else echo date('Y-m-d H:i:s'); ?>">
     <span class="select-box inline">
		<select name="isread" class="select">
			<option value="99">阅读状态</option>
			<option value="1" <?php if(isset($_GET['isread']) && $_GET['isread']=='1'){?> selected <?php }?>>已读</option>
			<option value="0" <?php if(isset($_GET['isread']) && $_GET['isread']=='0'){?> selected <?php }?>>未读</option>
		</select>
	 </span>
	 <span class="select-box inline">
	 	<select name="type" class="select">
	 	<option <?php if(isset($_GET['type']) && $_GET['type']=='1'){?> selected <?php }?> value="1">收件人</option>
	 	<option <?php if(isset($_GET['type']) && $_GET['type']=='2'){?> selected <?php }?> value="2">发件人</option>	
	 	<option <?php if(isset($_GET['type']) && $_GET['type']=='3'){?> selected <?php }?> value="3">消息标题</option>	
	 	<option <?php if(isset($_GET['type']) && $_GET['type']=='4'){?> selected <?php }?> value="4">消息内容</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 btn-search" type="submit" value="1"><i class="yzm-iconfont yzm-iconsousuo"></i> 搜索</button>
      <a href="<?php echo U('init');?>" class="btn btn-primary radius"><i class="yzm-iconfont yzm-iconshuaxin"></i> 重置</a>
	 </form>	
  </div>
  <div class="cl mt-15 tb-top"> <span class="l">
  <a href="javascript:;" onclick="yzm_open('发送消息','<?php echo U('add');?>','550','350')" class="btn btn-primary radius"><i class="yzm-iconfont yzm-icontianjia"></i> 发送消息</a>
  <a href="javascript:;" onclick="yzm_dels('ids')" class="btn btn-danger radius"><i class="yzm-iconfont yzm-iconshanchu2"></i> 批量删除</a> 
  </span> <span class="r">共有数据：<strong><?php echo $total?></strong> 条</span> </div>
  <form method="post" action="<?php echo U('del');?>" id="myform">
  <table class="table table-border table-bg table-hover">
    <thead>
      <tr class="text-c">
        <th width="25"><input type="checkbox"></th>
				<th>消息标题</th>
				<th>消息内容</th>
				<th width="100">发件人</th>
				<th width="100">收件人</th>
				<th width="50">状态</th>
				<th width="80">时间</th>
      </tr>
    </thead>
    <tbody>
		<?php 
		foreach($data as $val){
		?>
		  <tr class="text-c">
			<td><input type="checkbox" value="<?php echo $val['messageid']?>" name="ids[]"></td>
			<td><?php echo $val['subject']?></td>
			<td><?php echo $val['content']?></td>
			<td><?php echo $val['send_from']?></td>
			<td><?php echo $val['send_to']?></td>
			<td><?php echo $val['isread'] ? '<span class="label label-success radius">已读</span>' : '<span class="label label-danger radius">未读</span>';?></td>
			<td><?php echo date("Y-m-d",$val['message_time'])?><br><?php echo date("H:i:s",$val['message_time'])?></td>
		  </tr>		
		<?php 
		}
		?>
    </tbody>
  </table>
  <?php if(!$data){ ?><div class="yzm_no_data"><i class="yzm-iconfont yzm-iconshuoming"></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');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/laydate/1.1/laydate.js"></script>
<script type="text/javascript">
	var start = {elem:'#start',format:'YYYY-MM-DD hh:mm:ss',min:'1999-01-01',max:'2099-01-01',istime:true,istoday:false,choose:function(datas){end.min = datas;end.start = datas}
	};
	var end = {elem:'#end',format:'YYYY-MM-DD hh:mm:ss',min:'1999-01-01',max:'2099-01-01',istime:true,istoday:false,choose:function(datas){start.max = datas;}};
	laydate(start);
	laydate(end);
</script>

</body>
</html>