<?php include $this->admin_tpl('meta');?>
<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_log');?>" method="get">
	 <input type="hidden" value="admin" name="m">
	 <input type="hidden" value="admin_log" name="c">
	 <input type="hidden" value="search_log" name="a">
     用户名：<input type="text" name="adminname" placeholder="用户名" style="width:150px" class="input-text" value="<?php if(isset($_GET['adminname'])) echo $_GET['adminname'];?>">
     时 间：<input type="text" class="input-text laydate-icon" style="width:175px;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:175px;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'); ?>">
     模块名：<input type="text" name="module" placeholder="模块名" style="width:170px" class="input-text" value="<?php if(isset($_GET['module'])) echo $_GET['module'];?>"><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_del('<?php echo U('del_log',array('dosubmit'=>1));?>')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 删除一个月之前记录</a></span> <span class="r">共有数据：<strong><?php echo $total?></strong> 条</span> </div>
  <table class="table table-border table-bordered table-bg table-hover table-sort">
    <thead>
      <tr class="text-c">
        <th>ID</th>
		<th>用户名</th>
        <th>模块</th>
        <th>内容</th>
        <th>时间</th>
        <th>IP</th>
      </tr>
    </thead>
    <tbody>
		<?php 
		foreach($data as $val){
		?>
		  <tr class="text-c">
			<td><?php echo $val['id']?></td>
			<td><?php echo $val['adminname']?></td>
			<td><?php echo $val['module']?></td>
			<td><?php echo $val['querystring']?></td>
			<td><?php echo date('Y-m-d H:i:s', $val['logtime'])?></td>
			<td><?php echo $val['ip']?></td>
		  </tr>		
		<?php 
		}
		?>
    </tbody>
  </table>
  <?php if(!$data){ ?><div class="yzm_no_data"><i class="Hui-iconfont">&#xe6e0;</i> 暂无数据</div><?php } ?>
  <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');?>
<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>