<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canadmsqlset")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf not IsNumeric(Request.Form ("id")) Then
	ef=True
	ec="非法产品ID！"&Request.Form ("Sqltype")
ElseIf not IsNumeric(Request.Form ("Sqltype")) Then
	ef=True
	ec="非法产品ID！"&Request.Form ("Sqltype")
ElseIf not IsNumeric(Request.Form ("userspacelimt")) Then
	ef=True
	ec="非法数据库大小！"
ElseIf not IsNumeric(Request.Form ("logspacelimt")) Then
	ef=True
	ec="非法数据库大小！"
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='"&Request.Form ("id")&"'"
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="要修改的数据库产品不存在！"
end if
end if


if not ef then
	Set dspdl = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_SqlProductlist where id='"&Request("Sqltype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dspdl.Open Sql,conn,1,1
If dspdl.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

dsph("Sqltype")=dspdl ("Sqltype")
dsph("userspacelimt")=Request.Form ("userspacelimt")
dsph("logspacelimt")=Request.Form ("logspacelimt")
dsph.update

URL=dsserver("site")
userid=dsserver ("admname")
FreeHostsharekey=dsserver("FreeHostsharekey")
pwd=dsserver("admpass")
homedir=dsserver("homedir")
ip=dsserver("ip")
port=dsserver("port")
userspacelimt=dsph("userspacelimt")
logspacelimt=dsph("logspacelimt")
sqlname=dsph("sqlname")

dim softtype,MySQLver,MSSQLver
softtype=dsserver("softtype")
MySQLver=dsserver("MySQLver")
MSSQLver=dsserver("MSSQLver")

if softtype="SQL2000" then
ret=SqlModify(URL,FreeHostsharekey,userid,pwd,userspacelimt,logspacelimt,sqlname)
end if
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD align="left"><table height="59"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="7" background="img/midtop.gif">&nbsp;</td>
          <td width="90" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="admsql.asp"><font color="#FFFFFF"><strong>数据库管理</strong></font></a></td>
          <td width="5" background="img/midtop2.gif">&nbsp;</td>
        </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD align="left">&nbsp;</TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="300" align="center" vAlign=top bgcolor="#FFFFFF">	  			<br>
        <table width="65%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
			<br>
                <DIV class="tableborder"><br>
                    <br>
        受控端返回信息：<%=ret%>  操作完成。<br><br>
		<%If InStr(ret,"大小大于 MAXSIZE")>1 then%>现在数据库的实际已用大小已超过了您输入的大小了,无法强行修改大小,对于这样的库您只能通知用户支付升级费用,或停止这个库的使用权限.<%End if%>
        <br>
        <br>
              </div></td>
          </tr>
        </table></TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>
<%=htmlwrite("html10")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
