<!--#include file="mdb.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/format.asp"-->
<!--#include file="inc/inc.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
start="黄页发布"
call head()
call menu()
if request.form("MM_insert") then
if request.form("action")="save" then

sql="select * from hy"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim poster,hyfrom,title,keyword,content,catid,hyisbest,hyistop,newpic,isimg,tjuser,hyauthor,hyahome
catid=cint(request.form("cat_id"))
bigclass=cint(request.form("bigclass"))
sheng=cint(request.form("sheng"))
title=trim(replace(request.form("hy_title"),"'",""))
keyword=trim(replace(request.form("hy_keyword"),"'",""))
'content=rtrim(replace(request.form("hy_content"),"",""))
content=trim(replace(request.form("hy_content"),"∈",""))
newpic=request.form("pic")
city=cint(request.form("city"))
qyxz=trim(replace(request.form("qyxz"),"'",""))
zczj=trim(replace(request.form("zczj"),"'",""))
cldate=trim(replace(request.form("cl_date"),"'",""))
jylx=trim(replace(request.form("jylx"),"'",""))
tel=trim(replace(request.form("tel"),"'",""))
fax=trim(replace(request.form("fax"),"'",""))
email=trim(replace(request.form("email"),"'",""))
code=trim(replace(request.form("code"),"'",""))
dizhi=trim(replace(request.form("dizhi"),"'",""))
hyauthor=trim(replace(request.form("hy_author"),"'",""))
hyahome=trim(replace(request.form("hy_ahome"),"'",""))

    set rs=server.CreateObject("adodb.recordset")
    rs.open "select hy_id from hy where hy_title='"&title&"' and hy_author='"&hyauthor&"'",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 hy"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
if catid<1 or bigclass<1 then
  founderr=true
Response.Write("<script language=javascript>alert('你必须选择黄页的分类！');history.back(1);</script>")
else
  rs("cat_id")=catid
  rs("bcat_id")=bigclass
end if
if title="" then
  founderr=true
Response.Write("<script language=javascript>alert('你必须填写黄页的标题！');history.back(1);</script>")
else
  rs("hy_title")=title
end if
if hyauthor=""  then
  founderr=true
Response.Write("<script language=javascript>alert('联系人不能为空！');history.back(1);</script>")
else
  rs("hy_author")=hyauthor
  rs("hy_ahome")=hyahome
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 keyword="" then
  founderr=true
Response.Write("<script language=javascript>alert('你必须填写黄页的关键字！');history.back(1);</script>")
else
  rs("hy_keyword")=keyword
end if
if content="" then
  founderr=true
Response.Write("<script language=javascript>alert('你必须填写黄页的内容！');history.back(1);</script>")
else
  rs("hy_content")=content
end if
if jylx="" then
  founderr=true
Response.Write("<script language=javascript>alert('你必须选择经营类型！');history.back(1);</script>")
else
  rs("jylx")=jylx
end if
if city<1 then
  founderr=true
Response.Write("<script language=javascript>alert('你必须选择所属地区！');history.back(1);</script>")
else
rs("city")=city
rs("sheng")=sheng
end if
rs("qyxz")=qyxz
rs("zczj")=zczj
rs("cldate")=cldate
rs("qyxz")=qyxz
rs("tel")=tel
rs("fax")=fax
rs("email")=email
rs("code")=code
rs("dizhi")=dizhi

  rs("images")=newpic
  rs("tjuser")=Hx66_name
         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
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  sql="update allcount set hycount = hycount + 1"
  conn.execute(sql)
   response.Write"<script language=javascript>alert('发布成功，待审核 ！');this.location.href='corporation.asp';</script>"
   end if
end if		
end if
if request.querystring("action")="" then
%>
<!--导航栏-->
<TABLE width=958 border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF">
    <TR>
      <TD width=4></TD>
      <TD width=950 class="a3" height=24>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="show_corporation.asp?bigclass=1">国家机关</a> ·<a href="show_corporation.asp?bigclass=2">科教文体</a> ·<a href="show_corporation.asp?bigclass=3">运输物流</a> ·<a href="show_corporation.asp?bigclass=4">金融贸易</a> ·<a href="show_corporation.asp?bigclass=5">医疗保健</a> ·<a href="show_corporation.asp?bigclass=6">娱乐休闲</a> ·<a href="show_corporation.asp?bigclass=7">日用百货</a> ·<a href="show_corporation.asp?bigclass=8">城建房产</a> ·<a href="show_corporation.asp?bigclass=9">通信互联</a> ·<a href="show_corporation.asp?bigclass=10">商务广告</a> ·<a href="show_corporation.asp?bigclass=11">粮油食品</a> ·<a href="show_corporation.asp?bigclass=12">印刷包装</a></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 bgcolor="#FFFFFF">
    <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 width=958 border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF">
    <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><% Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='corporation.asp'>企业黄页</a> <font color=#FF6600>→</font> 发布信息 " & vbCrLf%><td height="25" align="right"><a href="corporation_put.asp"><B>申请加入黄页</B></a>&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=80><TABLE WIDTH='100%' CELLPADDING='0' CELLSPACING='0' BORDER='0'>
<tr>
<td height='22' width='100%'>
<SCRIPT language=javascript>
function showmenu1(buyok,img)
{
if(buyok.style.display=="none"){
buyok.style.display="";
img.src="img/bclass2.gif";
} else {
buyok.style.display="none"; 
img.src="img/bclass1.gif";
}
}
</SCRIPT><%
response.write "<TABLE align=center cellSpacing=0 cellPadding=0 width='100%' border=0>" & vbCrLf
sql="select * from hycat where sid=0"
set rs1=conn.execute(sql)
i=0
do while not rs1.eof
i=i+1
response.write "<TR><TD language=javascript onmouseup='showmenu1(buyok"&i&",img"&i&");' valign=middle>&nbsp;<IMG id=img"&i&" height=20 src=img/bclass1.gif width=20 align=absMiddle>"
sql="select hy_id from hy where bcat_id="&rs1("cat_id")
set rs01=server.createobject("adodb.recordset")
rs01.open sql,conn,1,1
geshu=rs01.recordcount

if request("bigclass")=cstr(rs1("cat_id")) then
response.write "&nbsp;<font color=""#FF0000"">［"&rs1("cat_name")&"］</a></font>("&geshu&")</td></tr>" & vbCrLf
else
response.write "&nbsp;<a href='show_corporation.asp?bigclass="&rs1("cat_id")&"'>［"&rs1("cat_name")&"］</a>("&geshu&")</td></tr>" & vbCrLf
end if
sql="select * from hycat where sid="&rs1("cat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
response.write "<TR><TD id=buyok"&i&" style='display: none'>" & vbCrLf
do while not rs2.eof
sql="select hy_id from hy where cat_id="&rs2("cat_id")
set rs02=server.createobject("adodb.recordset")
rs02.open sql,conn,1,1
geshu1=rs02.recordcount
if request("smallclass")=cstr(rs2("cat_id")) then
response.write "&nbsp;<IMG height=20 src=img/bclass3.gif width=36 align=absMiddle border=0><font color=""#FF0000"">"&rs2("cat_name")&"</font>("&geshu1&")<BR>" & vbCrLf
else
response.write "&nbsp;<IMG height=20 src=img/bclass3.gif width=36 align=absMiddle border=0><a href='Show_corporation.asp?smallclass="&rs2("cat_id")&"'>"&rs2("cat_name")&"</a>("&geshu1&")<BR>" & vbCrLf
end if
rs2.movenext
loop
response.write "</td></tr>" & vbCrLf
rs1.movenext
loop
if rs1.eof and rs1.bof then%><tr><td>
	<p align="center">当前没有分类</td></tr>
<%end if
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
response.write "</table>" & vbCrLf
%></td></tr>

</table></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=25><TABLE WIDTH='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
        <%sql="select top 10 * from hy where passed=0 order by hy_id DESC"
        set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
i=1
do while not rs.eof
        %><%sql="select * from [User] where username='"&rs("tjuser")&"'"
set rs1=server.createobject("adodb.recordset")
rs1.open sql,conn,1,1

%>
<tr>
<td height="25">
&nbsp;<%=i%>&nbsp;<%if rs1("usergrade")=1 then%><img src="img/vip.gif" align="absmiddle" alt="VIP会员企业"><%else%><img src="img/user.gif" align="absmiddle" alt="普通会员企业"><%end if%><a href="showcompany.asp?hy_id=<%=rs("hy_id")%>"><%=left(rs("hy_title"),10)%>...</a>
</td>
</tr>
<%
i=i+1
rs.movenext
loop
%>
</table></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"><script language="javascript" src="inc/PopupCalendar.js" ></script>
<script >
var oCalendarEn=new PopupCalendar("oCalendarEn");
oCalendarEn.Init();
var oCalendarChs=new PopupCalendar("oCalendarChs");
oCalendarChs.weekDaySting=new Array("日","一","二","三","四","五","六");
oCalendarChs.monthSting=new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
oCalendarChs.oBtnTodayTitle="今天";
oCalendarChs.oBtnCancelTitle="取消";
oCalendarChs.Init();
</script>

<script language = "JavaScript">
var onecount;
subcat = new Array();
         <%sql="select * from hycat where sid<>0"
set rs0=server.createobject("adodb.recordset")
rs0.open sql,conn,1,1
i=0
do while not rs0.eof
sql="select * from hycat where cat_id="&rs0("sid")
set rs1=server.createobject("adodb.recordset")
rs1.open sql,conn,1,1
%>         
         subcat[<%=i%>] = new Array("<%=rs0("cat_name")%>","<%=rs1("cat_id")%>","<%=rs0("cat_id")%>");
   <%
   i=i+1
rs0.movenext
loop%>             
        onecount=<%=i%>;

function changelocationid(locationid)
    {
    document.form2.cat_id.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.form2.cat_id.options[document.form2.cat_id.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    
</SCRIPT>


<form name='form2' action='' method=post >
<input type=hidden name='chk' value='yes'>
<table bgcolor='#ffffff' borderColor='#FOFOFO' Border='1' Cellspacing='0' Cellpadding='5' width='96%' align='Center' style="border-collapse: collapse">

    <tr> 
        <TD height="25">所在省份&nbsp;<font color="#FF0000">*</font></td>
        <td>
    
            <select name="sheng"  size="1" onchange="window.open('corporation_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
if rs0.eof and rs0.bof then%>
<option value=0>当前没有分类</option>
<%end if%>
          </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>行业分类&nbsp;<font color='#FF0000'>*</font></td>

     <TD>
       
        <select name="bigclass" onChange="changelocationid(document.form2.bigclass.options[document.form2.bigclass.selectedIndex].value)" size="1">
              <option value="" selected>请选择大类</option>
        <%sql="select * from hycat 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")%>"><%=rs0("cat_name")%></option>
<%
rs0.movenext
loop
if rs0.eof and rs0.bof then%>
<option value=0>当前没有分类</option>
<%end if%>
              </select>
              <select name="cat_id" class="input">
            <option value="" selected>请选择小类</option>         
          </select>&nbsp;</td>
    </tr>
<tr> 
<td width='17%'>企业名称&nbsp;<font color='#FF0000'>*</font></td>
<td><input type='text' name='hy_title' size='65' class='input'></td>
</tr>
<tr>
<td>关 键 字： </td>
     <TD>
<input type="text" name="hy_keyword" size="20" class="textarea" id="hy_keyword" value="<%=rs("hy_keyword")%>">
			&nbsp;多个用 | 隔开。

        　</td>
    </tr>
    <tr>  
      <td height="25">联 系 人： </td>
      <td><input type="text" name="hy_author" size="30" class="input"></td>
    </tr>
    <tr> 
     <td height="25">单位性质：</td>
     <td><select name="qyxz" class="input">
	<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>
	</select></td>
    </tr>
    <tr>
      <td height="25">成立日期：</td>
      <td><input readonly type="text" name="cl_date" id="aa" onclick="getDateString(this,oCalendarChs)" size="15" class="input"></td>
    </tr>
    <tr>
      <td height="25">注册资金：</td>
      <td><input  type="text" name="zczj" size="15"  class="input">  万元</td>
    </tr>
    <tr>
     <td height="25">经营类型： </td>
     <td><input type="radio" value="生产型" name="jylx" checked>生产型&nbsp; 
	 <input type="radio" value="贸易型" name="jylx" >贸易型&nbsp; 
	 <input type="radio" value="服务型" name="jylx" >服务型&nbsp; 
	 <input type="radio" value="政府|机构" name="jylx" >政府|机构
	 <input type="radio" value="其它类型" name="jylx" >其它类型</td>
    </tr>
    <tr> 
      <td height="25">电话(Tel)：</td>
      <td><input type="text" name="tel" size="30" class="input"></td>
    </tr>
    <tr> 
      <td height="25">传真(Fax)：</td>
      <td><input type="text" name="fax" size="30" class="input"></td>
    </tr>
    <tr> 
      <td height="25">E_mail： </td>
      <td><input type="text" name="email" size="30" class="input"></td>
    </tr>
    <tr> 
      <td height="25">邮政编码：</td>
      <td><input type="text" name="code" size="30" class="input"></td>
    </tr>
    <tr> 
      <td height="25">企业地址： </td>
      <td><input type="text" name="dizhi" size="65" value="" class="input"></td>
    </tr>
    <tr> 
      <td height="25" valign="top">企业简介：</td>
      <td><textarea name="hy_content" cols="65" rows="6" class="input"></textarea></td>
    </tr>
    <tr> 
      <td height="25">企业网址：</td>
      <td><input type="text" name="hy_ahome" size="65" class="input" value="http://"></td>
    </tr>
    <tr class=Hxcmsds> 
      <td height="25">形象图片：</td>
      <td><input type="text" name="pic" size="65" class="input">
          <BR><IFRAME name=ad src="user_upload.asp?action=pic" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></td>
    </tr>
    <tr> 
      <td height="35" colspan="2"> 
        <div align="center"> 
          <input type="submit" name="Submit" value="确认发布" class="button">
          &nbsp;&nbsp; 
          <input type="reset" name="Submit" value="清空重填" class="button">
          		  <input type="hidden" name="action" value="save">
		  <input type="hidden" name="MM_insert" value="true">
        </div>
      </td>
    </tr>
  </form>
</table></TD>
              </TR>
            </TABLE></TD>
  </TR>
</TABLE></TD>
      <TD width=4></TD>
    </TR>
</TABLE>
<%
end if
call footer()
%>