<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>2 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx8<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<html>
<head>
<title>网软志成在线购物系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style2 {
	color: #000000;
	font-weight: bold;
}
.STYLE3 {color: #FF0000}
-->
</style>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_infoid2 order by infoid ",conn,1,1

set rs2=server.createobject("adodb.recordset")
rs2.open "select * from shop_infoid3 order by infoid ",conn,1,1
%>
<script language = "JavaScript">
var onecount;
var threecount;
onecount=0;
threecount=0

subcat3=new Array();
<%
   count = 0
   do while not rs2.eof 
%>
subcat3[<%=count%>] = new Array("<%= trim(rs2("info"))%>","<%= rs2("classid2")%>","<%= rs2("id")%>");
<%
        count = count + 1
        rs2.movenext
        loop
        rs2.close
%>
threecount=<%=count%>;

subcat = new Array();
<%
   count = 0
   do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("info"))%>","<%= rs("classid1")%>","<%= rs("id")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>
		
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.form1.nclassid.length = 0; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
             document.form1.nclassid.options[document.form1.nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
		if(document.form1.nclassid.length!=0){
     changelocation3(document.form1.nclassid.options[document.form1.nclassid.selectedIndex].value) 
	 }else{
	 document.form1.xclassid.length=0
	 }      
    }    
    
function changelocation3(locationid)
    {
    document.form1.xclassid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < threecount; i++)
        {
            if (subcat3[i][1] == locationid)
            { 
             document.form1.xclassid.options[document.form1.xclassid.length] = new Option(subcat3[i][0], subcat3[i][2]);
            }        
        }
        
    } 
//-->
</script>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="28">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td width="77%" height="27" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">网软志成购物后台管理系统 &gt;&gt; 供求管理 &gt;&gt; 添加供求信息 </font></strong></td>
        <td width="23%" style="font-size:14px;color:#ffffff"><span class="STYLE3">* 为必添项目</span></td>
      </tr>
    </table></td>
  </tr>
</table>
<form method="POST" name="form1" action="info_add_save.asp?action=add" onSubmit="return checkdata()">
<script language="javascript">
function checkdata()
{
if (form1.tit.value=="")
	{
	  alert("对不起，请输入主题！")
	  form1.tit.focus()
	  return false
	 }


	 
if (form1.mal.value=="")
{
alert("请输入您的电子邮件地址！");
form1.mal.focus();
return false;
}

var str1 = form1.mal.value
if(str1.indexOf("@") == -1 || str1.indexOf(".") == -1)
{ 
alert("E-mail格式不正确,请重新填写！"); 
form1.mal.focus();
return false; 
}

if (form1.lxr.value=="")
{
alert("请输入联系人！");
form1.lxr.focus();
return false;
}
 
if (form1.tel.value=="")
{
alert("请输入电话！");
form1.tel.focus();
return false;
} 

if (form1.jg.value=="")
{
alert("请输入价格！");
form1.jg.focus();
return false;
} 
if (form1.ysh.value=="")
{
alert("请输入相关地址！");
form1.ysh.focus();
return false;
} 

}
</script>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
      <tr bgcolor="#F3F3F3">
        <td><div align="center">选择分类：</div></td>
        <td bgcolor="#F3F3F3"><span style="PADDING-LEFT: 6px">大类:
            <%set rs=server.CreateObject("adodb.recordset")
        rs.open "select * from shop_infoid order by infoid",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
            <select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.form1.anclassid.options[document.form1.anclassid.selectedIndex].value)">
              <%      dim selclass
         selclass=rs("id")
        
        do while not rs.eof

  response.write  "<option value="&rs("id")
  if anclassid=rs("id") then response.write " selected "
  response.write ">"&trim(rs("info"))&"</option>"    
        rs.movenext
        loop
	end if
        rs.close
%>
            </select>
&nbsp;&nbsp; 小类：
<select name="nclassid" size="1" id="nclassid" onChange="changelocation3(document.form1.nclassid.options[document.form1.nclassid.selectedIndex].value)">
  <%set rs=server.CreateObject("adodb.recordset")
		rs.open "select * from shop_infoid2 where classid1="&selclass,conn,1,1
if not(rs.eof and rs.bof) then
%>
  <% 
                                 dim selclass3
 				 selclass3=rs("id")
do while not rs.eof
  response.write  "<option value="&rs("id")
  if nclassid=rs("id") then response.write " selected "
  response.write ">"&trim(rs("info"))&"</option>"  
rs.movenext
loop
end if
        rs.close
        set rs = nothing
        
%>
</select>
<font color="#FF0000">&nbsp;&nbsp;&nbsp; </font> 子类：
<select name="xclassid">
  <%if selclass3="" then
		selclass3=0
		end if
		set rs2=server.CreateObject("adodb.recordset")
		rs2.open "select * from shop_infoid3 where classid2="&selclass3,conn,1,1
if not(rs2.eof and rs2.bof) then
do while not rs2.eof%>
  <option value="<%=rs2("id")%>"<%if xclassid=rs2("id") then %> selected <%end if %> ><%=rs2("info")%></option>
  <% rs2.movenext
loop


end if
        rs2.close
        set rs2= nothing
%>
</select>
        </span><span class="STYLE3">*</span></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td><div align="center">选择供求：</div></td>
        <td bgcolor="#F3F3F3"><input name="gq" type="radio" value="出售" checked>
出售
  <input type="radio" name="gq" value="求购">
求购</td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td width="16%"><div align="center">发布主题：</div></td>
        <td width="84%">
          <input name="tit" type="text" class="wenbenkuang" id="tit" size="44" maxlength="40">
          <span class="STYLE3">*</span></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td width="16%"><div align="center">电子邮件：</div></td>
        <td width="84%">
          <input name="mal" type="text" class="wenbenkuang" id="mal" size="44" maxlength="30">
          <span class="STYLE3">*</span></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td width="16%"><div align="center">联系人：</div></td>
        <td width="84%">
          <input name="lxr" type="text" class="wenbenkuang" id="lxr" size="20" maxlength="30">
          <span class="STYLE3">*</span></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td><div align="center">联系电话：</div></td>
        <td width="84%"><input name="tel" type="text" class="wenbenkuang" id="tel" size="19"maxlength="30">
        <span class="STYLE3">*</span></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td width="16%"><div align="center">联系QQ：</div></td>
        <td width="84%">
          <input name="qq" type="text" class="wenbenkuang" id="qq" size="14"maxlength="30">        </td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td><div align="center">发布价格：</div></td>
        <td width="84%"><input name="jg" type="text" class="wenbenkuang" id="jg" size="14"maxlength="30"  >
         <span class="STYLE3">*</span></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td width="16%"><div align="center">相关地址：</div></td>
        <td width="84%"> http://
            <input name="ysh" type="text" id="ysh" size="30" maxlength="500" class="wenbenkuang">
            <span class="STYLE3">*</span></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td width="16%" valign="top"><div align="center">相关说明：</div></td>
        <td width="84%" valign="middle">        <textarea name="msg" cols="80" rows="6" class="wenbenkuang" id="msg"></textarea></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td width="16%"><div align="center">所在地区：</div></td>
        <td width="84%">
          <select name="whe" size="1"  class="wenbenkuang" id="select2" >
            <option value="xxx" selected>请选择省份……</option>
            <%
set rs_s=server.createobject("adodb.recordset")
sql="select * From shop_szSheng  order by shengorder"
rs_s.open sql,conn,1,1
while not rs_s.eof
%>
            <option value="<%=rs_s("ShengName")%>" ><%=trim(rs_s("ShengName"))%></option>
            <%
    rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
          </select></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td><div align="center">有效期限：</div></td>
        <td><select  name="edt" size="1" class="wenbenkuang" id="select3">
          <option value="一天" selected>一天</option>
          <option value="二天">二天</option>
          <option value="三天">三天</option>
          <option value="四天">四天</option>
          <option value="五天">五天</option>
          <option value="六天">六天</option>
          <option value="一个星期">一个星期</option>
          <option value="半个月">半个月</option>
          <option value="一个月">一个月</option>
          <option value="二个月">二个月</option>
          <option value="一个季度">一个季度</option>
          <option value="半年">半年</option>
          <option value="一年">一年</option>
          <option value="无期">无期</option>
        </select></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td height="35" colspan="2" align="center">
          <input name="B12" type="submit" class="go-wenbenkuang" value="确 认 提 交">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" value="全部重填" name="B22" class="go-wenbenkuang">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
      </tr>
    </table>
</form>
  <!--#include file="copyright.asp"-->
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
