<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("username")<>""  and RegExpTest("[^A-Za-z0-9]",Request("username")) Then
	ef=True
	ec="请输入合法的用户名！"
ElseIf Request("id")<>"" And not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
end if

if not ef then
 
hostname=trim(replace(Request("domain"),"http://",""))
if hostname<>"" then hostname=ComX.idntoac_7i24_com(cstr(hostname))
hostnamecheck=replace(hostname,".","")
hostnamecheck=replace(hostnamecheck,"xn--","")
If RegExpTest("[^A-Za-z0-9--]",hostnamecheck) Then
	ef=True
	ec="请输入合法的域名！"
end if
hostname=Request("domain")
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>　域名列表
<%=htmlwrite("html6")%>
<%Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsdm = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Domain  where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"') order by id desc"
if Request("id")<>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')  and id ='"&Request("id")&"' order by id desc"
if Request("domain")<>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')  and domain like '%"&hostname&"%' order by id desc"
if Request.QueryString("username")<>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')  and  username = '"&Request("username")&"' order by id desc"
if Request("op")="end" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')  and endtime<'"&dateadd("d",30,now)&"' order by endtime desc"
if Request("op")="pre" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')  and status='预注册成功' order by endtime desc"
if Request("op")="err" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')  and status='失败' order by endtime desc"
if Request("op")="nowend" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')  and endtime<'"&now&"' order by endtime desc"
if Request("op")="reerr" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')  and (status='续费失败' or status='续费状态不确定') order by endtime desc"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsdm.PageSize = 25
	dsdm.Open Sql,conn,1,1
if dsdm.Eof then
%>
<br>
没有这类内容。
<%
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 dsdm.RecordCount <> 0 Then dsdm.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dsdm.PageCount<=10 then
       endini=dsdm.PageCount 
       else
       endini=10
      end if
    end if
%><br>
<form name="form1" method="get" action="listmydomain.asp">
         <table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
           <tr>
             <td width="9%" height="30" rowspan="2" bgcolor="#FFFFFF"><p>　域名：
                 <input name="domain" type="text" id="domain" size="15">
或用户名：
<input name="username" type="text" id="domain" size="8">
<input type="submit" name="Submit" value="搜索">
　<a href="listmydomain.asp?op=pre"><font color="#000000">预注册</font></a> <a href="listmydomain.asp?op=err"><font color="#000000">注册失败</font></a> <a href="listmydomain.asp?op=reerr"><font color="#000000">续费失败</font></a> <a href="listmydomain.asp?op=end"><font color="#000000">30天后到期</font></a> <a href="listmydomain.asp?op=nowend"><font color="#000000">现在到期</font></a> <a href="listmydomain.asp"><font color="#000000">全部</font></a>  <a href="domainupgif.asp"><font color="#000000">上传盖章</font></a> </p></td>
           </tr>
         </table>
</form>	
<%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>页 
        　共<%=dsdm.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>">上一页</a><%End If%>|<%If Clng(pn)<dsdm.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
        <table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
          <tr bgcolor="#EEEEEE">
            <td width="5%" align="center">编号</td>
            <td width="11%" align="center">用户名</td>
            <td width="10%" align="center">域名</td>
            <td width="14%" align="center">状态</td>
            <td width="12%" align="center">注册时间</td>
            <td width="13%" align="center">到期时间</td>
            <td width="10%" align="center">初始密码</td>
            <td width="10%" align="center">详细信息</td>
            <td width="15%" align="center">操作</td>
          </tr>
<%
For N=1 To dsdm.PageSize 
					If dsdm.RecordCount=0 Then Exit For
%>
          <tr bgcolor="#FFFFFF">
            <td width="5%" height="53" align="center"><%=N%></td>
            <td width="11%" align="center"><font color="#000000"><a href="searchuser.asp?username=<%=dsdm("username")%>" target="_blank"><font color="#000000"><%=dsdm("username")%></font></a>
        <font color="#FF0000">

        </font></font></td>
            <td width="10%" align="center"><%=dsdm("Domain")%></td>
            <td width="14%" align="center"><%if dsdm("endtime")<NOW and dsdm("status")="正常" then%>
              <font color=red>过期</font>
              <%else%>
              <%=dsdm("status")%>
            <%end if%></td>
            <td width="12%" align="center"><%=dsdm("starttime")%></td>
            <td width="13%" align="center"><%=dsdm("endtime")%></td>
            <td width="10%" align="center"><%=dsdm("inipass")%><br>
            <a href="domainpass.asp?id=<%=dsdm("id")%>" target="_blank"><font color="#000000">重置密码</font></a></td>
            <td width="10%" align="center">
              <%if dsdm("status")="预注册成功" then%>
              <a href="infoa.asp?id=<%=dsdm("id")%>" target="_blank"><font color="#000000">查询</font></a>
              <%else%>
              <a href="domainadm2.asp?id=<%=dsdm("id")%>" target="_blank"><font color="#000000">管理</font></a>
              <%end if%>
			</td>
            <td width="15%" align="center">
<%if dsdm("status")="预注册成功" then%>
<%if dsdm("username")<>session("agentusername") then%>
<a href="domain_pay1.asp?id=<%=dsdm("id")%>&op=a&chmoney=y"  onClick="if (confirm('请您确认后耐心等待，可能会需要两分钟的时间，在此期间请不要重复点击或关闭游览器....')==false){return false;}"><font color="#000000">确认扣用户费用</font></a><br>
<a href="domain_pay1.asp?id=<%=dsdm("id")%>&op=a"  onClick="if (confirm('下面的操作只扣您作为代理的成本价，不扣最终用户的费用，请您确认后耐心等待，可能会需要两分钟的时间，在此期间请不要重复点击或关闭游览器....')==false){return false;}"><font color="#000000">不扣用户费用</font></a><br>
<a href="domain_del.asp?id=<%=dsdm("id")%>" onClick="if (confirm('请您确认是否要删除？')==false){return false;}"><font color="#000000">马上删除</font></a>
<%else%>
<a href="domain_pay1.asp?id=<%=dsdm("id")%>&op=a"  onClick="if (confirm('请您确认后耐心等待，可能会需要两分钟的时间，在此期间请不要重复点击或关闭游览器....')==false){return false;}"><font color="#000000">确认开通扣费</font></a><br><br>
<a href="domain_del.asp?id=<%=dsdm("id")%>" onClick="if (confirm('请您确认是否要删除？')==false){return false;}"><font color="#000000">马上删除</font></a>
<%end if%>
<%else%>
<a href="domain_repay1.asp?id=<%=dsdm("id")%>"><font color="#000000">延长期限</font></a>
<%end if%>
			</td>
          </tr>

        <%
If clng(pn)=dsdm.PageCount Then
I = dsdm.RecordCount - (dsdm.PageCount-1) * dsdm.PageSize
If N=I Then Exit For
End If
dsdm.movenext
Next%>
</table>
<%end if
dsdm.close
set dsdm=nothing%>
<%=htmlwrite("html7")%>
<%
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
