<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../../inc/CommonFunction.asp"-->
<!--#include file="../checkvalid.asp" -->
<%If Not FRAdminLevel(303) Then Call ErrorMsg()
member_login=trim(request("login"))
set rs=server.createobject("ADODB.Recordset")
 sql="select member_login from JOB_member where Member_typeid=2 and member_login='"&member_login&"'"
 rs.open sql,conn,1,1
 if rs.eof then
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
  response.write "<script language=javascript>alert('此会员帐号不存在！');location.href='javascript:history.back()';</script>"
  response.end 
 end if
rs.close

hire_place=CheckStr(trim(request("place")))
If hire_place="" or isnull(hire_place) Then 
 conn.close
 set conn=nothing
 response.write "<script language=javascript>alert('职位名称不能为空，请重新输入！');location.href='javascript:history.back()';</script>"
 response.end 
end if
hire_dept=CheckStr(trim(request("dept")))
hire_introduce=CheckStrbox(request("introduce"))
If lenmix(hire_introduce)>=8000 Then
 conn.close
 set conn=nothing 
 response.write "<script language=javascript>alert('错误：详细说明太长了，要求不多于8000个字符!！');location.href='javascript:history.back()';</script>"
 response.end 
end if
hire_type=cint(trim(request("type")))
hire_trade=cint(trim(request("trade")))
hire_position=trim(request("position"))
hire_workadd=trim(request("workadd"))
hire_number=cint(trim(request("number")))
hire_pay=clng(trim(request("pay")))
hire_enddate=cdate(request("funddate"))
hire_usergroup=cint(trim(request("usergroup")))
hire_profession=trim(request("profession"))
hire_edu=cint(trim(request("edu")))
hire_experience=cint(trim(request("experience")))
hire_sex=cint(trim(request("sex")))
hire_age1=cint(trim(request("age1")))
hire_age2=cint(trim(request("age2")))
hire_comname=CheckStr(trim(request("comname")))
hire_address=CheckStr(trim(request("address")))
hire_post=CheckStr(trim(request("post")))
hire_contact=CheckStr(trim(request("contact")))
hire_tel=trim(request("tel"))
hire_fax=trim(request("fax"))
hire_email=CheckStr(trim(request("email")))

set rsw=conn.execute("select * from job_member where member_login='"&member_login&"'")
If Not rsw.Eof Then
member_id=rsw("member_id")
End If
rsw.close
set rsw=nothing

sql="select * from job_c_hire where hire_cmember='"&member_login&"' and hire_place='"&hire_place&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof then
rs.addnew
rs("hire_type")=hire_type
rs("hire_trade")=hire_trade
rs("hire_position")=hire_position
rs("hire_place")=hire_place
rs("hire_dept")=hire_dept
rs("hire_workadd")=hire_workadd
rs("hire_number")=hire_number
rs("hire_pay")=hire_pay
rs("hire_enddate")=hire_enddate
rs("hire_introduce")=hire_introduce
rs("hire_usergroup")=hire_usergroup
rs("hire_profession")=hire_profession
rs("hire_edu")=hire_edu
rs("hire_experience")=hire_experience
rs("hire_sex")=hire_sex
rs("hire_age1")=hire_age1
rs("hire_age2")=hire_age2
rs("hire_comname")=hire_comname
rs("hire_address")=hire_address
rs("hire_post")=hire_post
rs("hire_contact")=hire_contact
rs("hire_tel")=hire_tel
rs("hire_telshowflag")=hire_telshowflag
rs("hire_fax")=hire_fax
rs("hire_email")=hire_email
rs("hire_emailshowflag")=hire_emailshowflag
rs("company_id")=member_id
rs("hire_announcedate")=now()

If AdminHirCheckReg=1 Then
rs("hire_status")=0
Else
rs("hire_status")=1
End IF
rs("hire_cmember")=member_login
rs("hire_operator")=Request.Cookies("admin_name")
rs.update
rs.close
set rs=nothing
end if
'生成静态页面
set rsuc=conn.execute("select * from JOB_Channel where ChannelID=2")
	UseCreateHTML=rsuc("UseCreateHTML")
set rsuc=nothing
if  CreateHTML=1 and UseCreateHTML<>0 then
	set rsh=conn.execute("select * from job_c_hire where hire_cmember='"&member_login&"' and hire_place='"&hire_place&"'")
	if not rsh.eof then
	hire_id=rsh("hire_id")
	Call HireContentHtml(hire_id) '生成职位页面
	end if
	Set rsh=Nothing
	Call HireListContentHtml(member_id) '生成企业职位列表页面
	Call CompanyContentHtml(member_id) '生成企业页面
end if
conn.close
set conn=nothing
response.write ("<script language=JavaScript>if (confirm('招聘信息添加成功！继续添加招聘信息？')){location.href='hire_add.asp'}else{location.href='hire_searchlist.asp'}</script>")
response.end
%>