persission.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html>
  3. <head>
  4. <title>分配权限</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  6. <{include file='../public/admin_cssref.html'}>
  7. <style type='text/css'>
  8. #main{width:100%;}
  9. #main table{width:100%;}
  10. #contain{width:1200px;height:300px;margin:0 auto;margin-top:50px;}
  11. li{list-style:none;}
  12. #menu{width:100%;height:50px;display:block;text-align:center;}
  13. #menu li{float:left;}
  14. body{padding:0px;}
  15. .main_left{width:100%;height:100%;}
  16. <!--
  17. .table{margin-bottom:0px;}
  18. .form-actions .table th, .form-actions .table td {text-align: left;}
  19. .radio{padding-left:0px;} .radio .inline{margin-left:0px;} .radio input[type="radio"]{margin-left:0px;}
  20. .form-actions{padding-bottom:0px;}
  21. #extra_info{margin-top:20px;}
  22. .input-xxlarge{width: 430px;}
  23. select{margin-bottom:0px;}
  24. li{list-style:none;}
  25. .table-bordered{margin-bottom:10px;}
  26. -->
  27. </style>
  28. </head>
  29. <body>
  30. <{include file='../public/admin_header.html'}>
  31. <div class="container">
  32. <div class="row">
  33. <{include file='../public/admin_navi.html'}>
  34. <div class="span9">
  35. <div class="page-header">
  36. <h1>分配权限</h1>
  37. </div>
  38. <{if $error}>
  39. <div class="alert alert-error nodisplay"><{$error}></div>
  40. <{/if}>
  41. <{if $info}>
  42. <div class="alert alert-success nodisplay"><{$info}></div>
  43. <{/if}>
  44. <div id='main' class="form-actions">
  45. 给用户<span style="color:red;"><{$username}></span>分配权限:
  46. <form method="post" action="" id="to_persission">
  47. <input type="hidden" name="uname"  value="<{$username}>" />
  48. <table class="table table-bordered" style="margin-top:15px;">
  49. <tr>
  50. <td>
  51. <input type="checkbox" id="all_pro_selectall_checkbox" />
  52. <span style="margin-left:10px;" >全选</span>
  53. </td>
  54. </tr>
  55. <{foreach from=$persission_array item=item key=key}>
  56. <tr>
  57. <td>
  58. <input type="checkbox" name="persision_array[]" value="<{$key}>" onclick="selectmsg(this)" class="select_msg" <{if $my_persission|strpos:"$key" !== false}> checked<{/if}> />
  59. <span style="margin-left:10px;"><{$item}></span>
  60. </td>
  61. </tr>
  62. <{/foreach}>
  63. </table>
  64. <input type="button" value="提交" onclick="ps_toSubmit();" style="width:100px;height:30px;margin-bottom:15px;" />
  65. </form>
  66. </div>
  67. </div>
  68. <script>
  69. $(document).ready(function(){
  70. $('#all_pro_selectall_checkbox').change(function(){
  71. all_pro_selectall_checkbox_change($(this));
  72. });
  73. function all_pro_selectall_checkbox_change(obj){
  74. if(obj.attr('checked')=='checked'){ //如果此勾选框改变为选中
  75. obj.parent().parent().parent().find("input").attr('checked','checked'); // 本表 所有条目都打勾
  76. }else{
  77. obj.parent().parent().parent().find("input").removeAttr('checked'); //本表 所有条目都取消打勾
  78. }
  79. }
  80. });
  81. function selectmsg(){
  82. if($(this).attr("checked") != "checked"){
  83. $("#all_pro_selectall_checkbox").attr("checked",false);
  84. }else if($(":checkbox[checked='checked']").length == $(".select_msg").length){
  85. $("#all_pro_selectall_checkbox").attr("checked",true);
  86. }
  87. }
  88. function ps_toSubmit(){
  89. var n = $("input:checked").length;
  90. if (n == 0 ) {
  91. alert("请选择要分配的权限");
  92. } else {
  93. $('#to_persission').submit();
  94. }
  95. }
  96. </script>
  97. <script>
  98. $('#user_admin').addClass('li_active');
  99. </script>
  100. </div>
  101. </div>
  102. </div>
  103. </body>
  104. </html>