MemberFeedback.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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,"spacedata");
  20. //删除反馈
  21. function hDelMemberFeedback($add,$userid,$username){
  22. global $empire,$dbtbpre;
  23. $fid=intval($add['fid']);
  24. if(!$fid)
  25. {
  26. printerror("NotDelMemberFeedbackid","history.go(-1)");
  27. }
  28. $sql=$empire->query("delete from {$dbtbpre}enewsmemberfeedback where fid='$fid'");
  29. if($sql)
  30. {
  31. //操作日志
  32. insert_dolog("fid=".$fid);
  33. printerror("DelMemberFeedbackSuccess",EcmsGetReturnUrl());
  34. }
  35. else
  36. {
  37. printerror("DbError","history.go(-1)");
  38. }
  39. }
  40. //批量删除反馈
  41. function hDelMemberFeedback_All($add,$userid,$username){
  42. global $empire,$dbtbpre;
  43. $fid=$add['fid'];
  44. $count=count($fid);
  45. if(empty($count))
  46. {
  47. printerror("NotDelMemberFeedbackid","history.go(-1)");
  48. }
  49. for($i=0;$i<$count;$i++)
  50. {
  51. $addsql.="fid='".intval($fid[$i])."' or ";
  52. }
  53. $addsql=substr($addsql,0,strlen($addsql)-4);
  54. $sql=$empire->query("delete from {$dbtbpre}enewsmemberfeedback where (".$addsql.")");
  55. if($sql)
  56. {
  57. //操作日志
  58. insert_dolog("");
  59. printerror("DelMemberFeedbackSuccess",EcmsGetReturnUrl());
  60. }
  61. else
  62. {
  63. printerror("DbError","history.go(-1)");
  64. }
  65. }
  66. $enews=$_GET['enews'];
  67. if(empty($enews))
  68. {
  69. $enews=$_POST['enews'];
  70. }
  71. if($enews)
  72. {
  73. hCheckEcmsRHash();
  74. }
  75. if($enews=="hDelMemberFeedback")
  76. {
  77. hDelMemberFeedback($_GET,$logininid,$loginin);
  78. }
  79. elseif($enews=="hDelMemberFeedback_All")
  80. {
  81. hDelMemberFeedback_All($_POST,$logininid,$loginin);
  82. }
  83. include("../../member/class/user.php");
  84. include "../".LoadLang("pub/fun.php");
  85. $page=(int)$_GET['page'];
  86. $page=RepPIntvar($page);
  87. $start=0;
  88. $line=25;//每页显示条数
  89. $page_line=12;//每页显示链接数
  90. $offset=$page*$line;//总偏移量
  91. //搜索
  92. $search='';
  93. $search.=$ecms_hashur['ehref'];
  94. $and='';
  95. if($_GET['sear'])
  96. {
  97. $keyboard=RepPostVar2($_GET['keyboard']);
  98. if($keyboard)
  99. {
  100. $show=RepPostStr($_GET['show'],1);
  101. if($show==1)//反馈标题
  102. {
  103. $and.=" where title like '%$keyboard%'";
  104. }
  105. elseif($show==2)//反馈内容
  106. {
  107. $and.=" where ftext like '%$keyboard%'";
  108. }
  109. elseif($show==3)//空间主人用户ID
  110. {
  111. $and.=" where userid='$keyboard'";
  112. }
  113. elseif($show==4)//留言者IP
  114. {
  115. $and.=" where ip like '%$keyboard%'";
  116. }
  117. $search.="&sear=1&keyboard=$keyboard&show=$show";
  118. }
  119. }
  120. $query="select fid,title,uid,uname,addtime,userid from {$dbtbpre}enewsmemberfeedback".$and;
  121. $totalquery="select count(*) as total from {$dbtbpre}enewsmemberfeedback".$and;
  122. $num=$empire->gettotal($totalquery);//取得总条数
  123. $query=$query." order by fid desc limit $offset,$line";
  124. $sql=$empire->query($query);
  125. $returnpage=page2($num,$line,$page_line,$start,$page,$search);
  126. $url="会员空间&nbsp;>&nbsp;<a href=MemberFeedback.php".$ecms_hashur['whehref'].">管理反馈</a>";
  127. ?>
  128. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  129. <html>
  130. <head>
  131. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  132. <title>管理反馈</title>
  133. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  134. </head>
  135. <body>
  136. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  137. <tr>
  138. <td width="50%">位置:
  139. <?=$url?>
  140. </td>
  141. <td><div align="right">
  142. </div></td>
  143. </tr>
  144. </table>
  145. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  146. <form name="searchfb" method="get" action="MemberFeedback.php">
  147. <?=$ecms_hashur['eform']?>
  148. <tr>
  149. <td><div align="center">搜索:
  150. <input name="keyboard" type="text" id="keyboard" value="<?=$keyboard?>">
  151. <select name="show" id="show">
  152. <option value="1"<?=$show==1?' selected':''?>>反馈标题</option>
  153. <option value="2"<?=$show==2?' selected':''?>>反馈内容</option>
  154. <option value="3"<?=$show==3?' selected':''?>>空间主人用户ID</option>
  155. <option value="4"<?=$show==4?' selected':''?>>留言者IP</option>
  156. </select>
  157. <input type="submit" name="Submit2" value="搜索">
  158. <input name="sear" type="hidden" id="sear" value="1">
  159. </div></td>
  160. </tr>
  161. </form>
  162. </table>
  163. <form name="form1" method="post" action="MemberFeedback.php" onsubmit="return confirm('确认要删除?');">
  164. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder>
  165. <?=$ecms_hashur['form']?>
  166. <tr class=header>
  167. <td width="7%" height="23"><div align="center">ID</div></td>
  168. <td width="43%" height="23"><div align="center">标题(点击查看)</div></td>
  169. <td width="20%" height="23"><div align="center">空间主人</div></td>
  170. <td width="18%" height="23"><div align="center">发布时间</div></td>
  171. <td width="12%" height="23"><div align="center">操作</div></td>
  172. </tr>
  173. <?
  174. while($r=$empire->fetch($sql))
  175. {
  176. $ur=$empire->fetch1("select ".egetmf('username')." from ".eReturnMemberTable()." where ".egetmf('userid')."='$r[userid]'");
  177. $username=$ur['username'];
  178. if($r['uid'])
  179. {
  180. $r['uname']="<a href='../../space/?userid=$r[uid]' target='_blank'>$r[uname]</a>";
  181. }
  182. else
  183. {
  184. $r['uname']='游客';
  185. }
  186. ?>
  187. <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  188. <td height="25"><div align="center">
  189. <?=$r[fid]?>
  190. </div></td>
  191. <td height="25"><div align="left"><a href="#ecms" onclick="window.open('MemberShowFeedback.php?fid=<?=$r[fid]?><?=$ecms_hashur['ehref']?>','','width=650,height=600,scrollbars=yes,top=70,left=100');">
  192. <?=$r[title]?>
  193. </a>&nbsp;(<?=$r['uname']?>)</div></td>
  194. <td height="25"><div align="center"><a href="MemberFeedback.php?sear=1&show=3&keyboard=<?=$r[userid]?><?=$ecms_hashur['ehref']?>">
  195. <?=$username?>
  196. </a></div></td>
  197. <td height="25"><div align="center">
  198. <?=$r[addtime]?>
  199. </div></td>
  200. <td height="25"><div align="center">[<a href="MemberFeedback.php?enews=hDelMemberFeedback&fid=<?=$r[fid]?><?=$ecms_hashur['href']?>" onclick="return confirm('确认要删除?');">删除</a>
  201. <input name="fid[]" type="checkbox" value="<?=$r[fid]?>">
  202. ]</div></td>
  203. </tr>
  204. <?
  205. }
  206. ?>
  207. <tr bgcolor="#FFFFFF">
  208. <td height="25" colspan="5">&nbsp;
  209. <?=$returnpage?>
  210. &nbsp;&nbsp;&nbsp;
  211. <input type="submit" name="Submit" value="批量删除">
  212. <input name="enews" type="hidden" id="enews" value="hDelMemberFeedback_All"></td>
  213. </tr>
  214. </table>
  215. </form>
  216. </body>
  217. </html>
  218. <?
  219. db_close();
  220. $empire=null;
  221. ?>