ChangeUser.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../class/connect.php");
  4. require("../class/db_sql.php");
  5. require("../class/functions.php");
  6. require LoadLang("pub/fun.php");
  7. $link=db_connect();
  8. $empire=new mysqlquery();
  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. $page=(int)$_GET['page'];
  19. $page=RepPIntvar($page);
  20. $start=0;
  21. $field=RepPostVar($_GET['field']);
  22. $form=RepPostVar($_GET['form']);
  23. $line=20;//每页显示条数
  24. $page_line=12;//每页显示链接数
  25. $offset=$page*$line;//总偏移量
  26. $search="&field=$field&form=$form".$ecms_hashur['ehref'];
  27. $query="select * from {$dbtbpre}enewsuser";
  28. $num=$empire->num($query);//取得总条数
  29. $query=$query." order by userid desc limit $offset,$line";
  30. $sql=$empire->query($query);
  31. $returnpage=page2($num,$line,$page_line,$start,$page,$search);
  32. ?>
  33. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  34. <html>
  35. <head>
  36. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  37. <title>选择用户</title>
  38. <link href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  39. <script>
  40. function ChangeUser(user){
  41. var v;
  42. var str;
  43. var r;
  44. str=','+opener.document.<?=$form?>.<?=$field?>.value+',';
  45. //重复
  46. r=str.split(','+user+',');
  47. if(r.length!=1)
  48. {
  49. return false;
  50. }
  51. if(str==",,")
  52. {v="";}
  53. else
  54. {v=",";}
  55. opener.document.<?=$form?>.<?=$field?>.value+=v+user;
  56. }
  57. </script>
  58. </head>
  59. <body>
  60. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  61. <tr class="header">
  62. <td width="15%" height="25"><div align="center">ID</div></td>
  63. <td width="52%" height="25"><div align="center">用户名(点击选择)</div></td>
  64. <td width="33%"><div align="center">等级</div></td>
  65. </tr>
  66. <?
  67. while($r=$empire->fetch($sql))
  68. {
  69. $gr=$empire->fetch1("select groupname from {$dbtbpre}enewsgroup where groupid='$r[groupid]'");
  70. ?>
  71. <tr bgcolor="ffffff">
  72. <td height="25"><div align="center">
  73. <?=$r[userid]?>
  74. </div></td>
  75. <td height="25"><div align="center">
  76. <a href="#empirecms" onclick="javascript:ChangeUser('<?=$r[username]?>');" title="选择"><?=$r[username]?></a>
  77. </div></td>
  78. <td><div align="center">
  79. <?=$gr[groupname]?>
  80. </div></td>
  81. </tr>
  82. <?
  83. }
  84. ?>
  85. <tr bgcolor="ffffff">
  86. <td height="25" colspan="3">
  87. <?=$returnpage?>
  88. </td>
  89. </tr>
  90. </table>
  91. </body>
  92. </html>
  93. <?
  94. db_close();
  95. $empire=null;
  96. ?>