manage.html
4.05 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{template 'common/header'}
<ul class="nav nav-tabs">
<li {if $_GPC['isshow'] == 0} class="active"{/if}><a href="{php echo $this->createWebUrl('manage', array('id' => $id, 'isshow' => 0))}">待审核</a></li>
<li {if $_GPC['isshow'] == 1} class="active"{/if}><a href="{php echo $this->createWebUrl('manage', array('id' => $id, 'isshow' => 1))}">已审核</a></li>
</ul>
<div class="panel panel-default">
<div class="panel-heading">
{if $_GPC['isshow'] == 0}待审核{/if}
{if $_GPC['isshow'] == 1}已审核{/if}
</div>
<div class="panel-body table-responsive">
<div class="main" id="table-list">
<form action="" method="post" onsubmit="">
<table class="table table-hover">
<thead class="navbar-inner">
<tr>
<th style="width:5%;">选择</th>
<th style="width:10%;">用户</th>
<th style="width:15%;">昵称</th>
<th style="width:30%;">消息</th>
<th style="width:20%;">时间</th>
<th style="width:20%;"></th>
</tr>
</thead>
<tbody>
{loop $list $row}
<tr>
<td>
<input type="checkbox" name="select[]" class="checkbox" value="{$row['id']}" />
</td>
<td>
{if empty($row['avatar'])}
<img width="50" src="{php echo tomedia('images/global/noavatar_middle.gif');}" />
{else}
<img width="50" src="{php echo tomedia($row['avatar']);}" />
{/if}
</td>
<td>{$row['nickname']}</td>
<td>{$row['content']}</td>
<td>
{php echo date('Y-m-d H:i:s', $row[createtime]);}
</td>
<td>
{if empty($row['isblacklist'])}
<a class="btn btn-primary" href="{php echo $this->createWebUrl('blacklist', array('id' => $id, 'isshow'=>$isshow, 'from_user' => $row['from_user'], 'switch' => 1))}">添加黑名单</a>
{else}
<a class="btn btn-danger" href="{php echo $this->createWebUrl('blacklist', array('id' => $id, 'isshow'=>$isshow, 'from_user' => $row['from_user'], 'switch' => 0))}">移除黑名单</a>
{/if}
</td>
</tr>
{/loop}
</tbody>
</table>
{if !empty($list)}
<table class="table">
<tr>
<td style="width:50px;" class="row-first">
<input type="checkbox" onclick="selectAll(this);" /></td>
<td colspan="4">
{if $_GPC['isshow'] == 0}
<input type="submit" name="verify" value="审核" class="btn btn-primary" />
{/if}
<input type="submit" name="delete" value="删除" class="btn btn-primary" />
<input type="hidden" name="token" value="{$_W['token']}" />
</td>
</tr>
</table>
{/if}
{$pager}
</form>
</div>
</div>
</div>
<script type="text/javascript">
// 全选操作
function selectAll(obj){
$('.checkbox').prop('checked', $(obj).prop('checked'));
}
require(['jquery'], function($){
//详细数据相关操作
var tdIndex;
$("#table-list thead").delegate("th", "mouseover", function(){
if($(this).find("i").hasClass("")) {
$("#table-list thead th").each(function() {
if($(this).find("i").hasClass("icon-sort")) $(this).find("i").attr("class", "");
});
$("#table-list thead th").eq($(this).index()).find("i").addClass("icon-sort");
}
});
$("#table-list thead th").click(function() {
if($(this).find("i").length>0) {
var a = $(this).find("i");
if(a.hasClass("icon-sort") || a.hasClass("icon-caret-up")) { //递减排序
/*
数据处理代码位置
*/
$("#table-list thead th i").attr("class", "");
a.addClass("icon-caret-down");
} else if(a.hasClass("icon-caret-down")) { //递增排序
/*
数据处理代码位置
*/
$("#table-list thead th i").attr("class", "");
a.addClass("icon-caret-up");
}
$("#table-list thead th,#table-list tbody:eq(0) td").removeClass("row-hover");
$(this).addClass("row-hover");
tdIndex = $(this).index();
$("#table-list tbody:eq(0) tr").each(function() {
$(this).find("td").eq(tdIndex).addClass("row-hover");
});
}
});
});
</script>
{template 'common/footer'}