AddGoodType.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require('../../class/connect.php');
  4. require('../../class/db_sql.php');
  5. require('../../class/functions.php');
  6. require("../../data/dbcache/class.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,"class");
  21. $ttype=(int)$_GET['ttype'];
  22. $ttypetitle=$ttype==0?'推荐':'头条';
  23. $enews=RepPostStr($_GET['enews'],1);
  24. $url="<a href='ListGoodType.php?ttype=".$ttype.$ecms_hashur['ehref']."'>管理".$ttypetitle."级别</a>&nbsp;>&nbsp;增加".$ttypetitle."级别";
  25. $postword="增加".$ttypetitle."级别";
  26. $docopy=ehtmlspecialchars($_GET['docopy']);
  27. //初使化数据
  28. $tid=0;
  29. $r[myorder]=0;
  30. $r[levelid]=1;
  31. $r[showall]=0;
  32. $ecmsfirstpost=1;
  33. //复制
  34. if($docopy)
  35. {
  36. $tid=(int)$_GET['tid'];
  37. $r=$empire->fetch1("select * from {$dbtbpre}enewsgoodtype where tid='$tid'");
  38. $url="<a href='ListGoodType.php?ttype=".$ttype.$ecms_hashur['ehref']."'>管理".$ttypetitle."级别</a>&nbsp;>&nbsp;复制".$ttypetitle."级别:".$r['tname'];
  39. $r['tname'].='(1)';
  40. }
  41. //修改
  42. if($enews=="EditGoodType")
  43. {
  44. $ecmsfirstpost=0;
  45. $tid=(int)$_GET['tid'];
  46. $r=$empire->fetch1("select * from {$dbtbpre}enewsgoodtype where tid='$tid'");
  47. $url="<a href='ListGoodType.php?ttype=".$ttype.$ecms_hashur['ehref']."'>管理".$ttypetitle."级别</a>&nbsp;>&nbsp;修改".$ttypetitle."级别:".$r['tname'];
  48. $postword="修改".$ttypetitle."级别";
  49. }
  50. if($ecmsfirstpost==1)
  51. {
  52. $maxr=$empire->fetch1("select levelid from {$dbtbpre}enewsgoodtype where ttype='$ttype' order by levelid desc limit 1");
  53. $r['levelid']=$maxr['levelid']+1;
  54. }
  55. //用户组
  56. $group='';
  57. $groupsql=$empire->query("select groupid,groupname from {$dbtbpre}enewsgroup order by groupid");
  58. while($groupr=$empire->fetch($groupsql))
  59. {
  60. $select='';
  61. if(strstr($r[groupid],','.$groupr[groupid].','))
  62. {
  63. $select=' selected';
  64. }
  65. $group.="<option value='".$groupr[groupid]."'".$select.">".$groupr[groupname]."</option>";
  66. }
  67. //当前使用的模板组
  68. $thegid=GetDoTempGid();
  69. ?>
  70. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  71. <html>
  72. <head>
  73. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  74. <title><?=$ttypetitle?>级别</title>
  75. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  76. <script>
  77. function selectalls(doselect,formvar)
  78. {
  79. var bool=doselect==1?true:false;
  80. var selectform=document.getElementById(formvar);
  81. for(var i=0;i<selectform.length;i++)
  82. {
  83. selectform.all[i].selected=bool;
  84. }
  85. }
  86. </script>
  87. </head>
  88. <body>
  89. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  90. <tr>
  91. <td>位置:
  92. <?=$url?>
  93. </td>
  94. </tr>
  95. </table>
  96. <br>
  97. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  98. <form name="form1" method="post" action="ListGoodType.php">
  99. <?=$ecms_hashur['form']?>
  100. <tr class="header">
  101. <td height="25" colspan="2">
  102. <?=$postword?>
  103. <input type=hidden name=enews value="<?=$enews?>"> <input name="tid" type="hidden" id="tid" value="<?=$tid?>">
  104. <input name="ttype" type="hidden" id="ttype" value="<?=$ttype?>"></td>
  105. </tr>
  106. <tr>
  107. <td height="25" bgcolor="#FFFFFF"><?=$ttypetitle?>级别</td>
  108. <td bgcolor="#FFFFFF"><input name="levelid" type="text" id="levelid" value="<?=$r[levelid]?>" size="38">
  109. <font color="#666666">(填1~255之间数字)</font></td>
  110. </tr>
  111. <tr>
  112. <td width="24%" height="25" bgcolor="#FFFFFF">级别名称</td>
  113. <td width="76%" bgcolor="#FFFFFF"> <input name="tname" type="text" id="tname" value="<?=$r[tname]?>" size="38"></td>
  114. </tr>
  115. <tr>
  116. <td height="25" bgcolor="#FFFFFF">排序</td>
  117. <td bgcolor="#FFFFFF"><input name="myorder" type="text" id="myorder" value="<?=$r[myorder]?>" size="38">
  118. <font color="#666666"> (值越大显示越前面)</font></td>
  119. </tr>
  120. <tr>
  121. <td height="25" valign="top" bgcolor="#FFFFFF">可选择的用户组<br>
  122. <br>
  123. <font color="#666666">(不选为不限,<br>
  124. 选择多个用CTRL/SHIFT)</font></td>
  125. <td bgcolor="#FFFFFF"><select name="groupid[]" size="8" multiple id="groupidselect" style="width:180">
  126. <?=$group?>
  127. </select>
  128. [<a href="#empirecms" onclick="selectalls(0,'groupidselect')">全部取消</a>]</td>
  129. </tr>
  130. <tr>
  131. <td height="25" bgcolor="#FFFFFF">在管理所有信息页显示</td>
  132. <td bgcolor="#FFFFFF"><input type="radio" name="showall" value="0"<?=$r['showall']==0?' checked':''?>>
  133. <input type="radio" name="showall" value="1"<?=$r['showall']==1?' checked':''?>>
  134. 否</td>
  135. </tr>
  136. <tr>
  137. <td height="25" bgcolor="#FFFFFF">只在这些终极栏目显示</td>
  138. <td bgcolor="#FFFFFF"><input name="showcid" type="text" id="showcid" value="<?=substr($r['showcid'],1,-1)?>" size="38">
  139. <input type="button" name="Submit622232" value="管理栏目" onclick="window.open('../ListClass.php<?=$ecms_hashur['whehref']?>');">
  140. <font color="#666666">(多个栏目ID用半角逗号“,”隔开)</font></td>
  141. </tr>
  142. <tr>
  143. <td height="25" bgcolor="#FFFFFF">不在这些终极栏目显示</td>
  144. <td bgcolor="#FFFFFF"><input name="hiddencid" type="text" id="hiddencid" value="<?=substr($r['hiddencid'],1,-1)?>" size="38">
  145. <font color="#666666">(填写终极栏目ID,多个栏目ID用半角逗号“,”隔开)</font></td>
  146. </tr>
  147. <tr>
  148. <td height="25" bgcolor="#FFFFFF"> <div align="center"></div></td>
  149. <td bgcolor="#FFFFFF"> <input type="submit" name="Submit" value="提交"> &nbsp;&nbsp;
  150. <input type="reset" name="Submit2" value="重置"> </td>
  151. </tr>
  152. </form>
  153. </table>
  154. </body>
  155. </html>
  156. <?php
  157. db_close();
  158. $empire=null;
  159. ?>