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
<div style="/*max-height: 465px; overflow: scroll*/">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th style="text-align: center">TT</th>
<th style="text-align: center">ID</th>
<th style="text-align: center; min-width: 100px;">Mã Action</th>
<th style="text-align: center">Thời điểm login</th>
<th style="text-align: center">Với tài khoản</th>
<th style="text-align: center">Từ IP</th>
<th style="text-align: center">Kết quả</th>
<th style="text-align: center">Thời điểm logout</th>
<th style="text-align: center">Thời gian sử dụng</th>
<th style="text-align: center">Trạng thái</th>
<th style="text-align: center">Xử lý</th>
</tr>
</thead>
<tbody>
<?php
if(count($listData) > 0):
foreach($listData as $key => $data): ?>
<tr>
<td style="text-align: center"><?php echo ($key+1+$offset); ?></td>
<td style="text-align: center">#<?php echo $data['id']; ?></td>
<td style="text-align: center"><?php echo $data['action']; ?></td>
<td style="text-align: center"><?php echo MyHelper::reFormatDate($data['time_login']); ?></td>
<td><?php echo MyHelper::truncate($data['account_input']); ?></td>
<td><?php echo $data['ip_address']; ?></td>
<td style="text-align: center">
<?php
if($data['result'] == 'SUCCESS'){
echo '<span class="label label-success">'.$data['result'].'</span>';
}else{
echo '<span class="label label-danger">'.$data['result'].'</span>';
}?>
</td>
<td style="text-align: center">
<?php echo MyHelper::reFormatDate($data['time_logout']); ?>
</td>
<td style="text-align: right">
<?php
if($data['duration'] > 0){
echo gmdate("H:i:s", $data['duration']);
}?>
</td>
<td style="text-align: center">
<?php
if($data['duration'] > 0){
echo 'Đã logout';
}else{
if($data['result'] == 'SUCCESS'){
echo '<i class="fa fa-refresh fa-spin bigger-130"></i>';
}elseif($data['result'] == 'FAILED'){
echo 'Login thất bại';
}
}?>
</td>
<td style="text-align: center">
<?php if((time() - strtotime($data['time_login'])) > 15*24*3600): ?>
<a href="<?php echo base_url().'backend/cmsSetting/deleteLogUser/'.$data['id']; ?>"
onclick="return confirm('Bạn có chắc chắn muốn xóa không?')" title="Xóa">
<i class="ace-icon red fa fa-trash-o bigger-130"></i>
</a>
<?php else: echo 'Xóa sau '.(15-(gmdate('d', time()-strtotime($data['time_login'])))).' ngày'; endif;?>
</td>
</tr>
<?php
endforeach;
else:
?>
<tr>
<td colspan="11" style="color: red">Không có dữ liệu nào!</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<!-- /.row -->
<div style="text-align: center;"><?php echo $pagination; ?></div>