人人商城

group.html 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. {template 'common/header-gw'}
  2. <ol class="breadcrumb">
  3. <li><a href="./?refresh"><i class="fa fa-home"></i></a></li>
  4. <li><a href="{url 'system/welcome'}">系统</a></li>
  5. <li><a href="{url 'user/group'}">用户组</a></li>
  6. <li class="active">{if $do == 'display'}用户组列表{elseif $do == 'post'}{if $id}编辑{else}添加{/if}用户组{/if}</li>
  7. </ol>
  8. <ul class="nav nav-tabs">
  9. <li {if $do == 'display'}class="active"{/if}><a href="{php echo url('user/group/display');}">用户组列表</a></li>
  10. <li {if $do == 'post' && empty($id)}class="active"{/if}><a href="{php echo url('user/group/post');}">添加用户组</a></li>
  11. {if !empty($id)}
  12. <li {if $do == 'post' && !empty($id)}class="active"{/if}><a href="{php echo url('user/group/post', array('id' => $id));}">编辑用户组</a></li>
  13. {/if}
  14. </ul>
  15. {if $do == 'post'}
  16. <div class="clearfix">
  17. <form action="" method="post" class="form-horizontal" role="form" enctype="multipart/form-data" id="form1">
  18. <h5 class="page-header">用户组管理</h5>
  19. <input type="hidden" name="id" value="{$id}" />
  20. <input type="hidden" name="templateid" value="{$template['id']}">
  21. <div class="panel panel-default">
  22. <div class="panel-heading">基本信息</div>
  23. <div class="panel-body table-responsive">
  24. <div class="form-group">
  25. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">名称</label>
  26. <div class="col-sm-10 col-xs-12">
  27. <input type="text" class="form-control" name="name" id="name" value="{$group['name']}" />
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">公众号数量</label>
  32. <div class="col-sm-10 col-xs-12">
  33. <input type="text" class="form-control" name="maxaccount" value="{$group['maxaccount']}" />
  34. <span class="help-block">限制公众号的数量,为0则不允许添加。</span>
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">有效期限</label>
  39. <div class="col-sm-10 col-xs-12">
  40. <div class="input-group">
  41. <input type="text" class="form-control" name="timelimit" value="{$group['timelimit']}" >
  42. <span class="input-group-addon">天</span>
  43. </div>
  44. <span class="help-block">设置用户组的有效期限。0为不限制期限。到期后,该用户下的所有公众号只能使用 "基础服务"</span>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="panel panel-default">
  50. <div class="panel-heading">可使用的公众服务套餐</div>
  51. <div class="panel-body table-responsive">
  52. <table class="table table-hover">
  53. <thead>
  54. <tr>
  55. <th style="width:50px;" class="row-first">选择</th>
  56. <th style="width:120px;">公众服务套餐</th>
  57. <th style="width:400px;">模块权限</th>
  58. <th style="width:400px;">模板权限</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62. {loop $packages $item}
  63. <tr>
  64. <td class="row-first"><input class="modules" type="checkbox" value="{$item['id']}" name="package[]" {if !empty($group['package']) && in_array($item['id'], $group['package'])}checked{/if} /></td>
  65. <td>{$item['name']}</td>
  66. <td style="line-height:25px; white-space:normal;">
  67. <span class="label label-success">系统模块</span>
  68. {loop $item['modules'] $module}
  69. <span class="label label-info">{$module['title']}</span>
  70. {/loop}
  71. </td>
  72. <td style="line-height:25px; white-space:normal;">
  73. <span class="label label-success">微站默认模板</span>
  74. {loop $item['templates'] $template}
  75. <span class="label label-info">{$template['title']}</span>
  76. {/loop}
  77. </td>
  78. </tr>
  79. {/loop}
  80. <tr>
  81. <td class="row-first"><input class="modules" type="checkbox" value="-1" name="package[]" {if !empty($group['package']) && in_array(-1, $group['package'])}checked{/if} /></td>
  82. <td>所有服务</td>
  83. <td style="line-height:25px; white-space:normal;">
  84. <span class="label label-danger">系统所有模块</span>
  85. </td>
  86. <td style="line-height:25px; white-space:normal;">
  87. <span class="label label-danger">系统所有模板</span>
  88. </td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. </div>
  93. </div>
  94. <div class="form-group">
  95. <div class=" col-xs-12 col-sm-10 col-md-10 col-lg-11">
  96. <input name="token" type="hidden" value="{$_W['token']}" />
  97. <input type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交" />
  98. </div>
  99. </div>
  100. </form>
  101. </div>
  102. <script>
  103. $(function(){
  104. $('#form1').submit(function(){
  105. if(!$.trim($('#form1 :text[name="name"]').val())) {
  106. util.message('请填写用户组名称');
  107. return false;
  108. }
  109. /*
  110. if(!$('#form1 :checkbox[name="package[]"]:checked').size()) {
  111. util.message('请使用该会员组可使用的公众服务套餐');
  112. return false;
  113. }
  114. */
  115. return true;
  116. });
  117. });
  118. </script>
  119. {elseif $do == 'display'}
  120. <form action="" method="post">
  121. <div class="panel panel-default">
  122. <div class="panel-body table-responsive">
  123. <table class="table table-hover">
  124. <thead class="navbar-inner">
  125. <tr>
  126. <th style="width:30px;">删?</th>
  127. <th style="width:150px;">名称</th>
  128. <th>公众号数量</th>
  129. <th>有效期限</th>
  130. <th style="min-width:60px;">操作</th>
  131. </tr>
  132. </thead>
  133. <tbody>
  134. {loop $list $item}
  135. <tr>
  136. <td><input type="checkbox" name="delete[]" value="{$item['id']}" /></td>
  137. <td>{$item['name']}</td>
  138. <td>{if empty($item['maxaccount'])}无权限{else}{$item['maxaccount']}{/if}</td>
  139. <td>{if !$item['timelimit']}永久有效{else}{$item['timelimit']}天{/if}</td>
  140. <td><span><a href="{php echo url('user/group/post', array('id' => $item['id']))}">编辑</a></span></td>
  141. </tr>
  142. {/loop}
  143. </tbody>
  144. <tr>
  145. <th></th>
  146. <td>
  147. <input name="token" type="hidden" value="{$_W['token']}" />
  148. <input type="submit" class="btn btn-primary span3" name="submit" value="提交" />
  149. </td>
  150. </tr>
  151. </table>
  152. </div>
  153. </div>
  154. </form>
  155. {/if}
  156. {template 'common/footer-gw'}