<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("HOSTAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf Instr(1, Request("id"), "'", 1)>0 then
	ef=True
	ec="非法产品ID！"
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 dsph = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&session("HOSTAUID")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.Open Sql,conn,1,1
if dsph.Eof then
	ef=True
	ec="不存在的虚拟主机ID！"
end if
end if

if not ef then
	Set dsHostpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_HostProductlist where Hosttype='"&dsph("Hosttype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsHostpdlist.Open Sql,conn,1,1
if dsHostpdlist.Eof then
	ef=True
	ec="产品不存在！"
end if
end if

if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
end if
end if

if not ef then

 txml=dateadd("y",-1,now)

%>
<!--#include virtual="/inc-freehost-function/template-hostadm-top.asp"-->
　虚拟主机自助管理


<br>
<form action="cdnop2.asp" method="post" name="form1">
<TABLE width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR align="center">
      <TD height="35" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">
        <input name="id" type="hidden" value="<%=Request("id")%>">
        更新指定网址的缓存：</font></TD>
      </TR>
    <TR>
      <TD height="35" align="center" vAlign=middle bgColor=#FFFFFF>请您输入要更新的完整网址：
        <input name="url" type="text" id="url" value="http://" size="40" maxlength="250">
        (必须具体到文件名)</TD>
      </TR>
    <TR>
      <TD height="35" align="center" vAlign=middle bgColor=#FFFFFF><br>
          <input name="Submit" type="submit" id="Submit" value="马上更新缓存">
          <br>
          <br>
    注意,正常情况下您并不需要使用上述的功能更新网址，如果您在访问您的网址时发现没有更新，<br>
    您可以在IE中按Ctrl+F5，IE就会发指令让CDN服务器更新缓存了。<br></TD>
    </TR>
  </TBODY>
</TABLE>

<br>
<TABLE width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR align="center">
      <TD height="35" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">
        <input name="id" type="hidden" value="<%=Request("id")%>">
        流量分析：</font></TD>
    </TR>
    <TR>
            <%
If dsph("CDNMaxMb")=0 Then
endp=0
else
endp=dsph("CDNMBthismonth")*100/dsph("CDNMaxMb")
End if
if endp>99 then endp=100
%>
      <TD height="50" align="center" vAlign=bottom bgColor=#FFFFFF>昨天的流量为 <%=dsph("CDNMB"&day(txml))%> MB　　(您的月流量上限为
          <%if dsph("CDNMaxMb")=0 then%>
        不限流量
        <%else%>
        <%=dsph("CDNMaxMb")%>MB 已用了<%=FormatNumber(endp,1,-1)%>%
        <%end if%>
        )<br>

        <table width="520"  border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
          <tr>
            <td height="20"><table width="<%=endp%>%" height="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FF0000">
                <tr>
                  <td>&nbsp;</td>
                </tr>
            </table></td>
          </tr>
      </table></TD>
    </TR>
    <TR>
      <TD height="200" align="center" vAlign=middle bgColor=#FFFFFF><table width="520" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="right" valign="top" id="endMaxid" style="line-height: 12px; margin-right: 2;text-align: right;padding:0px"></td>
            <td><table width="500" border="1" cellpadding="0" cellspacing="0" background="img/deepback.gif">
                <tr>
                  <td><table width="18"  border="0" cellspacing="1" cellpadding="1">
                      <tr>
                        <%
nowtime=Date
runcountMax=0
'runcountMaxAGN=0
Y=1
For i=-29 To -1
runtime=dateadd("d",i,nowtime)
runtime2=dateadd("d",i+1,nowtime)

runcount=dsph("CDNMB"&day(dateadd("y",i,now)))

If runcount>runcountMax Then runcountMax=runcount

%>
                        <td width="14" height="100" valign="bottom" title="<%=runcount%>" id="TDid<%=Y%>"><table width="14"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td valign="bottom" bgcolor="#006600"  id="TDidX<%=Y%>" title="<%=Year(runtime)%>-<%=Month(runtime)%>-<%=Day(runtime)%> <%If Weekday(runtime)=7 then%>(星期六)<%End If%><%If Weekday(runtime)=1 then%>(星期日)<%End If%>
流量: <%=runcount%> MB"><table width="14" height="0" border="0" cellpadding="0" cellspacing="0">
                              </table></td>
                            </tr>
                        </table></td>
                        <%
Y=Y+1
next%>
                      </tr>
                      <tr>
                        <%
'nowtime=date
For i=-29 To -1
runtime=dateadd("d",i,nowtime)
runtime2=dateadd("d",i+1,nowtime)
%>
                        <td width="14" title="<%=Year(runtime)%>-<%=Month(runtime)%>-<%=Day(runtime)%>"><a href="#">
                          <%If Weekday(runtime)=1 or Weekday(runtime)=7 then%>
                          <font color=red><%=Day(runtime)%></font>
                          <%else%>
                          <%=Day(runtime)%>
                          <%End if%>
                        </a></td>
                        <%next%>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
          </tr>
        </table>
          <div style="width:520px;margin:12px 0px 12px 18px;color:#999">单位为MB，上图为近期的每天流量表</div>
          <%if runcountMax=0 then runcountMax=0.001%>
          <script>
document.getElementById("endMaxid").innerHTML="<%=FormatNumber(runcountMax,0,-1)%><br><br><%=FormatNumber(runcountMax*3/4,0,-1)%><br><br><%=FormatNumber(runcountMax*2/4,0,-1)%><br><br><%=FormatNumber(runcountMax*1/4,0,-1)%>";
<%For Y=1 To 29%>
document.getElementById("TDidX<%=Y%>").style.height = document.getElementById("TDid<%=Y%>").title*100/<%=runcountMax%>;
<%next%>
  </script>
      </TD>
    </TR>
  </TBODY>
</TABLE>
<br>
<TABLE width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR align="center">
      <TD height="35" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">下载昨天的CDN日志：</font></TD>
      </TR>
    <TR>
      <TD height="35" align="center" vAlign=middle bgColor=#FFFFFF><a href="cdnop2.asp?op=downlog">点击生成日志&gt;&gt;&gt;</a></TD>
    </TR>
  </TBODY>
</TABLE>

<br>
<br>
</form>

　<a href="selfhostmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回上一页]</font></a>
<!--#include virtual="/inc-freehost-function/template-hostadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>