<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("VPSAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。此功能只有代理可以操作。"
ElseIf not IsNumeric(session("VPSAUID"))  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应该是数字！"
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 id='"&session("VPSAUID")&"'"
			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="不存在的虚拟主机ID！"
end if
end If

if not ef then
if dsph("agent1")<>session("agentusername") then
	ef=True
	ec="此虚拟主机ID并不是当前代理名下所有！"
end If
end if

if not ef then
	Set dsHostpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_VPSProductlist where VPStype='"&dsph("VPStype")&"'"
	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_ServerVPSlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
Else
dim isAgnHostSer
if dsserver("agent1")=dsph("agent1") then
isAgnHostSer=true
Else
isAgnHostSer=false
end if
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/template-vpsadm-top.asp"-->
　代理 <%=session("agentusername")%> 管理名下用户 <%=dsph("username")%> 的VPS


<br>
<br><form action="agn-specadm2.asp" method="post">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="16%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">转移用户：</font></TD>
      <TD width="84%" height="40" bgColor=#ffffff>　本功能让您自己将此VPS转到另一用户名下。</TD>
      </TR>
    <TR>
      <TD width="16%" rowspan="3" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      <TD height="38" bgColor=#ffffff>          　 原用户名： <%=dsph("username")%> 　  </TD>
    </TR>
    <TR>
      <TD height="38" bgColor=#ffffff><input name="op" type="hidden" id="op" value="a">
　 新用户名：
  <input name="newusername" type="text" id="newusername" value="" size="14" maxlength="14"></TD>
    </TR>
    <TR>
      <TD height="38" bgColor=#ffffff>　
        <input name="Submit" type="submit" id="Submit" value="马上转移">
        <input name="id" type="hidden" value="<%=session("VPSAUID")%>"></TD>
    </TR>
  </TBODY>
</TABLE>
</form>

<form action="agn-specadm2.asp" method="post">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="16%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">删除VPS：</font></TD>
      <TD width="84%" height="40" bgColor=#ffffff>　　
        <input type="submit" name="Submit" value="删除" onClick="return chkFormweb(this)">
(删除是不可恢复的删除，而且不会返款)
<input name="id" type="hidden" value="<%=session("VPSAUID")%>"></TD>
      </TR>
  </TBODY>
</TABLE>
<script language=JavaScript>
<!--
	function chkFormweb(theform)
	{
			if(! confirm("请确认是否要删除?\n注意，如果删除是没有办法恢复的。"))
				return false;
	}
//-->
</script>
</form>

<%if isAgnHostSer Then%>
<font color="#0000FF">独立模式专有内容：</font><br>
<form action="agn-specadm2.asp" method="post" name="autoopen3">
<TABLE width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="16%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">高级调整：</font></TD>
      <TD width="84%" height="40" bgColor=#ffffff>　</TD>
      </TR>
    <TR>
      <TD width="16%" height="121" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      <TD bgColor=#ffffff>&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
</form>

<%end if%>
<br>
<br>

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