<%@ Language=VBScript %>
<%
server.ScriptTimeout =240
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canagnper")="" 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 dsagnettype = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Agent_pers where id='"&Request("id")&"'"
		dsagnettype.Open Sql,conn,1,1
if dsagnettype.eof then
	ef=True
	ec="代理类型折扣为空，请先设置它！"
end if
end if

if not ef then
%>
<!--#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 width="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="agentpercent.asp"><font color="#FFFFFF">代理折扣</font></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="148"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="120" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><font color="#FFFFFF">批量修改代理折扣</font></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="18">&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">
	  
　　手工设置代理级别为：<font color="#FF0000"><%=dsagnettype ("agenttype")%>  </font>的折扣执行结果(如果有此类代理会显示)：<br>

<%if Application("domaincansetM")=true Then%>




<strong>域名产品</strong>：

<%for regapi=1 to 7%>
<br>
<%if regapi=1 then%>新网互联<%end if%>
<%if regapi=2 then%>新网<%end if%>
<%if regapi=3 then%>商务中国<%end if%>
<%if regapi=4 then%>中国频道<%end if%>
<%if regapi=5 then%>万网<%end if%>
<%if regapi=6 then%>API6<%end if%>
<%if regapi=7 then%>外国接口<%end if%>：<br>
<%
	Set dsDomainlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_DomainProductlist order by id asc"
		dsDomainlist.Open Sql,conn,1,1
If dsDomainlist.Eof Then%>
产品列表为空.
<%else%><table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC"><%
while not dsDomainlist.Eof%>

  <tr bgcolor="#FFFFFF">
    <td width="28%" align="left">　　　<%=dsDomainlist("id")%>.<%=dsDomainlist("Domaintype")%>
    <td width="72%" align="left"><%

if request.form("selectdomain"&dsDomainlist("id")&"API"&regapi)="yes" then '修改直接价格
if IsNumeric(request.form("domain"&dsDomainlist("id")&"API"&regapi))  and IsNumeric(request.form("domainonlymoney"&dsDomainlist("id")&"API"&regapi)) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")
if request.form("domainlhtype"&dsDomainlist("id")&"API"&regapi)="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoney"&"API"&regapi&"="&request.form("domainonlymoney"&dsDomainlist("id")&"API"&regapi)
if request.form("domainlhtype"&dsDomainlist("id")&"API"&regapi)="为空" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoney"&"API"&regapi&" is null"
if request.form("domainlhtype"&dsDomainlist("id")&"API"&regapi)="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoney"&"API"&regapi&"<"&request.form("domainonlymoney"&dsDomainlist("id")&"API"&regapi)
if request.form("domainlhtype"&dsDomainlist("id")&"API"&regapi)="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoney"&"API"&regapi&">"&request.form("domainonlymoney"&dsDomainlist("id")&"API"&regapi)
'response.write request.form("domainlhtype"&dsDomainlist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsDomainlist("id")&"原价："&dsagnpri("usermoney"&"API"&regapi)&request.form("domainlhtype"&dsDomainlist("id")&"API"&regapi)&request.form("domainonlymoney"&dsDomainlist("id")&"API"&regapi)&"被改成新价："&request.form("domain"&dsDomainlist("id")&"API"&regapi)&"<br>"
dsagnpri("usermoney"&"API"&regapi)=request.form("domain"&dsDomainlist("id")&"API"&regapi)
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsDomainlist("id")
'response.write request.form("domainlhtype"&pdagnid)
if request.form("domainlhtype"&pdagnid&"API"&regapi)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="域名产品"
ds("usermoney"&"API"&regapi)=Request.Form ("domain"&pdagnid&"API"&regapi)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end if

for iqx=2 to 5
if request.form("selectdomain"&dsDomainlist("id")&"year"&iqx&"API"&regapi)="yes" then '修改直接价格--2-5年
if IsNumeric(request.form("domain"&dsDomainlist("id")&"year"&iqx&"API"&regapi))  and IsNumeric(request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx&"API"&regapi)) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")
if request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx&"API"&regapi)="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and year"&iqx&"API"&regapi&"="&request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx&"API"&regapi)
if request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx&"API"&regapi)="为空" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and year"&iqx&"API"&regapi&" is null"
if request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx&"API"&regapi)="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and year"&iqx&"API"&regapi&"<"&request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx&"API"&regapi)
if request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx&"API"&regapi)="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and year"&iqx&"API"&regapi&">"&request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx&"API"&regapi)
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
'response.write sql
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsDomainlist("id")&"原价("&iqx&"年)："&dsagnpri("year"&iqx&"API"&regapi)&request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx&"API"&regapi)&request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx&"API"&regapi)&"被改成新价："&request.form("domain"&dsDomainlist("id")&"year"&iqx&"API"&regapi)&"<br>"
dsagnpri("year"&iqx&"API"&regapi)=request.form("domain"&dsDomainlist("id")&"year"&iqx&"API"&regapi)
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsDomainlist("id")
if request.form("domainlhtype"&pdagnid&"year"&iqx&"API"&regapi)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="域名产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
ds("year"&iqx&"API"&regapi)=request.form("domain"&pdagnid&"year"&iqx&"API"&regapi)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理


end if'是数字
end if
next

'以下部分和单独接口价格完全是一样的_____________________________________________________________________
if request.form("selectdomainrepay"&dsDomainlist("id"))="yes" then '修改续费价格
'response.write dsDomainlist("id")
if IsNumeric(request.form("domainrepay"&dsDomainlist("id"))) and IsNumeric(request.form("domainonlymoneyrepay"&dsDomainlist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")
if request.form("domainrepaylhtype"&dsDomainlist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay="&request.form("domainonlymoneyrepay"&dsDomainlist("id"))
if request.form("domainrepaylhtype"&dsDomainlist("id"))="为空" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay is null"
if request.form("domainrepaylhtype"&dsDomainlist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay<"&request.form("domainonlymoneyrepay"&dsDomainlist("id"))
if request.form("domainrepaylhtype"&dsDomainlist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay>"&request.form("domainonlymoneyrepay"&dsDomainlist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsDomainlist("id")&"续费原价："&dsagnpri("usermoneyrepay")&request.form("domainrepaylhtype"&dsDomainlist("id"))&request.form("domainonlymoneyrepay"&dsDomainlist("id"))&"被改成新价："&request.form("domainrepay"&dsDomainlist("id"))&"<br>"
dsagnpri("usermoneyrepay")=request.form("domainrepay"&dsDomainlist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsDomainlist("id")
if request.form("domainrepaylhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="域名产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end If

for iqx=2 to 7
if request.form("selectdomainrepay"&dsDomainlist("id")&"_"&iqx)="yes" then '修改续费价格2-6 api
'response.write dsDomainlist("id")
if IsNumeric(request.form("domainrepay"&dsDomainlist("id")&"_"&iqx)) and IsNumeric(request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")
if request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay="&request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)
if request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)="为空" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay is null"
if request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay<"&request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)
if request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay>"&request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsDomainlist("id")&"(API:"&iqx&")续费原价："&dsagnpri("usermoneyrepay")&request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)&request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)&"被改成新价："&request.form("domainrepay"&dsDomainlist("id")&"_"&iqx)&"<br>"
dsagnpri("usermoneyrepay"&iqx)=request.form("domainrepay"&dsDomainlist("id")&"_"&iqx)

dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsDomainlist("id")
if request.form("domainrepaylhtype"&pdagnid&"_"&iqx)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="域名产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
'ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
ds("usermoneyrepay"&iqx)=request.form("domainrepay"&pdagnid&"_"&iqx)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end If
next


%><br></td>
</tr>

<%dsDomainlist.movenext
wend
dsDomainlist.close
set dsDomainlist=nothing%></table><%end if%>




<%next%>

<%Else
'没有单独价格.............................................
%>

<strong>域名产品</strong>：
<%
	Set dsDomainlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_DomainProductlist order by id asc"
		dsDomainlist.Open Sql,conn,1,1
If dsDomainlist.Eof Then%>
产品列表为空.
<%else%><table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC"><%
while not dsDomainlist.Eof%>

  <tr bgcolor="#FFFFFF">
    <td width="28%" align="left">　　　<%=dsDomainlist("id")%>.<%=dsDomainlist("Domaintype")%>
    <td width="72%" align="left"><%

if request.form("selectdomain"&dsDomainlist("id"))="yes" then '修改直接价格
if IsNumeric(request.form("domain"&dsDomainlist("id")))  and IsNumeric(request.form("domainonlymoney"&dsDomainlist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")
if request.form("domainlhtype"&dsDomainlist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoney="&request.form("domainonlymoney"&dsDomainlist("id"))
if request.form("domainlhtype"&dsDomainlist("id"))="为空" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoney is null"
if request.form("domainlhtype"&dsDomainlist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoney<"&request.form("domainonlymoney"&dsDomainlist("id"))
if request.form("domainlhtype"&dsDomainlist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoney>"&request.form("domainonlymoney"&dsDomainlist("id"))
'response.write request.form("domainlhtype"&dsDomainlist("id"))
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsDomainlist("id")&"原价："&dsagnpri("usermoney")&request.form("domainlhtype"&dsDomainlist("id"))&request.form("domainonlymoney"&dsDomainlist("id"))&"被改成新价："&request.form("domain"&dsDomainlist("id"))
dsagnpri("usermoney")=request.form("domain"&dsDomainlist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsDomainlist("id")
'response.write request.form("domainlhtype"&pdagnid)
if request.form("domainlhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="域名产品"
ds("usermoney")=Request.Form ("domain"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end if

for iqx=2 to 5
if request.form("selectdomain"&dsDomainlist("id")&"year"&iqx)="yes" then '修改直接价格--2-5年
if IsNumeric(request.form("domain"&dsDomainlist("id")&"year"&iqx))  and IsNumeric(request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx)) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")
if request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx)="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and year"&iqx&"="&request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx)
if request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx)="为空" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and year"&iqx&" is null"
if request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx)="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and year"&iqx&"<"&request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx)
if request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx)="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and year"&iqx&">"&request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx)
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
'response.write sql
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsDomainlist("id")&"原价("&iqx&"年)："&dsagnpri("year"&iqx)&request.form("domainlhtype"&dsDomainlist("id")&"year"&iqx)&request.form("domainonlymoney"&dsDomainlist("id")&"year"&iqx)&"被改成新价："&request.form("domain"&dsDomainlist("id")&"year"&iqx)
dsagnpri("year"&iqx)=request.form("domain"&dsDomainlist("id")&"year"&iqx)
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsDomainlist("id")
if request.form("domainlhtype"&pdagnid&"year"&iqx)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="域名产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理


end if'是数字
end if
next

if request.form("selectdomainrepay"&dsDomainlist("id"))="yes" then '修改续费价格
'response.write dsDomainlist("id")
if IsNumeric(request.form("domainrepay"&dsDomainlist("id"))) and IsNumeric(request.form("domainonlymoneyrepay"&dsDomainlist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")
if request.form("domainrepaylhtype"&dsDomainlist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay="&request.form("domainonlymoneyrepay"&dsDomainlist("id"))
if request.form("domainrepaylhtype"&dsDomainlist("id"))="为空" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay is null"
if request.form("domainrepaylhtype"&dsDomainlist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay<"&request.form("domainonlymoneyrepay"&dsDomainlist("id"))
if request.form("domainrepaylhtype"&dsDomainlist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay>"&request.form("domainonlymoneyrepay"&dsDomainlist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsDomainlist("id")&"续费原价："&dsagnpri("usermoneyrepay")&request.form("domainrepaylhtype"&dsDomainlist("id"))&request.form("domainonlymoneyrepay"&dsDomainlist("id"))&"被改成新价："&request.form("domainrepay"&dsDomainlist("id"))&"<br>"
dsagnpri("usermoneyrepay")=request.form("domainrepay"&dsDomainlist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsDomainlist("id")
if request.form("domainrepaylhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="域名产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end If

for iqx=2 to 7
if request.form("selectdomainrepay"&dsDomainlist("id")&"_"&iqx)="yes" then '修改续费价格2-6 api
'response.write dsDomainlist("id")
if IsNumeric(request.form("domainrepay"&dsDomainlist("id")&"_"&iqx)) and IsNumeric(request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")
if request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay="&request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)
if request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)="为空" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay is null"
if request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay<"&request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)
if request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and id="&dsDomainlist("id")&" and usermoneyrepay>"&request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsDomainlist("id")&"(API:"&iqx&")续费原价："&dsagnpri("usermoneyrepay")&request.form("domainrepaylhtype"&dsDomainlist("id")&"_"&iqx)&request.form("domainonlymoneyrepay"&dsDomainlist("id")&"_"&iqx)&"被改成新价："&request.form("domainrepay"&dsDomainlist("id")&"_"&iqx)&"<br>"
dsagnpri("usermoneyrepay"&iqx)=request.form("domainrepay"&dsDomainlist("id")&"_"&iqx)

dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsDomainlist("id")
if request.form("domainrepaylhtype"&pdagnid&"_"&iqx)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="域名产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
'ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
ds("usermoneyrepay"&iqx)=request.form("domainrepay"&pdagnid&"_"&iqx)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end If
next


%><br></td>
</tr>

<%dsDomainlist.movenext
wend
dsDomainlist.close
set dsDomainlist=nothing%></table><%end if%>

<%End If
'结束没有单独价格%>
	  
<strong>虚拟主机产品</strong>：
<%
	Set dsHostlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HostProductlist order by id asc"
		dsHostlist.Open Sql,conn,1,1
If dsHostlist.Eof Then%>产品列表为空.
<%else%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
  <%while not dsHostlist.Eof%>
  <tr bgcolor="#FFFFFF">
    <td width="28%" align="left">　　　
<%=dsHostlist("id")%>.<%=dsHostlist("Hosttype")%> 
    <td width="72%" align="left">
<%
if request.form("selecthost"&dsHostlist("id"))="yes" then '修改本项价格
'response.write dsHostlist("id")
if IsNumeric(request.form("host"&dshostlist("id")))  and IsNumeric(request.form("hostonlymoney"&dshostlist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='虚拟主机' and id="&dsHostlist("id")
if request.form("hostlhtype"&dsHostlist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='虚拟主机' and id="&dsHostlist("id")&" and usermoney="&request.form("hostonlymoney"&dsHostlist("id"))
if request.form("hostlhtype"&dsHostlist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='虚拟主机' and id="&dsHostlist("id")&" and usermoney<"&request.form("hostonlymoney"&dsHostlist("id"))
if request.form("hostlhtype"&dsHostlist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='虚拟主机' and id="&dsHostlist("id")&" and usermoney>"&request.form("hostonlymoney"&dsHostlist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsHostlist("id")&"原价："&dsagnpri("usermoney")&request.form("hostlhtype"&dsHostlist("id"))&request.form("hostonlymoney"&dsHostlist("id"))&"被改成新价："&request.form("host"&dsHostlist("id"))&"<br>"
dsagnpri("usermoney")=request.form("host"&dsHostlist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsHostlist("id")
if request.form("hostlhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='虚拟主机' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="虚拟主机"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
'ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
'ds("usermoneyrepay"&iqx)=request.form("domainrepay"&pdagnid&"_"&iqx)
ds("usermoney")=request.form("host"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end if
%>	
	<br>
</td>
  </tr>

<%
dsHostlist.movenext
wend
dsHostlist.close
set dsHostlist=nothing%></table>
<%end if%>

<strong>邮箱产品</strong>：
<%
	Set dsEmaillist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_EmailProductlist where isbyhost='n' order by id asc"
		dsEmaillist.Open Sql,conn,1,1
If dsEmaillist.Eof Then%>
产品列表为空.
<%else%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC"><%
while not dsEmaillist.Eof%>
  <tr bgcolor="#FFFFFF">
    <td width="28%" align="left">　　　<%=dsEmaillist("id")%>.<%=dsEmaillist("Emailtype")%>
    <td width="72%" align="left">
<%


if request.form("selectemail"&dsEmaillist("id"))="yes" then '修改本项价格
'response.write dsEmaillist("id")
if IsNumeric(request.form("email"&dsemaillist("id")))  and IsNumeric(request.form("emailonlymoney"&dsemaillist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='邮箱产品' and id="&dsemaillist("id")
if request.form("emaillhtype"&dsemaillist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='邮箱产品' and id="&dsemaillist("id")&" and usermoney="&request.form("emailonlymoney"&dsemaillist("id"))
if request.form("emaillhtype"&dsemaillist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='邮箱产品' and id="&dsemaillist("id")&" and usermoney<"&request.form("emailonlymoney"&dsemaillist("id"))
if request.form("emaillhtype"&dsemaillist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='邮箱产品' and id="&dsemaillist("id")&" and usermoney>"&request.form("emailonlymoney"&dsemaillist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsemaillist("id")&"原价："&dsagnpri("usermoney")&request.form("emaillhtype"&dsemaillist("id"))&request.form("emailonlymoney"&dsemaillist("id"))&"被改成新价："&request.form("email"&dsemaillist("id"))&"<br>"
dsagnpri("usermoney")=request.form("email"&dsemaillist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsemaillist("id")
if request.form("emaillhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='邮箱产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="邮箱产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
'ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
'ds("usermoneyrepay"&iqx)=request.form("domainrepay"&pdagnid&"_"&iqx)
ds("usermoney")=request.form("email"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end if%>	
<br>
</td>
  </tr>

<%

dsEmaillist.movenext
wend
dsEmaillist.close
set dsEmaillist=nothing%></table><%end if%>






<strong>云服务器产品</strong>：
<%
	Set dsVPSlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_VPSProductlist order by id asc"
		dsVPSlist.Open Sql,conn,1,1
If dsVPSlist.Eof Then%>
产品列表为空.
<%else%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC"><%
while not dsVPSlist.Eof%>
  <tr bgcolor="#FFFFFF">
    <td width="28%" align="left">　　　<%=dsVPSlist("id")%>.<%=dsVPSlist("VPStype")%>
    <td width="72%" align="left">
<%


if request.form("selectVPS"&dsVPSlist("id"))="yes" then '修改本项价格
'response.write dsVPSlist("id")
if IsNumeric(request.form("VPS"&dsVPSlist("id")))  and IsNumeric(request.form("VPSonlymoney"&dsVPSlist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and id="&dsVPSlist("id")
if request.form("VPSlhtype"&dsVPSlist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and id="&dsVPSlist("id")&" and usermoney="&request.form("VPSonlymoney"&dsVPSlist("id"))
if request.form("VPSlhtype"&dsVPSlist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and id="&dsVPSlist("id")&" and usermoney<"&request.form("VPSonlymoney"&dsVPSlist("id"))
if request.form("VPSlhtype"&dsVPSlist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and id="&dsVPSlist("id")&" and usermoney>"&request.form("VPSonlymoney"&dsVPSlist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsVPSlist("id")&"原价："&dsagnpri("usermoney")&request.form("VPSlhtype"&dsVPSlist("id"))&request.form("VPSonlymoney"&dsVPSlist("id"))&"被改成新价："&request.form("VPS"&dsVPSlist("id"))&"<br>"
dsagnpri("usermoney")=request.form("VPS"&dsVPSlist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsVPSlist("id")
if request.form("VPSlhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="云服务器产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
'ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
'ds("usermoneyrepay"&iqx)=request.form("domainrepay"&pdagnid&"_"&iqx)
ds("usermoney")=request.form("VPS"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end if%>	
<br>
</td>
  </tr>

<%

dsVPSlist.movenext
wend
dsVPSlist.close
set dsVPSlist=nothing%></table><%end if%>


<strong>CDN产品</strong>：
<%
	Set dsCDNlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_CDNProductlist order by id asc"
		dsCDNlist.Open Sql,conn,1,1
If dsCDNlist.Eof Then%>
产品列表为空.
<%else%>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC"><%
while not dsCDNlist.Eof%>
  <tr bgcolor="#FFFFFF">
    <td width="28%" align="left">　　　<%=dsCDNlist("id")%>.<%=dsCDNlist("CDNtype")%>
    <td width="72%" align="left">
<%


if request.form("selectCDN"&dsCDNlist("id"))="yes" then '修改本项价格
'response.write dsCDNlist("id")
if IsNumeric(request.form("CDN"&dsCDNlist("id")))  and IsNumeric(request.form("CDNonlymoney"&dsCDNlist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='CDN产品' and id="&dsCDNlist("id")
if request.form("CDNlhtype"&dsCDNlist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='CDN产品' and id="&dsCDNlist("id")&" and usermoney="&request.form("CDNonlymoney"&dsCDNlist("id"))
if request.form("CDNlhtype"&dsCDNlist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='CDN产品' and id="&dsCDNlist("id")&" and usermoney<"&request.form("CDNonlymoney"&dsCDNlist("id"))
if request.form("CDNlhtype"&dsCDNlist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='CDN产品' and id="&dsCDNlist("id")&" and usermoney>"&request.form("CDNonlymoney"&dsCDNlist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsCDNlist("id")&"原价："&dsagnpri("usermoney")&request.form("CDNlhtype"&dsCDNlist("id"))&request.form("CDNonlymoney"&dsCDNlist("id"))&"被改成新价："&request.form("CDN"&dsCDNlist("id"))&"<br>"
dsagnpri("usermoney")=request.form("CDN"&dsCDNlist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsCDNlist("id")
if request.form("CDNlhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='CDN产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="CDN产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
'ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
'ds("usermoneyrepay"&iqx)=request.form("domainrepay"&pdagnid&"_"&iqx)
ds("usermoney")=request.form("CDN"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end if%>	
<br>
</td>
  </tr>

<%

dsCDNlist.movenext
wend
dsCDNlist.close
set dsCDNlist=nothing%></table><%end if%>



<strong>数据库产品</strong>：
<%
	Set dsSqllist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_SqlProductlist where isbyhost='n' order by id asc"
		dsSqllist.Open Sql,conn,1,1
If dsSqllist.Eof Then%>
产品列表为空.
<%else%><table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
<%
while not dsSqllist.Eof%>

  <tr bgcolor="#FFFFFF">
    <td width="28%" align="left">　　　<%=dsSqllist("id")%>.<%=dsSqllist("Sqltype")%>
    <td width="72%" align="left">
<%

if request.form("selectsql"&dsSqllist("id"))="yes" then '修改本项价格
'response.write dsSqllist("id")
if IsNumeric(request.form("SQL"&dsSQLlist("id")))  and IsNumeric(request.form("SQLonlymoney"&dsSQLlist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='数据库产品' and id="&dsSQLlist("id")
if request.form("SQLlhtype"&dsSQLlist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='数据库产品' and id="&dsSQLlist("id")&" and usermoney="&request.form("SQLonlymoney"&dsSQLlist("id"))
if request.form("SQLlhtype"&dsSQLlist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='数据库产品' and id="&dsSQLlist("id")&" and usermoney<"&request.form("SQLonlymoney"&dsSQLlist("id"))
if request.form("SQLlhtype"&dsSQLlist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='数据库产品' and id="&dsSQLlist("id")&" and usermoney>"&request.form("SQLonlymoney"&dsSQLlist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsSQLlist("id")&"原价："&dsagnpri("usermoney")&request.form("SQLlhtype"&dsSQLlist("id"))&request.form("SQLonlymoney"&dsSQLlist("id"))&"被改成新价："&request.form("SQL"&dsSQLlist("id"))&"<br>"
dsagnpri("usermoney")=request.form("SQL"&dsSQLlist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsSQLlist("id")
if request.form("SQLlhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='数据库产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="数据库产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
'ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
'ds("usermoneyrepay"&iqx)=request.form("domainrepay"&pdagnid&"_"&iqx)
ds("usermoney")=request.form("SQL"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end if
%>	
<br>
</td>
  </tr>
<%
dsSqllist.movenext
wend
dsSqllist.close
set dsSqllist=nothing%></table><%end if%>


<strong>其他产品</strong>：
<%
	Set dsOtherlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_OtherProductlist where isbyhost='n' order by id asc"
		dsOtherlist.Open Sql,conn,1,1
If dsOtherlist.Eof Then%>
产品列表为空.
<%else%><table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC"><%
while not dsOtherlist.Eof%>

  <tr bgcolor="#FFFFFF">
    <td width="28%" align="left">　　　<%=dsOtherlist("id")%>.<%=dsOtherlist("Othertype")%>
    <td width="72%" align="left">
<%

if request.form("selectOther"&dsOtherlist("id"))="yes" then '修改本项价格
'response.write dsOtherlist("id")
if IsNumeric(request.form("Other"&dsOtherlist("id")))  and IsNumeric(request.form("Otheronlymoney"&dsOtherlist("id"))) then
'下面开始遍列代理的价格表，将成本价格修改到此价格..............
Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='其他产品' and id="&dsOtherlist("id")
if request.form("Otherlhtype"&dsOtherlist("id"))="等于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='其他产品' and id="&dsOtherlist("id")&" and usermoney="&request.form("Otheronlymoney"&dsOtherlist("id"))
if request.form("Otherlhtype"&dsOtherlist("id"))="低于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='其他产品' and id="&dsOtherlist("id")&" and usermoney<"&request.form("Otheronlymoney"&dsOtherlist("id"))
if request.form("Otherlhtype"&dsOtherlist("id"))="高于" then	Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='其他产品' and id="&dsOtherlist("id")&" and usermoney>"&request.form("Otheronlymoney"&dsOtherlist("id"))
'response.write sql
		dsagnpri.Open Sql,conn,1,3
while not dsagnpri.eof

Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype from FreeHost.FreeHost_Agent where username='"&dsagnpri("username")&"'"
		dsagn.Open Sql,conn,1,1
if not dsagn.eof then
if dsagn("agenttype")=request.form("agenttype") then
response.write  "代理名:"&dsagnpri("username")&"级别："&dsagn("agenttype")&"类别："&dsOtherlist("id")&"原价："&dsagnpri("usermoney")&request.form("Otherlhtype"&dsOtherlist("id"))&request.form("Otheronlymoney"&dsOtherlist("id"))&"被改成新价："&request.form("Other"&dsOtherlist("id"))&"<br>"
dsagnpri("usermoney")=request.form("Other"&dsOtherlist("id"))
dsagnpri.update
end if'是这个级别的代理
end if
dsagnpri.movenext
wend
dsagnpri.close

pdagnid=dsOtherlist("id")
if request.form("Otherlhtype"&pdagnid)="任何" then	'处理所有这个级别的代理，就算没有独立定价也处理'必须处理空价格问题。
Set dsagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select agenttype,username from FreeHost.FreeHost_Agent where agenttype='"&dsagnettype("agenttype")&"'"
		dsagn.Open Sql,conn,1,1
while not dsagn.eof
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='其他产品' and username='"&dsagn ("username")&"' and id="&pdagnid&""
		ds.Open Sql,conn,1,3
if ds.eof then ds.AddNew
ds("id")=pdagnid
ds("username")=dsagn("username")
ds("prtype")="其他产品"
'ds("usermoney")=Request.Form ("domain"&pdagnid)
'ds("year"&iqx)=request.form("domain"&pdagnid&"year"&iqx)
'ds("usermoneyrepay")=request.form("domainrepay"&pdagnid)
'ds("usermoneyrepay"&iqx)=request.form("domainrepay"&pdagnid&"_"&iqx)
ds("usermoney")=request.form("Other"&pdagnid)
response.write  "代理名:"&dsagn("username")&"已更新<br>"
ds.Update
ds.Close
dsagn.movenext
wend
End if'完成任何代理处理

end if'是数字
end if%>	
	<br>
</td>
  </tr>

<%

dsOtherlist.movenext
wend
dsOtherlist.close
set dsOtherlist=nothing%></table><%end if%>



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