<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%server.ScriptTimeout =240
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.Form ("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf Instr(1, Request.Form ("id"), "'", 1)>0 then
	ef=True
	ec="产品ID有非法字符！"
ElseIf not IsNumeric(Request.Form ("id"))  Then
	ef=True
	ec="产品ID有非法字符！"
ElseIf Request.Form ("username")="" Then
	ef=True
	ec="请输入用户名！"
ElseIf RegExpTest("[^A-Za-z0-9]",Request.Form ("username")) Then
	ef=True
	ec="用户名中有非法字符！"
ElseIf RegExpTest("[^A-Za-z0-9]",Request.Form ("newusername")) Then
	ef=True
	ec="新用户名中有非法字符！"

elseIf Request("Submit")="马上转移" And session("canadmsqlch")="" Then
	ef=True
	ec="您没有此操作的权限A。"

elseIf Request("dodel")="删除"  And session("canadmsqldel")="" Then
	ef=True
	ec="您没有此操作的权限B。"

elseIf ( Request("Submit")="暂停" Or Request("Submit")="恢复" Or Request("Submit")="重设数据库密码" Or Request("Submit")="删除旧库并更换服务器") And session("canadmsqlpau")="" Then
	ef=True
	ec="您没有此操作的权限C"


elseIf Request("Submit")="单独设置续费价格" And session("canadmsqlrepay")="" Then
	ef=True
	ec="您没有此操作的权限D。"
elseIf Request("Submit")="取消单独价格" And session("canadmsqlrepay")="" Then
	ef=True
	ec="您没有此操作的权限D。"


elseIf ( Request("Submit")="修改" ) And (session("canadmsqlset")="" and session("canadmsqlrenow")="" and session("canadmsqlupdate")="" ) Then
	ef=True
	ec="您没有此操作的权限E。"

'elseIf session("canadmsqlset")="" Then
'	ef=True
'	ec="您没有此操作的权限。"
ElseIf Request("ip1")<>"" And not IsNumeric(replace(Request("ip1"),".","")) Then
	ef=True
	ec="ip1不对"
ElseIf Request("ip2")<>"" And not IsNumeric(replace(Request("ip2"),".","")) Then
	ef=True
	ec="ip2不对"
end If


if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where username='"&Request.Form ("username")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		ds.Open Sql,conn,1,1
if ds.eof then
	ef=True
	ec="用户不存在!"
end if
end if

if not ef then
	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="不存在的数据库产品ID！"
end if
end if

if not ef then
if lcase(trim(dsph("sqlname")))="sa" or lcase(trim(dsph("sqlname")))="freehost"  then
	ef=True
	ec="不允许修改此用户！"
end if
end if

if not ef then
If Request.Form ("newusername")<>"" then
	Set dsNew = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where username='"&Request.Form ("newusername")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsNew.Open Sql,conn,1,1
if dsNew.eof then
	ef=True
	ec="要转移的用户不存在!"
end if
end if
end if

if not ef then
	Set dspdl = 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
		dspdl.Open Sql,conn,1,1
If dspdl.Eof Then
	ef=True
	ec="不存在的数据库产品类型！"
Else
'读取月付
PAY_Month=dspdl("PAY_Month")
PAY_Season=dspdl("PAY_Season")
PAY_halfyear=dspdl("PAY_halfyear")
PAY_Nextyear=dspdl("PAY_Nextyear")
PAY_2year=dspdl("PAY_2year")
PAY_3year=dspdl("PAY_3year")
PAY_4year=dspdl("PAY_4year")
PAY_5year=dspdl("PAY_5year")
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
dim softtype,MySQLver,MSSQLver
softtype=dsserver("softtype")
MySQLver=dsserver("MySQLver")
MSSQLver=dsserver("MSSQLver")

FreeHostsharekey=dsserver("FreeHostsharekey")
URL=dsserver("site")
opport=dsserver("port")
userid=dsserver ("admname")
pwd=dsserver("admpass")
sqlname=dsph("sqlname")
sqlpassword=dsph("sqlpassword")
%>
<!--#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"><table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#C8DAFF" id="t1">
        <tr height="24">
          <td width="13%" align="right" bgcolor="#ECF2FF"> 用户名：</td>
          <td width="87%" align="left" bgcolor="#FAFAFA">　<a href="searchuser.asp?username=<%=ds("username")%>" target="_blank"><%=ds("username")%></a> 　 <a href="javascript:document.formTop.action='/user/changeuser.asp';document.formTop.username.value='<%=ds("username")%>';document.formTop.submit();"><font color="#000000">切换成此用户角色>>>(用户区点注销会自动退回管理区)</font></a>　 <a href="#"  onClick="t1.style.display='none';"><font color="#6595D6">X</font></a></td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> 金额：</td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("usermoney")%> </td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> 电子邮件：</td>
          <td align="left" bgcolor="#FAFAFA">　<a href=mailto:<%=ds("email")%>><font color="#000000"><%=ds("email")%></font></a> </td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> QQ：</td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("qq")%> </td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right">代理名：</td>
          <td align="left" bgcolor="#FAFAFA">　
              <%if ds("agent1")<>"n" then%>
              <a href="searchagent.asp?username=<%=ds("agent1")%>" target="_blank"><font color="blue"><%=ds("agent1")%></font></a>
              <%end if%></td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"><div align="right">中文名:</div></td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("truename")%> </td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> 联系地址：</td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("address")%> 　邮编：<%=ds("postid")%> </td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> 电话：</td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("tel")%> 　传真：<%=ds("fax")%> </td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> 备注：</td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("coreinfo")%></td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> 身份证号码：</td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("perid")%></td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> 注册ip：</td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("regip")%> </td>
        </tr>
        <tr height="24">
          <td bgcolor="#ECF2FF" align="right"> 注册时间：</td>
          <td align="left" bgcolor="#FAFAFA">　<%=ds("regtime")%> </td>
        </tr>
      </table>
<%if Request.Form ("Submit")<>"修改" then%> <DIV class="tableborder" id="t1">
	  <table width="100%" border=0 cellpadding=2 cellspacing=1>
        <tr align="center" bgcolor="#EFEFEF">
          <td height="24" colspan="2" background="img/tablebg.gif"><font color="#FFFFFF">受控服务器上的记录　　<a href="#"  onClick="t1.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
        </tr>
        <tbody>
          <tr bgcolor="#E4EAF2">
            <td width="20%" height="70" align="right" >返回信息：</td>
            <td width="80%" height="22" align="left" >
<%if Request.Form ("Submit")="暂停" or Request.Form ("Submit")="恢复" then
if Request.Form ("Submit")="暂停" then
op=1
ret=PauseSQL(URL,FreeHostsharekey,userid,pwd,sqlname,sqlpassword,op)
dsph("status")="暂停"
end if
if Request.Form ("Submit")="恢复" then
op=0
ret=PauseSQL(URL,FreeHostsharekey,userid,pwd,sqlname,sqlpassword,op)
dsph("status")="正常"
end if
dsph.update
dsph.close
response.write ret
end if

if Request.Form ("Submit")="重设数据库密码" then
sqlpassword=Request.Form ("password")
Response.Write ResetSQLPassword(URL,FreeHostsharekey,userid,pwd,sqlname,sqlpassword)
dsph("sqlpassword")=sqlpassword
response.write "新密码："&sqlpassword
dsph.update
dsph.close
end if

if Request.Form ("Submit")="马上转移" then

FreeHost_oplog session("admusername"),"信息","管理员转移"&dsph ("username")&"数据库名("&dsph ("sqlname")&") 给"&Request.Form ("newusername")

dsph("username")=Request.Form ("newusername")
response.write "数据库产品已转移到用户："&Request.Form ("newusername")&" 名下。<br>"
dsph("agent1")=dsNEW("agent1")
if dsph("agent1")<>"n" then
response.write "数据库已转移到代理："&dsph("agent1")&" 名下。<br>"
end if
dsph.update
dsph.close
end if

if Request.Form ("Submit")="删除旧库并更换服务器" then
op=2
ret=PauseSQL(URL,FreeHostsharekey,userid,pwd,sqlname,sqlpassword,op)
dsph("ServerlistID")=Request.Form ("newServerlistID")
ret=ret&"删除旧库成功"
homedir=dsserver("homedir")
username=dsph("ftpname")
ftpdir=homedir&"\backup\"&sqlname&"_"&dsph("randir")
varcon=" /E /T /R "&username
todeluser=1
delacl=1
todelftp=1
if not isnull(dsph("ftpendtime")) then
ret = ret&"删除这个库的备份FTP："&DelFTP(URL,FreeHostsharekey,username,ftpdir,varcon,todeluser,delacl,todelftp)
end if
if not isnull(dsph("randir")) then
ret = ret&"删除这个库的备份目录："&DelDir(URL,FreeHostsharekey,ftpdir)
end if

for iipsec=1 to 2
response.write dsph("ip"&iipsec)&iipsec&"<br>"
if not isnull(dsph("ip"&iipsec)) then
	Set dsphip = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Sql where (ip1='"&dsph("ip"&iipsec)&"' or ip2='"&dsph("ip"&iipsec)&"') and id<>'"&dsph ("id")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsphip.Open Sql,conn,1,3
if dsphip.Eof then
opvar="del"
ret=ret&OPIpsec(URL,FreeHostsharekey,opvar,dsph("ip"&iipsec),opport)
dsph("ip"&iipsec)=null
end if
dsphip.close
end if
next
dsph("ServerlistID")=Request.Form ("newServerlistID")
FreeHost_clientlog conn,dsph ("username"),session("admusername"),"超级管理员换服务器删除操作","数据库产品",dsph ("id"),"删除","","",ret
response.write "<br>删除库："&ret
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerSqllist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
'重开

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

FreeHostsharekey=dsserver("FreeHostsharekey")
URL=dsserver("site")
opport=dsserver("port")
userid=dsserver ("admname")
pwd=dsserver("admpass")
sqlname=dsph("sqlname")
sqlpassword=dsph("sqlpassword")

homedir=dsserver("homedir")
ip=dsserver("ip")
port=dsserver("port")
userspacelimt=dsph("userspacelimt")
logspacelimt=dsph("logspacelimt")
sqlname=dsph("sqlname")
sqlpassword=dsph("sqlpassword")
if softtype="SQL2000" then
retsql=SqlAdd(URL,FreeHostsharekey,userid,pwd,homedir,userspacelimt,logspacelimt,sqlname,sqlpassword)
else
retsql=SqlAddmysql(URL,FreeHostsharekey,userid,pwd,homedir,userspacelimt,logspacelimt,sqlname,sqlpassword)
end if
FreeHost_oplog session("admusername"),"信息","管理员帮用户("&ds("username")&")换服务器开通,数据库名:"&sqlname&" 返回信息："&retsql
response.write "<br><br><br>开通库："&retsql
dsph.update
dsph.close
end if

if Request.Form ("Submit")="单独设置续费价格" and Request.Form ("repaymoney")<>"" then
if IsNumeric(Request.Form ("repaymoney")) and Request.Form ("repaymoney")>0 then
dsph ("repaymoney")=Request.Form ("repaymoney")
dsph.update
Response.Write "此产品的续费价格已单独更新为："&Request.Form ("repaymoney")&"元"
else
Response.Write "请输入大于0的价格。"
end if 
end If

if Request.Form ("Submit")="取消单独价格" then
dsph ("repaymoney")=null
dsph.update
Response.Write "此产品的续费价格已恢复为默认价格"
end if

if Request.Form ("dodel")="删除" then
op=2
ret=PauseSQL(URL,FreeHostsharekey,userid,pwd,sqlname,sqlpassword,op)
'dsph("status")="正常"
ret=ret&"删除成功"
homedir=dsserver("homedir")
username=dsph("ftpname")
ftpdir=homedir&"\backup\"&sqlname&"_"&dsph("randir")
varcon=" /E /T /R "&username
todeluser=1
delacl=1
todelftp=1
if not isnull(dsph("ftpendtime")) then
ret = ret&"删除这个库的备份FTP："&DelFTP(URL,FreeHostsharekey,username,ftpdir,varcon,todeluser,delacl,todelftp)
end if
if not isnull(dsph("randir")) then
ret = ret&"删除这个库的备份目录："&DelDir(URL,FreeHostsharekey,ftpdir)
end if

for iipsec=1 to 2
if not isnull(dsph("ip"&iipsec)) then
	Set dsphip = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Sql where (ip1='"&dsph("ip"&iipsec)&"' or ip2='"&dsph("ip"&iipsec)&"') and id<>'"&dsph ("id")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsphip.Open Sql,conn,1,3
if dsphip.Eof then
response.write "删除允许的IP："&dsph("ip"&iipsec)&"<br>"
opvar="del"
ret=ret&OPIpsec(URL,FreeHostsharekey,opvar,dsph("ip"&iipsec),opport)
end if
dsphip.close
end if
next

FreeHost_clientlog conn,dsph ("username"),session("admusername"),"超级管理员操作","数据库产品",dsph ("id"),"删除","","",ret
dsph.delete
dsph.update
dsph.close
response.write ret
end if			
			
			%></td>
          </tr>
          <tr align="center" bgcolor="#E4EAF2">
            <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
          </tr>
        </tbody>
      </table>
	  </div><%end if%>
	  <br>
	  <br>
      <%if Request.Form ("Submit")="修改" then
SQLtype=dsph("Sqltype")
		%>
<DIV class="tableborder" id="t4"> 
	  <table width="100%" border="0" cellspacing="1" cellpadding="2" align="center">
        <tr bgcolor="#C1BFBF" align="center">
          <td width="8%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">编号</font></td>
          <td background="img/tablebg.gif"><font color="#FFFFFF">产品类型</font></td>
          <td background="img/tablebg.gif"><font color="#FFFFFF">用户名</font></td>
          <td width="8%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">数据库名</font></td>
          <td width="12%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">大小上限</font></td>
          <td width="12%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">IP 地址</font></td>
          <td width="12%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">开通/到期</font></td>
          <td width="12%" background="img/tablebg.gif"><font color="#FFFFFF">大小检查</font></td>
          <td width="11%" height="24" background="img/tablebg.gif"><font color="#FFFFFF">状态</font></td>
        </tr>
        <tr align="center" bgcolor="#E4EAF2">
          <td width="8%"><%=dsph("id")%></td>
          <td><%=dsph("Sqltype")%>
              <%if dsph("byhost")<>"" then%>
              <br>
      附属于产品 <a href="handhost1.asp?username=<%=dsph("username")%>&id=<%=dsph("byhost")%>"><font color="#FF0000"><%=dsph("byhost")%></font></a>
      <%end if%>
	  <%if not isnull(dsph("repaymoney")) then%><br>
此产品已设置了单独续费价格：<%=dsph("repaymoney")%>元/年
<%end if%>
</td>
          <td><a href="searchuser.asp?username=<%=dsph("username")%>"><%=dsph("username")%></a></td>
          <td width="8%" height="30"><%=dsph("sqlname")%></td>
          <td width="12%"><%=dsph("userspacelimt")%>M/<%=dsph("logspacelimt")%>M</td>
          <td width="12%"><%
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerSQLlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
%>
              <%=dsserver("ip")%>
</td>
          <td width="12%"><%=dsph("starttime")%><br>
            <%=dsph("endtime")%></td>
          <td width="12%" title="数据库文件大小检查时间：<%=dsph("checktime")%>"> 库:<font color="<%if dsph("userspacelimtReal")>dsph("userspacelimt") then%>red<%end if%>"><%=dsph("userspacelimtReal")%></font>(<%=dsph("userspacelimt")%>)M<br>
  日志:<font color="<%if dsph("logspacelimtReal")>dsph("logspacelimt") then%>red<%end if%>"><%=dsph("logspacelimtReal")%></font>(<%=dsph("logspacelimt")%>)M<br>
  检查时间：<%=dsph("checktime")%></td>
          <td><%if dsph("endtime")>NOW then%>
              <%if dsph("istest")="y" then%>
              <font color="#FF0000">试用</font>
              <%else%>
              <%=dsph("status")%>
              <%end if%>
              <%else%>
              <font color="#FF0000">过期</font>
              <%if dsph("status")="暂停" then%>
              <br>
              <font color="#FF0000">暂停</font>
              <%end if%>
              <%end if%></td>
        </tr>
	    </table>
</div>		
<%if dsserver("softtype")="MySQL" then
getsize=ShowDirSize (dsserver("site"),FreeHostsharekey,dsserver("homedir")&"\"&dsph("sqlname"))
'response.write getsize
if instr(getsize,"出错")>1 then 
returnstr = returnstr &" 数据库放置的目录设置不正确：" &dsserver("homedir")&"\"&dsph("sqlname")
else
getsize=GETvalue(getsize,";目录大小为：",";FreeHostEnd")
returnstr = getsize
getsize=int(getsize/1024/1024)
returnstr = returnstr &"字节("& getsize&"M)"
end if%>
      <br>
        <DIV class="tableborder" id="t3"> 
	  <table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif" ><font color="#FFFFFF">Mysql数据库空间使用情况　　<a href="#"  onClick="t3.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
            <tr bgcolor="#E4EAF2">
              <td width="20%" height="70" align="right" >Mysql信息：</td>
              <td width="80%" height="22" align="left" >　<b>已用数据库空间：</b><%=returnstr%><%if getsize>dsph("userspacelimt") then%><font color=red>超出上限！</font><%end if%>　空间上限：<%=dsph("userspacelimt")%> M</td>
            </tr>
            <tr align="center" bgcolor="#E4EAF2">
              <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
            </tr>
          </tbody>
        </table>
</div>

<%end if%>

      <form name="form1" method="post" action="handsqlsetspace.asp"><DIV class="tableborder" id="t4"> 
	  <table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif" ><font color="#FFFFFF">直接修改数据库空间上限　　<a href="#"  onClick="t4.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
            <tr bgcolor="#E4EAF2">
              <td width="20%" height="70" align="right" >修改数据库空间：</td>
              <td width="80%" height="22" align="left" >                　数据库上限大小：
<input name="userspacelimt" type="text" id="userspacelimt" value="<%=dsph("userspacelimt")%>" size="8">
M<br>
　日志上限大小：
<input name="logspacelimt" type="text" id="logspacelimt" size="8" value="<%=dsph("logspacelimt")%>">
M
  <br>
  　更改数据库所属产品:
  <%
	Set dspdlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_SqlProductlist order by id asc"
		dspdlist.Open Sql,conn,1,1
If dspdlist.Eof Then%>
数据库产品列表为空.
<%else%>
<select name="Sqltype" id="Sqltype">
  <%while not dspdlist.Eof%>
  <option value="<%=dspdlist("id")%>" <%if dspdl("id")=dspdlist("id") then%>selected<%end if%>><%=dspdlist("Sqltype")%></option>
  <%
dspdlist.movenext
wend%>
</select>
<%end if%>
  <br>  　这儿更新产品并不会修改大小，请手工输入大小限制。<br>
  　
  <input name="id" type="hidden" value="<%=Request("id")%>">
  <input type="submit" name="Submit" value="保存修改"></td>
            </tr>
            <tr align="center" bgcolor="#E4EAF2">
              <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
            </tr>
          </tbody>
        </table>
</div> </form>

      <form name="form1" method="post" action="handsqlbyhost.asp"><DIV class="tableborder" id="t8"> 
	  <table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif" ><font color="#FFFFFF">更改数据库附属的虚拟主机　　<a href="#"  onClick="t4.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
            <tr bgcolor="#E4EAF2">
              <td width="20%" height="70" align="right" >修改数据库附属：</td>
              <td width="80%" height="22" align="left" >                　附属于
                <input name="byhost" type="text" id="byhost" value="<%=dsph("byhost")%>" size="8">
                号虚拟主机<%if not isnull(dsph("byhost")) then%>
                <a href="handhost1.asp?id=<%=dsph("byhost")%>" target="_blank">>>>>></a>
                <%end if%>
                <input name="id" type="hidden" value="<%=Request("id")%>">
  <input type="submit" name="Submit" value="保存修改"></td>
            </tr>
            <tr align="center" bgcolor="#E4EAF2">
              <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
            </tr>
          </tbody>
        </table>
</div>

        </form>
<form name="form4" method="post" action="handSqlmodifyendtime.asp"><DIV class="tableborder" id="t5"> 
	  <table width="100%" border=0 cellpadding=2 cellspacing=1>
          <tr align="center" bgcolor="#EFEFEF">
            <td height="24" colspan="2" background="img/tablebg.gif" ><font color="#FFFFFF">续费　　<a href="#"  onClick="t5.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
          </tr>
          <tbody>
            <tr bgcolor="#E4EAF2">
              <td width="20%" height="90" align="right" >延长使用期限：</td>
              <td width="80%" height="22" align="left" ><%if not isnull(dsph("repaymoney")) then%>
<font color="red">此产品已设置了单独续费价格：<%=dsph("repaymoney")%>元/年</font>
<%end if%>　
                 <input type="radio" name="year" value="<%=PAY_Month%>">
一个月
			  <input type="radio" name="year" value="<%=PAY_Season%>">一季
                <input type="radio" name="year" value="<%=PAY_halfyear%>">
半年
  <input type="radio" name="year" value="<%=PAY_Nextyear%>" checked>
一年
<input type="radio" name="year" value="<%=PAY_2year%>">
两年
<input type="radio" name="year" value="<%=PAY_3year%>">
三年
<input type="radio" name="year" value="<%=PAY_4year%>">
四年
<input type="radio" name="year" value="<%=PAY_5year%>">
五年<br>
  　　手工指定开通时间:
  <input name="starttime" type="text" id="starttime" size="10" maxlength="10">
2005-7-24　手工指定开通时间时，必须填写到期时间及扣除金额  <br>
  　　手工指定到期时间:
  <input type="text" name="endtime" size="10" maxlength="10">
  2005-7-24　手工指定必须填写扣除金额<br>
  　　用户金额中扣除：
  <input name="usermoney" type="text" id="usermoney" size="3" value="">
  元(如果不填写，将按产品默认金额扣除,也可以设成0)
  <input name="id" type="hidden" value="<%=Request.Form ("id")%>">
  <input type="submit" name="Submit" value="提交"></td></tr>
            <tr align="center" bgcolor="#E4EAF2">
              <td height="30" colspan="2" align="right"><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a></td>
            </tr>
          </tbody>
        </table>
</div>
        </form>
      <form name="form2" method="post" action="handSqlupdate1.asp">
        <DIV class="tableborder" id="t4">
          <table width="100%" border=0 cellpadding=2 cellspacing=1>
            <tr align="center" bgcolor="#EFEFEF">
              <td height="24" colspan="2" background="img/tablebg.gif" ><font color="#FFFFFF">升级产品　　<a href="#"  onClick="t4.style.display='none';"><font color="#F7F7FF">X</font></a></font></td>
            </tr>
            <tr align="center" bgcolor="#E4EAF2">
              <td width="20%" align="right">升级：</td>
              <td width="80%" height="30" align="left">　　更产品类型:
                  <%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_SQLProductlist order by id asc"
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
          产品列表为空.
          <%else%>
          <select name="hosttypeAuto" id="hosttypeAuto">
            <%while not dsX.Eof%>
            <option value="<%=dsX("id")%>" <%if dsX("SQLtype")=SQLtype then%>selected<%end if%>><%=dsX("SQLtype")%></option>
            <br>
            <%
dsX.movenext
wend%>
          </select>
          <%end if%>
          <br>
          　
          <input name="chmoneyauto" type="checkbox" id="chmoneyauto" value="checkbox">
          从用户金额中扣除(如果不选将只更改而不扣费)(产品不变不会扣)<br>
          　　 　价格：
          <input name="usermoneyauto" type="text" id="usermoneyauto" size="4" value="">
          元(不填价格将按产品差价扣除或退回)
          <input name="istestch1" type="checkbox" id="istestch1" value="y">
          将试用的用户变更成正式用户 <br>
          <input name="id" type="hidden" value="<%=Request.Form ("id")%>">
          　
          <input name="Submit" type="submit" id="auto" value="马上升级" onClick="if (confirm('请您确认本次升级操作？')==false){return false;}">
          (注意，代理及代理名下用户请让代理或用户自己操作，这儿的操作不会返款给上级代理)</td>
            </tr>
          </table>
        </div>
      </form>
      <%end if%>      <br>

	  </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%>
