<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>SQL命令行工具</title>

<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/base.css">
<script language="javascript" src="js/jquery.min.js" type="text/javascript"></script>	
<script type="text/javascript" src="js/admin.jquery.configuration.js"></script>

<script language="javascript" src="js/global.js"></script>
<script language="javascript" src="../include/js/dedeajax2.js"></script>

</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
<?php include(DEDEADMIN.'/templets/menu.htm'); ?>
<script language="javascript">
$("#sys").addClass("current");$("#sys_sql_query").addClass("current");</script>				

	<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>SQL命令行工具</h3>
					
					<ul class="content-box-tabs">

					</ul>
					
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					
<div class="tab-content  default-tab" id="tab1">				
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">
<tr>
    <td > 
      <table width="96%" border="0" cellspacing="1" cellpadding="1">
        <tr> 
          <td width="24%" style="padding-left:10px;"><b><a href="sys_data.php">数据备份</a> </b> 
            | <b><a href="sys_data_revert.php">数据还原</a></b> 
            | <b><a href="sys_sql_info.php">数据库说明文档</a></b> 
          </td>
        </tr>
      </table>
   </td>
</tr>
<tr>
    <td height="200" bgcolor="#FFFFFF" valign="top">
	<table width="100%" border="0" cellspacing="4" cellpadding="2">
        <form action="sys_sql_query.php" method="post" name="infoform" target="stafrm">
          <input type='hidden' name='dopost' value='viewinfo' />
          <tr bgcolor="#ffffff"> 
            <td width="15%" height="24" align="center">系统的表信息：</td>
            <td> 
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td width="35%">
                  	<select name="tablename" id="tablename" style="width:100%" size="6">
                      <?php
$dsql->SetQuery("Show Tables");
$dsql->Execute('t');
while($row = $dsql->GetArray('t',MYSQL_BOTH))
{
	$dsql->SetQuery("Select count(*) From ".$row[0]);
	$dsql->Execute('n');
	$row2 = $dsql->GetArray('n',MYSQL_BOTH);
	$dd = $row2[0];
	echo "			<option value='".$row[0]."'>".$row[0]."(".$dd.")</option>\r\n";
}
?>
                    </select>
                  </td>
                  <td width="2%">&nbsp;</td>
<td width="63%" valign="bottom">

<div style="float:left;margin-right:20px;">
<input class="button" name="Submit1" type="Submit" value="优化选中表" onClick="this.form.dopost.value='opimize';" />

	<br />
<input class="button" name="Submit2" type="Submit" value="修复选中表" onClick="this.form.dopost.value='repair';" />    

	<br />
<input class="button" name="Submit3" type="Submit" value="查看表结构" onClick="this.form.dopost.value='viewinfo';" />    

</div>
<div style="float:left">
<input class="button" name="Submit5" type="Submit" value="优化全部表" onClick="this.form.dopost.value='opimizeAll';" />  

	<br />
<input class="button" name="Submit6" type="Submit" value="修复全部表" onClick="this.form.dopost.value='repairAll';" />      

</div>

</td>
                </tr>
              </table></td>
          </tr>
          <tr> 
            <td height="200" align="center">返回信息：</td>
            <td>
			<iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe>
			</td>
          </tr>
		  </form>
		  <form action="sys_sql_query.php" method="post" name="form1" target="stafrm">
          <input type='hidden' name='dopost' value='query'>
          <tr> 
            <td colspan="2">运行SQL命令行： 
              <input name="querytype" type="radio" class="np" value="0">
              单行命令（支持简单查询） 
              <input name="querytype" type="radio" class="np" value="2" checked>
              多行命令</td>
          </tr>
		      <tr> 
            <td height="118" colspan="2">
			<textarea name="sqlquery" cols="60" rows="10" id="sqlquery" style="width:90%"></textarea> 
            </td>
          </tr>
          <tr> 
            <td height="53" align="center">&nbsp;</td>
            <td>
            <input class="button" name="imageField" type="submit" value="确定" />
           
            </td>
          </tr>
        </form>
      </table>
	 </td>
</tr>
</table>
							<div class="clear"></div><!-- End .clear -->
							
						
						
					</div> <!-- End #tab1 -->

					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			
			<div class="clear"></div>
			
           <?php include(DEDEADMIN.'/templets/footer.htm'); ?>
			
		</div> <!-- End #main-content -->	
	</div>
</body>
</html>