<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%
If session("username")="" And session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
'If session("HOSTAUID")<>"" Then ec="主机面板中不能操作用户区的内容，请您先登陆用户区。"
'If session("IDCAUID")<>"" Then ec="邮箱面板中不能操作用户区的内容，请您先登陆用户区。"
'If session("SQLAUID")<>"" Then ec="数据库面板中不能操作用户区的内容，请您先登陆用户区。"
'elseif Request("domain")<>"" and IsValidIDC(IDCname)=false then
'	ef=True
'	ec="存在无效邮箱名称！请检查域名是否正确。"
end If

if not ef then
if session("agentusername")<>"" Then%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>
<%else%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>
<%End if%>
　 托管/租用类
<%if session("agentusername")<>"" Then%>
<%=htmlwrite("html6")%>
<%else%>
<%=htmlwrite("html3")%>
<%End if%>
<br>
<%Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")

username=session("username")
If session("agentusername")<>"" Then
username=session("agentusername")
End If

Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_IDC where username='"&username&"' order by endtime desc"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.PageSize = 25
	dsph.Open Sql,conn,1,1
if dsph.Eof then%>
没有开通的托管/租用产品.	
<%else%>
<%
if Request.ServerVariables("QUERY_STRING")<>"" then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
else
ask=Split("freehost=1", "")
ask(0)="freehost=lsoft"
end if
	pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If dsph.RecordCount <> 0 Then dsph.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dsph.PageCount<=10 then
       endini=dsph.PageCount 
       else
       endini=10
      end if
    end if
%>
<%if clng(pn)<=10 then%>最新 <%for i=begini to endini
    if clng(pn)=i then%><font color=red>[<%=i%>]</font><%else%><a href="?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a><%end if%>　<%next%> 
        <%else%>　<a href="?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 
        　共<%=dsph.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>">上一页</a><%End If%>|<%If Clng(pn)<dsph.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
<table width="100%" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#CCCCCC">
  <tr bgcolor="#EEEEEE" align="center">
    <td height="21">产品类型</td>
    <td>类别</td>
    <td>IP 地址</td>
    <td>开通日期</td>
    <td>到期日期</td>
    <td>状态</td>
    <td>操作</td>
  </tr>
<%
For N=1 To dsph.PageSize 
					If dsph.RecordCount=0 Then Exit For
%>
<%
	IDCtype=dsph("IDCtype")
	Set ori_IDC_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_IDCProductlist where IDCtype='"&dsph("IDCtype")&"'"
		ori_IDC_name.Open Sql,conn,1,1
		if not ori_IDC_name.eof then
Set newname_IDC = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_IDCProductlist_AGN where agent1='"&session("agentname")&"' and id='"&ori_IDC_name("id")&"'"
		newname_IDC.Open Sql,conn,1,1
if not newname_IDC.eof then
IDCtype=newname_IDC("IDCtype")
end if
		end if

	%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="30" rowspan="3">
<%=IDCtype%>
</td>
    <td rowspan="3">
	<%if ori_IDC_name("istg")=true then%>托管<%else%>租用<%end if%></td>
    <td>
      <%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_IDCIP where PDID="&dsph("id")
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
IP尚未分配
<%else
while not dsX.eof
%>
<%=dsX("IP")%> <br>
<%
dsX.movenext
wend
end if%>
</td>
    <td><%=formatdatetime(dsph("starttime"),1)%></td>
    <td><%=formatdatetime(dsph("endtime"),1)%></td>
    <td><%if dsph("endtime")>NOW then%>
      <%if dsph("istest")="y" then%>
      <font color="#FF0000">试用</font>      <%else%>
      <%=dsph("status")%>
      <%end if%>
      <%else%>
      <font color="#FF0000">过期</font>
      <%if dsph("status")="暂停" then%>
      <br>
      <font color="#FF0000">暂停</font>
      <%end if%>
    <%end if%></td>
    <td><a href="idcrepay.asp?id=<%=dsph("id")%>"><font color="#000000">延期</font></a></td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF">
    <td>备注：</td>
    <td colspan="4"><%=dsph("userremindinfo")%></td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF">
    <td>订单处理结果：</td>
    <td colspan="4"><%=dsph("openinfo")%></td>
  </tr>
<%
If clng(pn)=dsph.PageCount Then
I = dsph.RecordCount - (dsph.PageCount-1) * dsph.PageSize
If N=I Then Exit For
End If
dsph.movenext
Next%>
</table>
<%dsph.close
set dsph=nothing
end if
%>
<br><br>
<br>
<br>
<%if session("agentusername")<>"" Then%>
<%=htmlwrite("html7")%>
<%else%>
<%=htmlwrite("html4")%>
<%End if%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
