AddViewGroup.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"viewgroup");
  20. $enews=ehtmlspecialchars($_GET['enews']);
  21. $postword='增加';
  22. $vgid=0;
  23. $r=array();
  24. $url="<a href='ListViewGroup.php".$ecms_hashur['whehref']."'>管理会员访问组</a>&nbsp;->&nbsp;增加会员访问组";
  25. if($enews=="EditViewGroup")
  26. {
  27. $vgid=(int)$_GET['vgid'];
  28. $postword='修改';
  29. $r=$empire->fetch1("select * from {$dbtbpre}enewsvg where vgid='$vgid'");
  30. $url="<a href='ListViewGroup.php".$ecms_hashur['whehref']."'>管理会员访问组</a>&nbsp;->&nbsp;修改会员访问组:<b>".$r[gname]."</b>";
  31. }
  32. //会员组
  33. $i=0;
  34. $membergroup='';
  35. $mgsql=$empire->query("select groupid,groupname from {$dbtbpre}enewsmembergroup order by level");
  36. while($level_r=$empire->fetch($mgsql))
  37. {
  38. $i++;
  39. $br='';
  40. if($i%6==0)
  41. {
  42. $br='<br>';
  43. }
  44. if(strstr($r['gids'],','.$level_r['groupid'].','))
  45. {$checked=" checked";}
  46. else
  47. {$checked="";}
  48. $membergroup.="<input type='checkbox' name='membergroup[]' value='$level_r[groupid]'".$checked.">".$level_r[groupname]."&nbsp;".$br;
  49. }
  50. //内部组
  51. $i=0;
  52. $ingroup='';
  53. $minsql=$empire->query("select gid,gname from {$dbtbpre}enewsingroup order by myorder");
  54. while($min_r=$empire->fetch($minsql))
  55. {
  56. $i++;
  57. $br='';
  58. if($i%6==0)
  59. {
  60. $br='<br>';
  61. }
  62. if(strstr($r['ingids'],','.$min_r['gid'].','))
  63. {$checked=" checked";}
  64. else
  65. {$checked="";}
  66. $ingroup.="<input type='checkbox' name='ingroup[]' value='$min_r[gid]'".$checked.">".$min_r[gname]."&nbsp;".$br;
  67. }
  68. //管理组
  69. $i=0;
  70. $madmingroup='';
  71. $agsql=$empire->query("select agid,agname from {$dbtbpre}enewsag order by isadmin");
  72. while($ag_r=$empire->fetch($agsql))
  73. {
  74. $i++;
  75. $br='';
  76. if($i%6==0)
  77. {
  78. $br='<br>';
  79. }
  80. if(strstr($r['agids'],','.$ag_r['agid'].','))
  81. {$checked=" checked";}
  82. else
  83. {$checked="";}
  84. $madmingroup.="<input type='checkbox' name='madmingroup[]' value='$ag_r[agid]'".$checked.">".$ag_r[agname]."&nbsp;".$br;
  85. }
  86. db_close();
  87. $empire=null;
  88. ?>
  89. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  90. <html>
  91. <head>
  92. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  93. <title>会员访问组</title>
  94. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  95. </head>
  96. <body>
  97. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0">
  98. <tr>
  99. <td height="25">位置:<?=$url?></td>
  100. </tr>
  101. </table>
  102. <form name="form1" method="post" action="ListViewGroup.php">
  103. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  104. <?=$ecms_hashur['form']?>
  105. <tr class="header">
  106. <td width="20%" height="25"><?=$postword?>会员访问组</td>
  107. <td width="80%" height="25"><input name="enews" type="hidden" id="enews" value="<?=$enews?>">
  108. <input name="vgid" type="hidden" id="vgid" value="<?=$vgid?>"></td>
  109. </tr>
  110. <tr bgcolor="#FFFFFF">
  111. <td height="25">组名称</td>
  112. <td height="25"> <input name="gname" type="text" id="gname" value="<?=$r[gname]?>" size="30"> </td>
  113. </tr>
  114. <tr bgcolor="#FFFFFF">
  115. <td height="25">允许会员组</td>
  116. <td height="25"><?=$membergroup?></td>
  117. </tr>
  118. <tr bgcolor="#FFFFFF">
  119. <td height="25">允许会员内部组</td>
  120. <td height="25"><?=$ingroup?></td>
  121. </tr>
  122. <tr bgcolor="#FFFFFF">
  123. <td height="25">允许会员管理组</td>
  124. <td height="25"><?=$madmingroup?></td>
  125. </tr>
  126. <tr bgcolor="#FFFFFF">
  127. <td height="25">&nbsp;</td>
  128. <td height="25"> <input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
  129. </tr>
  130. </table>
  131. </form>
  132. </body>
  133. </html>