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

127 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. </td>
  26. </tr>
  27. </table>
  28. </td>
  29. </tr>
  30. <tr>
  31. <td height="200" bgcolor="#FFFFFF" valign="top">
  32. <table width="100%" border="0" cellspacing="4" cellpadding="2" class="table table-borderless">
  33. <form action="sys_sql_query.php" method="post" name="infoform" target="stafrm">
  34. <input type='hidden' name='dopost' value='viewinfo' />
  35. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>" />
  36. <tr bgcolor="#ffffff">
  37. <td width="15%" height="24" align="center">系统的表信息:</td>
  38. <td>
  39. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  40. <tr>
  41. <td width="35%">
  42. <select name="tablename" id="tablename" style="width:100%;height: auto;" size="6">
  43. <?php
  44. $dsql->SetQuery("Show Tables");
  45. $dsql->Execute('t');
  46. while($row = $dsql->GetArray('t',MYSQL_BOTH))
  47. {
  48. $dsql->SetQuery("Select count(*) From ".$row[0]);
  49. $dsql->Execute('n');
  50. $row2 = $dsql->GetArray('n',MYSQL_BOTH);
  51. $dd = $row2[0];
  52. echo " <option value='".$row[0]."'>".$row[0]."(".$dd.")</option>\r\n";
  53. }
  54. ?>
  55. </select>
  56. </td>
  57. <td width="2%">&nbsp;</td>
  58. <td width="63%" valign="bottom">
  59. <div style="float:left;margin-right:20px;">
  60. <button type="Submit" name="Submit1" class="btn btn-secondary btn-sm"
  61. onClick="this.form.dopost.value='opimize';">优化选中表</button>
  62. <br />
  63. <button type="Submit" name="Submit2" class="btn btn-secondary btn-sm"
  64. onClick="this.form.dopost.value='repair';" style="margin-top:6px;">修复选中表</button>
  65. <br />
  66. <button type="Submit" name="Submit3" class="btn btn-secondary btn-sm"
  67. 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-secondary btn-sm"
  71. onClick="this.form.dopost.value='opimizeAll';">优化全部表</button>
  72. <br />
  73. <button type="Submit" name="Submit6" class="btn btn-secondary btn-sm"
  74. onClick="this.form.dopost.value='repairAll';" style="margin-top:6px;">修复全部表</button>
  75. </div>
  76. </td>
  77. </tr>
  78. </table>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td height="200" align="center">返回信息:</td>
  83. <td>
  84. <iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe>
  85. </td>
  86. </tr>
  87. </form>
  88. <form action="sys_sql_query.php" method="post" name="form1" target="stafrm">
  89. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token'];?>" />
  90. <input type='hidden' name='dopost' value='query'>
  91. <tr>
  92. <td height="24" colspan="2" bgcolor="#F9FCEF"><strong>运行SQL命令行:
  93. <label><input name="querytype" type="radio" class="np" value="0">
  94. 单行命令(支持简单查询)</label>
  95. <label><input name="querytype" type="radio" class="np" value="2" checked>
  96. 多行命令</label></strong></td>
  97. </tr>
  98. <tr>
  99. <td height="118" colspan="2" style="border: 1px solid #DDD;">
  100. <textarea id="sqlquery" name="sqlquery" cols="60" rows="10" id="sqlquery" style="width:90%;"></textarea>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td height="53" align="center">&nbsp;</td>
  105. <td>
  106. <button type="submit" class="btn btn-secondary">确定</button>
  107. </td>
  108. </tr>
  109. </form>
  110. </table>
  111. </td>
  112. </tr>
  113. </table>
  114. <script type="text/javascript">
  115. var editor = CodeMirror.fromTextArea(document.getElementById('sqlquery'), {
  116. lineNumbers: true,
  117. lineWrapping: true,
  118. mode: 'text/x-mysql'
  119. });
  120. </script>
  121. </body>
  122. </html>