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
129
<!DOCTYPE html>
<html lang="en">
<include file="Public:header" />
<include file="Public:page_css" />
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<include file="Public:nav" />
<div class="row">
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-12">
<h2>数据管理</h2>
<ol class="breadcrumb">
<li>
<a href="{:U('Index/index')}"><i class="fa fa-home"></i> 主页</a>
</li>
<li>
<a>数据管理</a>
</li>
<li>
<strong>数据列表</strong>
</li>
</ol>
</div>
</div>
<br />
</div>
<div class="row">
<div class="col-sm-12">
<div class="col-sm-1">
<div class="input-group">
<a href="{:U('Persona/persona_add')}" class="btn btn-primary">添加数据</a>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5><i class="fa fa-tasks"></i> 人物志数据列表</h5>
</div>
<div class="ibox-content">
<form>
<table class="table table-bordered">
<thead>
<tr class="long-tr">
<th>ID</th>
<th>列表图片</th>
<th>时间</th>
<th>类型</th>
<th>是否首页推荐</th>
<th width="20%">操作</th>
</tr>
</thead>
<tbody>
<foreach name="personaList" item="v">
<tr class="long-td">
<td>{$v.id}</td>
<td><img src="__ROOT__{$v.path}" alt="" style="width:100px;height:70px"></td>
<td>{$v.time}</td>
<td>
<if condition='$v[type] eq 1'>
人物志
<else/>
团队志
</if>
</td>
<td> <if condition='$v[is_hot] eq 1'>
<a class="red" href="javascript:;" onclick="return stateyes({$v.id});" title="是">
<div id="zt{$v.id}"><span class="label label-info">是</span></div>
</a>
<else/>
<a class="red" href="javascript:;" onclick="return stateyes({$v.id});" title="否">
<div id="zt{$v.id}"><span class="label label-danger">否</span></div>
</a>
</if>
</td>
<td>
<a href="{:U('persona_edit',array('id'=>$v['id']))}" class="btn btn-primary"><i class="fa fa-paste"></i> 编辑</a>
<a onclick="return del({$v.id});" href="javascript:;" class="btn btn-danger demo1">
<i class="fa fa-trash-o"></i> 删除</a>
</td>
</tr>
</foreach>
</tbody>
</table>
</form>
<div class="pages" style=" text-align: right;">
{$page}
</div>
</div>
</div>
</div>
</div>
<script>
function del(id){
layer.confirm('你确定要删除吗?', {icon: 3}, function(index){
layer.close(index);
window.location.href="__URL__/persona_del/id/"+id+"";
});
}
function stateyes(val){
$.post('{:U("persona_state")}',
{x:val},
function(data){
var $v=val;
if(data.status){
if(data.info=='否'){
var a='<span class="label label-danger">否</span>'
$('#zt'+val).html(a);
return false;
}else{
var b='<span class="label label-info">是</span>'
$('#zt'+val).html(b);
return false;
}
}
});
return false;
}
</script>
<include file="Public:footer" />
</body>
</html>