<!--#include file="../Conn.asp" -->
<!--#include file="../Comm/Site_Class.asp" -->
<%
Dim strMenu,PageTitle
strMenu = ""
PagePath = "../"

Set Qsite = New Site_Class

Qsite.SiteConfig()
Qsite.GotoErrPage()

PageTitle = Qsite.SiteName & " - 企业会员管理中心"

Qsite.Nav_Company()

Qsite.arrMember = Qsite.Member_Info()
%>
<!--#include file="Check_Login.asp" -->
<%
Dim Rs,Rs2,i,ThisYear,ThisMonth,ThisDay,selYear,selMonth,selDay
Dim JobType,Position_b,Position_s,JobName,Quantity,Salary
Dim ValidityYear,ValidityMonth,ValidityDay,Province,City,County
Dim Qualification,WorkExp,Sex,AgeBegin,AgeEnd,JobNote
Dim ValidityDate
Dim strDate,strYear,strMonth,strDay
Dim JobQuantity,JobFlag
Dim IsLock
Dim contProvince,contCity,contCounty,leaveWord

Set Rs = server.CreateObject("ADODB.recordset")
Set Rs2 = server.CreateObject("ADODB.recordset")

JobQuantity = Conn.Execute("select count(RecruitId) as JobQuantity from RecruitTbl where ComId = "& Session("ComId"))
JobQuantity = JobQuantity("JobQuantity")

leaveWord   =   request.Form( "JobName") 
if   Instr(leaveWord, "◆◆◆")> 0   then 
        response.write( "您的公司简介里含有本站不允许出现的文字，如有疑问请致电我们:0512-69937211！ ") 
response.End() 
    end   if 
	
if   Instr(leaveWord, "男女公关")> 0   then 
        response.write( "您的公司简介里含有本站不允许出现的文字，如有疑问请致电我们:0512-69937211！ ") 
response.End() 
    end   if 
if   Instr(leaveWord, "贵宾服务生")> 0   then 
        response.write( "您的公司简介里含有本站不允许出现的文字，如有疑问请致电我们:0512-69937211！ ") 
response.End() 
    end   if 
if   Instr(leaveWord, "DJ公主")> 0   then 
        response.write( "您的公司简介里含有本站不允许出现的文字，如有疑问请致电我们:0512-69937211！ ") 
response.End() 
    end   if 
	if   Instr(leaveWord, "◆◆")> 0   then 
        response.write( "您的公司简介里含有本站不允许出现的文字，如有疑问请致电我们:0512-69937211！ ") 
response.End() 
    end   if 
if   Instr(leaveWord, "KTV服务员")> 0   then 
        response.write( "您的公司简介里含有本站不允许出现的文字，如有疑问请致电我们:0512-69937211！ ") 
response.End() 
    end   if 
	if   Instr(leaveWord, "夜场兼职")> 0   then 
        response.write( "您的公司简介里含有本站不允许出现的文字，如有疑问请致电我们:0512-69937211！ ") 
response.End() 
    end   if 
if   Instr(leaveWord, "商务陪同")> 0   then 
        response.write( "您的公司简介里含有本站不允许出现的文字，如有疑问请致电我们:0512-69937211！ ") 
response.End() 
    end   if 
	
If Cint(JobQuantity) >= Cint(Qsite.arrMember(3 , Session("MemberType"))) Then
	JobFlag = False
Else
	JobFlag = True
End If

Rs.Open "select * from CompanyTbl where ComId = "& Session("ComId") , Conn , 1 , 1
If Rs.Eof Then
	IsLock = "1"
Else
	IsLock = Rs("IsLock")
End If
Rs.Close

If Request.Form <> "" And JobFlag = True And IsLock = "0" Then
	JobType = Qsite.chgStr(Trim(Request.Form("JobType")))
	Position_b = Qsite.chgStr(Trim(Request.Form("Position_b")))
	Position_s = Qsite.chgStr(Trim(Request.Form("Position_s")))
	JobName = Qsite.chgStr(Trim(Request.Form("JobName")))
	Quantity = Qsite.chgStr(Trim(Request.Form("Quantity")))
	Salary = Qsite.chgStr(Trim(Request.Form("Salary")))
	ValidityYear = Qsite.chgStr(Trim(Request.Form("ValidityYear")))
	ValidityMonth = Qsite.chgStr(Trim(Request.Form("ValidityMonth")))
	ValidityDay = Qsite.chgStr(Trim(Request.Form("ValidityDay")))
	Province = Qsite.chgStr(Trim(Request.Form("Province")))
	City = Qsite.chgStr(Trim(Request.Form("City")))
	County = Qsite.chgStr(Trim(Request.Form("County")))
	Qualification = Qsite.chgStr(Trim(Request.Form("Qualification")))
	WorkExp = Qsite.chgStr(Trim(Request.Form("WorkExp")))
	Sex = Qsite.chgStr(Trim(Request.Form("Sex")))
	AgeBegin = Qsite.chgStr(Trim(Request.Form("AgeBegin")))
	AgeEnd = Qsite.chgStr(Trim(Request.Form("AgeEnd")))
	JobNote = Qsite.chgStr(Trim(Request.Form("JobNote")))

	If JobType = "" Or IsNull(JobType) Then
		Qsite.ShowMsg "请选择职位类型" , ""
	End If
	If Position_b = "" Or IsNull(Position_b) Or Position_s = "" Or IsNull(Position_s) Then
		Qsite.ShowMsg "请选择职位类别" , ""
	End If
	If JobName = "" Or IsNull(JobName) Then
		Qsite.ShowMsg "请输入职位名称" , ""
	End If
	If Quantity = "" Or IsNull(Quantity) Or Not IsNumeric(Quantity) Then
		Qsite.ShowMsg "请输入招聘人数，只能输入数字，0表示若干人" , ""
	End If
	If Salary = "" Or IsNull(Salary) Or Not IsNumeric(Salary) Then
		Qsite.ShowMsg "请输入薪资待遇，只能输入数字，0表示面议" , ""
	End If
	
	strDate = Date()
	strYear = Year(strDate)
	strMonth = Month(strDate)
	strDay = Day(strDate)
	If ValidityYear < strYear Then
		Qsite.ShowMsg "截止日期不能是过去时间" , ""
	End If
	If ValidityYear = strYear And ValidityMonth < strMonth Then
		Qsite.ShowMsg "截止日期不能是过去时间" , ""
	End If
	If ValidityYear = strYear And ValidityMonth = strMonth And ValidityDay < strDay Then
		Qsite.ShowMsg "截止日期不能是过去时间" , ""
	End If
	
	If Province = "" Or IsNull(Province) Or City = "" Or IsNull(City) Then
		Qsite.ShowMsg "请选择工作地区" , ""
	End If
	
	If Qualification = "" Or IsNull(Qualification) Then
		Qsite.ShowMsg "请选择学历要求" , ""
	End If
	If WorkExp = "" Or IsNull(WorkExp) Then
		Qsite.ShowMsg "请选择工作经验" , ""
	End If
	If Sex = "" Or IsNull(Sex) Then
		Qsite.ShowMsg "请选择性别要求" , ""
	End If
	If AgeBegin <> "不限" And AgeEnd <> "不限" And AgeBegin > AgeEnd Then
		Qsite.ShowMsg "年龄要求中，开始年龄不能大于结束年龄" , ""
	End If
	If JobNote = "" Or IsNull(JobNote) Then
		Qsite.ShowMsg "请输入具体说明" , ""
	End If
	
	ValidityDate = ValidityYear & "-" & ValidityMonth & "-" & ValidityDay
	
	If Not IsDate(ValidityDate) Then
		Qsite.ShowMsg "输入的日期不是有效日期" , ""
	End If
	
	Rs.Open "select * from RecruitTbl where (RecruitId is null)" , Conn , 3 , 2
		Rs.AddNew
		Rs("JobType") = JobType
		Rs("Position_b") = Position_b
		Rs("Position_s") = Position_s
		Rs("JobName") = JobName
		Rs("Quantity") = Quantity
		Rs("Salary") = Salary
		Rs("ValidityDate") = Qsite.FormatDate(ValidityDate)
		Rs("Province") = Province
		Rs("City") = City
		Rs("County") = County
		Rs("Qualification") = Qualification
		Rs("WorkExp") = WorkExp
		Rs("Sex") = Sex
		Rs("AgeBegin") = AgeBegin
		Rs("AgeEnd") = AgeEnd
		Rs("JobNote") = JobNote
		Rs("AddDate") = Qsite.FormatDate(Now())
		Rs("EditDate") = Qsite.FormatDate(Now())
		Rs("ComId") = Session("ComId")
		Rs("IsPause") = "0"
		Rs.Update
	Rs.Close
	
	Conn.Execute("update CompanyTbl set EditDate = '"& Qsite.FormatDate(Now()) &"' where ComId = "& Session("ComId"))
	
	Qsite.ShowMsg "职位发布成功" , "Job_Manage.asp"
	
End If

Rs.Open "select * from CompanyTbl where ComId = "& Session("ComId") &" and UserName = '"& Session("UserName") &"'" , Conn , 1 , 1
If Rs.Eof Then
	Qsite.ShowMsg "请不要提交非法参数" , "../Index.asp"
Else
	contProvince = Rs("CompanyLocation_Province")
	contCity = Rs("CompanyLocation_City")
	contCounty = Rs("CompanyLocation_County")
End If
Rs.Close
%>
<table width="974" height="413" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr> 
        <td width="181" valign="top"> 
<!--#include file="Left_Menu.asp" -->
         </td>
        <td width="793" align="left" valign="top">
<%
If IsLock = "1" Then
%>
		<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" >

			<tr>
	<td style="padding-bottom:20px; padding-left:50px; padding-right:50px; padding-top:20px; line-height:25px;">&nbsp;&nbsp;&nbsp;&nbsp;您的帐号目前处于锁定状态，暂时无法发布招聘信息，锁定原因可能是您的资料不正确或者您发布的信息不符合本网站的规定。请正确修改您的资料及您发布的信息，我们的管理员会在您修改后重新审核您的帐号。<br />
					&nbsp;&nbsp;&nbsp;&nbsp;如有疑问，请咨询我们的客服人员。</td>
			</tr>
		</table>
<%
ElseIf JobFlag = False Then
%>
		<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" >
 
			<tr>
				<td style="padding-bottom:20px; padding-left:50px; padding-right:50px; padding-top:20px;">您发布的职位已达到当前会员类型的职位上限，请联系我们的管理员升级您的帐号，或删除过期职位再发布！</td>
			</tr>
		</table>
<%
Else
%>
<script language="javascript" src="../Comm/Job_All.js"></script>
<script language="javascript" src="../Comm/Job_Function.js"></script>
<script language="javascript" src="../Comm/Area_All.js"></script>
<script language="javascript" src="../Comm/Area_Function.js"></script>
<script language="javascript" src="../Comm/Comm.js"></script>
<script language="javascript">
	function CheckForm()
	{
		if(JobForm.JobType[0].checked == false && JobForm.JobType[1].checked == false && JobForm.JobType[2].checked == false)
		{
			alert("请选择职位类型");
			return false;
		}
		if(JobForm.Position_b.value == "")
		{
			alert("请选择工作职能");
			return false;
		}
		if(JobForm.Position_s.value == "")
		{
			alert("请选择工作职位");
			return false;
		}
		if(!checkLength("JobName" , "职位名称" , 1 , 100))
			return false;
		if(!checkLength("Quantity" , "招聘人数" , 1 , 10))
			return false;
		if(!checkInteger("Quantity" , "招聘人数" , 0 , "*"))
			return false;
		if(!checkLength("Salary" , "薪资待遇" , 1 , 10))
			return false;
		if(!checkInteger("Salary" , "薪资待遇" , 0 , "*"))
			return false;
		var strDate = new Date();
		var strYear = strDate.getYear();
		var strMonth = strDate.getMonth() + 1;
		var strDay = strDate.getDate();
		if(JobForm.ValidityYear.value < strYear)
		{
			alert("截止日期不能是过去时间");
			return false;
		}
		if(JobForm.ValidityYear.value == strYear && JobForm.ValidityMonth.value < strMonth)
		{
			alert("截止日期不能是过去时间");
			return false;
		}
		if(JobForm.ValidityYear.value == strYear && JobForm.ValidityMonth.value == strMonth && JobForm.ValidityDay.value < strDay)
		{
			alert("截止日期不能是过去时间");
			return false;
		}
		if(JobForm.Province.value == "")
		{
			alert("请选择工作地区");
			return false;
		}
		if(JobForm.City.value == "")
		{
			alert("请选择工作地区");
			return false;
		}
		if(JobForm.AgeBegin.value != "不限" && JobForm.AgeEnd.value != "不限" && JobForm.AgeBegin.value > JobForm.AgeEnd.value)
		{
			alert("年龄要求中，开始年龄不能大于结束年龄");
			return false;
		}
		if(!checkLength("JobNote" , "具体要求" , 1 , 1000))
			return false;
		return true;
	}
</script>
 <table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="26" background="../images/Member_Center_r7_c8.jpg"><table width="768" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="60">&nbsp;</td>
                    <td width="708"><span style="font-size:14px;color:#FF7706"><b>招聘职位发布</b></span><span style="font-size:14px;color:#333333"> 
                      <strong>Add Jobs</strong></span></td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td height="136" align="left" valign="top" background="../images/Member_Center_r10_c8.jpg" style="padding-top:5px;padding-left:10px;padding-right:10px;padding-bottom:5px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td width="100%" height="23"><img src="../images/ico_2.gif" width="15" height="12" align="absmiddle" />友情提示：请尽量详细填写招聘要求！</td>
                  </tr>
                </table>
                <table width="100%" height="7" border="0" cellpadding="0" cellspacing="0">
                  <tr height="1">
                    <td background="../images/ico_point.gif"></td>
                  </tr>
				  <tr height="6">
                    <td></td>
                  </tr>
                </table>
							<form id="JobForm" name="JobForm" method="post" action="Job_Add.asp" style="margin:0" onsubmit="return CheckForm();">
								<table width="82%" align=center border="0" cellpadding="5" cellspacing="3">
									<tr>
										<td width="13%" height="25" ><font color="#FF0000">*</font>职位类型：</td>
										<td width="87%" height="25" ><input name="JobType" type="radio" value="全职" checked="checked" />
											全职
											<input type="radio" name="JobType" value="兼职" />
											兼职
											<input type="radio" name="JobType" value="全职、兼职均可" />
										全职、兼职均可</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>职位类别：</td>
										<td height="25" ><select name="Position_b"  id="Position_b" onchange="SelectChange('Position_s' , document.all.Position_b.options[document.all.Position_b.selectedIndex].value , arrPosition_b , arrPosition_s);">
												<option value="">-请选择职位大类-</option>
											</select>
												<select name="Position_s"  id="Position_s">
													<option value="">-请选择职位小类-</option>
												</select>
										</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>职位名称：</td>
										<td height="25" ><input name="JobName" type="text"  id="JobName" /></td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>招聘人数：</td>
										<td height="25" ><input name="Quantity" type="text"  id="Quantity" value="0" />
											人（0表示若干人）</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>薪资待遇：</td>
										<td height="25" ><input name="Salary" type="text"  id="Salary" value="0" />
											元/月（0表示面议）</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>截止日期：</td>
										<%
ThisYear = Year(Date())
selMonth = Month(Date())
selDay = Day(Date())
selMonth = selMonth + 3
If selMonth > 12 Then
	selYear = ThisYear + 1
	selMonth = selMonth - 12
Else
	selYear = Thisyear
End If

If selDay > 28 Then selDay = 28
%>
										<td height="25" ><select name="ValidityYear"  id="ValidityYear">
												<%
												For i = ThisYear To ThisYear + 10
													Response.Write("<option value="""& i &""" ")
													If Cint(i) = Cint(selYear) Then Response.Write(" selected")
													Response.Write(">"& i &"</option>")
												Next
												%>
											</select>
											年
											<select name="ValidityMonth"  id="ValidityMonth">
												<%
													For i = 1 To 12
														Response.Write("<option value="""& i &""" ")
														If Cint(i) = Cint(selMonth) Then Response.Write(" selected")
														Response.Write(">"& i &"</option>")
													Next
													%>
											</select>
											月
											<select name="ValidityDay"  id="ValidityDay">
												<%
													For i = 1 To 31
														Response.Write("<option value="""& i &""" ")
														If Cint(i) = Cint(selDay) Then Response.Write(" selected")
														Response.Write(">"& i &"</option>")
													Next
													%>
											</select>
											日 </td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>工作地区：</td>
										<td height="25" ><select name="Province"  id="Province" onchange="SelChgCity('City' , document.all.Province.options[document.all.Province.selectedIndex].value , arrProvince , arrCity , 'County');">
											</select>
												<select name="City"  id="City" onchange="SelChgCounty('County' , document.all.City.options[document.all.City.selectedIndex].value , arrCity , arrCounty);">
												</select>
												<select name="County"  id="County">
												</select>
										</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>学历要求：</td>
										<td height="25" ><select name="Qualification"  id="Qualification">
												<option value="不限" selected="selected">不限</option>
												<%
						Rs.Open "select * from QualificationTbl order by QualificationId asc" , Conn , 1 , 1
						Do While Not Rs.Eof
							Response.Write("<option value="""& Rs("QualificationName") &""">"& Rs("QualificationName") &"</option>")
						Rs.MoveNext
						Loop
						Rs.Close
						%>
											</select>
										</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>工作经验：</td>
										<td height="25" ><select name="WorkExp"  id="WorkExp">
												<option value="不限" selected="selected">不限</option>
												<%
												Rs.Open "select * from WorkExpSelTbl order by WorkExpSelId asc" , Conn , 1 , 1
												Do While Not Rs.Eof
													Response.Write("<option value="""& Rs("WorkExpSelName") &""">"& Rs("WorkExpSelName") &"</option>")
												Rs.MoveNext
												Loop
												Rs.Close
												%>
											</select>
										</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>性别要求：</td>
										<td height="25" ><select name="Sex"  id="Sex">
												<option value="不限" selected="selected">不限</option>
												<option value="男">男</option>
												<option value="女">女</option>
											</select>
										</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>年龄要求：</td>
										<td height="25" ><select name="AgeBegin"  id="AgeBegin">
												<option value="不限">不限</option>
												<%
												For i = 18 To 60
													Response.Write("<option value="""& i &""">"& i &"</option>")
												Next
												%>
											</select>
											至
											<select name="AgeEnd"  id="AgeEnd">
												<option value="不限">不限</option>
												<%
												For i = 18 To 60
													Response.Write("<option value="""& i &""">"& i &"</option>")
												Next
												%>
											</select>
										</td>
									</tr>
									<tr>
										<td height="25" ><font color="#FF0000">*</font>具体要求：</td>
										<td height="25" ><textarea name="JobNote" cols="60" rows="8"  id="JobNote"></textarea></td>
									</tr>
									<tr>
										<td height="25">&nbsp;</td>
										<td height="25"><input type="submit" name="Submit" value=" 添  加 " />
											&nbsp;
											<input type="reset" name="Submit" value=" 重  置 " /></td>
									</tr>
								</table>
							</form> 
<script language="javascript">
	InitPosition("Position_b" , "Position_s" , arrPosition_b , arrPosition_s , "" , "")
	InitArea("Province" , "City" , "County" , arrProvince , arrCity , arrCounty , "<%=contProvince%>" , "<%=contCity%>" , "<%=contCounty%>")
</script>
<%
End If
%> <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0">
                  <tr height="1">  
                    <td background="../images/ico_point.gif"></td>
                  </tr>
                </table></td>
            </tr>
            <tr height="14">
              <td height="14" background="../images/Member_Center_r18_c8.jpg"></td>
            </tr>
          </table></td>
      </tr>
    </table>
 
<table width="974" height="8" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr height="8">
        <td height="8"></td>
      </tr>
    </table>
<%
Qsite.Bottom()
%>