<!--#include file="Access.asp"  -->
<!-- #include file="inc/functions.asp" -->
<!-- #include file="../func/rand.asp" -->
<!-- #include file="x_to_html/recruit_content_to_html.asp" -->

<% '添加数据到数据表
act=Request("act")
If act="save" Then 
j_firm=trim(request.form("j_firm"))
j_depart=trim(request.form("j_depart"))
j_name=trim(request.form("j_name"))
j_salary=trim(request.form("j_salary"))
j_sum=trim(request.form("j_sum"))
j_sex=trim(request.form("j_sex"))
j_age=trim(request.form("j_age"))
j_edu=trim(request.form("j_edu"))
j_exp=trim(request.form("j_exp"))
j_date=trim(request.form("j_date"))
j_demand=trim(request.form("j_demand"))
j_view_yes=trim(request.form("j_view_yes"))
j_index_push=trim(request.form("j_index_push"))

j_time=now()

set rs=server.createobject("adodb.recordset")
sql="select author from web_com where id="&j_firm&""
rs.open(sql),cn,1,1
if not rs.eof then
author_id=rs("author")
end if
rs.close
set rs=nothing


set rs=server.createobject("adodb.recordset")
sql="select * from web_job"
rs.open(sql),cn,1,3
rs.addnew
rs("j_firm")=j_firm
rs("j_depart")=j_depart
rs("j_name")=j_name
if j_salary<>"" then
rs("j_salary")=j_salary
else
rs("j_salary")="面议"
end if
if j_sum<>"" then
rs("j_sum")=j_sum
else
rs("j_sum")="不限"
end if
rs("j_sex")=j_sex
rs("j_age")=j_age
rs("j_edu")=j_edu
rs("j_exp")=j_exp
rs("j_date")=j_date
rs("j_demand")=j_demand
rs("j_view_yes")=j_view_yes
rs("j_index_push")=j_index_push
if author_id<>"" then
rs("author_id")=author_id
end if
rs("j_time")=j_time
rs.update
rs.close
set rs=nothing
%>

<% '生成html
set rs2=server.createobject("adodb.recordset")
sql="select top 1 [id] from [web_job] where [j_name]='"&j_name&"' and [author_id]="&author_id&" order by j_time desc "
rs2.open(sql),cn,1,1
if not rs2.eof and not rs2.bof then
a_id=rs2("id")
end if
rs2.close
set rs2=nothing

filepath="/zhaopinxinxi/"&a7&".html"

call recruit_content_to_html(a_id,filepath)

%>

<%
response.Write "<script language='javascript'>alert('添加成功！');location.href='job_list.asp';</script>"
end if 
 %>
 

	<%
Call header()

%>

  <form id="form1" name="form1" method="post" action="?act=save">
         <script language='javascript'>
function checksignup1() {
if ( document.form1.j_firm.value == '' ) {
window.alert('请选择招聘公司^_^');
document.form1.j_firm.focus();
return false;}

if ( document.form1.j_name.value == '' ) {
window.alert('请输入招聘职位^_^');
document.form1.j_name.focus();
return false;}

if(document.form1.j_salary.value.search(/^([0-9]*)([.]?)([0-9]*)$/)   ==   -1)   
      {   
  window.alert("工资待遇只能是数字^_^");   
document.form1.j_salary.focus();
return false;}

if(document.form1.j_sum.value.search(/^([0-9]*)([.]?)([0-9]*)$/)   ==   -1)   
      {   
  window.alert("招聘人数只能是数字^_^");   
document.form1.j_sum.focus();
return false;}

return true;}
</script>
	<table cellpadding='3' cellspacing='1' border='0' class='tableBorder' align=center>
	<tr>
	  <th class='tableHeaderText' colspan=2 height=25>添加招聘信息</th>
	<tr>
	  <td height=23 class='forumRowHighLight'>招聘公司 (必选) </td>
	  <td class='forumRowHighLight'><select name="j_firm" id="j_firm">
<option value="">请选择</option>
<% set rsp=server.createobject("adodb.recordset")
		   sql="select id,name from web_com where [name]<>''"
		   rsp.open(sql),cn,1,1
		   if not rsp.eof and not rsp.bof then
		   do while not rsp.eof 
		   %> <option value="<%=rsp("id")%>">[<%=rsp("id")%>] <%=rsp("name")%></option>
            <%
			rsp.movenext
			loop
			end if
			rsp.close
			set rsp=nothing%></select></td>
	  </tr>
	<tr>
	  <td height=23 class='forumRow'>招聘部门</td>
	  <td class='forumRow'><input name='j_depart' type='text' id='j_depart' size='50'></td>
	  </tr>
	<tr>
	<td width="15%" height=23 class='forumRowHighLight'>招聘职位 (必填) </td>
	<td class='forumRowHighLight'><input name='j_name' type='text' id='j_name' size='50'>
	  &nbsp;</td>
	</tr>
	<tr>
	<td class='forumRow' height=23>工资待遇</td>
    <td class='forumRow'><span class="forumRow">
      <input name='j_salary' type='text' id='j_salary' size='20'>
      元，不填则表示&quot;工资面议&quot;</span></td>
	</tr>
	  <tr>
	    <td class='forumRowHighLight' height=23>招聘人数 </td>
	    <td class='forumRowHighLight'><input name='j_sum' type='text' id='j_sum' size='20'> 不填则表示&quot;人数不限&quot;</td>
      </tr>
	  <tr>
	    <td class='forumRow' height=35>高级选项</td>
	    <td width="85%" class='forumRow'>性别
	      <label>
	      <select name="j_sex" id="j_sex">
	        <option value="不限">不限</option>
	        <option value="男">男</option>
	        <option value="女">女</option>
          </select>
&nbsp;&nbsp; </label> 
        年龄
        <label>
        <select name="j_age" id="j_age">
          <option value="不限" selected>不限</option>
          <option value="22岁以上">22岁以上</option>
          <option value="22-28岁">22-28岁</option>
          <option value="28-35岁">28-35岁</option>
          <option value="35-42岁">35-42岁</option>
          <option value="42-50岁">42-50岁</option>
		  <option value="50岁以上">50岁以上</option>
          <option value="22岁以下">22岁以下</option>
          <option value="28岁以下">28岁以下</option>
          <option value="35岁以下">35岁以下</option>
          <option value="42岁以下">42岁以下</option>
          <option value="50岁以下">50岁以下</option>
        </select>
        </label> 
        &nbsp;&nbsp;&nbsp;学历 
        <label>
        <select name="j_edu" id="j_edu">
          <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>
                                </select>
        </label>
        &nbsp;&nbsp;&nbsp;工作年限
        <label>
        <select name="j_exp" id="j_exp">
          <option value="不限" selected>不限</option>
          <option value="1年">1年</option>
          <option value="2年">2年</option>
          <option value="3年">3年</option>
          <option value="半年以上">半年以上</option>
          <option value="1年以上">1年以上</option>
          <option value="3年以上">3年以上</option>
          <option value="5年以上">5年以上</option>
          <option value="10年以上">10年以上</option>
          <option value="1-3年">1-3年</option>
          <option value="3-5年">3-5年</option>
          <option value="5-8年">5-8年</option>
          <option value="8-10年">8-10年</option>
                                        </select>
        </label></td>
	  </tr>
	  <tr>
	    <td  class='forumRowHighLight' height=35>截止日期</td>
	    <td  class='forumRowHighLight'><!-- #include file="inc/date_time.asp" --></td>
      </tr><tr>
	  <td class='forumRow' height=11>具体要求</td>
	  <td class='forumRow'><textarea name='j_demand'  style='display:none' dataType='Require'  ></textarea>
	  <iframe ID='eWebEditor1' src='editor/ewebeditor.htm?id=j_demand&style=coolblue&originalfilename=d_originalfilename&savefilename=d_savefilename&savepathfilename=d_savepathfilename' frameborder='0' scrolling='no' width='100%' HEIGHT='350'></iframe></td>
	</tr>
	<tr>
	  <td class='forumRowHighLight' height=23>是否显示</td>
	  <td class='forumRowHighLight'><label>
	    <input name="j_view_yes" type="radio" value="1" checked>
      是
      &nbsp;
      <input name="j_view_yes" type="radio" value="0">
      否</label></td>
	</tr>
	<tr>
	  <td class='forumRowHighLight' height=23>是否推荐</td>
	  <td class='forumRowHighLight'><label>
	    <input name="j_index_push" type="radio" value="1" >
      是
      &nbsp;
      <input name="j_index_push" type="radio" value="0" checked>
      否</label></td>
	</tr>	
	<tr><td height="50" colspan=2  class='forumRow'><div align="center">
	  <INPUT type=submit value='提交' onClick='javascript:return checksignup1()' name=Submit>
	  </div></td></tr>
	</table>
</form>

<%
Call DbconnEnd()
 %>