<!-- #include file="Conn.asp" -->
<!--#include file="Comm/Site_Class.asp" -->
<%
Response.Expires = -1 
Response.ExpiresAbsolute = Now() - 1 
Response.cachecontrol = "no-cache"

If Session("PerId") = "" Or Session("UserType") <> "Person" Then
	strMsg = "只有个人用户才能进行此操作，请先登录"
Else

	Set Qsite = New Site_Class

	Qsite.SiteConfig()
	Qsite.GotoErrPage()
	Qsite.arrMember = Qsite.Member_Info()

	Dim Rs,ComId,RecruitId,strMsg,thisDate
	Dim SendFlag
	Dim Fso,objFile
	Dim SendMail_ToMail,SendMail_Subject,SendMail_MailBody
	Dim ComMemType,PageContent
	
	thisDate = Qsite.FormatDate(Now())
	SendFlag = False

	ComId = Trim(Request.QueryString("ComId"))
	RecruitId = Trim(Request.QueryString("RecruitId"))

	If ComId = "" Or IsNull(ComId) Or Not IsNumeric(ComId) Or RecruitId = "" Or IsNull(RecruitId) Or Not IsNumeric(RecruitId) Then
		strMsg = "请先选择要应聘的职位"
	Else
		Set Rs = Conn.Execute("select * from CompanyBoxTbl where ComId = "& ComId &" and PerId = "& Session("PerId") &" and RecruitId = "& RecruitId)
		If Not Rs.Eof Then
			If Qsite.FormatDate(FormatDateTime(Rs("SendDate") , 2)) = Qsite.FormatDate(FormatDateTime(thisDate , 2)) Then
					strMsg = "一天内向同一职位只能发送一次简历"
			Else
				Conn.Execute("insert into CompanyBoxTbl (ComId , PerId , RecruitId , SendDate , IsRead) values ("& ComId &" , "& Session("PerId") &" , "& RecruitId &" , '"& thisDate &"' , '0')")
			
				Conn.Execute("insert into PersonSendBoxTbl (ComId , PerId , RecruitId , SendDate) values ("& ComId &" , "& Session("PerId") &" , "& RecruitId &" , '"& thisDate &"')")
			
				strMsg = "操作成功，已成功发送应聘简历！\n\n为增加求职成功几率，请在投递简历后及时通过电话与招聘企业沟通，使招聘企业加深对您的印象。"
				SendFlag = True
			End If
		Else
			Conn.Execute("insert into CompanyBoxTbl (ComId , PerId , RecruitId , SendDate , IsRead) values ("& ComId &" , "& Session("PerId") &" , "& RecruitId &" , '"& thisDate &"' , '0')")
			
			Conn.Execute("insert into PersonSendBoxTbl (ComId , PerId , RecruitId , SendDate) values ("& ComId &" , "& Session("PerId") &" , "& RecruitId &" , '"& thisDate &"')")
		
			strMsg = "操作成功，已成功发送应聘简历！\n\n为增加求职成功几率，请在投递简历后及时通过电话与招聘企业沟通，使招聘企业加深对您的印象。"
			SendFlag = True
		End If
		Set Rs = Nothing
	End If
End If
%>
<script language="javascript">
	alert("<%=strMsg%>");
	window.close();
</script>