AddSql.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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,"execsql");
  20. $enews=RepPostStr($_GET['enews'],1);
  21. if(empty($enews))
  22. {
  23. $enews='AddSql';
  24. }
  25. $url="<a href='ListSql.php".$ecms_hashur['whehref']."'>管理SQL语句</a>&nbsp;>&nbsp;增加SQL语句";
  26. $postword='增加SQL语句';
  27. if($enews=='EditSql')
  28. {
  29. $id=intval($_GET['id']);
  30. $r=$empire->fetch1("select * from {$dbtbpre}enewssql where id='$id'");
  31. $url="<a href='ListSql.php".$ecms_hashur['whehref']."'>管理SQL语句</a>&nbsp;>&nbsp;修改SQL语句: <b>".$r[sqlname]."</b>";
  32. $postword='修改SQL语句';
  33. }
  34. db_close();
  35. $empire=null;
  36. ?>
  37. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  38. <html>
  39. <head>
  40. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  41. <title><?=$postword?></title>
  42. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  43. </head>
  44. <body>
  45. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  46. <tr>
  47. <td height="25">位置:<?=$url?></td>
  48. </tr>
  49. </table>
  50. <form action="DoSql.php" method="POST" name="sqlform">
  51. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  52. <?=$ecms_hashur['form']?>
  53. <tr class="header">
  54. <td height="25"><div align="center"><?=$postword?></div></td>
  55. </tr>
  56. <tr>
  57. <td height="25" bgcolor="#FFFFFF"><div align="center">(多条语句请用&quot;回车&quot;格开,每条语句以&quot;;&quot;结束,数据表前缀可用:“[!db.pre!]&quot;表示)</div></td>
  58. </tr>
  59. <tr>
  60. <td height="25" bgcolor="#FFFFFF"><div align="center">
  61. <textarea name="sqltext" cols="90" rows="12" id="sqltext"><?=ehtmlspecialchars($r[sqltext])?></textarea>
  62. </div></td>
  63. </tr>
  64. <tr>
  65. <td height="25" bgcolor="#FFFFFF"><div align="center">SQL名称:
  66. <input name="sqlname" type="text" id="sqlname" value="<?=$r[sqlname]?>">
  67. <input type="submit" name="Submit3" value="保存">
  68. &nbsp;<input type="reset" name="Submit2" value="重置">
  69. <input name="enews" type="hidden" id="enews" value="<?=$enews?>">
  70. <input name="id" type="hidden" id="id" value="<?=$id?>">
  71. </div></td>
  72. </tr>
  73. </table>
  74. </form>
  75. </body>
  76. </html>