gusucode.com > 爱美尔女性商城源码 1.0源码程序 > admintouch/addgongqiu.asp

    <!--#include file="conn.asp"-->
<%
if session("bjxadmin")="" then
response.Write "<script LANGUAGE='javascript'>alert('网络超时或者您还没有登录请登录');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>2 then
response.Write "<p align=center><font color=red>您没有此项目管理权限!</font></p>"
response.End
end if
end if
 %>
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</head>
<body>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from bjx_class2 order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
   count = 0
   do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>
		
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.fabuform.Nclassid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { //这句不是很理解
             document.fabuform.Nclassid.options[document.fabuform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr align=center>
    <td background="images/admin_bg_1.gif"><span class="style2">发布供求信息</span></td>
  </tr>
  <tr>
    <td>
      <table width="95%" border="0" cellspacing="3" cellpadding="3" align="center">
        <form name="fabuform" method="post" action="savegongqiu.asp?action=save">
          <tr>
            <td width="25%"><div align="right">信息主题: </div></td>
            <td width="75%">
              <input name="gq_title" type="text" size="30" class="wenbenkuang">
            </td>
          </tr>
          <tr>
            <td><div align="right">发 表 人:</div></td>
            <td><input name="gq_ren" type="text" class="wenbenkuang" value=""></td>
          </tr>
          <tr>
            <td><div align="right">类&nbsp;&nbsp;&nbsp;&nbsp;型:</div></td>
            <td><select name="gq_class" size="1" class="wenbenkuang">
                <option>请选择</option>
                <option value="1">供应信息</option>
                <option value="2">求购信息</option>
                <option value="3">合作信息</option>
            </select></td>
          </tr>
          <tr>
            <td valign="top"><div align="right">选择分类:</div></td>
            <td>
              <%
		  set rs=server.createobject("adodb.recordset")
	rs.open "select * from bjx_class1 order by anclassidorder",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
              大类:
              <select name="anclassid" size="1" id="anclassid" class="wenbenkuang" onChange="changelocation(document.fabuform.anclassid.options[document.fabuform.anclassid.selectedIndex].value)">
                <option selected value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
                <%      dim selclass
         selclass=rs("anclassid")
        rs.movenext
        do while not rs.eof
%>
                <option value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
                <%
        rs.movenext
        loop
		end if
        rs.close
%>
              </select>
                
              <br>
              小类:
              <select name="Nclassid" class="wenbenkuang">
                <%rs.open "select * from bjx_class2 where anclassid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%>
                <option selected value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
                <% rs.movenext
do while not rs.eof%>
                <option value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
                <% rs.movenext
loop
end if
        rs.close
        set rs = nothing
%>
              </select>
            </td>
          </tr>
          <tr>
            <td valign="top"><div align="right">信息内容:</div></td>
            <td><textarea name="gq_conment" cols="40" rows="6" class="wenbenkuang"></textarea></td>
          </tr>
          <tr>
            <td valign="top"><div align="right">联系信息:</div></td>
            <td><textarea name="gq_lianxi" cols="40" rows="4" id="gq_lianxi" class="wenbenkuang"></textarea></td>
          </tr>
          <tr>
            <td valign="top">&nbsp;</td>
            <td>
              <input class="go-wenbenkuang" onclick="return checkfabugongqiu();" type="submit" name="submit" value=" 提交保存 ">
              <input class="go-wenbenkuang" onclick="ClearReset()" type=reset name="Clear" value=" 重新填写 ">
            </td>
          </tr>
        </form>
    </table></td>
  </tr>
</table>

</body>
</html>
<script language=javascript>
function mm()
{
   var a = document.getElementsByTagName("input");
   if(a[0].checked==true){
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = false;
   }
   else
   {
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = true;
   }
}
</script>