<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
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_Agent where username='"&session("agentusername")&"'"
		ds.Open Sql,conn,1,1
if ds.eof then
	ef=True
	ec="代理会员不存在！"
end if
end If

if not ef then
	Set dsagnettype = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Agent_pers where agenttype='"&ds("agenttype")&"'" 
				if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsagnettype.Open Sql,conn,1,1
if dsagnettype.eof then
	ef=True
	ec="代理类型折扣为空，请先设置它！"
end if
end if

if not ef then
for i=1 to 500

if Request.Form ("host"&i)<>"" and Request.Form ("host"&i)>=0 then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='虚拟主机' and username='"&session("agentusername")&"' and id="&i
				if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew



Set dsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HostProductlist where id="&i
		dsDlist.Open Sql,conn,1,1
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='虚拟主机' and username='"&session ("agentusername")&"' and id="&i
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
realcost=dsDlist("usermoney")*dsagnettype("pers")
else
realcost=dsagnpri("usermoney")
end if
dsagnpri.close
dsDlist.close
If not IsNumeric(Request.Form ("host"&i)) or CDbl(Request.Form ("host"&i))<realcost or CDbl(Request.Form ("host"&i))<0.01 Then
Response.Write "虚拟主机定价中存在不正常的金额！注意不能小于成本价。"&CDbl(Request.Form ("host"&i))
Response.End
end if

ds("id")=i
ds("username")=session("agentusername")
ds("prtype")="虚拟主机"
ds("usermoney")=Request.Form ("host"&i)
ds.Update
ds.Close
end if

if Request.Form ("email"&i)<>"" and Request.Form ("email"&i)>=0 then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='邮箱产品' and username='"&session("agentusername")&"' and id="&i&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew


Set dsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_EmailProductlist where id="&i
		dsDlist.Open Sql,conn,1,1
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='邮箱产品' and username='"&session ("agentusername")&"' and id="&i
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
realcost=dsDlist("usermoney")*dsagnettype("pers")
else
realcost=dsagnpri("usermoney")
end if
dsagnpri.close
dsDlist.close
If not IsNumeric(Request.Form ("email"&i)) or CDbl(Request.Form ("email"&i))<realcost or CDbl(Request.Form ("email"&i))<0.01 Then
Response.Write "邮箱定价中存在不正常的金额！注意不能小于成本价。"&CDbl(Request.Form ("email"&i))
Response.End
end if

ds("id")=i
ds("username")=session("agentusername")
ds("prtype")="邮箱产品"
ds("usermoney")=Request.Form ("email"&i)
ds.Update
ds.Close
end if

if Application("domaincansetM")=true Then
'独立接口价
For api=1 To 7
If Application("showapi"&api)=True then'是否显示这个接口价格

if Request.Form ("domain"&i&"API"&api)<>"" and Request.Form ("domain"&i&"API"&api)>=0 then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&session("agentusername")&"' and id="&i&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew


Set dsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_DomainProductlist where id="&i
		dsDlist.Open Sql,conn,1,1
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&session ("agentusername")&"' and id="&i
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'realcost=dsDlist("usermoney")*dsagnettype("pers")
'realcostrepay=dsDlist("usermoneyrepay")*dsagnettype("pers")
realcostrepay=dsDlist("usermoneyagnrepay")
realcostrepay2=dsDlist("usermoneyagnrepay2")
realcostrepay3=dsDlist("usermoneyagnrepay3")
realcostrepay4=dsDlist("usermoneyagnrepay4")
realcostrepay5=dsDlist("usermoneyagnrepay5")
realcostrepay6=dsDlist("usermoneyagnrepay6")
realcostrepay7=dsDlist("usermoneyagnrepay7")

'realcost=dsDlist("usermoneyagn")
'realcostyear2=dsDlist("year2agn")
'realcostyear3=dsDlist("year3agn")
'realcostyear4=dsDlist("year4agn")
'realcostyear5=dsDlist("year5agn")

realcost=dsDlist("usermoneyagn"&"API"&api)
realcostyear2=dsDlist("year2agn"&"API"&api)
realcostyear3=dsDlist("year3agn"&"API"&api)
realcostyear4=dsDlist("year4agn"&"API"&api)
realcostyear5=dsDlist("year5agn"&"API"&api)

else

realcostrepay=dsagnpri("usermoneyrepay")
realcostrepay2=dsagnpri("usermoneyrepay2")
realcostrepay3=dsagnpri("usermoneyrepay3")
realcostrepay4=dsagnpri("usermoneyrepay4")
realcostrepay5=dsagnpri("usermoneyrepay5")
realcostrepay6=dsagnpri("usermoneyrepay6")
realcostrepay7=dsagnpri("usermoneyrepay7")

'realcost=dsagnpri("usermoney")
'realcostyear2=dsagnpri("year2")
'realcostyear3=dsagnpri("year3")
'realcostyear4=dsagnpri("year4")
'realcostyear5=dsagnpri("year5")

realcost=dsagnpri("usermoney"&"API"&api)
realcostyear2=dsagnpri("year2"&"API"&api)
realcostyear3=dsagnpri("year3"&"API"&api)
realcostyear4=dsagnpri("year4"&"API"&api)
realcostyear5=dsagnpri("year5"&"API"&api)


end If

'If IsNull(realcost) Then realcost=dsDlist("usermoneyagn"&"API"&api)
If IsNull(realcost) Then realcost=dsDlist("usermoney")

'If IsNull(realcostyear2) Then realcostyear2=dsagnpri("year2")
'If IsNull(realcostyear3) Then realcostyear3=dsagnpri("year3")
'If IsNull(realcostyear4) Then realcostyear4=dsagnpri("year4")
'If IsNull(realcostyear5) Then realcostyear5=dsagnpri("year5")


If IsNull(realcostyear2) Then realcostyear2=dsDlist("year2agn"&"API"&api)
If IsNull(realcostyear3) Then realcostyear3=dsDlist("year3agn"&"API"&api)
If IsNull(realcostyear4) Then realcostyear4=dsDlist("year4agn"&"API"&api)
If IsNull(realcostyear5) Then realcostyear5=dsDlist("year5agn"&"API"&api)




dsagnpri.close
dsDlist.close

If not IsNumeric(Request.Form ("domain"&i&"API"&api)) or CDbl(Request.Form ("domain"&i&"API"&api))<realcost or CDbl(Request.Form ("domain"&i&"API"&api))<0.01 Then
Response.Write "存在不正常的金额！注意域名不能小于成本价。(xAPI:"&api&")(域名编号:"&i&")"&realcost&"/"&CDbl(Request.Form ("domain"&i&"API"&api))
Response.End
end if

If (not IsNumeric(Request.Form ("domainrepay"&i)) or CDbl(Request.Form ("domainrepay"&i))<realcostrepay or CDbl(Request.Form ("domainrepay"&i))<0.01) And CDbl(Request.Form ("domainrepay"&i))>0 Then
Response.Write "api1-存在不正常的金额！注意域名续费不能小于成本价。(域名编号:"&i&")"&CDbl(Request.Form ("domainrepay"&i))
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_2")) or CDbl(Request.Form ("domainrepay"&i&"_2"))<realcostrepay2) and Request.Form ("domainrepay"&i&"_2")>0 Then
Response.Write "api2-存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_2"))&"元/成本"&realcostrepay2&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_3")) or CDbl(Request.Form ("domainrepay"&i&"_3"))<realcostrepay3) And Request.Form ("domainrepay"&i&"_3")>0 Then
Response.Write "api3-存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_3"))&"元/成本"&realcostrepay3&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_4")) or CDbl(Request.Form ("domainrepay"&i&"_4"))<realcostrepay4) And Request.Form ("domainrepay"&i&"_4")>0 Then
Response.Write "api4-存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_4"))&"元/成本"&realcostrepay4&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_5")) or CDbl(Request.Form ("domainrepay"&i&"_5"))<realcostrepay5) And Request.Form ("domainrepay"&i&"_5")>0 Then
Response.Write "api5-存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_5"))&"元/成本"&realcostrepay5&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_6")) or CDbl(Request.Form ("domainrepay"&i&"_6"))<realcostrepay6) And Request.Form ("domainrepay"&i&"_6")>0 Then
Response.Write "api6-存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_6"))&"元/成本"&realcostrepay6&"元"
Response.End
end If

If (not IsNumeric(Request.Form ("domainrepay"&i&"_7")) or CDbl(Request.Form ("domainrepay"&i&"_7"))<realcostrepay7) And Request.Form ("domainrepay"&i&"_7")>0 Then
Response.Write "api7-存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_7"))&"元/成本"&realcostrepay7&"元"
Response.End
end if

If not IsNumeric(Request.Form ("domain"&i&"year2"&"API"&api)) or CDbl(Request.Form ("domain"&i&"year2"&"API"&api))<realcostyear2 Then
Response.Write "存在不正常的金额！注意不能小于成本价(2年)(域名编号:"&i&")。"&CDbl(Request.Form ("domain"&i&"year2"&"API"&api))&"元/成本"&realcostyear2&"元"
Response.End
end if
If not IsNumeric(Request.Form ("domain"&i&"year3"&"API"&api)) or CDbl(Request.Form ("domain"&i&"year3"&"API"&api))<realcostyear3 Then
Response.Write "存在不正常的金额！注意不能小于成本价(3年)(域名编号:"&i&")。"&CDbl(Request.Form ("domain"&i&"year3"&"API"&api))&"元/成本"&realcostyear3&"元"
Response.End
end if
If not IsNumeric(Request.Form ("domain"&i&"year4"&"API"&api)) or CDbl(Request.Form ("domain"&i&"year4"&"API"&api))<realcostyear4 Then
Response.Write "存在不正常的金额！注意不能小于成本价(4年)(域名编号:"&i&")。"&CDbl(Request.Form ("domain"&i&"year4"&"API"&api))&"元/成本"&realcostyear4&"元"
Response.End
end if
If not IsNumeric(Request.Form ("domain"&i&"year5"&"API"&api)) or CDbl(Request.Form ("domain"&i&"year5"&"API"&api))<realcostyear5 Then
Response.Write "存在不正常的金额！注意不能小于成本价(5年)(域名编号:"&i&")。"&CDbl(Request.Form ("domain"&i&"year5"&"API"&api))&"元/成本"&realcostyear5&"元"
Response.End
end if

ds("id")=i
ds("username")=session("agentusername")
ds("prtype")="域名产品"

If Request.Form ("domainrepay"&i)>0 Then ds("usermoneyrepay")=Request.Form ("domainrepay"&i)
If Request.Form ("domainrepay"&i&"_2")>0 Then ds("usermoneyrepay2")=Request.Form ("domainrepay"&i&"_2")
If Request.Form ("domainrepay"&i&"_3")>0 Then ds("usermoneyrepay3")=Request.Form ("domainrepay"&i&"_3")
If Request.Form ("domainrepay"&i&"_4")>0 Then ds("usermoneyrepay4")=Request.Form ("domainrepay"&i&"_4")
If Request.Form ("domainrepay"&i&"_5")>0 Then ds("usermoneyrepay5")=Request.Form ("domainrepay"&i&"_5")
If Request.Form ("domainrepay"&i&"_6")>0 Then ds("usermoneyrepay6")=Request.Form ("domainrepay"&i&"_6")
If Request.Form ("domainrepay"&i&"_7")>0 Then ds("usermoneyrepay7")=Request.Form ("domainrepay"&i&"_7")

'ds("usermoney")=Request.Form ("domain"&i)
'ds("year2")=Request.Form ("domain"&i&"year2")
'ds("year3")=Request.Form ("domain"&i&"year3")
'ds("year4")=Request.Form ("domain"&i&"year4")
'ds("year5")=Request.Form ("domain"&i&"year5")

ds("usermoneyAPI"&api)=trim(Request.Form("domain"&ds("id")&"API"&api))
ds("year2API"&api)=trim(Request.Form("domain"&ds("id")&"year2API"&api))
ds("year3API"&api)=trim(Request.Form("domain"&ds("id")&"year3API"&api))
ds("year4API"&api)=trim(Request.Form("domain"&ds("id")&"year4API"&api))
ds("year5API"&api)=trim(Request.Form("domain"&ds("id")&"year5API"&api))

ds.Update
ds.Close
end If

End if' 不显示这个接口价格

next'API1-6

else'没有设置不同接口不同价
if Request.Form ("domain"&i)<>"" and Request.Form ("domain"&i)>=0 then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&session("agentusername")&"' and id="&i&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew


Set dsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_DomainProductlist where id="&i
		dsDlist.Open Sql,conn,1,1
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&session ("agentusername")&"' and id="&i
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'realcost=dsDlist("usermoney")*dsagnettype("pers")
'realcostrepay=dsDlist("usermoneyrepay")*dsagnettype("pers")
realcost=dsDlist("usermoneyagn")
realcostrepay=dsDlist("usermoneyagnrepay")
realcostrepay2=dsDlist("usermoneyagnrepay2")
realcostrepay3=dsDlist("usermoneyagnrepay3")
realcostrepay4=dsDlist("usermoneyagnrepay4")
realcostrepay5=dsDlist("usermoneyagnrepay5")
realcostrepay6=dsDlist("usermoneyagnrepay6")
realcostrepay7=dsDlist("usermoneyagnrepay7")

realcostyear2=dsDlist("year2agn")
realcostyear3=dsDlist("year3agn")
realcostyear4=dsDlist("year4agn")
realcostyear5=dsDlist("year5agn")
else
realcost=dsagnpri("usermoney")
realcostrepay=dsagnpri("usermoneyrepay")

realcostrepay2=dsagnpri("usermoneyrepay2")
realcostrepay3=dsagnpri("usermoneyrepay3")
realcostrepay4=dsagnpri("usermoneyrepay4")
realcostrepay5=dsagnpri("usermoneyrepay5")
realcostrepay6=dsagnpri("usermoneyrepay6")
realcostrepay7=dsagnpri("usermoneyrepay7")

realcostyear2=dsagnpri("year2")
realcostyear3=dsagnpri("year3")
realcostyear4=dsagnpri("year4")
realcostyear5=dsagnpri("year5")
end if
dsagnpri.close
dsDlist.close

If not IsNumeric(Request.Form ("domain"&i)) or CDbl(Request.Form ("domain"&i))<realcost or CDbl(Request.Form ("domain"&i))<0.01 Then
Response.Write "存在不正常的金额！注意域名不能小于成本价。(API:"&api&")(域名编号:"&i&")成本"&realcost&"元/出售:"&CDbl(Request.Form ("domain"&i))&"元"
Response.End
end If

If (not IsNumeric(Request.Form ("domainrepay"&i)) or CDbl(Request.Form ("domainrepay"&i))<realcostrepay or CDbl(Request.Form ("domainrepay"&i))<0.01) And CDbl(Request.Form ("domainrepay"&i))>0 Then
Response.Write "api1存在不正常的金额！注意域名续费不能小于成本价。(域名编号:"&i&")"&CDbl(Request.Form ("domainrepay"&i))
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_2")) or CDbl(Request.Form ("domainrepay"&i&"_2"))<realcostrepay2) and Request.Form ("domainrepay"&i&"_2")>0 Then
Response.Write "api2存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_2"))&"元/成本"&realcostrepay2&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_3")) or CDbl(Request.Form ("domainrepay"&i&"_3"))<realcostrepay3) And Request.Form ("domainrepay"&i&"_3")>0 Then
Response.Write "api3存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_3"))&"元/成本"&realcostrepay3&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_4")) or CDbl(Request.Form ("domainrepay"&i&"_4"))<realcostrepay4) And Request.Form ("domainrepay"&i&"_4")>0 Then
Response.Write "api4存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_4"))&"元/成本"&realcostrepay4&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_5")) or CDbl(Request.Form ("domainrepay"&i&"_5"))<realcostrepay5) And Request.Form ("domainrepay"&i&"_5")>0 Then
Response.Write "api5存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_5"))&"元/成本"&realcostrepay5&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_6")) or CDbl(Request.Form ("domainrepay"&i&"_6"))<realcostrepay6) And Request.Form ("domainrepay"&i&"_6")>0 Then
Response.Write "api6存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_6"))&"元/成本"&realcostrepay6&"元"
Response.End
end If
If (not IsNumeric(Request.Form ("domainrepay"&i&"_7")) or CDbl(Request.Form ("domainrepay"&i&"_7"))<realcostrepay7) And Request.Form ("domainrepay"&i&"_7")>0 Then
Response.Write "api7存在不正常的金额！注意域名续费不能小于成本价(域名编号:"&i&")。现"&CDbl(Request.Form ("domainrepay"&i&"_7"))&"元/成本"&realcostrepay7&"元"
Response.End
end if

If not IsNumeric(Request.Form ("domain"&i&"year2")) or CDbl(Request.Form ("domain"&i&"year2"))<realcostyear2 Then
Response.Write "存在不正常的金额！注意不能小于成本价(2年)(域名编号:"&i&")。"&CDbl(Request.Form ("domain"&i&"year2"))&"元/成本"&realcostyear2&"元"
Response.End
end if
If not IsNumeric(Request.Form ("domain"&i&"year3")) or CDbl(Request.Form ("domain"&i&"year3"))<realcostyear3 Then
Response.Write "存在不正常的金额！注意不能小于成本价(3年)(域名编号:"&i&")。"&CDbl(Request.Form ("domain"&i&"year3"))&"元/成本"&realcostyear3&"元"
Response.End
end if
If not IsNumeric(Request.Form ("domain"&i&"year4")) or CDbl(Request.Form ("domain"&i&"year4"))<realcostyear4 Then
Response.Write "存在不正常的金额！注意不能小于成本价(4年)(域名编号:"&i&")。"&CDbl(Request.Form ("domain"&i&"year4"))&"元/成本"&realcostyear4&"元"
Response.End
end if
If not IsNumeric(Request.Form ("domain"&i&"year5")) or CDbl(Request.Form ("domain"&i&"year5"))<realcostyear5 Then
Response.Write "存在不正常的金额！注意不能小于成本价(5年)(域名编号:"&i&")。"&CDbl(Request.Form ("domain"&i&"year5"))&"元/成本"&realcostyear5&"元"
Response.End
end if

ds("id")=i
ds("username")=session("agentusername")
ds("prtype")="域名产品"
ds("usermoney")=Request.Form ("domain"&i)
ds("usermoneyrepay")=Request.Form ("domainrepay"&i)


If Request.Form ("domainrepay"&i)>0 Then ds("usermoneyrepay")=Request.Form ("domainrepay"&i)
If Request.Form ("domainrepay"&i&"_2")>0 Then ds("usermoneyrepay2")=Request.Form ("domainrepay"&i&"_2")
If Request.Form ("domainrepay"&i&"_3")>0 Then ds("usermoneyrepay3")=Request.Form ("domainrepay"&i&"_3")
If Request.Form ("domainrepay"&i&"_4")>0 Then ds("usermoneyrepay4")=Request.Form ("domainrepay"&i&"_4")
If Request.Form ("domainrepay"&i&"_5")>0 Then ds("usermoneyrepay5")=Request.Form ("domainrepay"&i&"_5")
If Request.Form ("domainrepay"&i&"_6")>0 Then ds("usermoneyrepay6")=Request.Form ("domainrepay"&i&"_6")
If Request.Form ("domainrepay"&i&"_7")>0 Then ds("usermoneyrepay7")=Request.Form ("domainrepay"&i&"_7")


ds("year2")=Request.Form ("domain"&i&"year2")
ds("year3")=Request.Form ("domain"&i&"year3")
ds("year4")=Request.Form ("domain"&i&"year4")
ds("year5")=Request.Form ("domain"&i&"year5")
ds.Update
ds.Close
end if
End if

if Request.Form ("Sql"&i)<>"" and Request.Form ("Sql"&i)>=0 then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='数据库产品' and username='"&session("agentusername")&"' and id="&i&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew

Set dsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_SqlProductlist where id="&i
		dsDlist.Open Sql,conn,1,1
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='数据库产品' and username='"&session ("agentusername")&"' and id="&i
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
realcost=dsDlist("usermoney")*dsagnettype("pers")
'Response.Write dsagnettype("pers")
else
realcost=dsagnpri("usermoney")
end if
dsagnpri.close
dsDlist.close
If not IsNumeric(Request.Form ("Sql"&i)) or CDbl(Request.Form ("Sql"&i))<realcost or CDbl(Request.Form ("Sql"&i))<0.01 Then
Response.Write "数据库定价中存在不正常的金额！注意不能小于成本价("&realcost&"元)。出售价"&CDbl(Request.Form ("Sql"&i))&"元,产品编号:"&i
Response.End
end if

ds("id")=i
ds("username")=session("agentusername")
ds("prtype")="数据库产品"
ds("usermoney")=Request.Form ("Sql"&i)
ds.Update
ds.Close
end if


if Request.Form ("VPS"&i)<>"" and Request.Form ("VPS"&i)>=0 then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='云服务器产品' and username='"&session("agentusername")&"' and id="&i&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew


Set dsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_VPSProductlist where id="&i
		dsDlist.Open Sql,conn,1,1
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and username='"&session ("agentusername")&"' and id="&i
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
realcost=dsDlist("usermoney")*dsagnettype("pers")
else
realcost=dsagnpri("usermoney")
end if
dsagnpri.close
dsDlist.close
If not IsNumeric(Request.Form ("VPS"&i)) or CDbl(Request.Form ("VPS"&i))<realcost or CDbl(Request.Form ("VPS"&i))<0.01 Then
Response.Write "存在不正常的金额！注意不能小于成本价。"&CDbl(Request.Form ("VPS"&i))
Response.End
end if

ds("id")=i
ds("username")=session("agentusername")
ds("prtype")="云服务器产品"
ds("usermoney")=Request.Form ("VPS"&i)
ds.Update
ds.Close
end If

if Request.Form ("CDN"&i)<>"" and Request.Form ("CDN"&i)>=0 then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='CDN产品' and username='"&session("agentusername")&"' and id="&i&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew


Set dsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_CDNProductlist where id="&i
		dsDlist.Open Sql,conn,1,1
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='CDN产品' and username='"&session ("agentusername")&"' and id="&i
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
realcost=dsDlist("usermoney")*dsagnettype("pers")
else
realcost=dsagnpri("usermoney")
end if
dsagnpri.close
dsDlist.close
If not IsNumeric(Request.Form ("CDN"&i)) or CDbl(Request.Form ("CDN"&i))<realcost or CDbl(Request.Form ("CDN"&i))<0.01 Then
Response.Write "存在不正常的金额！注意不能小于成本价。"&CDbl(Request.Form ("CDN"&i))
Response.End
end if

ds("id")=i
ds("username")=session("agentusername")
ds("prtype")="CDN产品"
ds("usermoney")=Request.Form ("CDN"&i)
ds.Update
ds.Close
end if



if Request.Form ("Other"&i)<>"" and Request.Form ("Other"&i)>=0 then
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='其他产品' and username='"&session("agentusername")&"' and id="&i&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew

Set dsDlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_OtherProductlist where id="&i
		dsDlist.Open Sql,conn,1,1
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='其他产品' and username='"&session ("agentusername")&"' and id="&i
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
realcost=dsDlist("usermoney")*dsagnettype("pers")
else
realcost=dsagnpri("usermoney")
end if
dsagnpri.close
dsDlist.close
If not IsNumeric(Request.Form ("Other"&i)) or CDbl(Request.Form ("Other"&i))<realcost or CDbl(Request.Form ("Other"&i))<0.01 Then
Response.Write "存在不正常的金额！注意不能小于成本价。"&CDbl(Request.Form ("Other"&i))
Response.End
end if

ds("id")=i
ds("username")=session("agentusername")
ds("prtype")="其他产品"
ds("usermoney")=Request.Form ("Other"&i)
ds.Update
ds.Close
end if



next

set ds=nothing
conn.Close 
set conn=nothing
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>　修改成功
<%=htmlwrite("html6")%>
<br><br><br>修改成功！
<%=htmlwrite("html7")%>
<%
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if
%>
