AddMember.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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. $link=db_connect();
  8. $empire=new mysqlquery();
  9. $editor=1;
  10. //验证用户
  11. $lur=is_login();
  12. $logininid=$lur['userid'];
  13. $loginin=$lur['username'];
  14. $loginrnd=$lur['rnd'];
  15. $loginlevel=$lur['groupid'];
  16. $loginadminstyleid=$lur['adminstyleid'];
  17. //ehash
  18. $ecms_hashur=hReturnEcmsHashStrAll();
  19. //验证权限
  20. CheckLevel($logininid,$loginin,$classid,"member");
  21. $r=array();
  22. $userdate=0;
  23. $enews=ehtmlspecialchars($_GET['enews']);
  24. $changegroupid=(int)$_GET['changegroupid'];
  25. $url="<a href=ListMember.php".$ecms_hashur['whehref'].">管理会员</a>&nbsp;>&nbsp;增加会员";
  26. if($enews=="EditMember")
  27. {
  28. $userid=(int)$_GET['userid'];
  29. //取得用户资料
  30. $r=ReturnUserInfo($userid);
  31. $r['groupid']=$r['groupid']?$r['groupid']:eReturnMemberDefGroupid();
  32. $addr=$empire->fetch1("select * from {$dbtbpre}enewsmemberadd where userid='$userid' limit 1");
  33. $url="<a href=ListMember.php".$ecms_hashur['whehref'].">管理会员</a>&nbsp;>&nbsp;修改会员资料:<b>".$r[username]."</b>";
  34. //时间
  35. if($r[userdate])
  36. {
  37. $userdate=$r[userdate]-time();
  38. if($userdate<=0)
  39. {
  40. OutTimeZGroup($userid,$r['zgroupid']);
  41. if($r['zgroupid'])
  42. {
  43. $r['groupid']=$r['zgroupid'];
  44. $r['zgroupid']=0;
  45. }
  46. $userdate=0;
  47. }
  48. else
  49. {
  50. $userdate=round($userdate/(24*3600));
  51. }
  52. }
  53. }
  54. if($changegroupid)
  55. {
  56. $r['groupid']=$changegroupid;
  57. }
  58. //----------会员组
  59. $sql=$empire->query("select groupid,groupname from {$dbtbpre}enewsmembergroup order by level");
  60. while($level_r=$empire->fetch($sql))
  61. {
  62. if($r[groupid]==$level_r[groupid])
  63. {$select=" selected";}
  64. else
  65. {$select="";}
  66. $group.="<option value=".$level_r[groupid].$select.">".$level_r[groupname]."</option>";
  67. if($r[zgroupid]==$level_r[groupid])
  68. {$zselect=" selected";}
  69. else
  70. {$zselect="";}
  71. $zgroup.="<option value=".$level_r[groupid].$zselect.">".$level_r[groupname]."</option>";
  72. }
  73. //内部组
  74. $ingroup='';
  75. $inmsql=$empire->query("select * from {$dbtbpre}enewsingroup order by myorder");
  76. while($inm_r=$empire->fetch($inmsql))
  77. {
  78. if($r['ingid']==$inm_r['gid'])
  79. {$select=" selected";}
  80. else
  81. {$select="";}
  82. $ingroup.="<option value=".$inm_r['gid'].$select.">".$inm_r['gname']."</option>";
  83. }
  84. //管理组
  85. $magname='';
  86. $magadminname='';
  87. if($r['agid'])
  88. {
  89. $r['agid']=(int)$r['agid'];
  90. $magr=$empire->fetch1("select * from {$dbtbpre}enewsag where agid='".$r['agid']."'");
  91. $magname=$magr['agname'];
  92. if($magname)
  93. {
  94. if($magr['isadmin']==9)
  95. {
  96. $magadminname='管理员 ('.$magr['isadmin'].')';
  97. }
  98. elseif($magr['isadmin']==5)
  99. {
  100. $magadminname='版主 ('.$magr['isadmin'].')';
  101. }
  102. elseif($magr['isadmin']==1)
  103. {
  104. $magadminname='实习版主 ('.$magr['isadmin'].')';
  105. }
  106. else
  107. {
  108. $magadminname='('.$magr['isadmin'].')';
  109. }
  110. }
  111. }
  112. //风格
  113. $spacestyle='';
  114. $spacesql=$empire->query("select styleid,stylename from {$dbtbpre}enewsspacestyle");
  115. while($spacer=$empire->fetch($spacesql))
  116. {
  117. $selected='';
  118. if($spacer[styleid]==$addr[spacestyleid])
  119. {
  120. $selected=' selected';
  121. }
  122. $spacestyle.="<option value='$spacer[styleid]'".$selected.">".$spacer[stylename]."</option>";
  123. }
  124. //取得表单
  125. $formid=GetMemberFormId($r[groupid]);
  126. $formfile='../../data/html/memberform'.$formid.'.php';
  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>位置:<?=$url?></td>
  139. </tr>
  140. </table>
  141. <form name="form1" method="post" action="ListMember.php" enctype="multipart/form-data">
  142. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  143. <?=$ecms_hashur['form']?>
  144. <input type=hidden name=add[oldusername] value='<?=$r[username]?>'>
  145. <input type=hidden name=add[userid] value='<?=$userid?>'>
  146. <tr class="header">
  147. <td height="25" colspan="2">修改资料
  148. <input name="enews" type="hidden" id="enews" value="<?=$enews?>"> </td>
  149. </tr>
  150. <tr bgcolor="#FFFFFF">
  151. <td width="25%" height="25">用户名</td>
  152. <td width="75%" height="25"><input name=add[username] type=text id="add[username]" value='<?=$r[username]?>'></td>
  153. </tr>
  154. <tr bgcolor="#FFFFFF">
  155. <td height="25">密码</td>
  156. <td height="25"><input name="add[password]" type="password" id="add[password]">
  157. (修改时:如不想修改,请留空)</td>
  158. </tr>
  159. <tr bgcolor="#FFFFFF">
  160. <td height="25">审核</td>
  161. <td height="25"><input name="add[checked]" type="checkbox" id="add[checked]" value="1"<?=$r[checked]==1?' checked':''?>>
  162. 审核通过</td>
  163. </tr>
  164. <tr bgcolor="#FFFFFF">
  165. <td height="25">实名状态</td>
  166. <td height="25"><input type="radio" name="add[isern]" value="0"<?=$r['isern']==0?' checked':''?>>未实名
  167. <input type="radio" name="add[isern]" value="1"<?=$r['isern']==1?' checked':''?>>已实名</td>
  168. </tr>
  169. <tr bgcolor="#FFFFFF">
  170. <td height="25" valign="top">所属会员组<br> <br> <input type="button" name="Submit3" value="管理会员组" onclick="window.open('ListMemberGroup.php<?=$ecms_hashur['whehref']?>');"> </td>
  171. <td height="25"><select name="add[groupid]" size="6" id="add[groupid]" onchange="self.location.href='AddMember.php?<?=$ecms_hashur['ehref']?>&enews=EditMember&userid=<?=$userid?>&changegroupid='+this.options[this.selectedIndex].value;">
  172. <?=$group?>
  173. </select></td>
  174. </tr>
  175. <tr bgcolor="#FFFFFF">
  176. <td height="25">所属内部组</td>
  177. <td height="25"><select name="add[ingid]" id="add[ingid]">
  178. <option value="0"<?=$r['ingid']==0?' selected':''?>>不属于</option>
  179. <?=$ingroup?>
  180. </select> </td>
  181. </tr>
  182. <tr bgcolor="#FFFFFF">
  183. <td height="25">邮箱</td>
  184. <td height="25"><input name="add[email]" type="text" id="add[email]" value="<?=$r[email]?>" size="35"></td>
  185. </tr>
  186. <tr bgcolor="#FFFFFF">
  187. <td height="25">剩余天数</td>
  188. <td height="25"><input name=add[userdate] type=text id="add[userdate]" value='<?=$userdate?>' size="6">
  189. 天,到期后转向用户组:
  190. <select name="add[zgroupid]" id="add[zgroupid]">
  191. <option value="0">不设置</option>
  192. <?=$zgroup?>
  193. </select></td>
  194. </tr>
  195. <tr bgcolor="#FFFFFF">
  196. <td height="25">点数</td>
  197. <td height="25"><input name=add[userfen] type=text id="add[userfen]" value='<?=$r[userfen]?>' size="6">
  198. 点</td>
  199. </tr>
  200. <tr bgcolor="#FFFFFF">
  201. <td height="25">帐户余额</td>
  202. <td height="25"><input name=add[money] type=text id="add[money]" value='<?=$r[money]?>' size="6">
  203. 元 </td>
  204. </tr>
  205. <tr bgcolor="#FFFFFF">
  206. <td height="25">所属管理组</td>
  207. <td height="25">
  208. <?php
  209. if($r['agid'])
  210. {
  211. ?>
  212. 组ID:<?=$r['agid']?>,组名称:<a href="#ecms" title="<?=$magadminname?>"><?=$magname?></a>
  213. <?php
  214. }
  215. else
  216. {
  217. ?>
  218. ----
  219. <?php
  220. }
  221. ?> </td>
  222. </tr>
  223. <tr bgcolor="#FFFFFF">
  224. <td height="25">注册时间</td>
  225. <td height="25"><?=eReturnMemberRegtime($r['registertime'],"Y-m-d H:i:s")?></td>
  226. </tr>
  227. <tr bgcolor="#FFFFFF">
  228. <td height="25">注册IP</td>
  229. <td height="25"><?=$addr[regip]?>:<?=$addr[regipport]?></td>
  230. </tr>
  231. <tr bgcolor="#FFFFFF">
  232. <td height="25">最后登录</td>
  233. <td height="25">总登录次数:<?=$addr[loginnum]?>,时间:<?=date("Y-m-d H:i:s",$addr[lasttime])?>,登录IP:<?=$addr[lastip]?>:<?=$addr[lastipport]?></td>
  234. </tr>
  235. <tr bgcolor="#FFFFFF" class="header">
  236. <td height="25" colspan="2">其他信息</td>
  237. </tr>
  238. <tr bgcolor="#FFFFFF">
  239. <td height="25" colspan="2">
  240. <?php
  241. @include($formfile);
  242. ?> </td>
  243. </tr>
  244. <tr bgcolor="#FFFFFF" class="header">
  245. <td height="25" colspan="2">会员空间设置</td>
  246. </tr>
  247. <tr bgcolor="#FFFFFF">
  248. <td height="25">空间使用模板</td>
  249. <td height="25"><select name="add[spacestyleid]" id="add[spacestyleid]">
  250. <?=$spacestyle?>
  251. </select> <input type="button" name="Submit32" value="管理空间模板" onclick="window.open('ListSpaceStyle.php<?=$ecms_hashur['whehref']?>');"></td>
  252. </tr>
  253. <tr bgcolor="#FFFFFF">
  254. <td height="25">空间名称</td>
  255. <td height="25"><input name="add[spacename]" type="text" id="add[spacename]" value="<?=ehtmlspecialchars(stripSlashes($addr['spacename']))?>"></td>
  256. </tr>
  257. <tr bgcolor="#FFFFFF">
  258. <td height="25">空间公告</td>
  259. <td height="25"><textarea name="add[spacegg]" cols="60" rows="6" id="add[spacegg]"><?=stripSlashes($addr['spacegg'])?></textarea></td>
  260. </tr>
  261. <tr bgcolor="#FFFFFF">
  262. <td height="25">&nbsp;</td>
  263. <td height="25"><input type="submit" name="Submit" value="修改"> <input type="reset" name="Submit2" value="重置"></td>
  264. </tr>
  265. </table>
  266. </form>
  267. </body>
  268. </html>
  269. <?php
  270. db_close();
  271. $empire=null;
  272. ?>