人人商城

solution.html 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. {template 'common/header'}
  2. {if $do == 'operator'}
  3. <div class="form-horizontal form">
  4. <h4>设置可操作用户</h4>
  5. <div class="search" style="padding:0px;padding-bottom:15px;">
  6. <form action="site.php" method="get">
  7. <input type="hidden" name="act" value="solution" />
  8. <input type="hidden" name="do" value="operator" />
  9. <input type="hidden" name="name" value="{$_GPC['module']}" />
  10. <table class="table table-bordered tb">
  11. <tr>
  12. <th>用户名</th>
  13. <td><input class="span6" name="username" id="" type="text" value="{$_GPC['username']}"></td>
  14. </tr>
  15. <tr class="search-submit">
  16. <td colspan="2"><button class="btn btn-default pull-right"><i class="fa fa-search fa-lg"></i> 搜索</button></td>
  17. </tr>
  18. </table>
  19. </form>
  20. </div>
  21. <table class="table table-hover">
  22. <thead class="navbar-inner">
  23. <tr>
  24. <th class="col-xm-2">用户名</th>
  25. <th style="text-align:right;">操作</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. {loop $members $m}
  30. <tr>
  31. <td>{$m['username']}</td>
  32. <td style="text-align:right;">
  33. <a href="{php echo url('member/edit', array('id' => $m['uid']));}">编辑用户</a>&nbsp;|&nbsp;<a href="{php echo url('site/solution/menu', array('module' => $_GPC['module'], 'memberid' => $m['uid']));}">设置权限</a>
  34. </td>
  35. </tr>
  36. {/loop}
  37. </tbody>
  38. </table>
  39. {$pager}
  40. </div>
  41. {elseif $do=='menu'}
  42. <form class="form-horizontal form" action="" method="post" enctype="multipart/form-data">
  43. <div class="main">
  44. <input type="hidden" name="act" value="{$action}" />
  45. <input type="hidden" name="op" value="post" />
  46. <input type="hidden" name="do" value="menu" />
  47. <input type="hidden" name="name" value="{$_GPC['module']}" />
  48. <input type="hidden" name="uid" value="{$member['uid']}" />
  49. <h4>用户管理</h4>
  50. <table class="tb">
  51. <tr>
  52. <th><label for="">管理员名称</label></th>
  53. <td>
  54. <input type="text" class="span4" id="name" value="{$member['username']}" readonly="readonly"/>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td colspan="2">
  59. <div class="sub-item" id="table-list">
  60. <h4 class="sub-title">权限设置</h4>
  61. <div class="sub-content">
  62. <table class="table table-hover">
  63. <thead class="navbar-inner">
  64. <tr>
  65. <th style="width:40px;" class="row-first">选择</th>
  66. <th>导航标题</th>
  67. <th>链接地址</th>
  68. </tr>
  69. </thead>
  70. <tbody>
  71. {loop $allmenus $menu}
  72. <tr>
  73. <td class="row-first">
  74. <input type="hidden" name="eid[]" value="{$menu['eid']}" />
  75. <input type="hidden" name="state[]" value="{$menu['state']}" />
  76. <input type="hidden" name="doname[]" value="{$menu['do']}" />
  77. <input type="hidden" name="title[]" value="{$menu['title']}" />
  78. <input type="hidden" name="check[]" {if !empty($menu['eid']) && !empty($menus[$menu['eid']]['enable'])} value="true"{elseif $menus[$menu['state']]['enable']} value="true"{/if} />
  79. <input class="modules check" type="checkbox" {if !empty($menu['eid']) && !empty($menus[$menu['eid']]['enable'])} checked{elseif $menus[$menu['state']]['enable']} checked{/if} />
  80. </td>
  81. <td>{$menu['title']}</td>
  82. <td><a href="{$menu['url']}" target="_blank">{php echo str_replace('&','&amp;', $menu['url']);}</a></td>
  83. </tr>
  84. {/loop}
  85. </tbody>
  86. </table>
  87. </div>
  88. </div>
  89. </td>
  90. </tr>
  91. <tr>
  92. <th></th>
  93. <td>
  94. <input name="token" type="hidden" value="{$_W['token']}" />
  95. <input type="submit" class="btn btn-primary" name="submit" value="提交" />
  96. </td>
  97. </tr>
  98. </table>
  99. </div>
  100. </form>
  101. <script type="text/javascript">
  102. <!--
  103. $('.check').click(function(){
  104. $(this).parent().find("input[name='check[]']").val($(this).attr('checked') == 'checked');
  105. });
  106. //-->
  107. </script>
  108. {elseif $do == 'management'}
  109. <div id="global-bg">
  110. <div id="global" class="img-rounded">
  111. <div id="header">
  112. <div class="logo pull-left" {if !empty($_W['setting']['copyright']['blogo'])}style="background:url('{$_W['setting']['copyright']['blogo']}') no-repeat;"{/if}>{if !empty($_W['setting']['copyright']['sitename'])}{$_W['setting']['copyright']['sitename']}{/if}</div>
  113. <!-- 导航 -->
  114. <div class="hnav clearfix">
  115. <div class="row-fluid">
  116. <ul class="hnav-main text-center unstyled pull-left" style="width:55%;">
  117. {if $_W['isfounder']}
  118. <li class="hnav-parent"><a href="{php echo url('account/permission', array('id' => $_W['weid'], 'module' => $modulename, 'reference' => 'solution'))}" target="main">设置操作用户</a></li>
  119. <li class="hnav-parent"><a href="https://mp.weixin.qq.com/" target="main">参数设置</a></li>
  120. {/if}
  121. <li class="hnav-parent"><a href="https://mp.weixin.qq.com/" target="main">公众平台</a></li>
  122. </ul>
  123. <!-- 右侧管理菜单 -->
  124. <ul class="hnav-manage text-center unstyled pull-right">
  125. <li class="hnav-parent" id="wechatpanel">
  126. <a href="javascript:;"><i class="fa fa-chevron-down fa-lg"></i><span id="current-account">{if $_W['account']}{$_W['account']['name']}{else}请切换公众号{/if}</span></a>
  127. <ul class="hnav-child unstyled text-left">
  128. {php $i = 1;}
  129. {loop $wechats $account}
  130. <li><a href="{php echo url('account/switch', array('id' => $account['weid']))}" onclick="return ajaxopen(this.href, function(s) {switchHandler(s)})">{$account['name']}</a></li>
  131. {if $i >= 10}
  132. <li style="background:#4f525b;"><a href="{php echo url('account/display')}" target="main">点击查看更多</a></li>
  133. {php break;}
  134. {/if}
  135. {php $i++;}
  136. {/loop}
  137. </ul>
  138. </li>
  139. <li class="hnav-parent"><a href=""><i class="fa fa-user fa-lg"></i>{$_W['username']}</a></li>
  140. <li class="hnav-parent"><a href="{php echo url('member/logout')}"><i class="icon-signout icon-large"></i>退出</a></li>
  141. </ul>
  142. <!-- end -->
  143. </div>
  144. </div>
  145. <!-- end -->
  146. </div>
  147. <!-- 头部 end -->
  148. <div class="content-main">
  149. <table width="100%" height="100%" cellspacing="0" cellpadding="0" id="frametable">
  150. <tbody>
  151. <tr>
  152. <td valign="top" height="100%" class="content-left" style="padding-top:0px;">
  153. <div class="sidebar-nav" style="">
  154. <ul class="snav unstyled">
  155. {loop $menus $item}
  156. <li class="snav-list"><a href="{$item[1]}" target="{if $item[2]}_blank{else}main{/if}">{$item[0]}<i class="arrow fa fa-caret-right"></i></a>{if !empty($item['childItems'])}<a href="{$item['childItems'][1]}" target="main" class="snav-small">{$item['childItems'][0]}</a>{/if}</li>
  157. {/loop}
  158. </ul>
  159. </div>
  160. </td>
  161. <td valign="top" height="100%" class="content-right" style=""><iframe width="100%" scrolling="yes" height="100%" frameborder="0" style="min-width:800px; overflow:visible; height:100%; background:#FFF;" name="main" id="main" src="{$iframe}"></iframe></td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <script type="text/javascript">
  170. function max(a) {
  171. var b = a[0];
  172. for(var i=1;i<a.length;i++){ if(b<a[i])b=a[i]; }
  173. return b;
  174. }
  175. function switchHandler(s) {
  176. var mainurl = window.frames['main'].location;
  177. if (window.frames['main'].location.href.indexOf('global') > -1) {
  178. window.top.location.href = '?do=profile';
  179. }
  180. window.top.location.href = '?do=profile';
  181. $('#current-account').html(s);
  182. }
  183. function strlen(str) {
  184. var n = 0;
  185. for(i=0;i<str.length;i++){
  186. var leg=str.charCodeAt(i);
  187. n+=1;
  188. }
  189. return n;
  190. }
  191. function leftScrollbar(e) {
  192. $('.content-left').mCustomScrollbar({
  193. theme:"dark-thin",
  194. autoHideScrollbar:true,
  195. scrollButtons:{
  196. enable:true
  197. },
  198. advanced:{
  199. updateOnBrowserResize:true,
  200. updateOnContentResize:true,
  201. autoScrollOnFocus:false
  202. },
  203. scrollInertia:150
  204. });
  205. }
  206. $(document).ready(function() {
  207. $(".hnav").delegate(".hnav-parent", "mouseout", function(){
  208. $(".hnav-child").hide();
  209. });
  210. //左侧导航
  211. //初始化第一条显示
  212. $(".sidebar-nav .snav").eq(0).find(".snav-header").addClass("open");
  213. $(".sidebar-nav .snav").eq(0).find(".snav-list").addClass("open");
  214. $(".sidebar-nav").delegate(".snav-header", "click", function(){
  215. var a = $(this).hasClass("open");
  216. $(".sidebar-nav .snav .snav-header").removeClass("open");
  217. $(".sidebar-nav .snav .snav-list").addClass("hide");
  218. if(a) {
  219. $(this).removeClass("open");
  220. $(this).parent().find(".snav-list").each(function(i) {
  221. $(this).addClass("hide");
  222. });
  223. } else {
  224. $(this).addClass("open");
  225. $(this).parent().find(".snav-list").each(function(i) {
  226. $(this).removeClass("hide");
  227. });
  228. }
  229. //右侧菜单滚动控制
  230. var b = "#" + $(this).parent().attr("id");
  231. $('.content-left').mCustomScrollbar("update");
  232. $('.content-left').mCustomScrollbar("scrollTo", b);
  233. return false;
  234. });
  235. $(".sidebar-nav .snav").each(function() {
  236. if($(this).find(".snav-header").hasClass("open")) {
  237. $(this).find(".snav-list").each(function() {
  238. $(this).toggleClass("hide");
  239. });
  240. }
  241. $(this).find(".snav-list").each(function() {
  242. if($(this).hasClass("current")) {
  243. $(this).parent().find(".snav-header").toggleClass("open");
  244. $(this).parent().find(".snav-list").each(function() {
  245. $(this).toggleClass("hide");
  246. });
  247. }
  248. });
  249. $(this).find(".snav-list a,.snav-header-list a").click(function() {
  250. $(".snav-list,.snav-header-list").removeClass("current");
  251. $(this).parent().addClass("current");
  252. if ($(this).attr('target') == '_blank') {
  253. return true;
  254. } else {
  255. window.frames['main'].location.href= $(this).attr("href");
  256. }
  257. return false;
  258. });
  259. });
  260. });
  261. $(function() {
  262. //调整框架宽高 兼容ie8
  263. $(".content-main, .content-main .content-right").height($(window).height()-40-20);
  264. $(".content-main .content-left").height($(window).height()-40-20-40);
  265. $("#main").width($(window).width()-200-20);
  266. //右侧菜单滚动控制
  267. leftScrollbar();
  268. });
  269. $(window).resize(function(){
  270. //调整框架宽高 兼容ie8
  271. $(".content-main, .content-main .content-right").height($(window).height()-40-20);
  272. $(".content-main .content-left").height($(window).height()-40-20-40);
  273. $("#main").width($(window).width()-200-20);
  274. });
  275. </script>
  276. {/if}