<?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('admin_login_log_list');?>" method="get">
			<input type="hidden" value="admin" name="m">
			<input type="hidden" value="admin_log" name="c">
			<input type="hidden" value="admin_login_log_list" name="a">
			登录时间：<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="loginresult" class="select">
				<option value="99">登录结果</option>
				<option <?php if(isset($_GET['loginresult']) && $_GET['loginresult']=='0'){?> selected <?php }?> value="0">登录失败</option>
				<option <?php if(isset($_GET['loginresult']) && $_GET['loginresult']=='1'){?> selected <?php }?> value="1">登录成功</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">登录IP</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('admin_login_log_list');?>" 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_login_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>登录时间</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 htmlspecialchars($val['adminname']); ?></td>
			<td><?php echo $val['loginresult'] ? '登录成功' : '<span style="color:red;">登录失败</span>'; ?></td>
			<td><?php echo $val['cause']; ?></td>
			<td><?php echo $val['password'] ? htmlspecialchars($val['password']) : '***'; ?></td>
			<td><?php echo date('Y-m-d H:i:s', $val['logintime']); ?></td>
			<td><?php echo $val['loginip']; ?></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>