<?php include $this->admin_tpl('meta');?>
<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_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'); ?>">
     <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">操作IP</option>	
 		<option <?php if(isset($_GET['type']) && $_GET['type']=='3'){?> selected <?php }?> value="3">内容</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_del('<?php echo U('del_log',array('dosubmit'=>1));?>')" class="btn btn-danger radius"><i class="yzm-iconfont yzm-iconshanchu2"></i> 删除一个月之前记录</a></span> <span class="r">共有数据：<strong><?php echo $total?></strong> 条</span> </div>
  <table class="table table-border 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 htmlspecialchars(urldecode($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="yzm-iconfont yzm-iconshuoming"></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>