noticemanage.html
3.8 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
{php $newUI = true;}
{template 'common/header'}
{if $op == 'post'}
<div classs="clearfix">
<form action="" class="form-horizontal form" method="post" enctype="multipart/form-data" id="form1">
<input type="hidden" name="id" value="{$notice['id']}"/>
<div class="panel panel-default">
<div class="panel-heading">发布通知</div>
<div class="panel-body">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">标题</label>
<div class="col-sm-9 col-xs-12">
<input type="text" class="form-control" name="title" value="{$notice['title']}"/>
<div class="help-block">不超过30个字符</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">通知图片</label>
<div class="col-sm-9 col-xs-12">
{php echo tpl_form_field_image('thumb', $notice['thumb']);}
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">通知会员组</label>
<div class="col-sm-9 col-xs-12">
<label class="radio-inline">
<input type="radio" name="groupid" value="0" {if !$notice['groupid']}checked{/if}/> 全部会员
</label>
{loop $_W['account']['groups'] $group}
<label class="radio-inline">
<input type="radio" name="groupid" value="{$group['groupid']}" {if $notice['groupid'] == $group['groupid']}checked{/if}/> {$group['title']}
</label>
{/loop}
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">通知内容</label>
<div class="col-sm-9 col-xs-12">
{php echo tpl_ueditor('content', $notice['content']);}
</div>
</div>
</div>
</div>
<div class="form-group" style="margin-left:0px">
<input type="hidden" name="token" value="{$_W['token']}"/>
<input type="submit" name="submit" value="提交" class="btn btn-primary"/>
</div>
</form>
</div>
<script>
$(function(){
$('#form1').submit(function(){
if(!$.trim($(':text[name="title"]').val())) {
util.message('通知标题不能为空', '', 'error');
return false;
}
});
});
</script>
{else if $op == 'list'}
<div class="clearfix">
<form action="" method="post" class="form-horizontal" role="form">
<div class="form-group">
<div class="col-sm-8 col-lg-9 col-xs-12">
<a href="{php echo $this->createWeburl('noticemanage', array('op' => 'post'));}" class="btn btn-success"><i class="fa fa-plus"></i> 发布通知</a>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>标题</th>
<th>通知会员组</th>
<th>添加时间</th>
<th class="text-right">操作</th>
</tr>
</thead>
<tbody>
{loop $notices $notice}
<tr>
<td>
{if !empty($notice['thumb'])}
<img src="{php echo tomedia($notice['thumb']);}" alt="" width="40" border="1"/>
{/if}
{$notice['title']}
</td>
<td>
{if !$notice['groupid']}
<span class="label label-success">全部会员</span>
{else}
<span class="label label-danger">{$_W['account']['groups'][$notice['groupid']]['title']}</span>
{/if}
</td>
<td>{php echo date('Y-m-d H:i', $notice['addtime']);}</td>
<td class="text-right">
<a href="{php echo $this->createWeburl('noticemanage', array('op' => 'post', 'id' => $notice['id']));}" class="btn btn-default">编辑</a>
<a href="{php echo $this->createWeburl('noticemanage', array('op' => 'del', 'id' => $notice['id']));}" onclick="if(!confirm('确定删除吗')) return false;" class="btn btn-default">删除</a>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
{$pager}
</form>
</div>
{/if}
{template 'common/footer'}