admingroup_add.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * 添加管理员组【弹窗页面】
  4. *
  5. * @createtime 2018/03/01
  6. * @author 空竹
  7. * @copyright 芝麻开发(http://www.zhimawork.com)
  8. */
  9. require_once('admin_init.php');
  10. require_once('admincheck.php');
  11. $POWERID = '9001';//权限
  12. Admin::checkAuth($POWERID, $ADMINAUTH);
  13. ?>
  14. <!DOCTYPE html>
  15. <html>
  16. <head>
  17. <?php include('htmlhead.inc.php');?>
  18. </head>
  19. <body>
  20. <div id="maincontent">
  21. <div class="zm_form_wrap">
  22. <p>
  23. <label>组名称</label>
  24. <input type="text" class="text-input input-length-30" name="admingroup_name" />
  25. <span class="warn-inline">* </span>
  26. </p>
  27. <p>
  28. <label>  </label>
  29. <input type="submit" id="btn_submit" class="btn_submit" value="提交" />
  30. </p>
  31. </div>
  32. </div>
  33. <script type="text/javascript">
  34. $(function(){
  35. $('#btn_submit').click(function(){
  36. var admingroup_name = $('input[name="admingroup_name"]').val();
  37. if(admingroup_name == ''){
  38. layer.msg('组名不能为空');
  39. return false;
  40. }
  41. $.ajax({
  42. type : 'POST',
  43. data : {
  44. admingroup_name : admingroup_name
  45. },
  46. dataType: 'json',
  47. url : 'admingroup_do.php?act=add',
  48. success : function(data){
  49. var code = data.code;
  50. var msg = data.msg;
  51. switch(code){
  52. case 1:
  53. layer.alert(msg, {icon: 6,shade: false}, function(index){
  54. parent.location.reload();
  55. });
  56. break;
  57. default:
  58. layer.alert(msg, {icon: 5});
  59. }
  60. }
  61. });
  62. });
  63. });
  64. </script>
  65. </body>
  66. </html>