GbookClass.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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,"gbook");
  20. $enews=$_POST['enews'];
  21. if(empty($enews))
  22. {$enews=$_GET['enews'];}
  23. if($enews)
  24. {
  25. hCheckEcmsRHash();
  26. include("../../class/com_functions.php");
  27. }
  28. if($enews=="AddGbookClass")
  29. {
  30. AddGbookClass($_POST,0,$logininid,$loginin);
  31. }
  32. elseif($enews=="EditGbookClass")
  33. {
  34. EditGbookClass($_POST,0,$logininid,$loginin);
  35. }
  36. elseif($enews=="DelGbookClass")
  37. {
  38. $bid=$_GET['bid'];
  39. DelGbookClass($bid,0,$logininid,$loginin);
  40. }
  41. else
  42. {}
  43. $sql=$empire->query("select bid,bname,checked,groupid from {$dbtbpre}enewsgbookclass order by bid desc");
  44. //----------会员组
  45. $sql1=$empire->query("select groupid,groupname from {$dbtbpre}enewsmembergroup order by level");
  46. while($l_r=$empire->fetch($sql1))
  47. {
  48. $membergroup.="<option value='".$l_r[groupid]."'>".$l_r[groupname]."</option>";
  49. }
  50. ?>
  51. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  52. <html>
  53. <head>
  54. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  55. <title></title>
  56. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  57. </head>
  58. <body>
  59. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  60. <tr>
  61. <td>位置:<a href="gbook.php<?=$ecms_hashur['whehref']?>">管理留言</a>&nbsp;&nbsp;&gt;&nbsp;&nbsp;<a href="GbookClass.php<?=$ecms_hashur['whehref']?>">管理留言分类</a></td>
  62. </tr>
  63. </table>
  64. <form name="form1" method="post" action="GbookClass.php">
  65. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  66. <?=$ecms_hashur['form']?>
  67. <tr class="header">
  68. <td height="25">增加留言分类:
  69. <input name=enews type=hidden id="enews" value=AddGbookClass>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td height="25" bgcolor="#FFFFFF"> 分类名称:
  74. <input name="bname" type="text" id="bname">
  75. <select name="groupid" id="groupid">
  76. <option value="0">游客</option>
  77. <?=$membergroup?>
  78. </select>
  79. <input name="checked" type="checkbox" id="checked" value="1">
  80. 需要审核
  81. <input type="submit" name="Submit" value="增加">
  82. <input type="reset" name="Submit2" value="重置"></td>
  83. </tr>
  84. </table>
  85. </form>
  86. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  87. <tr class="header">
  88. <td width="7%"><div align="center">ID</div></td>
  89. <td width="39%" height="25"><div align="center">分类名称</div></td>
  90. <td width="39%"><div align="center">留言板地址</div></td>
  91. <td width="15%" height="25"><div align="center">操作</div></td>
  92. </tr>
  93. <?
  94. while($r=$empire->fetch($sql))
  95. {
  96. $gourl=$public_r[newsurl]."e/tool/gbook/?bid=".$r[bid];
  97. $checked="";
  98. if($r[checked])
  99. {
  100. $checked=" checked";
  101. }
  102. $thismembergroup=str_replace("<option value='".$r[groupid]."'>","<option value='".$r[groupid]."' selected>",$membergroup);
  103. ?>
  104. <form name=form2 method=post action=GbookClass.php>
  105. <?=$ecms_hashur['form']?>
  106. <input type=hidden name=enews value=EditGbookClass>
  107. <input type=hidden name=bid value=<?=$r[bid]?>>
  108. <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  109. <td><div align="center">
  110. <?=$r[bid]?>
  111. </div></td>
  112. <td height="25"> <div align="center">
  113. <input name="bname" type="text" id="bname" value="<?=$r[bname]?>">
  114. <select name="groupid" id="groupid">
  115. <option value="0">游客</option>
  116. <?=$thismembergroup?>
  117. </select>
  118. <input name="checked" type="checkbox" id="checked" value="1"<?=$checked?>>
  119. 审核</div></td>
  120. <td><div align="center">
  121. <input name="textfield" type="text" size="32" value="<?=$gourl?>">
  122. [<a href="<?=$gourl?>" target="_blank">访问</a>]</div></td>
  123. <td height="25"><div align="center">
  124. <input type="submit" name="Submit3" value="修改">
  125. &nbsp;
  126. <input type="button" name="Submit4" value="删除" onclick="self.location.href='GbookClass.php?enews=DelGbookClass&bid=<?=$r[bid]?><?=$ecms_hashur['href']?>';">
  127. </div></td>
  128. </tr>
  129. </form>
  130. <?
  131. }
  132. db_close();
  133. $empire=null;
  134. ?>
  135. </table>
  136. </body>
  137. </html>