<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
server.ScriptTimeout =7200
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

'ds.close
'set ds=nothing
'conn.Close 
'set conn=nothing
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>
　设置价格
<%=htmlwrite("html6")%>
<br>
<br>
代理用户名：<%=session("agentusername")%> <%if session("agenttype")<>"子代理" then%><%=ds("agenttype")%><%end if%> 　　
<a href="/user/myprice.asp">点击查看简化的价格列表(包含购买多年与续费的价格)&gt;&gt;&gt;</a>
<br>
<br> 
<form action="" method="get" name="addperform">
将本页面中显示的所有类型产品出售价自动按成本价增加百份之
  <input name="add" type="text" size="2" maxlength="10" value="20">
  <a href="#" onClick="addpercent()">
(请点击这儿，点击后请稍等一分钟)</a><br>
<br>
将本页面中显示的域名类型产品出售价自动按成本价增加百份之
  <input name="adddomain" type="text" size="2" maxlength="10" value="20">
  <a href="#" onClick="addpercentdomain()"> 请点击这儿，(点击后请稍等一分钟)</a>　<br>
</form>

<form name="form1" method="post" action="myprice-sub.asp"  id="priceform">
  虚<b>拟主机产品：
  </b>  
  <table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
  <%
	Set dsHostlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HostProductlist where canbyagnenduser='y' order by id asc"
		dsHostlist.Open Sql,conn,1,1
If dsHostlist.Eof Then%>
  产品列表为空.
  <%else
while not dsHostlist.Eof


%>

    <tr bgcolor="#FFFFFF">
      <td width="26%"><%=dsHostlist("id")%>.<%=dsHostlist("Hosttype")%>
<%
	Set newname_host = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_HostProductlist_AGN where agent1='"&session("agentusername")&"' and id='"&dsHostlist("id")&"'"
		newname_host.Open Sql,conn,1,1
if not newname_host.eof then%>
　<font color=red>(<%=newname_host("Hosttype")%>)</font>
<%
newname_host.close
end if%>
      <td width="74%" bgcolor="#EEEEEE">　成本价格：
          <input name="orihost<%=dsHostlist("id")%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" 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

	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='虚拟主机' and username='"&ds("username")&"' and id="&dsHostlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsHostlist("usermoney")
else
usermoney=dsendmoney("usermoney")
end if
dsendmoney.close
	  
	  %>>元1年　　出售给最终用户价格：
      <input name="host<%=dsHostlist("id")%>" type="text" size="4" maxlength="10" value="<%=usermoney%>">
      </td>
    </tr>
  <%
dsHostlist.movenext
wend
dsHostlist.close
set dsHostlist=nothing
end if%>
  </table>
  <br>
  <b>数据库产品：
  </b>
  <table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
<%
	Set dsSqllist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_SqlProductlist where isbyhost='n' and canbyagnenduser='y' order by id asc"
		dsSqllist.Open Sql,conn,1,1
If dsSqllist.Eof Then%>
产品列表为空.
<%else
while not dsSqllist.Eof%>

  <tr bgcolor="#FFFFFF">
    <td width="26%"><%=dsSqllist("id")%>.<%=dsSqllist("Sqltype")%>
<%
	Set newname_Sql = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_SqlProductlist_AGN where agent1='"&session("agentusername")&"' and id='"&dsSqllist("id")&"'"
		newname_Sql.Open Sql,conn,1,1
if not newname_Sql.eof then%>
　<font color=red>(<%=newname_Sql("Sqltype")%>)</font>
<%
newname_Sql.close
end if%>
    <td width="74%" bgcolor="#EEEEEE">　成本价格：
        <input name="oriSql<%=dsSqllist("id")%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" 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

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='数据库产品' and username='"&ds("username")&"' and id="&dsSqllist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsSqllist("usermoney")
else
usermoney=dsendmoney("usermoney")
end if
dsendmoney.close
	  %>>元1年　　出售给最终用户价格：
      <input name="Sql<%=dsSqllist("id")%>" type="text" size="4" maxlength="10" value="<%=usermoney%>"></td>
  </tr>

<%
dsSqllist.movenext
wend
dsSqllist.close
set dsSqllist=nothing
end if%>
</table>
<br>
<b>邮箱产品：</b>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
<%
	Set dsEmaillist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_EmailProductlist where isbyhost='n' and isbydomain='n' and canbyagnenduser='y' order by id asc"
		dsEmaillist.Open Sql,conn,1,1
If dsEmaillist.Eof Then%>
产品列表为空.
<%else
while not dsEmaillist.Eof%>
  <tr bgcolor="#FFFFFF">
    <td width="26%"><%=dsEmaillist("id")%>.<%=dsEmaillist("Emailtype")%>
<%
	Set newname_email = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_EmailProductlist_AGN where agent1='"&session("agentusername")&"' and id='"&dsEmaillist("id")&"'"
		newname_email.Open Sql,conn,1,1
if not newname_email.eof then%>
　<font color=red>(<%=newname_email("Emailtype")%>)</font>
<%
newname_email.close
end if%>
    <td width="74%" bgcolor="#EEEEEE">
	　成本价格：
                <input  name="oriemail<%=dsEmaillist("id")%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" 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

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='邮箱产品' and username='"&ds("username")&"' and id="&dsEmaillist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsEmaillist("usermoney")
else
usermoney=dsendmoney("usermoney")
end if
dsendmoney.close
	  %>>元1年　　出售给最终用户价格：
      <input name="email<%=dsEmaillist("id")%>" type="text" size="4" maxlength="10" value="<%=usermoney%>"></td>
  </tr>

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

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

  <tr bgcolor="#FFFFFF">
    <td width="26%"><%=dsDlist("id")%>.<%=dsDlist("Domaintype")%>
<%
	Set newname_domain = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_DomainProductlist_AGN where agent1='"&session("agentusername")&"' and id='"&dsDlist("id")&"'"
		newname_domain.Open Sql,conn,1,1
if not newname_domain.eof then%>
　<font color=red>(<%=newname_domain("Domaintype")%>)</font>
<%
newname_domain.close
end if%>
    <td width="74%" bgcolor="#EEEEEE">
<%if Application("domaincansetM")=true Then%>
<%for regapi=1 to 7
If Application("showapi"&regapi)=True then
%>
<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="oridomain<%=dsDlist("id")%>API<%=regapi%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%
	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
realcost=dsDlist("usermoneyagn"&"API"&regapi)
else
realcost=dsagnpri("usermoney"&"API"&regapi)
end If
if isnull(realcost) then realcost=dsDlist("usermoney")
response.write realcost
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
'usermoney=dsDlist("usermoney")
usermoney=dsDlist("usermoney"&"API"&regapi)
else
'usermoney=dsendmoney("usermoney")
usermoney=dsendmoney("usermoney"&"API"&regapi)
if isnull(dsendmoney("usermoney"&"API"&regapi)) then usermoney=dsDlist("usermoney"&"API"&regapi)
end if
dsendmoney.close
	  %>>元1年　　出售给最终用户价格：
      <input name="domain<%=dsDlist("id")%>API<%=regapi%>" type="text" size="4" maxlength="10" value="<%=usermoney%>">
      1年<br>
<%for iqx=2 to 5%>
　成本价格：
        <input  name="oridomain<%=dsDlist("id")%>year<%=iqx%>API<%=regapi%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
'response.write  dsDlist("year"&iqx&"agn")
repaytempmoney=dsDlist("year"&iqx&"agn"&"API"&regapi)
else
repaytempmoney=dsagnpri("year"&iqx&"API"&regapi)
end If
if isnull(repaytempmoney) then repaytempmoney=dsDlist("year"&iqx&"agn"&"API"&regapi)
if isnull(repaytempmoney) then repaytempmoney=dsDlist("year"&iqx)
response.write repaytempmoney
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
'usermoney=dsDlist("year"&iqx)
usermoney=dsDlist("year"&iqx&"API"&regapi)
else
'usermoney=dsendmoney("year"&iqx)
usermoney=dsendmoney("year"&iqx&"API"&regapi)
if isnull(dsendmoney("year"&iqx&"API"&regapi)) then usermoney=dsDlist("year"&iqx&"API"&regapi)
end if
dsendmoney.close
	  %>>元<%=iqx%>年　　出售给最终用户价格：
      <input name="domain<%=dsDlist("id")%>year<%=iqx%>API<%=regapi%>" type="text" size="4" maxlength="10" value="<%=usermoney%>">
元<%=iqx%>年      <br>
<%next%>
<%
End if'当系统参数中允许设置这个价格

next%>





<%'没有设置不同接口不同价

else%>	　成本价格：
        <input  name="oridomain<%=dsDlist("id")%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("usermoneyagn")
else
response.write  dsagnpri("usermoney")
if isnull(dsagnpri("usermoney")) then response.write  dsDlist("usermoneyagn")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("usermoney")
else
usermoney=dsendmoney("usermoney")
if isnull(dsendmoney("usermoney")) then usermoney=dsDlist("usermoney")
end if
dsendmoney.close
	  %>>元1年　　出售给最终用户价格：
      <input name="domain<%=dsDlist("id")%>" type="text" size="4" maxlength="10" value="<%=usermoney%>">
      1年<br>
<%for iqx=2 to 5%>
　成本价格：
        <input  name="oridomain<%=dsDlist("id")%>year<%=iqx%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("year"&iqx&"agn")
else
response.write  dsagnpri("year"&iqx)
if isnull(dsagnpri("year"&iqx)) then response.write  dsDlist("year"&iqx&"agn")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("year"&iqx)
else
usermoney=dsendmoney("year"&iqx)
if isnull(dsendmoney("year"&iqx)) then usermoney=dsDlist("year"&iqx)
end if
dsendmoney.close
	  %>>元<%=iqx%>年　　出售给最终用户价格：
      <input name="domain<%=dsDlist("id")%>year<%=iqx%>" type="text" size="4" maxlength="10" value="<%=usermoney%>">
元<%=iqx%>年      <br>
<%next%>
<%end if%>

<%If Application("showapi1")=True then%>
	  
　<font color="#0000FF">续费</font>成本(新网互联)：
      <input name="oridomainrepay<%=dsDlist("id")%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("usermoneyagnrepay")
else
response.write  dsagnpri("usermoneyrepay")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("usermoneyrepay")
else
usermoney=dsendmoney("usermoneyrepay")
end if
dsendmoney.close
	  %>>元/年　最终用户续费：
<input name="domainrepay<%=dsDlist("id")%>" type="text" id="domainrepay<%=dsDlist("id")%>" value="<%=usermoney%>" size="4" maxlength="10">
/年<br>
<%end if%>
<%If Application("showapi2")=True then%>


　<font color="#0000FF">续费</font>成本(新网)：
            <input name="oridomainrepay<%=dsDlist("id")%>_2" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("usermoneyagnrepay2")
else
response.write  dsagnpri("usermoneyrepay2")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("usermoneyrepay2")
else
usermoney=dsendmoney("usermoneyrepay2")
end if
dsendmoney.close
	  %>>元/年　最终用户续费：
<input name="domainrepay<%=dsDlist("id")%>_2" type="text" value="<%=usermoney%>" size="4" maxlength="10">
/年<br>
<%end if%>
<%If Application("showapi3")=True then%>


　<font color="#0000FF">续费</font>成本(商务中国)：
                  <input name="oridomainrepay<%=dsDlist("id")%>_3" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("usermoneyagnrepay3")
else
response.write  dsagnpri("usermoneyrepay3")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("usermoneyrepay3")
else
usermoney=dsendmoney("usermoneyrepay3")
end if
dsendmoney.close
	  %>>元/年　最终用户续费：
<input name="domainrepay<%=dsDlist("id")%>_3" type="text" value="<%=usermoney%>" size="4" maxlength="10">
/年<br>
<%end if%>
<%If Application("showapi4")=True then%>



　<font color="#0000FF">续费</font>成本(中国频道)：
                        <input name="oridomainrepay<%=dsDlist("id")%>_4" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("usermoneyagnrepay4")
else
response.write  dsagnpri("usermoneyrepay4")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("usermoneyrepay4")
else
usermoney=dsendmoney("usermoneyrepay4")
end if
dsendmoney.close
	  %>>元/年　最终用户续费：
<input name="domainrepay<%=dsDlist("id")%>_4" type="text" value="<%=usermoney%>" size="4" maxlength="10">
/年<br>
<%end if%>
<%If Application("showapi5")=True then%>



　<font color="#0000FF">续费</font>成本(万网)：
                        <input name="oridomainrepay<%=dsDlist("id")%>_5" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("usermoneyagnrepay5")
else
response.write  dsagnpri("usermoneyrepay5")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("usermoneyrepay5")
else
usermoney=dsendmoney("usermoneyrepay5")
end if
dsendmoney.close
	  %>>元/年　最终用户续费：
<input name="domainrepay<%=dsDlist("id")%>_5" type="text" value="<%=usermoney%>" size="4" maxlength="10">
/年<br>
<%end if%>
<%If Application("showapi6")=True then%>



　<font color="#0000FF">续费</font>成本(API6)：
                        <input name="oridomainrepay<%=dsDlist("id")%>_6" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("usermoneyagnrepay6")
else
response.write  dsagnpri("usermoneyrepay6")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("usermoneyrepay6")
else
usermoney=dsendmoney("usermoneyrepay6")
end if
dsendmoney.close
	  %>>元/年　最终用户续费：
<input name="domainrepay<%=dsDlist("id")%>_6" type="text" value="<%=usermoney%>" size="4" maxlength="10">
/年<br>
<%end if%>

<%If Application("showapi7")=True then%>



　<font color="#0000FF">续费</font>成本(外国接口)：
                        <input name="oridomainrepay<%=dsDlist("id")%>_7" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" value=<%

	  	Set dsagnpri = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_price where prtype='域名产品' and username='"&ds ("username")&"' and id="&dsDlist("id")&""
		dsagnpri.Open Sql,conn,1,1
if dsagnpri.eof then
response.write  dsDlist("usermoneyagnrepay7")
else
response.write  dsagnpri("usermoneyrepay7")
end if
dsagnpri.close

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='域名产品' and username='"&ds("username")&"' and id="&dsDlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsDlist("usermoneyrepay7")
else
usermoney=dsendmoney("usermoneyrepay7")
end if
dsendmoney.close
	  %>>元/年　最终用户续费：
<input name="domainrepay<%=dsDlist("id")%>_7" type="text" value="<%=usermoney%>" size="4" maxlength="10">
/年<br>
<%end if%>

</td>
  </tr>

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


<br>
<b>云服务器产品：
</b>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
<%
	Set dsVPSlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_VPSProductlist where canbyagnenduser='y' order by id asc"
		dsVPSlist.Open Sql,conn,1,1
If dsVPSlist.Eof Then%>
产品列表为空.
<%else
while not dsVPSlist.Eof%>

  <tr bgcolor="#FFFFFF">
    <td width="26%"><%=dsVPSlist("id")%>.<%=dsVPSlist("VPStype")%>
<%
	Set newname_VPS = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_VPSProductlist_AGN where agent1='"&session("agentusername")&"' and id='"&dsVPSlist("id")&"'"
		newname_VPS.Open Sql,conn,1,1
if not newname_VPS.eof then%>
　<font color=red>(<%=newname_VPS("VPStype")%>)</font>
<%
newname_VPS.close
end if%>
    <td width="74%" bgcolor="#EEEEEE">
	　成本价格：
        <input  name="oriVPS<%=dsVPSlist("id")%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" 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

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='云服务器产品' and username='"&ds("username")&"' and id="&dsVPSlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsVPSlist("usermoney")
else
usermoney=dsendmoney("usermoney")
end if
dsendmoney.close
	  %>>元1年　　出售给最终用户价格：
      <input name="VPS<%=dsVPSlist("id")%>" type="text" size="4" maxlength="10" value="<%=usermoney%>"></td>
  </tr>

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

<br>
<b>CDN产品：
</b>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
<%
	Set dsCDNlist = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_CDNProductlist where canbyagnenduser='y' order by id asc"
		dsCDNlist.Open Sql,conn,1,1
If dsCDNlist.Eof Then%>
产品列表为空.
<%else
while not dsCDNlist.Eof%>

  <tr bgcolor="#FFFFFF">
    <td width="26%"><%=dsCDNlist("id")%>.<%=dsCDNlist("CDNtype")%>
<%
	Set newname_CDN = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_CDNProductlist_AGN where agent1='"&session("agentusername")&"' and id='"&dsCDNlist("id")&"'"
		newname_CDN.Open Sql,conn,1,1
if not newname_CDN.eof then%>
　<font color=red>(<%=newname_CDN("CDNtype")%>)</font>
<%
newname_CDN.close
end if%>
    <td width="74%" bgcolor="#EEEEEE">
	　成本价格：
        <input  name="oriCDN<%=dsCDNlist("id")%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" 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

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='CDN产品' and username='"&ds("username")&"' and id="&dsCDNlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsCDNlist("usermoney")
else
usermoney=dsendmoney("usermoney")
end if
dsendmoney.close
	  %>>元1年　　出售给最终用户价格：
      <input name="CDN<%=dsCDNlist("id")%>" type="text" size="4" maxlength="10" value="<%=usermoney%>"></td>
  </tr>

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

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

  <tr bgcolor="#FFFFFF">
    <td width="26%"><%=dsOtherlist("id")%>.<%=dsOtherlist("Othertype")%>
<%
	Set newname_Other = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_OtherProductlist_AGN where agent1='"&session("agentusername")&"' and id='"&dsOtherlist("id")&"'"
		newname_Other.Open Sql,conn,1,1
if not newname_Other.eof then%>
　<font color=red>(<%=newname_Other("Othertype")%>)</font>
<%
newname_Other.close
end if%>
    <td width="74%" bgcolor="#EEEEEE">　成本价格：
        <input  name="oriOther<%=dsOtherlist("id")%>" type="text" size="4"  readonly="true" style="background:;text-align:right;BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px" 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

	  
	  	Set dsendmoney = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Agent_user_price where prtype='其他产品' and username='"&ds("username")&"' and id="&dsOtherlist("id")&""
		dsendmoney.Open Sql,conn,1,1
if dsendmoney.eof then
usermoney=dsOtherlist("usermoney")
else
usermoney=dsendmoney("usermoney")
end if
dsendmoney.close
	  %>>元1年　　出售给最终用户价格：
      <input name="Other<%=dsOtherlist("id")%>" type="text" size="4" maxlength="10" value="<%=usermoney%>"></td>
  </tr>

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

<input type="submit" name="Submit" value="保存价格设置">
</form>
<script>


  var   all=document.getElementById("priceform")   
      var   checks=all.getElementsByTagName("input");   
	  var havenull=false;
	  	  var havelow=false;

setTimeout("checkallvalue()",1000);

function checkallvalue()
{

//alert("请注意，所有价格都必须填写，不允许有空的价格，也不允许低于成本价出售,下面自动检查有没有错的价格...");

//if (confirm('请注意！所有价格都必须填写，不允许有空的价格，也不允许低于成本价出售，是否现在检查所有的价格有没有错?(强烈建议检查，检查的时间可能需要两分钟或更长的时间，请耐心等候，不要关闭IE)')==true){
    
 for(var   i=0;i<checks.length;i++)   
      {     

		if ((checks[i].name.indexOf("ori")==-1)&& checks[i].name!="Submit")
			{

				if (checks[i].value=="")
				{


						checks[i].value=parseInt(document.getElementsByName("ori"+checks[i].name).item(0).value*1.2);//将空白的自动加20%
						checks[i].style.borderColor = 'red';
						havenull=true;

			     
				}
				else
				{//检查有没有低于成本价

					if(parseInt(checks[i].value)<parseInt(document.getElementsByName("ori"+checks[i].name).item(0).value))
					{
						checks[i].style.borderColor = 'black';
							checks[i].value=parseInt(document.getElementsByName("ori"+checks[i].name).item(0).value*1.2);//将低于成本的自动加20%
							havelow=true;
					}


				
				}
			}
      }   

	  	  var haveok=true;

if (havenull)
{
haveok=false;
	//		document.writeln("<font color=red>存在空的出售价格（已显示为红色边框），已自动将空的出售价按成本价增加20%，请设置好价格后点保存价格设置。</font><br>");
	alert("存在空的出售价格（已显示为红色边框），已自动将空的出售价按成本价增加20%，请设置好价格后点保存价格设置。");
}
if (havelow)
{
haveok=false;
	//		document.writeln("<font color=red>存在低于成本价的出售价格（已显示为黑色边框），已自动将错的出售价按成本价增加20%，请设置好价格后点保存价格设置。</font><br>");
	alert("存在低于成本价的出售价格（已显示为黑色边框），已自动将错的出售价按成本价增加20%，请设置好价格后点保存价格设置。");
}
if (haveok==true)
{
alert("价格自动检查完成,全部符合要求.");
}
//}

}
function addpercent()
{
 for(var   i=0;i<checks.length;i++)   
      {     


		if ((checks[i].name.indexOf("ori")==-1)&& checks[i].name!="Submit")
			{

				checks[i].value=parseInt(document.getElementsByName("ori"+checks[i].name).item(0).value*(1+(document.addperform.add.value/100)));

			}
      }   
	  	  alert("处理完成，请点保存价格设置。");
}

function addpercentdomain()
{
 for(var   i=0;i<checks.length;i++)   
      {     

		if ((checks[i].name.indexOf("ori")==-1)&&checks[i].name.indexOf("domain")!=-1&& checks[i].name!="Submit")
			{

				checks[i].value=parseInt(document.getElementsByName("ori"+checks[i].name).item(0).value*(1+(document.addperform.adddomain.value/100)));
			}
      }   
	  	  alert("处理完成，请点保存价格设置。");
}


</script>

<%=htmlwrite("html7")%>
<%
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 %>
</form>
<br>
