<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<body>
<h1>
<span class="action-span1"><a href="?ctl=index&act=admin_main"><tpl>$common_admin_index</tpl><!--管理首页--></a> >> <tpl>$data_sql_query</tpl><!--SOL语句执行--></span>
<div style="clear:both"></div>
</h1>
<div class="form-div">
  <form name="sqlFrom" method="post" action="index.php?ctl=data&act=query_sql" onSubmit="return validate()">
  <table>
    <tr><th><tpl>$data_sql_query</tpl></th></tr>
    <tr><td><span style="color: rgb(255, 0, 0);"><strong><tpl>$data_sql_info</tpl></strong></span></td></tr>
    <tr><td><textarea name="sql" rows="6" cols="100"><tpl>$sql</tpl></textarea></td></tr>
    <tr><td><input value="<tpl>$data_sql_submit</tpl>" type="submit" class="button" /></td></tr>
  </table>
  </form>
</div>
<tpl>if $show=='yes'</tpl>
<div class="list-div" id="listDiv">
  <tpl>if $state == '0'</tpl>
  <!-- 出错提示-->
  <span style="color: rgb(255, 0, 0);"><strong><tpl>$data_sql_error</tpl>:</strong></span><br />
  <tpl>$message</tpl>
  <tpl>/if</tpl>
  <tpl>if $state == '1'</tpl>
  <!-- 执行成功-->
  <center><h3><tpl>$message</tpl></h3></center>
  <tpl>/if</tpl>
  <tpl>if $state == '2'</tpl>
  <!--有返回值-->
    <tpl>$message</tpl>
  <tpl>/if</tpl>
</div>
<tpl>/if</tpl>
<script language="JavaScript">
<!--
  /**
   * 检查表单输入的内容
   */
  function validate()
  {
    var validator = new Validator('sqlFrom');
    validator.required('sql','<tpl>$data_sql_null</tpl>');
    return validator.passed();
  }
//-->
</script>
<div id="footer">
<tpl>$common_copyright</tpl>
</div>
</body>