<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canadmdomain")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf Request("starttime")<>"" And Not IsDate(Request("starttime")) Then
	ef=True
	ec="时间格式无效startime"
ElseIf Request("endtime")<>"" And Not IsDate(Request("endtime")) Then
	ef=True
	ec="时间格式无效endtime"
ElseIf Request("starttime2")<>"" And Not IsDate(Request("starttime2")) Then
	ef=True
	ec="时间格式无效startime2"
ElseIf Request("endtime2")<>"" And Not IsDate(Request("endtime2")) Then
	ef=True
	ec="时间格式无效endtime2"
ElseIf Request("starttime1")<>"" And Not IsDate(Request("starttime1")) Then
	ef=True
	ec="时间格式无效startime1"
ElseIf Request("endtime1")<>"" And Not IsDate(Request("endtime1")) Then
	ef=True
	ec="时间格式无效endtime1"
ElseIf Request("id")<>"" And not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
ElseIf Request("pid")<>"" And not IsNumeric(Request("pid"))  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=trim(replace(Request("domain"),"http://",""))
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="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="listmydomain.asp"><font color="#FFFFFF">域名管理</font></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="7" background="img/midtop.gif">&nbsp;</td>
          <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="urlcheck.asp"><font color="#FFFFFF">URL转发</font></a></td>
          <td width="5" background="img/midtop2.gif">&nbsp;</td>
        </tr>
      </table></TD>
      <TD width="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="7" background="img/midtop.gif">&nbsp;</td>
          <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="domainpreopen.asp"><font color="#FFFFFF">赠送域名</font></a></td>
          <td width="5" background="img/midtop2.gif">&nbsp;</td>
        </tr>
      </table></TD>
      <TD width="83" align="left"><table height="59"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="7" background="img/midtop.gif">&nbsp;</td>
          <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="domainupgif.asp"><font color="#FFFFFF">上传盖章</font></a></td>
          <td width="5" background="img/midtop2.gif">&nbsp;</td>
        </tr>
      </table></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">
<form name="form1" method="get" action="listmydomain.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" bgcolor="#E4EAF2">&nbsp;</td>
          <td width="91%" align="left">用户名：
<input name="username" type="text" id="domain" size="10">
或域名：
<input name="domain" type="text" id="domain" size="15"><input type="submit" name="Submit" value="搜索">
　　<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?op=pre"><font color="#000000"></font></a><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"><font color="#000000">列出全部</font></a></td>
        </tr>
      </table>
         </div>
</form>	
<%Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
'if Request("id")="" then
	Set dsdm = Server.CreateObject("ADODB.Recordset")	
	Sql="Select  * from FreeHost.FreeHost_Product_Domain order by id desc"
if Request("pid")<>"" then		Sql="Select * from FreeHost.FreeHost_Product_Domain where id='"&Request("pid")&"'"
if Request("id")<>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain where  id ='"&Request("id")&"' order by id desc"
if Request("domain")<>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain where  domain like '%"&hostname&"%' order by id desc"
if Request("username")<>"" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain where  username = '"&Request("username")&"' order by id desc"
if Request("op")="end" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where endtime<'"&dateadd("d",30,now)&"' order by endtime desc"
if Request("op")="nowend" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where endtime<'"&now&"' order by endtime desc"
if Request("op")="pre" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where status='预注册成功' order by endtime desc"
if Request("op")="err" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where status='失败' order by endtime desc"
if Request("op")="reerr" then 	Sql="Select * from FreeHost.FreeHost_Product_Domain  where status='续费失败' or status='续费状态不确定' order by endtime desc"
if Request.QueryString ("starttime2") <>"" then  Sql="Select * from FreeHost.FreeHost_Product_Domain  where status='正常' and starttime>'"&Request.QUERYSTRING ("starttime1")&"' and starttime<'"&Request.QUERYSTRING ("starttime2")&"'  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
%>
<%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%>
<DIV class="tableborder"><table width="100%"  border="0" cellspacing="1">
          <tr bgcolor="#CCCCCC">
            <td width="6%" height="24" align="center" background="img/tablebg.gif" bgcolor="#CCCCCC"><font color="#FFFFFF">编号</font></td>
            <td width="10%" align="center" background="img/tablebg.gif" bgcolor="#CCCCCC"><font color="#FFFFFF">用户名</font></td>
            <td align="center" background="img/tablebg.gif" bgcolor="#CCCCCC"><font color="#FFFFFF">域名</font></td>
            <td width="9%" align="center" background="img/tablebg.gif" bgcolor="#CCCCCC"><font color="#FFFFFF">状态</font></td>
            <td width="10%" align="center" background="img/tablebg.gif" bgcolor="#CCCCCC"><font color="#FFFFFF">注册时间</font></td>
            <td width="10%" align="center" background="img/tablebg.gif" bgcolor="#CCCCCC"><font color="#FFFFFF">到期时间</font></td>
            <td width="11%" align="center" background="img/tablebg.gif" bgcolor="#CCCCCC"><font color="#FFFFFF">初始密码</font></td>
            <td width="8%" align="center" background="img/tablebg.gif"><font color="#FFFFFF">详细信息</font></td>
            <td width="12%" align="center" background="img/tablebg.gif" bgcolor="#CCCCCC"><font color="#FFFFFF">操作</font></td>
          </tr>
<%
For N=1 To dsdm.PageSize 
					If dsdm.RecordCount=0 Then Exit For
%>
          <tr bgcolor="#E4EAF2" onmouseover=this.bgColor='#cccccc'; onmouseout=this.bgColor='#E4EAF2';>
            <td width="6%" height="90" align="center"><%=dsdm("id")%></td>
            <td width="10%" height="90" align="center"><font color="#000000"><a href="searchuser.asp?username=<%=dsdm("username")%>" target="_blank"><font color="#000000"><%=dsdm("username")%></font></a>
        <font color="#FF0000">
        <%if not isnull(dsdm("agent1")) and dsdm("agent1")<>"n" and dsdm("agent1")<>"" then%>
        <br>
(<a href="searchagent.asp?username=<%=dsdm("agent1")%>" target="_blank"><font color="#FF0000"><%=dsdm("agent1")%></font></a>)
<%end if%>
        </font></font></td>
            <td height="90" align="center"><a href="listmydomain.asp?id=<%=dsdm("id")%>"><font color="#000000"><%=dsdm("Domain")%><br><%If dsdm("Domain_API")=1 then%>新网互联
			<%ElseIf  dsdm("Domain_API")=2 then%>新网
			<%ElseIf  dsdm("Domain_API")=3 then%>商中
			<%ElseIf  dsdm("Domain_API")=4 then%>中频
			<%ElseIf  dsdm("Domain_API")=5 then%>万网
			<%ElseIf  dsdm("Domain_API")=6 then%>API6
			<%ElseIf  dsdm("Domain_API")=7 then%>外国接口 <%If  dsdm("api7select")=3 then%>Enom<%End if%><%If  dsdm("api7select")=1 then%>Asia<%End if%><%If  dsdm("api7select")=2 then%>Hexonet<%End if%>
			<%End if%>
			<%If dsdm("type1")=1 then%><br>解析产品(允许<%=dsdm("DNScount")%>条)<%end if%>
			</font></a></td>
            <td width="9%" height="90" align="center">
			<%if dsdm("endtime")<NOW and dsdm("status")="正常" then%><font color=red>过期</font><%else%><%=dsdm("status")%><%end if%><%if dsdm("status")="失败" or dsdm("status")="续费失败" then%><br>
			<a href="showapiinfo.asp?id=<%=dsdm("id")%>" target="_blank">API返回信息</a>
			<%end if%></td>
            <td width="10%" height="90" align="center"><%=dsdm("starttime")%></td>
            <td width="10%" height="90" align="center"><%=dsdm("endtime")%><br>
              <a href="moneyalllist.asp?op=search&selecttype=全部&usertype=用户或代理名&whichProduct=域名产品&pdid=<%=dsdm("id")%>" target="_blank">此产品财务信息</a></td>
            <td width="11%" height="90" align="center"><%if (Request("op")<>"err" Or Request("op")<>"reerr") and dsdm("type1")=0 then%><%=dsdm("inipass")%><br>
            <a href="domainpass.asp?id=<%=dsdm("id")%>" target="_blank"><font color="#000000">重置密码</font></a><%else%><%if not isnull(dsdm("retdns")) then%><%=replace(lcase(dsdm("retdns")),"script","")%><%end if%><%end if%></td>
            <td width="8%" height="90" align="center">
              <%if dsdm("status")="预注册成功" or 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="12%" height="90" align="center">
<%if dsdm("status")="预注册成功" or dsdm("status")="失败" then%>
<a href="domain_pay1.asp?id=<%=dsdm("id")%>&op=a"><font color="#000000">确认并扣费</font></a><br>
<br>
<a href="domain_pay1.asp?id=<%=dsdm("id")%>&op=a&pay=n"><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>
<%else%>
<%If dsdm("type1")=1 then%>
<a href="listmydomain.asp?id=<%=dsdm("id")%>"><font color="#000000">修改产品</font></a>
<%else%>
<a href="domain_repay1.asp?id=<%=dsdm("id")%>"><font color="#000000">延长时间</font></a>
<%end if%>
<br>
<br>
<a href="domain_del.asp?id=<%=dsdm("id")%>" onClick="if (confirm('请您确认是否要删除？')==false){return false;}"><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></div>
<%end if
dsdm.close
set dsdm=nothing
'end if
%>

<%if Request("id")<>"" and Instr(Request("id"), "'")<1  then


	Set dsdm = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_Domain where id='"&Request("id")&"'"
		dsdm.Open Sql,conn,1,1
If not dsdm.Eof Then
username=dsdm("username")
Domain=dsdm("Domain")
status=dsdm("status")
starttime=dsdm("starttime")
endtime=dsdm("endtime")
inipass=dsdm("inipass")
agent1=dsdm("agent1")
api7select=dsdm("api7select")
if agent1="n" then agent1=""
Domain_API=dsdm("Domain_API")
id=dsdm("id")
isbyhost=dsdm("isbyhost")
Hosttype=dsdm("Hosttype")
byid=dsdm("byid")
years=dsdm("years")
DNS_API=dsdm("DNS_API")
type1=dsdm("type1")
DNScount=dsdm("DNScount")
end if
end if
if Domain_API="" then
Domain_API=Application("Domain_API")
starttime=now
endtime=now
years=1
type1=0
DNScount=20
end if

%>
<form action="domainadd.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">录入/修改域名：<%=id%></font></td>
        </tr>
        <tr bgcolor="#E4EAF2">
          <td width="9%" align="right">&nbsp;</td>
          <td width="91%" align="left">　用户　名：
            <input name="username" type="text" size="20"  value="<%=username%>">
代理用户名：
<input name="agent1" type="text" id="agent1"  value="<%=agent1%>" size="20">
<br>
　域　　名：
<input name="Domain" type="text" id="Domain" size="20" value="<%=Domain%>">
　初始密码：
<input name="inipass" type="text" id="inipass" size="14" value="<%=inipass%>">
<br>　状态：
<select name="status" id="status">
  <option value="预注册成功" <%if status="预注册成功" then%>selected<%end if%>>预注册成功</option>
  <option value="正常" <%if status="正常" then%>selected<%end if%>>正常</option>
  <option value="失败" <%if status="失败" then%>selected<%end if%>>失败</option>
    <option value="续费失败" <%if status="续费失败" then%>selected<%end if%>>续费失败</option>
</select>　
　年限：
<select name="years" id="years">
  <option value="1" <%if years=1 then%>selected<%end if%>>一年</option>
  <option value="2" <%if years=2 then%>selected<%end if%>>二年</option>
  <option value="3" <%if years=3 then%>selected<%end if%>>三年</option>
  <option value="4" <%if years=4 then%>selected<%end if%>>四年</option>
  <option value="5" <%if years=5 then%>selected<%end if%>>五年</option>
</select><br>
　注册时间：
<input name="starttime" type="text" id="starttime" value="<%=starttime%>" size="20">
到期时间：
<input name="endtime" type="text" id="endtime" value="<%=endtime%>" size="20">
<br>
　域名接口：
<select name="Domain_API" id="Domain_API">
  <option value="1" <%if Domain_API=1 then%>selected<%end if%>>新网互联</option>
  <option value="2" <%if Domain_API=2 then%>selected<%end if%>>新网</option>
  <option value="3" <%if Domain_API=3 then%>selected<%end if%>>商务中国</option>
  <option value="4" <%if Domain_API=4 then%>selected<%end if%>>中国频道</option>
  <option value="5" <%if Domain_API=5 then%>selected<%end if%>>万网</option>
  <option value="6" <%if Domain_API=6 then%>selected<%end if%>>API6</option>
  <option value="7" <%if Domain_API=7 then%>selected<%end if%>>外国接口</option>
</select>
当是外国接口时：
<select name="api7select" id="api7select">
  <option value="0" <%if api7select=0 then%>selected<%end if%>>不是外国接口</option>
  <option value="3" <%if api7select=3 then%>selected<%end if%>>Enom</option>
  <option value="2" <%if api7select=2 then%>selected<%end if%>>Hexonet</option>
  <option value="1" <%if api7select=1 then%>selected<%end if%>>Asia</option>
</select>
DNS：
<select name="DNS_API" id="DNS_API">
  <option value="0" <%if DNS_API=0 then%>selected<%end if%>>原始注册商</option>
  <option value="1" <%if DNS_API=1 then%>selected<%end if%>>星外平台</option>
</select>
<br>
　由于虚拟主机附送:
<input name="isbyhost" type="checkbox" id="isbyhost" value="y" <%if isbyhost="y" then%>checked<%end if%>>
附属于产品:
<%
	Set dsX = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HostProductlist order by id asc"
		dsX.Open Sql,conn,1,1
If dsX.Eof Then%>
产品列表为空.
<%else%>
<select name="Hosttype" id="Hosttype">
  <%while not dsX.Eof%>
  <option value="<%=dsX("Hosttype")%>" <%if dsX("Hosttype")=Hosttype then%>selected<%
  ServerlistID=dsX("ServerlistID")
  end if%>><%=dsX("Hosttype")%></option>
  <br>
  <%
dsX.movenext
wend%>
</select>
<%end if%>
产品号：
<input name="byid" type="text" id="byid"  value="<%=byid%>" size="5">
<br>
<br>
　当使用本地DNS允许的最多解析记录：
<input name="DNScount" type="text" id="DNScount" size="10" value="<%=DNScount%>">　
属于独立的解析产品：
<select name="type1" id="type1">
  <option value="0" <%if type1=0 then%>selected<%end if%>>否</option>
  <option value="1" <%if type1=1 then%>selected<%end if%>>是</option>
</select>
<br>
<br>
<input name="id" type="hidden" id="id" size="20" value="<%=id%>">
　
<input type="submit" name="Submit222" value="执行">
<%if Request.QueryString ("id")<>"" then%>
　　
<a href="domain_del.asp?id=<%=Request.QueryString ("id")%>" onClick="if (confirm('请您确认是否要删除？')==false){return false;}"><font color="red">强行删除</font></a>
　　<a href="showapiinfo.asp?id=<%=Request.QueryString ("id")%>" target="_blank">查看API返回信息</a>
<%end if%></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%>
