AddSearchLoadTb.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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,"searchall");
  20. $url="<a href=ListSearchLoadTb.php".$ecms_hashur['whehref'].">管理全站搜索数据源</a>&nbsp;>&nbsp;增加搜索数据源";
  21. $word='增加全站搜索数据源';
  22. $enews=ehtmlspecialchars($_GET['enews']);
  23. $r['titlefield']='title';
  24. $r['loadnum']='300';
  25. //修改
  26. if($enews=="EditSearchLoadTb")
  27. {
  28. $lid=(int)$_GET['lid'];
  29. $r=$empire->fetch1("select lid,tbname,titlefield,infotextfield,smalltextfield,loadnum from {$dbtbpre}enewssearchall_load where lid='$lid'");
  30. $url="<a href=ListSearchLoadTb.php".$ecms_hashur['whehref'].">管理全站搜索数据源</a>&nbsp;>&nbsp;修改搜索数据源";
  31. $word='修改全站搜索数据源';
  32. }
  33. //数据表
  34. $tsql=$empire->query("select tid,tbname,tname from {$dbtbpre}enewstable order by tid");
  35. while($tr=$empire->fetch($tsql))
  36. {
  37. if($r[tbname]==$tr[tbname])
  38. {$select=" selected";}
  39. else
  40. {$select="";}
  41. $table.="<option value='".$tr[tbname]."'".$select.">".$tr[tname]."</option>";
  42. }
  43. db_close();
  44. $empire=null;
  45. ?>
  46. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  47. <html>
  48. <head>
  49. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  50. <title>管理全站搜索数据源</title>
  51. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  52. </head>
  53. <body>
  54. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  55. <tr>
  56. <td>位置:<?=$url?>
  57. </td>
  58. </tr>
  59. </table>
  60. <form name="form1" method="post" action="ListSearchLoadTb.php">
  61. <input type=hidden name=enews value=<?=$enews?>>
  62. <input type=hidden name=lid value=<?=$lid?>>
  63. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  64. <?=$ecms_hashur['form']?>
  65. <tr class="header">
  66. <td height="25" colspan="2"><?=$word?></td>
  67. </tr>
  68. <tr bgcolor="#FFFFFF">
  69. <td height="25">导入的数据表:</td>
  70. <td height="25"><select name="tbname" id="tbname">
  71. <?=$table?>
  72. </select>
  73. <font color="#666666">(*)</font>
  74. <input name="oldtbname" type="hidden" id="oldtbname" value="<?=$r[tbname]?>"> </td>
  75. </tr>
  76. <tr bgcolor="#FFFFFF">
  77. <td width="18%" height="25">标题字段:</td>
  78. <td width="82%" height="25"><input name="titlefield" type="text" id="titlefield" value="<?=$r[titlefield]?>">
  79. <font color="#666666">(*)</font> </td>
  80. </tr>
  81. <tr bgcolor="#FFFFFF">
  82. <td height="25">内容字段:</td>
  83. <td height="25"><input name="infotextfield" type="text" id="infotextfield" value="<?=$r[infotextfield]?>">
  84. <font color="#666666">(*)</font></td>
  85. </tr>
  86. <tr bgcolor="#FFFFFF">
  87. <td height="25">简介字段:</td>
  88. <td height="25"><input name="smalltextfield" type="text" id="smalltextfield" value="<?=$r[smalltextfield]?>">
  89. <font color="#666666">(*)</font> </td>
  90. </tr>
  91. <tr bgcolor="#FFFFFF">
  92. <td height="25">每组导入记录数:</td>
  93. <td height="25"><input name="loadnum" type="text" id="loadnum" value="<?=$r[loadnum]?>">
  94. <font color="#666666">(*)</font></td>
  95. </tr>
  96. <tr bgcolor="#FFFFFF">
  97. <td height="25">&nbsp;</td>
  98. <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
  99. </tr>
  100. </table>
  101. </form>
  102. </body>
  103. </html>