<link rel="stylesheet" type="text/css" href="css/css.css">
</head>
<!--#include file="conn.asp"-->
<%
  if session("admin")="" then
  response.redirect "admin_login.asp"
  else
	if session("flag")>2 then
		response.write "<br><p align=center>您没有操作的权限</p>"
		response.end
	end if
  end if
  %>
<%
dim rs3
dim sql
dim count
set rs3=server.createobject("adodb.recordset")
sql = "select * from city order by c_id asc"
rs3.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs3.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs3("city"))%>","<%= trim(rs3("a_id"))%>","<%= trim(rs3("c_id"))%>");
        <%
        count = count + 1
        rs3.movenext
        loop
        rs3.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.c_id.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.c_id.options[document.myform.c_id.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<body>
<table border="1" cellpadding="4" cellspacing="0" style="border-collapse: collapse" bordercolor="#999999" width="339">
  <tr> 
    <td colspan="2"><strong><font color="#FF0000">网站登陆</font></strong><font color="#FF0000">&nbsp; 
      请先做好本站链接。</font></td>
  </tr>
  <form name="myform" method="post" action="saveadd.asp">
    <tr> 
      <td width="81">所处地区： </td>
      <td width="236"> 
        <%
        sql = "select * from area"
        rs3.open sql,conn,1,1
	if rs3.eof and rs3.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
        <select name="a_id" onChange="changelocation(document.myform.a_id.options[document.myform.a_id.selectedIndex].value)" size="1">
          <option selected value="<%=trim(rs3("a_id"))%>"><%=trim(rs3("area"))%></option>
          <%      dim selarea
         selarea=rs3("a_id")
        rs3.movenext
        do while not rs3.eof
%>
          <option value="<%=trim(rs3("a_id"))%>"><%=trim(rs3("area"))%></option>
          <%
        rs3.movenext
        loop
	end if
        rs3.close
%>
        </select> <select name="c_id">
          <%sql="select * from city where a_id="&selarea
rs3.open sql,conn,1,1
if not(rs3.eof and rs3.bof) then
%>
          <option selected value="<%=rs3("c_id")%>"><%=rs3("city")%></option>
          <% rs3.movenext
do while not rs3.eof%>
          <option value="<%=rs3("c_id")%>"><%=rs3("city")%></option>
          <% rs3.movenext
loop
end if
        rs3.close
        set rs3 = nothing
%>
        </select>
        　</td>
    </tr>
    <tr> 
      <td>网站类型： </td>
      <td><select name="t_id" id="select2">
          <% set rs=server.createobject("adodb.recordset")
	  sql="select * from type"
				           rs.open sql,conn,1,1%>
          <%if rs.eof and rs.bof then%>
          <%else
						   while not rs.eof%>
          <option value="<%=rs("t_id")%>"><%=rs("type")%></option>
          <%rs.movenext
   wend
   end if%>
        </select>
        　</td>
    </tr>
    <tr> 
      <td>网站名称：</td>
      <td> 
        <input name="webname" type="text" id="webname" size="20">
        <font color="#FF0000"> *必填</font></td>
    </tr>
    <tr> 
      <td>网站地址： </td>
      <td>
<input name="url" type="text" id="url" value="http://" size="20">
        <font color="#FF0000">*必填</font></td>
    </tr>
    <tr> 
      <td>网站LOGO： </td>
      <td>
<input name="logo" type="text" id="logo" size="20"></td>
    </tr>
    <tr> 
      <td>站长姓名： </td>
      <td> <input name="name" type="text" id="name3" value="无" size="20">
        <font color="#FF0000">*必填</font></td>
    </tr>
    <tr> 
      <td>密码：</td>
      <td><input name="pwd" type="text" id="pwd" value="123456" size="20">
        <font color="#FF0000">*必填</font></td>
    </tr>
    <tr> 
      <td>OICQ： </td>
      <td> 
        <input name="qq" type="text" id="qq" value="110" size="20"></td>
    </tr>
    <tr> 
      <td>邮箱地址：</td>
      <td> 
        <input name="mail" type="text" id="mail" size="20">
        <font color="#FF0000">*必填</font></td>
    </tr>
    <tr> 
      <td>联系电话： </td>
      <td>
<input name="tel" type="text" id="tel" size="20"></td>
    </tr>
    <tr> 
      <td>推荐级别： </td>
      <td> 
        <select name="vouch" id="select4">
          <option value="1" selected>1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
          <option value="6">首页</option>
		  <option value="7">内页</option>
        </select> &nbsp;</td>
    </tr>
    <tr> 
      <td>网站介绍： </td>
      <td><textarea name="intro" rows="4" id="textarea2" cols="30"></textarea>
        <br>
        *必填 (小于20字)</td>
    </tr>
    <tr> 
      <td colspan="2"><input type="submit" name="Submit2" value="提交"></td>
    </tr>
  </FORM>
</table>
</body></html>