<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
server.ScriptTimeout =7200
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canagnper")="" Then
	ef=True
	ec="您没有此操作的权限。"
elseIf Request("username")="" or RegExpTest("[^A-Za-z0-9]",Request("username")) 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='"&Request("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
if 	ds("agenttype")="n" then
	ef=True
	ec="此代理会员尚未审批，请先在代理管理中审批。"
end if
end if

if not ef then
	Set dsagnettype = Server.CreateObject("ADODB.Recordset")	
'if 	Request.QueryString ("agenttype")<>"" then
Sql="Select * from FreeHost.FreeHost_Agent_pers where agenttype='"&ds("agenttype")&"'"
'else
'Sql="Select * from FreeHost.FreeHost_Agent_pers"
'end if
	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

'ds.close
'set ds=nothing
'conn.Close 
'set conn=nothing
%>
<!--#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><a href="logininfo.asp"></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&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">
	  
　　手工设置代理用户：<%=Request("username")%>  的折扣：
	  
	  <form name="form1" method="post" action="agentprice-sub.asp">
虚拟主机产品：
<%
	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">价格:
      <input name="host<%=dsHostlist("id")%>" type="text" size="4" maxlength="10" value="<%
	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='虚拟主机' and username='"&ds ("username")&"' and id="&dsHostlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsHostlist("usermoney")*dsagnettype("pers")
else
response.write  dsagnpri("usermoney")
end if
dsagnpri.close
	  
	  
	  %>">
    元</td>
  </tr>

<%


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

邮箱产品：
<%
	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">价格:
      <input name="email<%=dsEmaillist("id")%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='邮箱产品' and username='"&ds ("username")&"' and id="&dsEmaillist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsEmaillist("usermoney")*dsagnettype("pers")
else
response.write  dsagnpri("usermoney")
end if
dsagnpri.close
	  
	  %>">
    元</td>
  </tr>

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







域名产品：
<%
	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 Application("domaincansetM")=true Then%>
<%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>
价格:
<input name="domain<%=dsDomainlist("id")%>API<%=regapi%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
'response.write  dsDomainlist("usermoneyagn")
response.write  dsDomainlist("usermoneyagn"&"API"&regapi)
else
response.write  dsagnpri("usermoney"&"API"&regapi)
if isnull(dsagnpri("usermoney"&"API"&regapi)) then response.write  dsDomainlist("usermoneyagn"&"API"&regapi)
end if
dsagnpri.close
	  
	  %>">
    元1年<br>
<%for iqx=2 to 5%>
价格:
      <input name="domain<%=dsDomainlist("id")%>year<%=iqx%>API<%=regapi%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
'response.write  dsDomainlist("year"&iqx&"agn")
response.write  dsDomainlist("year"&iqx&"agn"&"API"&regapi)
else
response.write  dsagnpri("year"&iqx&"API"&regapi)
if isnull(dsagnpri("year"&iqx&"API"&regapi)) then response.write  dsDomainlist("year"&iqx&"agn"&"API"&regapi)
end if
dsagnpri.close
	  
	  %>"> 元<%=iqx%>年<br>
<%next%>

<%next%>
<%else%>价格:<input name="domain<%=dsDomainlist("id")%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("usermoneyagn")
else
response.write  dsagnpri("usermoney")
if isnull(dsagnpri("usermoney")) then response.write  dsDomainlist("usermoneyagn")
end if
dsagnpri.close
	  
	  %>">
    元1年<br>
<%for iqx=2 to 5%>
价格:
      <input name="domain<%=dsDomainlist("id")%>year<%=iqx%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("year"&iqx&"agn")
else
response.write  dsagnpri("year"&iqx)
if isnull(dsagnpri("year"&iqx)) then response.write dsDomainlist("year"&iqx&"agn")
end if
dsagnpri.close
	  
	  %>"> 元<%=iqx%>年<br>
<%next%>
<%end if%>
<font color="#0000FF">续费(新网互联):</font>      <input name="domainrepay<%=dsDomainlist("id")%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("usermoneyagnrepay")
else
response.write  dsagnpri("usermoneyrepay")
end if
dsagnpri.close
	  
	  %>">
元/年<br>
<font color="#0000FF">续费(新网):</font>      <input name="domainrepay<%=dsDomainlist("id")%>_2" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("usermoneyagnrepay2")
else
response.write  dsagnpri("usermoneyrepay2")
end if
dsagnpri.close
	  
	  %>">
元/年<br>
<font color="#0000FF">续费(商务中国):</font>      <input name="domainrepay<%=dsDomainlist("id")%>_3" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("usermoneyagnrepay3")
else
response.write  dsagnpri("usermoneyrepay3")
end if
dsagnpri.close
	  
	  %>">
元/年<br>

<font color="#0000FF">续费(中国频道):</font>      <input name="domainrepay<%=dsDomainlist("id")%>_4" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("usermoneyagnrepay4")
else
response.write  dsagnpri("usermoneyrepay4")
end if
dsagnpri.close
	  
	  %>">
元/年<br>
<font color="#0000FF">续费(万网):</font>      <input name="domainrepay<%=dsDomainlist("id")%>_5" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("usermoneyagnrepay5")
else
response.write  dsagnpri("usermoneyrepay5")
end if
dsagnpri.close
	  
	  %>">
元/年<br>
<font color="#0000FF">续费(API6):</font>      <input name="domainrepay<%=dsDomainlist("id")%>_6" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("usermoneyagnrepay6")
else
response.write  dsagnpri("usermoneyrepay6")
end if
dsagnpri.close
	  
	  %>">
元/年<br>
<font color="#0000FF">续费(外国接口):</font>      <input name="domainrepay<%=dsDomainlist("id")%>_7" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDomainlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDomainlist("usermoney")*dsagnettype("pers")
'读FreeHost_DomainProductlist
response.write  dsDomainlist("usermoneyagnrepay7")
else
response.write  dsagnpri("usermoneyrepay7")
end if
dsagnpri.close
	  
	  %>">
元/年<br>


</td>
  </tr>

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



数据库产品：
<%
	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">价格:
      <input name="Sql<%=dsSqllist("id")%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='数据库产品' and username='"&ds ("username")&"' and id="&dsSqllist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsSqllist("usermoney")*dsagnettype("pers")
else
response.write  dsagnpri("usermoney")
end if
dsagnpri.close
	  
	  %>">
    元</td>
  </tr>
<%
dsSqllist.movenext
wend
dsSqllist.close
set dsSqllist=nothing%></table><%end if%>


云服务器产品：
<%
	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">价格:
      <input name="VPS<%=dsVPSlist("id")%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='云服务器产品' and username='"&ds ("username")&"' and id="&dsVPSlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsVPSlist("usermoney")*dsagnettype("pers")
else
response.write  dsagnpri("usermoney")
end if
dsagnpri.close
	  
	  %>">
    元</td>
  </tr>

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

CDN产品：
<%
	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">价格:
      <input name="CDN<%=dsCDNlist("id")%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='CDN产品' and username='"&ds ("username")&"' and id="&dsCDNlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsCDNlist("usermoney")*dsagnettype("pers")
else
response.write  dsagnpri("usermoney")
end if
dsagnpri.close
	  
	  %>">
    元</td>
  </tr>

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

其他产品：
<%
	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">价格:
      <input name="Other<%=dsOtherlist("id")%>" type="text" size="4" maxlength="10" value="<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='其他产品' and username='"&ds ("username")&"' and id="&dsOtherlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsOtherlist("usermoney")*dsagnettype("pers")
else
response.write  dsagnpri("usermoney")
end if
dsagnpri.close
	  
	  %>">
    元</td>
  </tr>

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


<input type="submit" name="Submit" value="提交">
<input name="username" type="hidden" id="username" value="<%=ds("username")%>">
</form>
	  
	  
	  
	  
	  </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


Function RegExpTest(patrn, strng)
  Dim regEx
  Set regEx = New RegExp
  regEx.Pattern = patrn
  regEx.IgnoreCase = False
  RegExpTest = regEx.Test(strng)
End Function %>
