<%@ Language=VBScript %> <% If session("agentusername")="" Then ef=True ec="授权非法,有可能是超时造成的。" 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='"&Request("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="不存在的云服务器产品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 ds = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_USER where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') and username='"&dsph ("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 dsagent = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_AGENT where username='"&ds("agent1")&"'" if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then Response.Write "非法字符!" Response.End end if dsagent.Open Sql,conn,1,3 If dsagent.Eof Then ef=True ec="代理会员名不存在或密码出错了!" end if end if if not ef then Set dsHost = 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 dsHost.Open Sql,conn,1,1 if dsHost.Eof then ef=True ec="产品不存在!" Else '读取月付 PAY_DAY=dsHost("PAY_DAY") PAY_WEEK=dsHost("PAY_WEEK") PAY_Month=dsHost("PAY_Month") PAY_Season=dsHost("PAY_Season") PAY_halfyear=dsHost("PAY_halfyear") PAY_Nextyear=dsHost("PAY_Nextyear") if dsph("istest")="y" then PAY_Nextyear="1" PAY_2year=dsHost("PAY_2year") PAY_3year=dsHost("PAY_3year") PAY_4year=dsHost("PAY_4year") PAY_5year=dsHost("PAY_5year") end if end If if not ef then if Not dsph("isagentpd")=true Then ef=True ec="不是代理上级的产品不能用这个功能!" End If End If if not ef Then if dshost("cancloud")=true then'是弹性购买产品 Dim cloudAddmoney cloudAddmoney=0 if (dsph("CpuNum")>dsHost("CpuNum")) then cloudAddmoney=cloudAddmoney+((dsph("CpuNum")-dsHost("CpuNum"))/dsHost("addCpuNum"))*dsHost("addCpuCost") if (dsph("MAXRAM")>dsHost("MAXRAM")) then cloudAddmoney=cloudAddmoney+((dsph("MAXRAM")-dsHost("MAXRAM"))/dsHost("addRamNum"))*dsHost("addRamCost") if (dsph("Maxspace")>dsHost("Maxspace")) then cloudAddmoney=cloudAddmoney+((dsph("Maxspace")-dsHost("Maxspace"))/dsHost("addVHDNum"))*dsHost("addVHDCost") if (dsph("Maxmbps8")>dsHost("Maxmbps8")) then cloudAddmoney=cloudAddmoney+((dsph("Maxmbps8")-dsHost("Maxmbps8"))/dsHost("addMbpsNum"))*dsHost("addMbpsCost") If dsHost("CDNMaxMb")>0 then'如果限制流量 if (dsph("CDNMaxMb")>dsHost("CDNMaxMb")) then cloudAddmoney=cloudAddmoney+((dsph("CDNMaxMb")-dsHost("CDNMaxMb"))/1000/dsHost("addNGBNum"))*dsHost("addNGBCost") End If If dsHost("MaxIOPS")>0 then'如果限制IOPS if (dsph("MaxIOPS")>dsHost("MaxIOPS")) then cloudAddmoney=cloudAddmoney+((dsph("MaxIOPS")-dsHost("MaxIOPS"))/dsHost("addIOPSNum"))*dsHost("addIOPSCost") End if if (dsph("MaxSNA")>dsHost("MaxSNA")) then cloudAddmoney=cloudAddmoney+((dsph("MaxSNA")-dsHost("MaxSNA"))/dsHost("addSnaNum"))*dsHost("addSnaCost") if (dsph("MaxBak")>dsHost("MaxBak")) then cloudAddmoney=cloudAddmoney+((dsph("MaxBak")-dsHost("MaxBak"))/dsHost("addBakNum"))*dsHost("addBakCost") if (dsph("MaxIP")>dsHost("MaxIP")) then cloudAddmoney=cloudAddmoney+((dsph("MaxIP")-dsHost("MaxIP"))/dsHost("addIpNum"))*dsHost("addIPCost") cloudAddmoney=Clng(FormatNumber(cloudAddmoney,0,-1,0,0))'四舍五入 end if end if if not ef then%> <%session("FreeHostCom").FreeHost_WR("html5")%>  云服务器管理 <%session("FreeHostCom").FreeHost_WR("html6")%>
   代理 <%=session("agentusername")%> 管理名下用户 <%=dsph("username")%> 的云服务器 <%=dsph("vpsname")%> 续费/升级

用户名:  " target="_blank"><%=ds("username")%>
金额:  <%=ds("usermoney")%> 元
电子邮件:  ><%=ds("email")%>
QQ:  <%=ds("qq")%>
代理名:   <%if ds("agent1")<>"n" then%> " target="_blank"><%=ds("agent1")%> <%end if%>
中文名:
 <%=ds("truename")%>
联系地址:  <%=ds("address")%>  邮编:<%=ds("postid")%>
电话:  <%=ds("tel")%>  传真:<%=ds("fax")%>
备注:  <%=ds("coreinfo")%>
身份证号码:  <%=ds("perid")%>
注册ip:  <%=ds("regip")%>
注册时间:  <%=ds("regtime")%>
<%if dsph("username")<>session("agentusername") Then'是否处理自己的云服务器产品%> <%else%> <%End if%>
  延长使用期限:
开通时间:<%=formatdatetime(dsph("starttime"),1)%> 到期时间:<%=formatdatetime(dsph("endtime"),1)%>
延长: 一天 一周 一个月 一季 半年 一年 两年 三年 四年 五年
<% 'if dsph("username")=session("agentusername") then '操作自己的云服务器产品 Set dsagnettype = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_Agent_pers where agenttype='"&dsagent("agenttype")&"'" dsagnettype.Open Sql,conn,1,1 Set dsagent = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_Agent where username='"&agentname&"'" dsagent.Open Sql,conn,1,1 if Not dsagent.eof then if Not dsagnettype.eof Then canshowagnpric=True Else canshowagnpric=false End if end If dsagent.close 'end If if isnull(dsph("repaymoney")) then%><% agentname=session("agentusername") 'usermoney=dsHost("usermoney") usermoney=dsHost("usermoney")+cloudAddmoney'增加弹性部分 if agentname<>"n" then Set dsendmoney = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='云服务器产品' and username='"&agentname&"' and id="&dsHost("id")&"" dsendmoney.Open Sql,conn,1,1 if not dsendmoney.eof then 'usermoney=dsendmoney("usermoney") usermoney=dsendmoney("usermoney")+cloudAddmoney'增加弹性部分 end if dsendmoney.close end If%>用户价格:<%=usermoney%>元/年<% if canshowagnpric then%>  (代理成本价格 <% Set dsagnpri = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and username='"&agentname&"' and id="&dsHost("id")&"" dsagnpri.Open Sql,conn,1,1 if dsagnpri.eof then usermoneyAGN=dsHost("usermoney")*dsagnettype("pers") If cloudAddmoney>0 Then usermoneyAGN=(dsHost("usermoney")+cloudAddmoney)*dsagnettype("pers") '2014-1-18增加的弹性购买附加代理成本折扣 else usermoneyAGN=dsagnpri("usermoney") If cloudAddmoney>0 Then usermoneyAGN=usermoney+(cloudAddmoney*(usermoney/dsHost("usermoney"))) '2014-1-18增加的弹性购买附加代理直价 end if dsagnpri.close %>)<%End if%> <% If canshowagnpric And isAgnHostSer then%> (当前此产品为独立模式产品) <% usermoneyAGN=0 End if%> <%=usermoneyAGN%><%else%>(单独设置的价格) <%=dsph("repaymoney")%><%end if%> 元/年
从用户金额中自动扣除(不选将以成本价扣除代理自己的钱) 价格:
">
<% Set dsHostlist = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_VPSProductlist where cancloud=0 and isagentpd=1 and canbyenduser='y' and (onlyusebyagn is null or onlyusebyagn='"&agentname&"') order by orderbyid desc" if agentname<>"n" then Sql="Select * from FreeHost.FreeHost_VPSProductlist where cancloud=0 and isagentpd=1 and canbyagnenduser='y' and (onlyusebyagn is null or onlyusebyagn='"&agentname&"') order by orderbyid desc" dsHostlist.Open Sql,conn,1,1 If dsHostlist.Eof Then%> 产品列表为空. <%else while not dsHostlist.Eof usermoney=dsHostlist("usermoney") if agentname<>"n" then Set dsendmoney = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='云服务器产品' and username='"&agentname&"' and id="&dsHostlist("id")&"" dsendmoney.Open Sql,conn,1,1 if not dsendmoney.eof then usermoney=dsendmoney("usermoney") end if dsendmoney.close end if if (dsHost("updatebytypeid")="y" and dsHostlist("typeid")=dsHost("typeid")) or isnull(dsHost("updatebytypeid")) or dsHost("updatebytypeid")="n" then %> <% end if dsHostlist.movenext wend dsHostlist.close set dsHostlist=nothing end if%> <%if dsph("username")<>session("agentusername") Then'是否处理自己的云服务器产品%> <%else%> <%End if%>
  升级产品:
<%isAgnHostSer=false info=dsHostlist("info") Hosttype=dsHostlist("VPStype") Set newname_host = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_VPSProductlist_AGN where agent1='"&agentname&"' and id='"&dsHostlist("id")&"'" newname_host.Open Sql,conn,1,1 if not newname_host.eof then info=newname_host("info") Hosttype=newname_host("VPStype") if newname_host ("ServerlistID")<>0 Then isAgnHostSer=True '这是独立模板的产品 newname_host.close end if %>  <%=dsHostlist("id")%>." <%If dsHost("id")=dsHostlist("id") then%>disabled<%End if%>> <%=Hosttype%><%If dsHost("id")=dsHostlist("id") then%>
     当前类型<%End if%>
出售价格:<%=usermoney%> 元 (代理成本价格 <%'注意是dsHostlist 2个地方 Set dsagnpri = Server.CreateObject("ADODB.Recordset") Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and username='"&agentname&"' and id="&dsHostlist("id")&"" dsagnpri.Open Sql,conn,1,1 if dsagnpri.eof then usermoneyAGN=dsHostlist("usermoney")*dsagnettype("pers") else usermoneyAGN=dsagnpri("usermoney") end if dsagnpri.close %>) <% If isAgnHostSer then%> (当前此产品为独立模式产品) <% usermoneyAGN=0 End if%> <%=usermoneyAGN%>元  " target="_blank">详细介绍
手工强行指定从用户金额中扣除 元 (不选将时按正常扣除用户费用)
">  


<%session("FreeHostCom").FreeHost_WR("html7")%> <%end if if ef then Response.Redirect "e.asp?e="&ec end if%>