<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<body onLoad="show(B11),show(B12)">
<!--#include file="top.asp"-->
<%hy "login.asp"
if shopnet("del")<>"" and shopnet("del")="yes" and shopnet("url")<>"" then 
 conn.execute("Delete * from url where home='"&shopnet("url")&"'")
  conn.execute("Delete * from huiyuan_url where home='"&shopnet("url")&"'")
 response.Write("<Script>alert('删除二级域名"&shopnet("url")&"成功');window.location='?';</script>")
 response.End
 end if
%>
<table width="762" border="0" align="center" cellpadding="2" cellspacing="0" style='BORDER-COLLAPSE: collapse;MARGIN: 3px'>
  <tr> 
    <td height="15" colspan="2"></td>
  </tr>
  <tr> 
    <td width="180" valign="top">
<!--#include file="left.asp"-->
    </td>
    <td width="582" height="280" valign="top"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><table border="0" align="left" cellpadding="0" cellspacing="0">
              <tr>
                <td width="1"><IMG SRC="../images/mytaobaobj1_3.gif" WIDTH=3 HEIGHT=25 ALT=""></td>
                <td width="120" align="center" background="../images/mytaobaobj1_4.gif"><font color="#FFFFFF">免费域名<font span class="C"></font></font></td>
                <td width="1"><IMG SRC="../images/mytaobaobj1_6.gif" WIDTH=7 HEIGHT=25 ALT=""></td>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="4" bgcolor="1E88C1"></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="5"></td>
        </tr>
      </table>
      <%
if request("add")="yes" then	 
hy_url=shopnet("myhome")&shopnet("domain")
set rs = conn.execute("select * from url where home = '"&hy_url&"'")
if not rs.eof then
response.write "<script>alert(""您申请的域名已经有记录了,重新选择一个吧！"");history.back();</script>"
response.end
end if

if len(request("myhome"))<4 then
response.write "<script>alert(""免费赠送的二级域名只能申请3位以上的，3位以下的二级域名请联系管理员！"");history.back();</script>"
response.end
end if
count1=conn.execute("select count(id) from huiyuan_url where huiyuan='"&Request.Cookies(Rikee)("huiyuan")&"'")(0)
if count1>=yumingx then 
response.write "<script>alert(""你已经申请了"&count1&"个域名，不能再申请了！"");history.back();</script>"
response.end
end if

conn.execute("Insert into huiyuan_url(home,url,huiyuan)values('"&hy_url&"','"&shopnet("url")&"','"&Request.Cookies(Rikee)("huiyuan")&"')")
response.write "<script>alert(""二级域名申请成功，"&count1&"请等待管理员审"&yumingx&"核"");location.href=""url.asp"";</script>"
response.end


rs.close
set rs=nothing
end if
%>

<script language="javascript"><!--//
	function checksignup() {
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	var checkStr = document.myform.myhome.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length)
		{
			allValid = false;
			break;
		}
	}
	if (!allValid)
	{
	  window.alert("请输入正确的申请域名，只支持英文字母和数字！");
	  document.myform.myhome.focus();
	  return false;
	}
		if((document.myform.myhome.value== '' )||(document.myform.myhome.value.length<3)) {
			window.alert('请输入大于3位数的免费二级域名!!');
			return false;
		}
		if(document.myform.url.value== '' ) {
			window.alert('请输入转向网址!!');
			return false;
		}
			return true;
			}
	//-->
</script>
<%
set rs=conn.execute("select * from huiyuan_url where huiyuan='"&Request.Cookies(Rikee)("huiyuan")&"'")
if not rs.eof then
%>
<br>
您的二级域名：
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="efefef">
<tr>
    <td width="63%" height="21" background="../image/bk.gif"> <div align="center">域名</div></td>
    <td width="17%" background="../image/bk.gif"><div align="center">访问统计</div></td>
    <td width="11%" background="../image/bk.gif"><div align="center">状态</div></td>
    <td width="9%" background="../image/bk.gif"><div align="center">删除</div></td>
  </tr>
   <%i=1
do while not rs.eof%><tr>
    <td height="21" bgcolor="#FFFFFF"> <a href=http://<%=rs("home")%> target="_blank">http://<%=rs("home")%></a></td>
    <td bgcolor="#FFFFFF"><div align="center">
	
	</div></td>
    <td bgcolor="#FFFFFF"><div align="center">
      <%Select case rs("zt")
case "0"
response.write "尚未审核"
case "1"
response.write "申请成功"
case "2"
response.write "<s>系统拒绝</s>"
End Select%>
    </div></td>
    <td bgcolor="#FFFFFF"><div align="center"><a href="?del=yes&url=<%=rs("home")%>">删除</a></div></td>
  </tr>
  <%
i=i+1
rs.movenext
loop
%>
</table>
<%rs.close
set rs=nothing
end if%>
<br>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#efefef">
        <form action="?add=yes" method="post" name="myform" id="form">
          
          <tr valign="middle">
            <td height="21" colspan="2" align="center" background="../image/bk.gif" bgcolor="#f1f1f1">&nbsp;</td>
          </tr>
		            <tr valign="middle"> 
            <td height="25" colspan="2" align="center" bgcolor="#FFFFFF"><table width="95%" border="0" cellpadding="3" cellspacing="0">
		            <tr valign="middle"> 
            <td height="25" colspan="2" bgcolor="#FFFFFF">
              您可以选择一个3位数以上的免费二级域名如：http://<%If to_url="2" Then Response.Write myurl&"yourname" else Response.Write "yourname"&myurl&""%> ，以后别人就可以用<br>
              http://<%If to_url="2" Then Response.Write myurl&"yourname" else Response.Write "yourname"&myurl&""%> 的二级域名直接访问您的网页了。<br>
             转向网址一经审核就不能修改。</td>
          </tr>
            </table></td>
          </tr>
          <tr valign="middle"> 
            <td width="100" height="25" align="center" bgcolor="#FFFFFF">二级域名</td>
            <td width="304" height="25" bgcolor="#FFFFFF">&nbsp;<font color="#FF6600">http://</font><%
			If to_url="2" Then 
			Response.Write "<font color=#FF6600>"&myurl&"</font><input name=myhome type=text class=wenbenkuang id=myhome size=20 maxlength=20>" 
			else 
			Response.Write "<input name=myhome type=text class=wenbenkuang id=myhome size=20 maxlength=20><font color=#FF6600><b>.</b></font>"
			domain=split(my_domains,",")
			response.write "<select name=""domain"">"
            For i=0 to Ubound(domain)
			response.write "<option value="""&domain(i)&""" "
			if i=0 then response.write "selected"
			response.write ">"
			response.write domain(i)
			response.write "</option>"       
            Next
			response.write "</select>"
			end if
			%>            </td>
          </tr>
          <tr valign="middle"> 
            <td height="25" align="center" bgcolor="#FFFFFF">转向网址</td>
            <td height="25" bgcolor="#FFFFFF">&nbsp; <input name="url" type="text" class="wenbenkuang" id="url" value="http://" size="35" maxlength="50">
              前加http://</td>
          </tr>

          <tr valign="middle"> 
            <td height="25" colspan="2" align="center" bgcolor="#FFFFFF"> <%if yuming<>"2" then %><input name="Submit3" type="submit" class="go-wenbenkuang" value="提交申请" onClick="javascript:return checksignup()"><%else%>
              <strong><font color="#FF0000">系统关闭了二级域名注册!</font></strong>
              <%end if%></td>
          </tr>
        </form>
      </table> 
</td>
  </tr>
</table>
<br>
<!--#include file="../bottom.asp"-->
