clerk.html
6.57 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
{template 'common/header'}
<script language='javascript' src='{php echo $this->_script_url}jquery.gcjs.js'></script>
<script language='javascript' src='{php echo $this->_script_url}jquery.form.js'></script>
<script language='javascript' src='{php echo $this->_script_url}tooltipbox.js'></script>
<div class="main">
<ul class="nav nav-tabs">
<li class="active"><a href="{php echo $this->createWebUrl('clerk',array('op'=>'list'));}">店员管理</a></li>
<li><a href="{php echo $this->createWebUrl('clerk',array('op'=>'edit'));}">添加店员</a></li>
<li style="display:none"><a href="{php echo $this->createWebUrl('clerk',array('op'=>'clerkcommentlist'));}">店员评分</a></li>
</ul>
<div class="panel panel-info">
<div class="panel-heading">条件</div>
<div class="panel-body">
<form action="./index.php" method="get" class="form-horizontal" role="form">
<input type="hidden" name="c" value="site" />
<input type="hidden" name="a" value="entry" />
<input type="hidden" name="m" value="wn_storex" />
<input type="hidden" name="do" value="clerk" />
<div class="form-group">
<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">身份</label>
<div class="col-sm-9 col-xs-12">
<a href="#" class="btn btn-primary" style="width: 90px">店员</a>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">姓名</label>
<div class="col-xs-12 col-sm-8 col-lg-9">
<input class="form-control" name="realname" type="text" value="{$_GPC['realname']}">
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">手机号</label>
<div class="col-xs-12 col-sm-8 col-lg-9">
<input class="form-control" name="mobile" type="text" value="{$_GPC['mobile']}">
</div>
<div class=" col-xs-12 col-sm-2 col-lg-2">
<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
</div>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body table-responsive">
<table class="table table-hover">
<thead class="navbar-inner">
<tr>
<th style='width:30px' class='with-checkbox'>
<input type="checkbox" class="check_all" />
</th>
<th style='width:100px'>序号</th>
<th style='width:210px'>微信号</th>
<th style='width:150px'>用户名</th>
<th style='width:150px'>真实姓名</th>
<th style='width:150px'>电话</th>
<th style='width:150px'>加入时间</th>
<th style="width:80px;">状态</th>
<th style="width:200px;">操作</th>
</tr>
</thead>
<tbody>
{loop $list $item}
<tr>
<td class="with-checkbox">
<input type="checkbox" name="check" value="{$item['id']}">
</td>
<td>{$item['id']}</td>
<td>{$item['from_user']}</td>
<td>
{if empty($item['username'])}
<span class="label label-danger">未完善</span>
{else}
{$item['username']}
{/if}
</td>
<td>
{if empty($item['realname'])}
<span class="label label-danger">未完善</span>
{else}
{$item['realname']}
{/if}
</td>
<td>
{if empty($item['mobile'])}
<span class="label label-danger">未完善</span>
{else}
{$item['mobile']}
{/if}
</td>
<td>{php echo date('Y-m-d H:i',$item['createtime'])}</td>
<td>
{if $item['status']==1}
<span class='label label-success'>启用</span>
{else}
<span class='label label-default'>禁用</span>
{/if}
</td>
<td>
<a class="btn btn-default " data-toggle="tooltip" data-placement="bottom" href="{php echo $this->createWebUrl('clerk',array('op'=>'edit','id'=>$item['id']))}" title="编辑"><i class="fa fa-edit"></i></a>
{if $item['status']==0}
<a class="btn btn-default" title="显示" href="#" onclick="drop_confirm('您确定要启用此用户吗?', '{php echo $this->createWebUrl('clerk',array('op'=>'status','status'=>1, 'id'=>$item['id']))}');" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-play"></i></a>
{elseif $item['status']==1}
<a class="btn btn-default" title="隐藏" href="#" onclick="drop_confirm('您确定要禁用此用户吗?', '{php echo $this->createWebUrl('clerk',array('op'=>'status','status'=>0, 'id'=>$item['id']))}');" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-stop"></i></a>
{/if}
<a class="btn btn-default" data-toggle="tooltip" data-placement="bottom" href="#" onclick="drop_confirm('您确定要删除吗?', '{php echo $this->createWebUrl('clerk',array('op'=>'delete', 'id'=>$item['id']))}');" title="删除" ><i class="fa fa-times"></i></a>
</td>
</tr>
{/loop}
<tr>
<td colspan="9">
<input type="button" class="btn btn-primary" name="deleteall" value="删除选择的" />
<input type="button" class="btn btn-primary edit_all" name="showall" value="批量启用" />
<input type="button" class="btn btn-primary edit_all" name="hideall" value="批量禁用" />
</td>
</tr>
</tbody>
<input name="token" type="hidden" value="{$_W['token']}" />
</table>
</div>
</div>
{$pager}
</div>
<script>
require(['bootstrap'],function(){
$('.btn').tooltip();
});
$(function(){
$(".check_all").click(function(){
var checked = $(this).get(0).checked;
$(':checkbox').each(function(){this.checked = checked});
});
$(".edit_all").click(function(){
var name = $(this).attr('name');
var check = $("input:checked");
if(check.length < 1){
alert('请选择要操作的记录!');
return false;
}
var id = new Array();
check.each(function(i){
id[i] = $(this).val();
});
$.post("{php echo create_url('site/entry', array('do' => 'clerk','op'=>'showall', 'm' => $_GPC['m']))}", {idArr:id,show_name:name},function(data){
if (data.errno == 0)
{
location.reload();
} else {
alert(data.error);
}
},'json');
});
$("input[name=deleteall]").click(function(){
var check = $("input:checked");
if(check.length<1){
alert('请选择要删除的记录!');
return false;
}
if( confirm("确认要删除选择的记录?")){
var id = new Array();
check.each(function(i){
id[i] = $(this).val();
});
$.post("{php echo create_url('site/entry', array('do' => 'clerk','op'=>'deleteall', 'm' => $_GPC['m']))}", {idArr:id},function(data){
if (data.errno ==0)
{
location.reload();
} else {
alert(data.error);
}
},'json');
}
});
});
</script>
<script>
function drop_confirm(msg, url){
if(confirm(msg)){
window.location = url;
}
}
</script>
{template 'common/footer'}