index.php
5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
use yii\helpers\Url;
use app\ht\widgets\LinkPager;
$this->title = "管理日志";
$this->params['breadcrumbs'][] = '系统管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="panel panel-default">
<div class="panel-body">
<form action="" method="get" id="search-form" class="filter-form">
<table width="100%" class="table table-bordered">
<tbody>
<tr >
<td width="10%" class="text-right">操作人员:</td>
<td width="10%" class="text-left">
<select class="form-control" name="user_id">
<option value="0">全部</option>
<?php foreach ($sysUser as $item): ?>
<?php if(isset($item->id)) {?>
<option value="<?php echo $item->id ?>" <?php if ($gets['user_id'] == $item->id) { echo "selected"; } ?>><?php echo isset($item->username)?$item->username:'' ?></option>
<?php }?>
<?php endforeach; ?>
</select>
</td>
<td width="10%" class="text-right">开始时间:</td>
<td width="20%" class="text-left"><input type="date" class="form-control" name="time_start" value="<?php if (!empty($gets['time_start'])){ echo $gets['time_start']; } ?>"></td>
<td width="10%" class="text-right">结束时间:</td>
<td width="20%" class="text-left"><input type="date" class="form-control" name="time_end" value="<?php if (!empty($gets['time_end'])){ echo $gets['time_end']; } ?>"></td>
</tr>
<tr >
<td class="text-right">操作路由:</td>
<td class="text-left"><input type="text" class="form-control" name="route" value="<?php if (!empty($gets['route'])){ echo $gets['route']; } ?>"></td>
<td class="text-right">操作描述:</td>
<td class="text-left"><input type="text" class="form-control" name="description" value="<?php if (!empty($gets['description'])){ echo $gets['description']; } ?>"></td>
<td class="text-right">IP地址:</td>
<td class="text-left"><input type="text" class="form-control" name="ip" value="<?php if (!empty($gets['ip'])){ echo $gets['ip']; } ?>"></td>
</tr>
<tr class="search">
<td colspan="6" class="text-center">
<button type="submit" class="btn btn-primary btncls" id="search"><i class="glyphicon glyphicon-search"></i> 查 询 </button>
<a class="btn btn-default btncls" href="<?=Url::toRoute("/system/admin-log/index")?>">重 置</a>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-striped table-bordered" id="brand-table">
<thead>
<tr>
<th width="6%">ID</th>
<th width="10%">操作员</th>
<th width="20%">访问路由</th>
<th width="40%">操作描述</th>
<th width="8%">IP地址</th>
<th width="8%">创建时间</th>
<th width="8%">更新时间</th>
</tr>
</thead>
<tbody>
<?php foreach ($adminLog as $log) : ?>
<tr>
<td style="padding:12px;">
<?= $log['id'] ?>
</td>
<td style="padding:12px;">
<?= $log['username'] . '(' . $log['realname'] . ')' ?>
</td>
<td style="padding:12px;">
<?php
$route = $log['route'];
$route = preg_replace('/(.*)\?{1}([^\?]*)/i', '$1', $route);
?>
<div><a title="<?= $log['route'] ?>"><?= $route ?></a></div>
</td>
<td style="padding:12px;">
<?= $log['description'] ?>
</td>
<td style="padding:12px;">
<?= $log['ip'] ?>
</td>
<td style="padding:12px;">
<?= date("Y-m-d H:i:s",$log['created_at']) ?>
</td>
<td style="padding:12px;">
<?= date("Y-m-d H:i:s",$log['updated_at']) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="panel-footer">
<div class="hqy-panel-pager">
<?= LinkPager::widget([
'pagination' => $pages,
]); ?>
<div class="clearfix"></div>
</div>
</div>
</div>