<!--#include file="mdb.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/format.asp"-->
<!--#include file="inc/inc.asp"-->
<!--#include file="inc/syscode_fillbuy.asp"-->
<%
if userfb<>"yes" then
response.write"<SCRIPT language=JavaScript>alert(' 错误提示：\n\n参数非法！非法操作！！\n\n系统设置会员不能发表 ！');"
response.write"JavaScript:window.close()</SCRIPT>"
response.end
end if

if Request.Cookies("HX_USER")("User_Name")="" or isnull(Request.Cookies("HX_USER")("User_Name")) or Request.Cookies("HX_USER")("User_Pwd")="" or isnull(Request.Cookies("HX_USER")("User_Pwd")) then
	response.write"<SCRIPT language=JavaScript>alert(' 请登陆后操作 ，请返回 ！');"
	response.write"javascript:history.go(-1)</SCRIPT>"
	response.end
end if
if request.querystring("sheng")<>"" then
  if not isInteger(request.querystring("sheng")) then
    Response.Write "<script language=javascript>alert('参数非法');javascript:history.back();</script>"
    Response.End
  end if
end if

start="供求信息发布"
call head()
call menu()
if request.form("MM_insert") then
if request.form("action")="save" then

'dim gqcatid,gqname,gqclassid,gqdesc,gqisbest,gqistop,gqname,InfoAdd,InfoDate,ContactMan,Tel,Address,price,Email,CompanyName,Postalcode,Fax,Homepage,QQ
gqcatid=cint(request.form("gqcatid"))
gqclassid=cint(request.form("InfoClass"))
gqname=trim(replace(request.form("name"),"'",""))
sheng=cint(request.form("sheng"))
city=cint(request.form("city"))
InfoDate=cint(request.form("InfoDate"))
ContactMan=trim(replace(request.form("ContactMan"),"'",""))
Tel=trim(replace(request.form("Tel"),"'",""))
Address=trim(replace(request.form("Add"),"'",""))
price=trim(replace(request.form("price"),"'",""))
Email=trim(replace(request.form("Email"),"'",""))
CompanyName=trim(replace(request.form("CompanyName"),"'",""))
Postalcode=cint(request.form("Postalcode"))
Fax=trim(replace(request.form("Fax"),"'",""))
Homepage=trim(replace(request.form("Homepage"),"'",""))
QQ=trim(replace(request.form("QQ"),"'",""))
gqdesc=trim(replace(request.form("desc"),"'",""))
gqisbest=cint(request.form("isbest"))
gqistop=cint(request.form("istop"))
tjuser=trim(replace(request.form("ContactMan"),"'",""))

    set rs=server.CreateObject("adodb.recordset")
    rs.open "select gq_name from gq where gq_name='"&gqname&"' and ContactMan='"&ContactMan&"'",conn,1,1
    if not rs.eof and not rs.bof then
	   	   response.write"<SCRIPT language=JavaScript>alert('错误提示：\n\n① 此信息已提交过，正等待审核通过，请不要重复提交!\n\n② 您提交的信息已经存在，感谢你的支持!');"
	           response.write"this.top.location.href='fillbuy.asp';</SCRIPT>"
		   Response.End
    rs.close
    end if
    sql="select * from gq"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
if gqname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写供求名称！');history.back(1);</script>")
else
  rs("gq_name")=gqname
end if
if gqcatid<1 then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择供求所属分类！');history.back(1);</script>")
else
  rs("gqcat_id")=gqcatid
end if
if gqclassid<1 then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择信息类型！');history.back(1);</script>")
else
  rs("InfoClass")=gqclassid
end if
if sheng="" or city="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写面向地区！');history.back(1);</script>")
else
  rs("sheng")=sheng
  rs("city")=city  
end if
if InfoDate="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择有效时间！');history.back(1);</script>")
else
  rs("InfoDate")=InfoDate
end if
if gqdesc="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写信息内容！');history.back(1);</script>")
else
  rs("gq_desc")=gqdesc
end if
if ContactMan="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写联系人！');history.back(1);</script>")
else
  rs("ContactMan")=ContactMan
end if
if Tel="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写联系人电话！');history.back(1);</script>")
else
  rs("Tel")=Tel
end if
	If Request.Form("email")<>"" Then
	If instr(Request.Form("email"),"@")=0 or instr(Request.Form("email"),"@")=1 or instr(Request.Form("email"),"@")=len(email) then
	Response.Write "<script language=javascript>alert('电子信箱格式填写不正确！');javascript:history.back();</script>"
	Response.End
	End If
	End If
if Email="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写联系人Email！');history.back(1);</script>")
else
  rs("Email")=Email
end if
        If Request.Form("qq")<>"" Then
	If Len(Request.Form("qq"))<5 or Len(Request.Form("qq"))>10 or Not IsNumeric(Request.Form("qq")) then
	Response.Write "<script language=javascript>alert('QQ号码错误：\n\n① QQ号码只能是数字。\n\n② QQ号码不能低于4位数 \n\n③ QQ号码不能高于11位数\n\n④ 如果你没有QQ号码可以不填！');javascript:history.back();</script>"
	Response.End
	End If
	End If

if cint(gqisbest)=1 then
  rs("isbest")=cint(gqisbest)
end if
if cint(gqistop)=1 then
  rs("istop")=cint(gqistop)
end if
rs("CompanyName")=CompanyName
rs("price")=price
rs("Add")=Address
rs("Postalcode")=Postalcode
rs("Fax")=Fax
rs("Homepage")=Homepage
rs("QQ")=QQ

       if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
    rs("passed")=0
    sql="UPDATE [user] SET points = points + "&fbpoints&" where username='"&username&"'"
    conn.execute (sql)
    else
    rs("passed")=1
    end if


rs("tjuser")=Hx66_name

if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  sql="update allcount set gqcount = gqcount + 1"
  conn.execute(sql)
   response.Write"<script language=javascript>alert('发布成功，待审核 ！');this.location.href='fillbuy.asp';</script>"		
end if
end if
end if
if request.querystring("action")="" then
%>
<!--导航栏-->
<TABLE cellSpacing=0 cellPadding=0 width=958 border=0 align="center">
    <TR>
      <TD width=4></TD>
      <TD width=950 class="a3" height=24>&nbsp;&nbsp;&nbsp;&nbsp;稍后推出</TD>
      <TD width=4></TD>
    </TR>
    <TR>
      <TD width=4></TD>
      <TD width=950 class="a4" height=9></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<!--导航栏-->

<!--广告位A-->
<TABLE width=958 border=0 align="center" cellPadding=0 cellSpacing=0>
    <TR>
      <TD width=4></TD>
      <TD align=middle width=950 bgColor=#ffffff height=24><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TR>
            <TD width="100%" bgColor=#da251d height=2></TD>
          </TR>
          <TR>
            <TD width="100%"><%Call hx66_AD(1)%></TD>
          </TR>
          <TR>
            <TD width="100%" bgColor=#da251d height=2></TD>
          </TR>
      </TABLE></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<!--广告位A-->

<!--倒计时-->
<TABLE cellSpacing=0 cellPadding=0 width=958 border=0 align="center">
    <TR>
      <TD width=4></TD>
      <TD align=middle width=950 bgColor=#ffffff height=24><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TR>
            <TD width="100%" class="a5" height=9></TD>
          </TR>
          <TR>
            <TD align=middle width="100%" class="a6" height=31>
<table width="100%" border=0 cellpadding=0 cellspacing=0>
 <TR>
   <TD width="65" align="center"><img src="skin/1/login_title.gif" width="37" height="31"><TD><%call main_gq()%><td height="25" align="right"><%call djs()%>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</TD>
 </TR>
</TABLE>
            </TD>
          </TR>
      </TABLE></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<!--倒计时-->

<TABLE width=958 border=0 align="center" cellPadding=0 cellSpacing=0>
    <TR>
      <TD width=4></TD>
      <TD align=middle width=950 bgColor=#ffffff height=24><TABLE cellSpacing=0 cellPadding=0 width=950 border=0>
          <TR>
            <TD align=middle vAlign=top width=198><TABLE height=51 cellSpacing=0 cellPadding=0 
width="100%" border=0>
                <TR>
                  <TD align=middle width=30 class="a1" height=34><IMG height=20 src="skin/1/gu1.gif" width=24 border=0></TD>
                    <TD class="a1" height=34 width=170><a href="#" class="STYLE1">会员登录</a></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=150><%call userlogin()%></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
            </TABLE>
              <TABLE height=51 cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TR>
                  <TD align=middle width=30 class="a1" height=34><IMG height=20 src="skin/1/gu1.gif" width=24 border=0></TD>
                    <TD class="a1" height=34 width=170><a href="#" class="STYLE1">信息分类</a></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=150><%call xinxi_gq()%></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
            </TABLE><TABLE height=51 cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TR>
                  <TD align=middle width=30 class="a1" height=34><IMG height=20 src="skin/1/gu1.gif" width=24 border=0></TD>
                    <TD class="a1" height=34 width=170><a href="#" class="STYLE1">类型分类</a></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=80><%call leixing_gq()%></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
            </TABLE><TABLE height=51 cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TR>
                  <TD align=middle width=30 class="a1" height=34><IMG height=20 src="skin/1/gu1.gif" width=24 border=0></TD>
                    <TD class="a1" height=34 width=170><a href="#" class="STYLE1">信息发布</a></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=80 align=center><a href="fillbuy_put.asp">
	<img src=img/gq2.gif width=78 border="0"></a></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
            </TABLE><TABLE height=51 cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TR>
                  <TD align=middle width=30 class="a1" height=34><IMG height=20 src="skin/1/gu1.gif" width=24 border=0></TD>
                    <TD class="a1" height=34 width=170><a href="#" class="STYLE1">信息查找</a></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=10></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=20><%call search_gq()%></TD>
                </TR>
                <TR>
                  <TD width="100%" colSpan=2 height=1></TD>
                </TR>
            </TABLE></TD>
            <TD vAlign=top align=middle width=1 bgColor=#cecccc></TD>
            <TD vAlign=top align=middle><TABLE height=51 cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TR>
                <TD align=middle width=30 class="a1" height=34><IMG height=20 src="skin/1/gu1.gif" width=24 border=0></TD>
                <TD class="a1" height=34 width=720><a href="#" class="STYLE1">信息发布</a></TD></TR>
              <TR>
                <TD width="100%" colSpan=2 align="center"><form name="form2" method="post" action="">
<form name="form2" method="post" action="">
<table bgcolor='#ffffff' borderColor='#FOFOFO' Border='1' Cellspacing='0' Cellpadding='5' width='96%' align='Center' style="border-collapse: collapse" id="table8">
<tr>
     <td>面向地区&nbsp;<font color="#FF0000">*</font></td>
     <td>
	<select name="sheng" size="1" class="input" onchange="window.open('fillbuy_put.asp?sheng='+this.options[this.selectedIndex].value,'_self')">
        <option value="0" selected>全国</option>
                <%

        sql="select * from area where sid=0"
set rs0=server.createobject("adodb.recordset")
rs0.open sql,conn,1,1
do while not rs0.eof
%>         
<option value="<%=rs0("cat_id")%>" <%if cstr(request("sheng"))=cstr(rs0("cat_id")) and request("sheng")<>"" then%> selected<%end if%>><%=rs0("cat_name")%></option>
<%
rs0.movenext
loop
%>
       </select> 
            <select name="city">
            <option value="0" selected>请选择下属城市</option>
                   <%
sheng=cint(request.querystring("sheng"))
if sheng<>"" then
        sql="select * from area where sid<>0 and sid="&sheng&""
set rs0=server.createobject("adodb.recordset")
rs0.open sql,conn,1,1
do while not rs0.eof
%>         
<option value="<%=rs0("cat_id")%>" ><%=rs0("cat_name")%></option>
<%
rs0.movenext
loop
end if
%>   
          </select></td>
  </tr><tr> 
<td width='17%'>信息主题&nbsp;<font color='#FF0000'>*</font></td>
<td><input type='text' name='name' size='65' class='input'></td>
</tr>
<tr>
<td>所属分类&nbsp;<font color='#FF0000'>*</font></td>
<td><select name="gqcatid"  class="input" size="1">
<%
sql="select * from gqcat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof%><option value="<%=rs("gqcat_id")%>"><%=rs("gqcat_name")%></option>
<%rs.movenext
loop
if rs.eof and rs.bof then%><option value="0">当前没有分类</option>
<%end if%>
</select></td>
  </tr>

   <tr>
     <td height="25">选择类型&nbsp;<font color="#FF0000">*</font></td>                            
     <td height="25"><select class="input" size="1" name="InfoClass">
   
<%
sql="select * from gqclass"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof%><option value="<%=rs("gqclass_id")%>"><%=rs("gqclass_name")%></option>
<%rs.movenext
loop
if rs.eof and rs.bof then%><option value="0">当前没有分类</option>
<%end if%>
</select></td>
  </tr>
    <tr>
    <td>交易价格：</td>                            
    <td>
    <input type="text" name="price" size="10" maxlength="20" value="面议" class="input"></td>
  </tr> 
  
  <tr>
    <td>有 效 期&nbsp;<font color="#FF0000">*</font></td>                            
    <td>
    <select size="1" name="InfoDate" class="input">
        <option value="0">无限期</option>
    <option value="1">一天</option>
    <option value="3">三天</option>
    <option value="7">一星期</option>
    <option value="15">半个月</option>
    <option value="30" selected>一个月</option>
    <option value="60">两个月</option>
    <option value="90">一个季度</option>
    <option value="182">半年</option>
    <option value="365">一年</option>
    </select>                      
    </td>
  </tr> 
  <tr> 
     <td>信息内容&nbsp;<font color="#FF0000">*</font></td>
     <td><textarea name="desc" cols="63" rows="8" class="input"></textarea></td>
  </tr>
  <tr>
    <td>联 系 人&nbsp;<font color="#FF0000">*</font></td>
    <td><input name="ContactMan" type="text" size="20" maxlength="20" value="<%=Hx66_Name%>" class="input"></td>
  </tr> 
  <tr>
    <td>电&nbsp;&nbsp;&nbsp;&nbsp;话&nbsp;<font color="#FF0000">*</font></td>                            
    <td><input type="text" name="Tel" size="20" maxlength="20" value="<%=Hx66_phone%>" class="input"></td>
  </tr>
  <tr>
    <td>&nbsp;&nbsp;E-Mail&nbsp;<font color="#FF0000">*</font></td>
    <td><input type="text" name="Email" size="20" maxlength="50" value="<%=Hx66_Email%>" class="input"></td>
  </tr>
  <tr>
    <td>企业名称</td>
    <td><input name="CompanyName" type="text" size="40" maxlength="100" value="" class="input"></td>
  </tr>
  <tr>
    <td>联系地址</td>                            
    <td><input type="text" name="Add" size="40" maxlength="100" value="<%=dvHTMLEncode(Hx66_address)%>" class="input"></td>
  </tr> 
  <tr>
    <td>邮&nbsp;&nbsp;&nbsp;&nbsp;编</td>                            
    <td><input type="text" name="Postalcode" size="20" maxlength="6" value="" class="input"></td>
  </tr>
  <tr>
    <td>传&nbsp;&nbsp;&nbsp;&nbsp;真</td>                            
    <td><input type="text" name="Fax" size="20" maxlength="20" value="" class="input"></td>
  </tr>
  <tr>
    <td>主&nbsp;&nbsp;&nbsp;&nbsp;页</td>                            
    <td height="25"><input type="text" name="Homepage" size="20" maxlength="50" value="<%=Hx66_Homepage%>" class="input"></td>
  </tr>
  <tr>
    <td>联 系 QQ&nbsp;</td>
    <td><input type="text" name="QQ" size="20" maxlength="20" value="<%=Hx66_QQ%>" class="input"></td>
  </tr>
  <tr align="center"> 
     <td colspan="2" height="30">
     <input type="submit" name="Submit" value="确定发布" class="input">
     <input type="reset" name="Reset" value="清空重填"  class="input"><input type="hidden" name="action" value="save"><input type="hidden" name="MM_insert" value="true"></td>          
  </tr></form>
</table></TD>
              </TR>
            </TABLE></TD>
          </TR>
      </TABLE></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<%
end if
call footer()
%>