<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%
If session("CDNAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsphCDN = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_CDN where id='"&session("CDNAUID")&"'"
	dsphCDN.Open Sql,conn,1,3
if dsphCDN.Eof then
	ef=True
	ec="不存在的产品ID！"
end if
end If


if not ef then
	Set dspdl = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_CDNProductlist where CDNtype='"&dsphCDN ("CDNtype")&"'"
		dspdl.Open Sql,conn,1,1
If dspdl.Eof Then
	ef=True
	ec="不存在的CDN产品类型！"
end if
end if


if not ef then
%>
<!--#include virtual="/inc-freehost-function/template-CDNadm-top.asp"-->
　CDN自助管理
          <br>
          <br>
 <TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
   <TBODY>
     <TR>
       <TD width="20%" height="35" align="center" vAlign=middle bgColor=#F3F3F3>&nbsp;<font color="#000000">产品类型：</font></TD>
       <TD width="80%" height="35" bgColor=#ffffff><%
	CDNtype=dspdl("CDNtype")
	info=dspdl("info")
	Set ori_CDN_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_CDNProductlist where CDNtype='"&CDNtype&"'"
		ori_CDN_name.Open Sql,conn,1,1
		if not ori_CDN_name.eof then
Set newname_CDN = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_CDNProductlist_AGN where agent1='"&dsphCDN("agent1")&"' and id='"&ori_CDN_name("id")&"'"
		newname_CDN.Open Sql,conn,1,1
if not newname_CDN.eof then
CDNtype=newname_CDN("CDNtype")
info=newname_CDN("info")
end if
		end if

	%>　　<%=CDNtype%> </TD>
     </TR>
     <TR>
       <TD height="35" align="center" vAlign=middle bgColor=#F3F3F3>状态：</TD>
       <TD height="35" bgColor=#ffffff>　　
         <%if dsphCDN("endtime")>NOW then%>
         <%if dsphCDN("istest")="y" then%>
         <font color="#FF0000">试用</font>
         <%else%>
         <%=dsphCDN("status")%>
         <%end if%>
         <%else%>
         <font color="#FF0000">过期</font>
         <%if dsphCDN("status")="暂停" then%>
         <br>
         <font color="#FF0000">暂停</font>
         <%end if%>
         <%end if%></TD>
     </TR>



	 
     <TR>
       <TD width="20%" height="35" align="center" vAlign=middle bgColor=#F3F3F3>开通时间：</TD>
       <TD height="35" bgColor=#ffffff>　　<%=formatdatetime(dsphCDN("starttime"),1)%></TD>
     </TR>
     <TR>
       <TD height="35" align="center" vAlign=middle bgColor=#F3F3F3>到期时间：</TD>
       <TD height="35" bgColor=#ffffff>　　<%=formatdatetime(dsphCDN("endtime"),1)%></TD>
     </TR>
     <TR>
       <TD height="35" align="center" vAlign=middle bgColor=#F3F3F3>CDN名：</TD>
       <TD height="35" bgColor=#ffffff>　　<%=dsphCDN("ftpname")%></TD>
     </TR>
	 
	      <TR>
       <TD width="20%" height="35" align="center" vAlign=middle bgColor=#F3F3F3>CNAME域名：</TD>
       <TD height="35" bgColor=#ffffff>　　
         <%
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_ServerBindlist where id='"&dsphCDN ("Bindserverid1")&"'"
	dsserver.Open Sql,conn,1,1
%>
         <%=dsserver("aname")%>.<%=dsserver("domain")%> </TD>
     </TR>
	 
   </TBODY>
 </TABLE>
 <br>　
 您的CDN产品当前在用的CDN加速服务器：<br>
          <br>
<%
set dsCDNserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerCDNlist where cdntype='多点分布CDN加速用'  and (Bindserverid1='"&dsphCDN ("Bindserverid1")&"' or Bindserverid1='"&dsphCDN ("Bindserverid2")&"' or Bindserverid2='"&dsphCDN ("Bindserverid1")&"' or Bindserverid2='"&dsphCDN ("Bindserverid2")&"')"
	dsCDNserver.Open Sql,conn,1,1
if dsCDNserver.Eof then%>没有可用的服务器<%else%>
  
 <TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
   <TBODY>
<%	
while not dsCDNserver.Eof
%>		   
     <TR>
       <TD width="20%" height="35" align="center" vAlign=middle bgColor=#F3F3F3>&nbsp;<font color="#000000"><%=dsCDNserver("servername")%></font></TD>
       <TD width="80%" height="35" bgColor=#ffffff><%


	%>　　<%=dsCDNserver("ip")%> </TD>
     </TR>
 <%
 dsCDNserver.movenext
 wend
 %>	 
   </TBODY>
 </TABLE>
 <%end if%>
<%If session("username")<>"" Then%><br>
　<a href="/user/CDNadm.asp"><font color="#000000">[返回用户区]</font></a>
<br>
<br>
<%end if%>
 <!--#include virtual="/inc-freehost-function/template-CDNadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>