ListMember.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. require("../../member/class/user.php");
  7. require "../".LoadLang("pub/fun.php");
  8. require("../../data/dbcache/MemberLevel.php");
  9. $link=db_connect();
  10. $empire=new mysqlquery();
  11. $editor=1;
  12. //验证用户
  13. $lur=is_login();
  14. $logininid=$lur['userid'];
  15. $loginin=$lur['username'];
  16. $loginrnd=$lur['rnd'];
  17. $loginlevel=$lur['groupid'];
  18. $loginadminstyleid=$lur['adminstyleid'];
  19. //ehash
  20. $ecms_hashur=hReturnEcmsHashStrAll();
  21. //验证权限
  22. CheckLevel($logininid,$loginin,$classid,"member");
  23. $addgethtmlpath="../";
  24. $enews=$_POST['enews'];
  25. if(empty($enews))
  26. {$enews=$_GET['enews'];}
  27. //导入处理会员函数
  28. if($enews)
  29. {
  30. hCheckEcmsRHash();
  31. include('../../member/class/member_adminfun.php');
  32. include('../../member/class/member_modfun.php');
  33. }
  34. //修改会员
  35. if($enews=="EditMember")
  36. {
  37. $add=$_POST['add'];
  38. admin_EditMember($add,$logininid,$loginin);
  39. }
  40. elseif($enews=="DelMember")//删除会员
  41. {
  42. $userid=$_GET['userid'];
  43. admin_DelMember($userid,$logininid,$loginin);
  44. }
  45. elseif($enews=="DelMember_all")//批量删除会员
  46. {
  47. $userid=$_POST['userid'];
  48. admin_DelMember_all($userid,$logininid,$loginin);
  49. }
  50. elseif($enews=="DoCheckMember_all")//审核会员
  51. {
  52. admin_DoCheckMember_all($_POST,$logininid,$loginin);
  53. }
  54. elseif($enews=="DoMoveInGroupMember_all")//转移内部会员组
  55. {
  56. admin_DoMoveInGroupMember_all($_POST,$logininid,$loginin);
  57. }
  58. elseif($enews=="MemberChangeTimeGroup")//批量更新到期会员组
  59. {
  60. admin_MemberChangeTimeGroup($_GET,$logininid,$loginin);
  61. }
  62. else
  63. {}
  64. $search=$ecms_hashur['ehref'];
  65. $line=25;
  66. $page_line=12;
  67. $page=(int)$_GET['page'];
  68. $page=RepPIntvar($page);
  69. $start=0;
  70. $offset=$page*$line;
  71. $url="<a href=ListMember.php".$ecms_hashur['whehref'].">管理会员</a>";
  72. $add="";
  73. //搜索
  74. $sear=$_POST['sear'];
  75. if(empty($sear))
  76. {$sear=$_GET['sear'];}
  77. $sear=RepPostStr($sear,1);
  78. if($sear)
  79. {
  80. $groupid=$_POST['groupid'];
  81. if(empty($groupid))
  82. {$groupid=$_GET['groupid'];}
  83. $ingid=$_POST['ingid'];
  84. if(empty($ingid))
  85. {$ingid=$_GET['ingid'];}
  86. $agid=$_POST['agid'];
  87. if(empty($agid))
  88. {$agid=$_GET['agid'];}
  89. $keyboard=$_POST['keyboard'];
  90. if(empty($keyboard))
  91. {$keyboard=$_GET['keyboard'];}
  92. $keyboard=RepPostVar2($keyboard);
  93. $show=(int)$_GET['show'];
  94. if($keyboard)
  95. {
  96. if($show==2)//邮箱
  97. {
  98. $add=" where ".egetmf('email')." like '%$keyboard%'";
  99. }
  100. elseif($show==3)//ID
  101. {
  102. $add=" where ".egetmf('userid')."='$keyboard'";
  103. }
  104. else
  105. {
  106. $add=" where ".egetmf('username')." like '%$keyboard%'";
  107. }
  108. }
  109. $groupid=(int)$groupid;
  110. if($groupid)
  111. {
  112. if(empty($add))
  113. {$add.=" where ".egetmf('groupid')."='$groupid'";}
  114. else
  115. {$add.=" and ".egetmf('groupid')."='$groupid'";}
  116. }
  117. $ingid=(int)$ingid;
  118. if($ingid)
  119. {
  120. if(empty($add))
  121. {$add.=" where ".egetmf('ingid')."='$ingid'";}
  122. else
  123. {$add.=" and ".egetmf('ingid')."='$ingid'";}
  124. }
  125. $agid=(int)$agid;
  126. if($agid)
  127. {
  128. if(empty($add))
  129. {$add.=" where ".egetmf('agid')."='$agid'";}
  130. else
  131. {$add.=" and ".egetmf('agid')."='$agid'";}
  132. }
  133. $search.="&sear=1&show=$show&groupid=".$groupid."&ingid=".$ingid."&agid=".$agid."&keyboard=".urlencode($keyboard);
  134. }
  135. //审核
  136. $schecked=(int)$_GET['schecked'];
  137. if($schecked)
  138. {
  139. $and=$add?' and ':' where ';
  140. if($schecked==1)
  141. {
  142. $add.=$and.egetmf('checked')."=0";
  143. }
  144. else
  145. {
  146. $add.=$and.egetmf('checked')."=1";
  147. }
  148. $search.="&schecked=$schecked";
  149. }
  150. //实名
  151. $sisern=(int)$_GET['sisern'];
  152. if($sisern)
  153. {
  154. $and=$add?' and ':' where ';
  155. if($sisern==1)
  156. {
  157. $add.=$and.egetmf('isern')."=0";
  158. }
  159. else
  160. {
  161. $add.=$and.egetmf('isern')."=1";
  162. }
  163. $search.="&sisern=$sisern";
  164. }
  165. $totalquery="select count(*) as total from ".eReturnMemberTable().$add;
  166. $num=$empire->gettotal($totalquery);
  167. $query="select ".eReturnSelectMemberF('*')." from ".eReturnMemberTable().$add;
  168. $query.=" order by ".egetmf('userid')." desc limit $offset,$line";
  169. $sql=$empire->query($query);
  170. $returnpage=page2($num,$line,$page_line,$start,$page,$search);
  171. //----------会员组
  172. $group='';
  173. $sql1=$empire->query("select * from {$dbtbpre}enewsmembergroup order by level");
  174. while($l_r=$empire->fetch($sql1))
  175. {
  176. if($groupid==$l_r[groupid])
  177. {$select=" selected";}
  178. else
  179. {$select="";}
  180. $group.="<option value=".$l_r[groupid].$select.">".$l_r[groupname]."</option>";
  181. }
  182. //----------内部组
  183. $ingroup='';
  184. $chingroup='';
  185. $inmsql=$empire->query("select * from {$dbtbpre}enewsingroup order by myorder");
  186. while($inm_r=$empire->fetch($inmsql))
  187. {
  188. if($ingid==$inm_r['gid'])
  189. {$select=" selected";}
  190. else
  191. {$select="";}
  192. $ingroup.="<option value=".$inm_r['gid'].$select.">".$inm_r['gname']."</option>";
  193. $chingroup.="<option value=".$inm_r['gid'].">".$inm_r['gname']."</option>";
  194. }
  195. //----------管理组
  196. $madmingroup='';
  197. $agsql=$empire->query("select agid,agname from {$dbtbpre}enewsag order by isadmin");
  198. while($ag_r=$empire->fetch($agsql))
  199. {
  200. if($agid==$ag_r['agid'])
  201. {$select=" selected";}
  202. else
  203. {$select="";}
  204. $madmingroup.="<option value=".$ag_r['agid'].$select.">".$ag_r['agname']."</option>";
  205. }
  206. ?>
  207. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  208. <html>
  209. <head>
  210. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  211. <title>管理会员</title>
  212. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  213. <script>
  214. function CheckAll(form)
  215. {
  216. for (var i=0;i<form.elements.length;i++)
  217. {
  218. var e = form.elements[i];
  219. if (e.name != 'chkall')
  220. e.checked = form.chkall.checked;
  221. }
  222. }
  223. </script>
  224. </head>
  225. <body>
  226. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  227. <tr>
  228. <td width="50%">位置:
  229. <?=$url?>
  230. </td>
  231. <td><div align="right" class="emenubutton">
  232. <input type="button" name="Submit5" value="注册会员" onclick="window.open('../../member/register/');">
  233. &nbsp;&nbsp;
  234. <input type="button" name="Submit5" value="前台会员列表" onclick="window.open('../../member/list/');">
  235. &nbsp;&nbsp;
  236. <input type="button" name="Submit5" value="批量更新到期会员组" onclick="if(confirm('确认要批量更新到期会员组?')){self.location.href='ListMember.php?enews=MemberChangeTimeGroup<?=$ecms_hashur['href']?>';}">
  237. &nbsp;
  238. </div></td>
  239. </tr>
  240. </table>
  241. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  242. <form name="form2" method="GET" action="ListMember.php">
  243. <?=$ecms_hashur['eform']?>
  244. <input type=hidden name=sear value=1>
  245. <tr>
  246. <td><div align="center">关键字:
  247. <select name="show" id="show">
  248. <option value="1"<?=$show==1?' selected':''?>>用户名</option>
  249. <option value="3"<?=$show==3?' selected':''?>>用户ID</option>
  250. <option value="2"<?=$show==2?' selected':''?>>邮箱</option>
  251. </select>
  252. <input name="keyboard" type="text" id="keyboard" value="<?=$keyboard?>">
  253. <select name="groupid" id="groupid">
  254. <option value="0">不限会员组</option>
  255. <?=$group?>
  256. </select>
  257. <select name="ingid" id="ingid">
  258. <option value="0">不限内部组</option>
  259. <?=$ingroup?>
  260. </select>
  261. <select name="agid" id="agid">
  262. <option value="0">不限管理组</option>
  263. <?=$madmingroup?>
  264. </select>
  265. <select name="schecked" id="schecked">
  266. <option value="0"<?=$schecked==0?' selected':''?>>不限审核</option>
  267. <option value="1"<?=$schecked==1?' selected':''?>>未审核</option>
  268. <option value="2"<?=$schecked==2?' selected':''?>>已审核</option>
  269. </select>
  270. <select name="sisern" id="sisern">
  271. <option value="0"<?=$sisern==0?' selected':''?>>不限实名</option>
  272. <option value="1"<?=$sisern==1?' selected':''?>>未实名</option>
  273. <option value="2"<?=$sisern==2?' selected':''?>>已实名</option>
  274. </select>
  275. <input type="submit" name="Submit" value="搜索">
  276. &nbsp;&nbsp; [<a href="ListMember.php?schecked=1<?=$ecms_hashur['ehref']?>">未审核</a>] [<a href="ListMember.php?schecked=2<?=$ecms_hashur['ehref']?>">已审核</a>] [<a href="ListMember.php?sisern=1<?=$ecms_hashur['ehref']?>">未实名</a>] [<a href="ListMember.php?sisern=2<?=$ecms_hashur['ehref']?>">已实名</a>] </div></td>
  277. </tr>
  278. </form>
  279. </table>
  280. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  281. <form name="memberform" method="post" action="ListMember.php" onsubmit="return confirm('确认要操作?');">
  282. <?=$ecms_hashur['form']?>
  283. <tr class="header">
  284. <td width="2%">&nbsp;</td>
  285. <td width="4%" height="25"><div align="center">ID</div></td>
  286. <td width="17%" height="25"><div align="center">用户名</div></td>
  287. <td width="9%"><div align="center">会员组</div></td>
  288. <td width="10%"><div align="center">内部组</div></td>
  289. <td width="9%"><div align="center">管理组</div></td>
  290. <td width="4%"><div align="center">审核</div></td>
  291. <td width="4%"><div align="center">实名</div></td>
  292. <td width="14%"><div align="center">注册时间</div></td>
  293. <td width="11%"><div align="center">记录</div></td>
  294. <td width="16%" height="25"><div align="center">操作</div></td>
  295. </tr>
  296. <?
  297. while($r=$empire->fetch($sql))
  298. {
  299. if(empty($r['checked']))
  300. {
  301. $checked=" title='未审核' style='background:#99C4E3'";
  302. $namefont1="<font color='gray'>";
  303. $namefont2="</font>";
  304. $checkedstatus='<font color=red>否</font>';
  305. }
  306. else
  307. {
  308. $checked="";
  309. $namefont1="";
  310. $namefont2="";
  311. $checkedstatus='是';
  312. }
  313. $registertime=date("Y-m-d H:i:s",$r['registertime']);
  314. //管理组
  315. $magname='';
  316. $magadminname='';
  317. if($r['agid'])
  318. {
  319. $magname=$aglevel_r[$r['agid']]['agname'];
  320. if($magname)
  321. {
  322. if($aglevel_r[$r['agid']]['isadmin']==9)
  323. {
  324. $magadminname='管理员 ('.$aglevel_r[$r['agid']]['isadmin'].')';
  325. }
  326. elseif($aglevel_r[$r['agid']]['isadmin']==5)
  327. {
  328. $magadminname='版主 ('.$aglevel_r[$r['agid']]['isadmin'].')';
  329. }
  330. elseif($aglevel_r[$r['agid']]['isadmin']==1)
  331. {
  332. $magadminname='实习版主 ('.$aglevel_r[$r['agid']]['isadmin'].')';
  333. }
  334. else
  335. {
  336. $magadminname='('.$aglevel_r[$r['agid']]['isadmin'].')';
  337. }
  338. }
  339. }
  340. //内部组
  341. $migname='';
  342. if($r['ingid'])
  343. {
  344. $migname=$iglevel_r[$r['ingid']]['gname'];
  345. }
  346. //编码转换
  347. $m_username=$r['username'];
  348. $email=$r['email'];
  349. ?>
  350. <tr bgcolor="ffffff" id=user<?=$r['userid']?>>
  351. <td><div align="center">
  352. <input name="userid[]" type="checkbox" id="userid[]" value="<?=$r['userid']?>"<?=$checked?> onclick="if(this.checked){user<?=$r['userid']?>.style.backgroundColor='#DBEAF5';}else{user<?=$r['userid']?>.style.backgroundColor='#ffffff';}">
  353. </div></td>
  354. <td height="25"><div align="center">
  355. <?=$r['userid']?>
  356. </div></td>
  357. <td height="25"><div align="center"><a href="../../space/?userid=<?=$r['userid']?>" title="查看会员空间" target="_blank"><?=$namefont1?><?=$m_username?><?=$namefont2?></a></div></td>
  358. <td><div align="center"><a href="ListMember.php?sear=1&groupid=<?=$r['groupid']?><?=$ecms_hashur['ehref']?>"><?=$level_r[$r['groupid']][groupname]?></a></div></td>
  359. <td><div align="center"><a href="ListMember.php?sear=1&ingid=<?=$r['ingid']?><?=$ecms_hashur['ehref']?>"><?=$migname?></a></div></td>
  360. <td><div align="center"><a href="ListMember.php?sear=1&agid=<?=$r['agid']?><?=$ecms_hashur['ehref']?>" title="<?=$magadminname?>"><?=$magname?></a></div></td>
  361. <td><div align="center"><?=$checkedstatus?></div></td>
  362. <td><div align="center"><?=$r['isern']?'是':'<font color=red>否</font>'?></div></td>
  363. <td><div align="center">
  364. <?=$registertime?>
  365. </div></td>
  366. <td><div align="center">[<a href="#ecms" onclick="window.open('ListBuyBak.php?userid=<?=$r['userid']?>&username=<?=$m_username?><?=$ecms_hashur['ehref']?>','','width=650,height=600,scrollbars=yes,top=70,left=100');">购买</a>]
  367. [<a href="#ecms" onclick="window.open('ListDownBak.php?userid=<?=$r['userid']?>&username=<?=$m_username?><?=$ecms_hashur['ehref']?>','','width=650,height=600,scrollbars=yes,top=70,left=100');">消费</a>]</div></td>
  368. <td height="25"><div align="center">[<a href="AddMember.php?enews=EditMember&userid=<?=$r['userid']?><?=$ecms_hashur['ehref']?>">修改</a>]
  369. &nbsp;
  370. [<a href="ListMember.php?enews=DelMember&userid=<?=$r['userid']?><?=$ecms_hashur['href']?>" onclick="return confirm('确认要删除?');">删除</a>]
  371. </div></td>
  372. </tr>
  373. <?
  374. }
  375. ?>
  376. <tr bgcolor="ffffff">
  377. <td height="25"><div align="center"><input type=checkbox name=chkall value=on onclick="CheckAll(this.form)" title="全选"></div></td>
  378. <td height="25" colspan="10"> <select name="toingid" id="toingid">
  379. <option value="0">取消内部组</option>
  380. <?=$chingroup?>
  381. </select>
  382. <input type="submit" name="Submit32" value="转移内部组" onclick="document.memberform.enews.value='DoMoveInGroupMember_all';">
  383. &nbsp;&nbsp;&nbsp;
  384. <input type="submit" name="Submit3" value="审核" onclick="document.memberform.enews.value='DoCheckMember_all';document.memberform.docheck.value='1';"> &nbsp;&nbsp;&nbsp;
  385. <input type="submit" name="Submit3" value="取消审核" onclick="document.memberform.enews.value='DoCheckMember_all';document.memberform.docheck.value='0';"> &nbsp;&nbsp;&nbsp;
  386. <input type="submit" name="Submit2" value="删除" onclick="document.memberform.enews.value='DelMember_all';">
  387. <input name="enews" type="hidden" id="enews" value="DelMember_all">
  388. &nbsp;
  389. <input name="docheck" type="hidden" id="docheck" value="1">
  390. &nbsp; </td>
  391. </tr>
  392. <tr bgcolor="ffffff">
  393. <td height="25" colspan="11"><?=$returnpage?></td>
  394. </tr>
  395. <tr bgcolor="ffffff">
  396. <td height="25" colspan="11"><font color="#666666">说明:多选框为蓝色或用户名灰色代表未审核会员. </font></td>
  397. </tr>
  398. </form>
  399. </table>
  400. </body>
  401. </html>
  402. <?
  403. db_close();
  404. $empire=null;
  405. ?>