ListZt.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. $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,"zt");
  21. //修改栏目顺序
  22. function EditZtOrder($ztid,$myorder,$userid,$username){
  23. global $empire,$dbtbpre;
  24. for($i=0;$i<count($ztid);$i++)
  25. {
  26. $newmyorder=(int)$myorder[$i];
  27. $ztid[$i]=(int)$ztid[$i];
  28. $sql=$empire->query("update {$dbtbpre}enewszt set myorder='$newmyorder' where ztid='$ztid[$i]'");
  29. }
  30. //操作日志
  31. insert_dolog("");
  32. printerror("EditZtOrderSuccess",EcmsGetReturnUrl());
  33. }
  34. $enews=$_POST['enews'];
  35. if(empty($enews))
  36. {$enews=$_GET['enews'];}
  37. if($enews)
  38. {
  39. hCheckEcmsRHash();
  40. }
  41. //修改显示顺序
  42. if($enews=="EditZtOrder")
  43. {
  44. EditZtOrder($_POST['ztid'],$_POST['myorder'],$logininid,$loginin);
  45. }
  46. $page=(int)$_GET['page'];
  47. $page=RepPIntvar($page);
  48. $start=0;
  49. $line=25;//每页显示条数
  50. $page_line=12;//每页显示链接数
  51. $offset=$page*$line;//总偏移量
  52. $add="";
  53. $search="";
  54. $search.=$ecms_hashur['ehref'];
  55. $url="<a href=ListZt.php".$ecms_hashur['whehref'].">管理专题</a>";
  56. //类别
  57. $zcid=(int)$_GET['zcid'];
  58. if($zcid)
  59. {
  60. $add=" where zcid=$zcid";
  61. $search.="&zcid=$zcid";
  62. }
  63. //分类
  64. $zcstr="";
  65. $csql=$empire->query("select classid,classname from {$dbtbpre}enewsztclass order by classid");
  66. while($cr=$empire->fetch($csql))
  67. {
  68. $select="";
  69. if($cr[classid]==$zcid)
  70. {
  71. $select=" selected";
  72. }
  73. $zcstr.="<option value='".$cr[classid]."'".$select.">".$cr[classname]."</option>";
  74. }
  75. $totalquery="select count(*) as total from {$dbtbpre}enewszt".$add;
  76. $query="select * from {$dbtbpre}enewszt".$add;
  77. $num=$empire->gettotal($totalquery);//取得总条数
  78. $query=$query." order by myorder,ztid desc limit $offset,$line";
  79. $sql=$empire->query($query);
  80. $returnpage=page2($num,$line,$page_line,$start,$page,$search);
  81. ?>
  82. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  83. <html>
  84. <head>
  85. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  86. <title>专题</title>
  87. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  88. </head>
  89. <body>
  90. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  91. <tr>
  92. <td width="50%">位置:
  93. <?=$url?>
  94. </td>
  95. <td><div align="right" class="emenubutton">
  96. <input type="button" name="Submit52" value="增加专题" onclick="self.location.href='AddZt.php?enews=AddZt<?=$ecms_hashur['ehref']?>';">
  97. &nbsp;&nbsp;
  98. <input type="button" name="Submit6" value="数据更新中心" onclick="window.open('../ReHtml/ChangeData.php<?=$ecms_hashur['whehref']?>');">
  99. </div></td>
  100. </tr>
  101. </table>
  102. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  103. <form name="form1" method="get" action="ListZt.php">
  104. <?=$ecms_hashur['eform']?>
  105. <tr>
  106. <td height="30">限制显示:
  107. <select name="zcid" id="zcid" onchange="document.form1.submit()">
  108. <option value="0">显示所有分类</option>
  109. <?=$zcstr?>
  110. </select>
  111. </td>
  112. </tr>
  113. </form>
  114. </table>
  115. <br>
  116. <table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
  117. <form name="editorder" method="post" action="ListZt.php">
  118. <?=$ecms_hashur['form']?>
  119. <tr class="header">
  120. <td width="5%"><div align="center">顺序</div></td>
  121. <td width="6%" height="25"><div align="center">ID</div></td>
  122. <td width="34%" height="25"><div align="center">专题名</div></td>
  123. <td width="20%"><div align="center">增加时间</div></td>
  124. <td width="11%"><div align="center">访问量</div></td>
  125. <td width="13%">专题管理</td>
  126. <td width="11%" height="25"><div align="center">操作</div></td>
  127. </tr>
  128. <?
  129. while($r=$empire->fetch($sql))
  130. {
  131. if($r[zturl])
  132. {
  133. $ztlink=$r[zturl];
  134. }
  135. else
  136. {
  137. $ztlink="../../../".$r[ztpath];
  138. }
  139. ?>
  140. <tr bgcolor="ffffff" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  141. <td><div align="center">
  142. <input name="myorder[]" type="text" id="myorder[]" value="<?=$r[myorder]?>" size="2">
  143. <input name="ztid[]" type="hidden" id="ztid[]" value="<?=$r[ztid]?>">
  144. </div></td>
  145. <td height="25"><div align="center">
  146. <a href="../ecmschtml.php?enews=ReZtHtml&ztid=<?=$r[ztid]?><?=$ecms_hashur['href']?>"><?=$r[ztid]?></a>
  147. </div></td>
  148. <td height="25"><div align="center">
  149. <a href="<?=$ztlink?>" target="_blank"><?=$r[ztname]?></a>
  150. </div></td>
  151. <td><div align="center"><?=$r['addtime']?date("Y-m-d",$r['addtime']):'---'?></div></td>
  152. <td><div align="center">
  153. <?=$r[onclick]?>
  154. </div></td>
  155. <td><a href="AddZt.php?enews=EditZt&ztid=<?=$r[ztid]?><?=$ecms_hashur['ehref']?>">修改</a> <a href="../ecmschtml.php?enews=ReZtHtml&ztid=<?=$r[ztid]?>&ecms=1<?=$ecms_hashur['href']?>">刷新</a> <a href="AddZt.php?enews=AddZt&ztid=<?=$r[ztid]?>&docopy=1<?=$ecms_hashur['ehref']?>">复制</a> <a href="../ecmsclass.php?enews=DelZt&ztid=<?=$r[ztid]?><?=$ecms_hashur['href']?>" onclick="return confirm('确认要删除此专题?');">删除</a></td>
  156. <td height="25"><div align="center"><a href="#ecms" onclick="window.open('../openpage/AdminPage.php?leftfile=<?=urlencode('../special/pageleft.php?ztid='.$r[ztid].$ecms_hashur['ehref'])?>&title=<?=urlencode($r[ztname])?><?=$ecms_hashur['ehref']?>','','');">更新专题</a></div></td>
  157. </tr>
  158. <?
  159. }
  160. ?>
  161. <tr bgcolor="ffffff">
  162. <td height="25" colspan="7"><div align="right">
  163. <input type="submit" name="Submit5" value="修改专题顺序" onClick="document.editorder.enews.value='EditZtOrder';">
  164. <input name="enews" type="hidden" id="enews" value="EditZtOrder">
  165. <font color="#666666">(顺序值越小越前面)</font></div></td>
  166. </tr>
  167. <tr bgcolor="ffffff">
  168. <td height="25" colspan="7">&nbsp;&nbsp;
  169. <?=$returnpage?></td>
  170. </tr>
  171. </form>
  172. </table>
  173. </body>
  174. </html>
  175. <?
  176. db_close();
  177. $empire=null;
  178. ?>