TempGroup.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  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. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"tempgroup");
  20. $enews=$_POST['enews'];
  21. if(empty($enews))
  22. {$enews=$_GET['enews'];}
  23. if($enews)
  24. {
  25. hCheckEcmsRHash();
  26. include("../../class/tempfun.php");
  27. }
  28. if($enews=="LoadInTempGroup")//导入
  29. {
  30. include "../".LoadLang("pub/fun.php");
  31. $file=$_FILES['file']['tmp_name'];
  32. $file_name=$_FILES['file']['name'];
  33. $file_type=$_FILES['file']['type'];
  34. $file_size=$_FILES['file']['size'];
  35. LoadInTempGroup($_POST,$file,$file_name,$file_type,$file_size,$logininid,$loginin);
  36. }
  37. elseif($enews=="LoadTempGroup")//导出
  38. {
  39. LoadTempGroup($_POST,$logininid,$loginin);
  40. }
  41. elseif($enews=="EditTempGroup")//修改
  42. {
  43. EditTempGroup($_POST,$logininid,$loginin);
  44. }
  45. elseif($enews=="DefTempGroup")//默认
  46. {
  47. DefTtempGroup($_POST,$logininid,$loginin);
  48. }
  49. elseif($enews=="DelTempGroup")//删除
  50. {
  51. DelTempGroup($_POST,$logininid,$loginin);
  52. }
  53. else
  54. {}
  55. $sql=$empire->query("select gid,gname,isdefault from {$dbtbpre}enewstempgroup order by gid");
  56. ?>
  57. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  58. <html>
  59. <head>
  60. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  61. <title>模板组管理</title>
  62. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  63. <script>
  64. function CheckDel(gid){
  65. var ok=confirm("确认要删除?");
  66. if(ok)
  67. {
  68. self.location.href='TempGroup.php?<?=$ecms_hashur['href']?>&enews=DelTempGroup&gid='+gid;
  69. }
  70. }
  71. </script>
  72. </head>
  73. <body>
  74. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  75. <tr>
  76. <td>位置:<a href="TempGroup.php<?=$ecms_hashur['whehref']?>">模板组管理</a></td>
  77. </tr>
  78. </table>
  79. <br>
  80. <table width="100%" border="0" align="center">
  81. <tr>
  82. <td width="48%" valign="top">
  83. <table width="93%" border="0" cellpadding="3" cellspacing="1" class="tableborder">
  84. <form name=tempgroup method=post action=TempGroup.php onsubmit="return confirm('确认要执行?');">
  85. <?=$ecms_hashur['form']?>
  86. <input type=hidden name=enews value=EditTempGroup>
  87. <tr class="header">
  88. <td width="10%" height="25"> <div align="center"></div></td>
  89. <td width="90%" height="25">模板组名称</td>
  90. </tr>
  91. <?
  92. while($r=$empire->fetch($sql))
  93. {
  94. $tempgroup_options.="<option value='".$r['gid']."'>".$r['gname']."</option>";
  95. $bgcolor="#FFFFFF";
  96. $checked="";
  97. $movejs=' onmouseout="this.style.backgroundColor=\'#ffffff\'" onmouseover="this.style.backgroundColor=\'#C3EFFF\'"';
  98. if($r['isdefault'])
  99. {
  100. $bgcolor="#DBEAF5";
  101. $checked=" checked";
  102. $movejs='';
  103. }
  104. ?>
  105. <input type=hidden name=gid[] value=<?=$r[gid]?>>
  106. <tr bgcolor="<?=$bgcolor?>"<?=$movejs?>>
  107. <td height="25"> <div align="center">
  108. <input type="radio" name="changegid" value="<?=$r[gid]?>"<?=$checked?>>
  109. </div></td>
  110. <td height="25"> <input name="gname[]" type="text" id="gname[]" value="<?=$r[gname]?>" size="30">(ID:<?=$r[gid]?>)
  111. </td>
  112. </tr>
  113. <?
  114. }
  115. ?>
  116. <tr bgcolor="#FFFFFF">
  117. <td height="25">&nbsp;</td>
  118. <td height="25"><input type="submit" name="Submit3" value="修改" onclick="document.tempgroup.enews.value='EditTempGroup';">&nbsp;
  119. <input type="submit" name="Submit4" value="设为默认" onclick="document.tempgroup.enews.value='DefTempGroup';">&nbsp;
  120. <input type="submit" name="Submit6" value="导出" onclick="document.tempgroup.enews.value='LoadTempGroup';">&nbsp;
  121. <input type="submit" name="Submit7" value="删除" onclick="document.tempgroup.enews.value='DelTempGroup';">&nbsp;
  122. <input type="reset" name="Submit5" value="重置">
  123. </td>
  124. </tr>
  125. </form>
  126. </table>
  127. </td>
  128. <td width="52%" valign="top">
  129. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  130. <form action=TempGroup.php method=post enctype="multipart/form-data" name=loadform onsubmit="return confirm('确认要执行?');">
  131. <?=$ecms_hashur['form']?>
  132. <input type=hidden name=enews value=LoadInTempGroup>
  133. <tr class="header">
  134. <td height="25" colspan="2">导入模板组</td>
  135. </tr>
  136. <tr bgcolor="#FFFFFF">
  137. <td width="24%" height="32">上传模板文件</td>
  138. <td width="76%"> <input type="file" name="file">
  139. <font color="#666666">(*.temp文件)</font></td>
  140. </tr>
  141. <tr bgcolor="#FFFFFF">
  142. <td height="32">模板编码</td>
  143. <td> <input name="ChangeChar" type="checkbox" id="ChangeChar" value="1" onclick="if(this.checked){changechardiv.style.display='';}else{changechardiv.style.display='none';}">
  144. 模板需要转编码 &nbsp;&nbsp;<font color="#666666">(当前站点编码:<b><?=$ecms_config['sets']['pagechar']?></b>)</font></td>
  145. </tr>
  146. <tr bgcolor="#FFFFFF" id="changechardiv" style="display:none">
  147. <td height="32">&nbsp;</td>
  148. <td> 要导入的模板编码:
  149. <select name="tempchar" id="tempchar">
  150. <option value="GB2312">简体GB2312</option>
  151. <option value="UTF8">简体UTF-8</option>
  152. <option value="BIG5">繁体BIG5</option>
  153. <option value="TCUTF8">繁体UTF-8</option>
  154. </select>
  155. </td>
  156. </tr>
  157. <tr bgcolor="#FFFFFF">
  158. <td height="32">覆盖模板组</td>
  159. <td> <select name="gid" id="gid">
  160. <option value="0">新建新的模板组</option>
  161. <?=$tempgroup_options?>
  162. </select> </td>
  163. </tr>
  164. <tr bgcolor="#FFFFFF">
  165. <td height="32">&nbsp;</td>
  166. <td height="25"> <input type="submit" name="Submit" value="导 入">
  167. &nbsp;&nbsp; </td>
  168. </tr>
  169. </form>
  170. </table>
  171. <table width="100%" border="0" cellspacing="1" cellpadding="3">
  172. <tr>
  173. <td height="25"><font color="#666666">查看源模板编码技巧:用记事本打开.temp文件,然后搜索“<strong>charset=</strong>”就能查看编码</font></td>
  174. </tr>
  175. </table></td>
  176. </tr>
  177. </table>
  178. </body>
  179. </html>
  180. <?
  181. db_close();
  182. $empire=null;
  183. ?>