<%@ Language=VBScript %>
<%
isagentpd=False
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.QueryString ("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf not IsNumeric(Request.QueryString ("id"))  Then
	ef=True
	ec="ID应该是数字！"
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_VPS where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and id='"&Request.QueryString ("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,1
if dsph.Eof then
	ef=True
	ec="不存在的云服务器！"
Else
If dsph ("isagentpd")=True Then isagentpd=true'代理的产品
end if
end if

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

If Not isagentpd then
if not ef then
session("VPSAUID")=dsph("id")
'if Request.QueryString ("go")="a" then Response.Redirect "/sqladm/selfsqlmodify.asp?id="&dsph("id")
if Request.QueryString ("go")="a" then Response.Redirect "/vpsadm/agn-upvps.asp?id="&dsph("id")
if Request.QueryString ("go")="c" then Response.Redirect "/vpsadm/selfvpsmodifyrepay.asp?id="&dsph("id")
if Request.QueryString ("go")="d" then Response.Redirect "/vpsadm/selfvpsmodifyup.asp?id="&dsph("id")
end If
end If

If isagentpd then
If not ef Then
'post 上级
%>
<form name="form1" method="post" action="http://<%=dsph("VPScpdomain")%>/vpsadm/login.asp" ID="Form1">
<input name="vpsname" type="hidden" value="<%=dsph("vpsname")%>">
<input name="vpspassword" type="hidden" value="<%=dsph("vpspassword")%>">
<input type="submit" name="Submit" value="<%If ef then%>Error if you want to login pls click here<%else%>login...........<%End if%>">
</form>
<script language="JavaScript">
document.Form1.submit();
</script>
<%
end If
End If

if ef then
Response.Redirect "e.asp?e="&ec
end if%>