国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
5.8KB

  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
  6. <title>SQL命令行工具</title>
  7. <link rel="stylesheet" href="../static/css/bootstrap.min.css">
  8. <link href="../static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  9. <link href='css/base.css' rel='stylesheet' type='text/css'>
  10. <link rel="stylesheet" type="text/css" href="css/codemirror.css">
  11. <script type="text/javascript" src="js/codemirror.js"></script>
  12. <script type="text/javascript" src="js/mode/sql/sql.js"></script>
  13. </head>
  14. <body background='images/allbg.gif' leftmargin='8' topmargin='8'>
  15. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6"
  16. class="table maintable table-bordered mt-3">
  17. <tr>
  18. <td height="19" background="images/tbg.gif">
  19. <table width="96%" border="0" cellspacing="1" cellpadding="1" class="table table-borderless">
  20. <tr>
  21. <td width="24%" style="padding-left:10px;"><strong>SQL命令运行器:</strong></td>
  22. <td width="76%" align="right">
  23. <a href="sys_data.php" class="btn btn-secondary btn-sm">数据备份</a>
  24. <a href="sys_data_revert.php" class="btn btn-secondary btn-sm">数据还原</a>
  25. <a href="sys_sql_info.php" class="btn btn-secondary btn-sm">数据库说明文档</a>
  26. </td>
  27. </tr>
  28. </table>
  29. </td>
  30. </tr>
  31. <tr>
  32. <td height="200" bgcolor="#FFFFFF" valign="top">
  33. <table width="100%" border="0" cellspacing="4" cellpadding="2" class="table table-borderless">
  34. <form action="sys_sql_query.php" method="post" name="infoform" target="stafrm">
  35. <input type='hidden' name='dopost' value='viewinfo' />
  36. <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
  37. <tr bgcolor="#ffffff">
  38. <td width="15%" height="24" align="center">系统的表信息:</td>
  39. <td>
  40. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  41. <tr>
  42. <td width="35%">
  43. <select name="tablename" id="tablename" style="width:100%;height: auto;" size="6">
  44. <?php
  45. $dsql->SetQuery("Show Tables");
  46. $dsql->Execute('t');
  47. while($row = $dsql->GetArray('t',MYSQL_BOTH))
  48. {
  49. $dsql->SetQuery("Select count(*) From ".$row[0]);
  50. $dsql->Execute('n');
  51. $row2 = $dsql->GetArray('n',MYSQL_BOTH);
  52. $dd = $row2[0];
  53. echo " <option value='".$row[0]."'>".$row[0]."(".$dd.")</option>\r\n";
  54. }
  55. ?>
  56. </select>
  57. </td>
  58. <td width="2%">&nbsp;</td>
  59. <td width="63%" valign="bottom">
  60. <div style="float:left;margin-right:20px;">
  61. <button type="Submit" name="Submit1" class="btn btn-secondary btn-sm"
  62. onClick="this.form.dopost.value='opimize';">优化选中表</button>
  63. <br />
  64. <button type="Submit" name="Submit2" class="btn btn-secondary btn-sm"
  65. onClick="this.form.dopost.value='repair';" style="margin-top:6px;">修复选中表</button>
  66. <br />
  67. <button type="Submit" name="Submit3" class="btn btn-secondary btn-sm"
  68. onClick="this.form.dopost.value='viewinfo';" style="margin-top:6px;">查看表结构</button>
  69. </div>
  70. <div style="float:left">
  71. <button type="Submit" name="Submit5" class="btn btn-secondary btn-sm"
  72. onClick="this.form.dopost.value='opimizeAll';">优化全部表</button>
  73. <br />
  74. <button type="Submit" name="Submit6" class="btn btn-secondary btn-sm"
  75. onClick="this.form.dopost.value='repairAll';" style="margin-top:6px;">修复全部表</button>
  76. </div>
  77. </td>
  78. </tr>
  79. </table>
  80. </td>
  81. </tr>
  82. <tr>
  83. <td height="200" align="center">返回信息:</td>
  84. <td>
  85. <iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe>
  86. </td>
  87. </tr>
  88. </form>
  89. <form action="sys_sql_query.php" method="post" name="form1" target="stafrm">
  90. <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
  91. <input type='hidden' name='dopost' value='query'>
  92. <tr>
  93. <td height="24" colspan="2" bgcolor="#F9FCEF"><strong>运行SQL命令行:
  94. <label><input name="querytype" type="radio" class="np" value="0">
  95. 单行命令(支持简单查询)</label>
  96. <label><input name="querytype" type="radio" class="np" value="2" checked>
  97. 多行命令</label></strong></td>
  98. </tr>
  99. <tr>
  100. <td height="118" colspan="2" style="border: 1px solid #DDD;">
  101. <textarea id="sqlquery" name="sqlquery" cols="60" rows="10" id="sqlquery" style="width:90%;"></textarea>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td height="53" align="center">&nbsp;</td>
  106. <td>
  107. <button type="submit" class="btn btn-secondary">确定</button>
  108. </td>
  109. </tr>
  110. </form>
  111. </table>
  112. </td>
  113. </tr>
  114. </table>
  115. <script type="text/javascript">
  116. var editor = CodeMirror.fromTextArea(document.getElementById('sqlquery'), {
  117. lineNumbers: true,
  118. lineWrapping: true,
  119. mode: 'text/x-mysql'
  120. });
  121. </script>
  122. </body>
  123. </html>