国内流行的内容管理系统(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.

122 lines
5.7KB

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