<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("SqlAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf Instr(1, Request("id"), "'", 1)>0 then
	ef=True
	ec="非法产品ID！"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
ElseIf not IsNumeric(Request("backupid"))  Then
	ef=True
	ec="产品ID应该是数字！"
ElseIf Instr(1, session("username"), "'", 1)>0 then
	ef=True
	ec="非法用户名！"
ElseIf Request("ip"&Request("backupid"))<>"" and not IsNumeric(replace(Request("ip"&Request("backupid")),".","")) then
	ef=True
	ec="无效的IP地址！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Sql where id='"&session("SqlAUID")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.Open Sql,conn,1,3
if dsph.Eof then
	ef=True
	ec="不存在的库ID！"
end if
end If

If not ef then
if not dsph("status")="正常" then
		ef=True
		ec="必须是处于正常状态的数据库才能管理！"
end if
end if

if not ef then
	Set dsHostpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_SQLProductlist where SQLtype='"&dsph("SQLtype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsHostpdlist.Open Sql,conn,1,1
if dsHostpdlist.Eof then
	ef=True
	ec="产品不存在！"
end if
end if

if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerSQLlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
end if
end if

if not ef then

sqlname=dsph("sqlname")
sqlpassword=dsph("sqlpassword")




%>
<!--#include virtual="/inc-freehost-function/template-sqladm-top.asp"-->
　数据库自助管理


<br>

<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD height="35" align="center" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">数据库高级管理功能：</font></TD>
      </TR>
    <TR>
      <TD height="35" align="center" vAlign=middle bgColor=#EEEEEE>
	  <%if dsserver("softtype")="MySQL" then%>
	   <form name="gofxx" method="post" action="<%=dsserver("admurl")%>/index.php" target=_blank>
	     <input type="hidden" name="pma_username" value="<%=sqlname%>">       
              <input type="hidden" name="pma_password" value="<%=sqlpassword%>">
	     <input type="hidden" name="server" value="1" />
<!--              <input type="hidden" name="lang" value="zh-utf-8" />-->
              <input type="hidden" name="convcharset" value="iso-8859-1" />
	     </form>	   <%else%>
	   <form name="gofxx" method="post" action="<%=dsserver("admurl")%>/login.asp" target=_blank>
	     <input type="hidden" name="autorun" value="7i24.com">  
	     <input type="hidden" name="UsernameTextBox" value="<%=sqlname%>">       
              <input type="hidden" name="PasswordTextBox" value="<%=sqlpassword%>">
	     <input type="hidden" name="ServerTextBox" value="(local)" />
              <input type="hidden" name="AuthRadioButtonList" value="sql" />
		                <input type="hidden" name="LoginButton" value="Login" />
  

	     </form>	   <%end if%>
	  
	   <%if not isnull(dsserver("admurl")) then%>	   <%if len(dsserver("admurl"))>13 then%>
	   <a href="javascript:document.gofxx.submit()"><font color="#000000">[点击进入高级管理]</font></a>
	   
	   <%else%>很抱歉，您所在的服务器不支持此功能。<%end if%>	   <%end if%></TD>
      </TR>
  </TBODY>
</TABLE>
<br>
<br>
<br>
<%=ret2%><br><br><br>

　<a href="selfsqlmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回上一页]</font></a>
<!--#include virtual="/inc-freehost-function/template-sqladm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>