<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canshowpro")="" Then
	ef=True
	ec="您没有此操作的权限。"
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="151"><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"><a href="product-CDN.asp"><font color="#FFFFFF">CDN产品定义</font></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="15">&nbsp;</TD>
      <TD 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">
	  
	  
<%
PAY_Month="0.084"
PAY_Season="0.25"
PAY_halfyear="0.5"
PAY_Nextyear="1"
PAY_2year="2"
PAY_3year="3"
PAY_4year="4"
PAY_5year="5"

MaxBandwidth="4294967295"
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_CDNProductlist order by orderbyid desc"
		ds.Open Sql,conn,1,1
If ds.Eof Then%>
产品列表为空.
<%
canbyenduser="y"
canbyagnenduser="y"
canbyagn="y"
orderbyid=0
typeid=0
subweb=0
allowdomain=15



else%>
<DIV class="tableborder">
<table width="100%"  border="0" cellspacing="1">
  <tr >
    <td width="24%" height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">编号</font></td>
    <td width="63%" align="center" background="img/tablebg.gif"><font color="#FFFFFF">产品参数</font></td>
    <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color="#FFFFFF">操作</font></td>
    </tr><%
while not ds.Eof
if  Request.QueryString ("id")=Cstr(ds("id")) then
CDNtype=ds("CDNtype")
usermoney=ds("usermoney")


info=ds("info")
infomore=ds("infomore")

cantest=ds("cantest")
canmonth=ds("canmonth")
canseason=ds("canseason")
canhalfyear=ds("canhalfyear")


canbyenduser=ds("canbyenduser")
canbyagnenduser=ds("canbyagnenduser")
canbyagn=ds("canbyagn")
orderbyid=ds("orderbyid")
typeid=ds("typeid")
allowupdate=ds("allowupdate")
allowupdatetoother=ds("allowupdatetoother")

updatebytypeid=ds("updatebytypeid")



PAY_Month=ds("PAY_Month")
PAY_Season=ds("PAY_Season")
PAY_halfyear=ds("PAY_halfyear")
PAY_Nextyear=ds("PAY_Nextyear")
PAY_2year=ds("PAY_2year")
PAY_3year=ds("PAY_3year")
PAY_4year=ds("PAY_4year")
PAY_5year=ds("PAY_5year")

onlyusebyagn=ds("onlyusebyagn")
allowdomain=ds("allowdomain")
CDNMaxMb=ds("CDNMaxMb")
Bindserverid1=ds("Bindserverid1")
Bindserverid2=ds("Bindserverid2")

end if

%>

  <tr bgcolor="#E4EAF2" onmouseover=this.bgColor='#cccccc'; onmouseout=this.bgColor='#E4EAF2';>
    <td height="30" align="center"><%=ds("id")%>.<%=ds("CDNtype")%> </td>
    <td align="left">　价格:<%=ds("usermoney")%>元　
      域名数量:<%=ds("allowdomain")%>个 月流量限制:<%=ds("CDNMaxMb")%>MB
      <%if ds("cantest")="y" then%>
      可以试用
      <%else%>
      不可以试用
      <%end if%> 排队:<%=ds("orderbyid")%> (DNS:<%
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerBindlist where id='"&ds ("Bindserverid1")&"'"
	dsserver.Open Sql,conn,1,1
If dsserver.eof then%><font color=red>没有对应的DNS服务器,这个产品不能用</font><%else%>
<%=dsserver("servername")%>:<%=dsserver("ip")%><%End if%><%dsserver.close%>|<%
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerBindlist where id='"&ds ("Bindserverid2")&"'"
	dsserver.Open Sql,conn,1,1
If dsserver.eof then%><font color=red>没有对应的DNS服务器,这个产品不能用</font><%else%>
 <%=dsserver("servername")%>:<%=dsserver("ip")%><%End if%><%dsserver.close%>)</td>
    <td width="6%" align="center"><a href="/style/info/CDN.asp" target="_blank"><font color="#618ECF"><strong>浏览</strong></font></a> </td>
    <td width="7%" align="center"><a href="product-CDN.asp?id=<%=ds("id")%>#m"><font color="#618ECF"><strong>修改</strong></font></a> </td>
  </tr>
<%
ds.movenext
wend%>
</table>
</div>
<%end if%>	  


<%if  Request.QueryString ("id")="" then
canbyenduser="y"
canbyagnenduser="y"
canbyagn="y"
asp="y"
aspx="y"
php="y"
orderbyid=0
typeid=0
subweb=0
allowdomain=15
MaxRam=256
Maxspace=10
MaxCPU=10
CpuNum=1
updatebytypeid="n"
cangetlog="y"
cantwodb=0
canrar="y"
caninstallos="y"
allowdomain=10
CDNMaxMb=0
end if

%><a name="m">
              <form action="product-CDNlist-sub.asp" method="post" name="form1">  
	<DIV class="tableborder">
<table width="100%"  border="0" cellspacing="1">
  <tr >
    <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color="#FFFFFF">添加/修改产品类型</font></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td width="9%" align="right">&nbsp;</td>
    <td width="91%" align="left"><p><br>
          <br>
        产品名： 
        <input name="CDNtype" type="text" id="CDNtype" value="<%=CDNtype%>" size="20" maxlength="50" <%if CDNtype<>"" then%>readonly<%end if%>>
      排队顺序：
      <input name="orderbyid" type="text" id="orderbyid" size="4" maxlength="6" value="<%=orderbyid%>">
      (数值大排前面)<br>
      价格：
      <input name="usermoney" type="text" id="usermoney" size="4" maxlength="6" value="<%=usermoney%>">
元一年<br>
月付费率：
<input name="PAY_Month" type="text" size="4" maxlength="6" value="<%=PAY_Month%>">
 (如果一个产品是120元/年，每月支付的价格就是120X费率，默认费率是0.084=1/12)<br>
 季付费率：
 <input name="PAY_Season" type="text" size="4" maxlength="6" value="<%=PAY_Season%>">
  (如果一个产品是120元/年，每季支付的价格就是120X费率，默认费率是0.25=1/4)<br>
 半年付费率：
 <input name="PAY_halfyear" type="text" size="4" maxlength="6" value="<%=PAY_halfyear%>">
 (如果一个产品是120元/年，每季支付的价格就是120X费率，默认费率是0.5=1/2)<br>
一次购买两年费率：
<input name="PAY_2year" type="text" size="4" maxlength="6" value="<%=PAY_2year%>">
　三年费率
<input name="PAY_3year" type="text" size="4" maxlength="6" value="<%=PAY_3year%>">
　四年费率
<input name="PAY_4year" type="text" size="4" maxlength="6" value="<%=PAY_4year%>">
　五年费率
<input name="PAY_5year" type="text" size="4" maxlength="6" value="<%=PAY_5year%>">
<br>
续费一年费率：
<input name="PAY_Nextyear" type="text" size="4" maxlength="6" value="<%=PAY_Nextyear%>">
(续费二,三,四,五年的费率和一次性购买二,三,四,五年是一样的)<br>
<br>      
允许绑定的域名数量
      <input name="allowdomain" type="text" size="2" maxlength="3" value="<%=allowdomain%>">
个 (不能超过99个)<br>
流量限制
      <input name="CDNMaxMb" type="text" id="CDNMaxMb" value="<%=CDNMaxMb%>" size="5" maxlength="8">
      M/月<br>
      <br>
      分类编号：
      <input name="typeid" type="text" id="orderbyid" size="4" maxlength="6" value="<%=typeid%>">
      　限制只允许同一类型之间才能升级:
      <input name="updatebytypeid" type="checkbox" id="updatebytypeid" value="y" <%if updatebytypeid="y"  then%>checked<%end if%>>
      <br>
      <font color="#999999">          </font>            是否允许试用:
            <input name="cantest" type="checkbox" id="cantest" value="y" <%if cantest="y" then%>checked<%end if%>>
            是否允许月付:
            <input name="canmonth" type="checkbox" id="canmonth" value="y"   <%if canmonth="y" then%>checked<%end if%>>
            是否允许季付:
            <input name="canseason" type="checkbox" id="canseason" value="y"   <%if canseason="y" then%>checked<%end if%>>
            是否允许半年付:
            <input name="canhalfyear" type="checkbox" id="canhalfyear" value="y"   <%if canhalfyear="y" then%>checked<%end if%>>
            <br>
            此产品主站的最终用户可以看到:
            <input name="canbyenduser" type="checkbox" id="canbyenduser" value="y" <%if canbyenduser="y" then%>checked<%end if%>>
            代理的最终用户可以看到:
            <input name="canbyagnenduser" type="checkbox" id="canbyagnenduser" value="y"   <%if canbyagnenduser="y" then%>checked<%end if%>>
            代理可以看到:
            <input name="canbyagn" type="checkbox" id="canbyagn" value="y"   <%if canbyagn="y" then%>checked<%end if%>>
            <br>
            此产品不允许从别的产品升级:
            <input name="allowupdate" type="checkbox" id="allowupdate" value="y"   <%if allowupdate="y" then%>checked<%end if%>>
            　此产品不允许升级到别的产品:
            <input name="allowupdatetoother" type="checkbox" id="allowupdatetoother" value="y"   <%if allowupdatetoother="y" then%>checked<%end if%>>
            　<br>
            <br>
            此产品使用的DNS服务器：<br>

                  绑定的的DNS服务器一：
                  <select name="Bindserverid1" id="Bindserverid1">
                    <%		
	Set dsCDNserver = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_ServerBindlist order by id asc"
		dsCDNserver.Open Sql,conn,1,1%>
                    <%if dsCDNserver.eof then%>
                    <option value=0>没有可用的CDN专用的DNS服务器，请您定义CDN专用的DNS服务器</option>
                    <%end if
while not dsCDNserver.eof%>
                    <option value="<%=dsCDNserver("id")%>" <%if dsCDNserver("id")=Bindserverid1 then%>selected<%end if%>><%=dsCDNserver("id")%>.<%=dsCDNserver("servername")%>(<%=dsCDNserver("ip")%>)</option>
                    <%
dsCDNserver.movenext
wend%>
                  </select>
                  <br>
绑定的的DNS服务器二：
<select name="Bindserverid2" id="Bindserverid2">
  <%		
	Set dsCDNserver = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_ServerBindlist order by id asc"
		dsCDNserver.Open Sql,conn,1,1%>
  <%if dsCDNserver.eof then%>
  <option value=0>没有可用的CDN专用的DNS服务器，请您定义CDN专用的DNS服务器</option>
  <%end if
while not dsCDNserver.eof%>
  <option value="<%=dsCDNserver("id")%>" <%if dsCDNserver("id")=Bindserverid2 then%>selected<%end if%>><%=dsCDNserver("id")%>.<%=dsCDNserver("servername")%>(<%=dsCDNserver("ip")%>)</option>
  <%
dsCDNserver.movenext
wend%>
</select>
<br>
                  <br>
                  <br>
            简要说明：
            <textarea name="info" cols="30" rows="3" id="info"><%=info%></textarea>
            (可以用html语法)<br>
            <br>
            详细说明：
            <textarea name="infomore" cols="45" rows="6" id="infomore"><%=infomore%></textarea>
            (可以用html语法)<br>
<br>
<br>
　　　　　
<input name="Submit" type="submit" id="Submit" value="添加">
<input name="modify" type="submit" id="modify" value="修改">
　　　　　　
<input name="delit" type="submit" id="delit" value="删除">
<br>
            <br>
      </p>
      </td>
  </tr>
</table></div>
</form>


              <form name="form2" method="post" action="product-CDN-modifyname.asp">           
<DIV class="tableborder">
<table width="100%"  border="0" cellspacing="1">
  <tr >
    <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color="#FFFFFF">修改产品名称：</font></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td width="9%" height="40" align="right">&nbsp;</td>
    <td width="91%" align="left">	                  原产品名：
                  <input name="CDNtype" type="text" id="CDNtype" size="20" maxlength="50">
新产品名：
                <input name="newCDNtype" type="text" id="newCDNtype" size="20" maxlength="50">
                <input type="submit" name="Submit" value="提交"></td>
  </tr>
</table></div>
</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%>
