<!--#include file ="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK href="admin/admin.css" type=text/css rel=stylesheet><script language="JavaScript" src="admin/js.js"></SCRIPT></head>
<%

if Request.QueryString("del")="yes" Then
Dim tname
Dim sql
tname = request.Querystring("tname")
Sql="drop table "&tname&""
Conn.ExeCute(sql)
JaSys("管理员" & session("ManagerUser")&"删除数据表<font color=red>["&tname&"]</font>")
 Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('数据表删除成功!');" & Chr(13)
		Response.write "window.document.location.href='JaAcc_Manage.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
      Response.End
End If
%> 
<SCRIPT language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除选中的信息吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;	 
}
function chk()
{
  if (document.form1.cmd.value=="")
  {
    alert("语句不能为空！");
    document.form1.cmd.focus();
    return false;
  }
}
</SCRIPT>
<body text="#000000">
<br>
<table width="87%" border="0" align="center" cellpadding="4" cellspacing="0" class=tableBorder>
  <tr> 
    <td height="25" background="admin/admin_bg_1.gif"><div align="center"><strong><font color="#FFFFFF">数据库表管理</font></strong></div></td>
  </tr>
<tr> 
    <td height="25"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
		<%
Dim objTableRs
Dim tablename
Dim i
i = 0
Set objTableRS = Conn.OpenSchema(20,Array(Empty, Empty, Empty, "TABLE"))
if tablename="" then tablename=objTableRS("Table_Name").Value
Do While Not objTableRS.EOF
Response.Write "  <td><a href='JaAcc_Edit.asp?tname="&objTableRS("Table_Name").Value&"'>"&objTableRS("Table_Name").Value&"</a></td>"
If i mod 3 = 0 Then
Response.Write "</tr>"
End if
i = i + 1
objTableRS.MoveNext
Loop
%>
        </tr>
      </table> </td>
  </tr>

</table>

<%
If Request.QueryString("action")="do" Then
Dim cmd
cmd = Request.Form("cmd")
Set objRS = Conn.ExeCute(cmd)
%>
<br>
<table width="87%" border="0" align="center" cellpadding="4" cellspacing="0" class=tableBorder>
  <tr> 
    <td height="25" background="admin/admin_bg_1.gif"><div align="center"><strong><font color="#FFFFFF">命令返回结果</font></strong></div></td>
  </tr>
  <tr> 
    <td height="25"> 
  <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF">
        <tr bgcolor="#fffff" align="center" valign="top">
<%
if objrs.state = 1 then 
For i=0 to objRs.Fields.Count-1
Response.write"<td><b>"&objRS.Fields(i).name&"</b></td>"
Next
Response.write "</tr>"
if objrs.eof then
else
DO While NOT objRS.Eof
Response.write "<tr>"
For i=0 to objRs.Fields.Count-1
Response.write"<td>"
If IsNull(objRs.Fields(i).value) or objRs.Fields(i).value="" or objRs.Fields(i).value=" " then
response.write "&nbsp;"
else
  Response.write Server.HTMLEncode(objRs.Fields(i).value)
 end if
Response.write"</td>"
Next
Response.write"</tr>"
objRS.MoveNext
j=j+1
Loop
end if
end if
set objRs = nothing
set objTableRS = nothing
objConn.Close
set objConn = nothing
Response.Write "</table><br>"
if request("cmd")<>"" then response.Write("SQL命令执行成功，返回 <font color=""#FF0000"">"&j&"</font> 条记录")
Response.Write "</table></tr></table>"


End If
%>
<form name="form1" action="?action=do" method="post" onSubmit="return chk(this)">
<table width="87%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="61"><div align="center">
        <input name="cmd" type="text" id="cmd" size="60">
        <input name="submit" type="submit" value="执行SQL">
      </div></td>
  </tr>
</table>
</form>
