<!--#include file="../conn/conn.asp"-->
<!--#include file="Commoncode.asp"-->
<!--#include file="../person/flagandexpend.asp"-->
<!--#include file="../company/flagandexpend.asp"-->
<%Response.Charset = "GB2312"
On Error Resume Next
SQLin
companyid=Replace(request("companyid"),"'","")
hireid=Replace(request("hireid"),"'","")
resumeid=Replace(request("resumeid"),"'","")
issee=Replace(request("issee"),"'","")
if companyid<>"" then
	'更新访问统计
	if hireid<>"" then
		conn.execute("update JOB_C_hire set hire_visitcount=hire_visitcount+1 where hire_id="&hireid&" and company_id="&companyid&"")
	else
		conn.execute("update JOB_Member set Member_hits=Member_hits+1 where Member_id="&companyid&"")
		pmember_login=CheckStr(Request.Cookies(FRHRCMS)("user_login"))
	end if
	pmember_type=Request.Cookies(FRHRCMS)("user_type")
	if GuestSeeComContact=1 then
		Call ShowHireContact()
	else
		if pmember_login<>"" and pmember_type="pmember" then
			if CheckPFlag("Plimits",10)=True and CheckPFlag("Plimits",11)=True then
				Call ShowHireContact()
			else
				response.write "<font color='#ff0000'>您所在的用户组无权查看联系方式或者您的系统服务已经达到上限!请联系客服中心进行帐号升级!</font>"
			end if
		else
			response.write "<font color='#ff0000'><B>个人会员登录查看联系方式：</B></font>"
			if hireid<>"" then
				response.write "<form name='form1' method='post' action='"&InstallDir&"person/check.asp?link="&InstallDir&"Company/hire.asp?hireid="&hireid&"' onSubmit='return check(this)'>"
			else
				response.write "<form name='form1' method='post' action='"&InstallDir&"person/check.asp?link="&InstallDir&"Company/company.asp?comid="&companyid&"' onSubmit='return check(this)'>"
			end if	
			response.write "<li>用户名：<input name=login id='login' style='FONT-SIZE: 12px; FONT-FAMILY: Verdana' size=18 maxlength=20>&nbsp;&nbsp;&nbsp;&nbsp;密&nbsp;&nbsp;码：<input name=pwd type=password id='pwd' style='FONT-SIZE: 12px; FONT-FAMILY: Verdana' size=18 maxlength=20>&nbsp;&nbsp;&nbsp;<input name=submit type='submit' class='inputs' value='查看联系方式'></li></form>"
			response.write "<li>如果您还没有注册，请这点这里进行注册！<input name=regnow type='button' class='inputs' value='　个人会员注册　' onClick=window.location='"&InstallDir&"Register.asp?Member_type=1'></li>"
		end if
	end if
end if

Sub ShowHireContact()
	if hireid<>"" then
		set rs=conn.execute("select hire_address,hire_post,hire_contact,hire_telshowflag,hire_tel,hire_fax,hire_emailshowflag,hire_email from JOB_C_hire where hire_id="&hireid&" and company_id="&companyid&"")
			if rs.eof then
				response.write "联系方式读取出错!"
			else
				ComHireaddress=rs("hire_address")
				ComHirepost=rs("hire_post")
				ComHirecontact=rs("hire_contact")
				ComHiretelshowflag=rs("hire_telshowflag")
				ComHiretel=rs("hire_tel")
				ComHirefax=rs("hire_fax")
				ComHireemailshowflag=rs("hire_emailshowflag")
				ComHireemail=rs("hire_email")
			end if
		rs.close
		set rs=nothing
	else
	set rs=conn.execute("select Member_address,Member_post,Member_contact,Member_telshowflag,Member_tel,Member_fax,Member_emailshowflag,Member_email from JOB_Member where Member_id="&companyid&"")
		if rs.eof then
			response.write "联系方式读取出错!"
		else
			ComHireaddress=rs("Member_address")
			ComHirepost=rs("Member_post")
			ComHirecontact=rs("Member_contact")
			ComHiretelshowflag=rs("Member_telshowflag")
			ComHiretel=rs("Member_tel")
			ComHirefax=rs("Member_fax")
			ComHireemailshowflag=rs("Member_emailshowflag")
			ComHireemail=rs("Member_email")
		end if
	end if
	if UserSeeContact=1 and issee=0 then
		if hireid<>"" then 
		response.write "<li><font color='#ff0000'>友情提醒：请确定您要查看该职位的联系方式，<a style=""cursor:pointer"" onClick=""Contact("&companyid&","&hireid&",1);"">查看请点这里！</a></font></li>"
		else
		response.write "<font color='#ff0000'>友情提醒：请确定您要查看该企业联系方式，<a style=""cursor:pointer"" onClick=""Contact("&companyid&",1);"">查看请点这里！</a></font>"
		end if
	else
		if ComHireaddress<>"" then response.write "通信地址："&ComHireaddress&"("&ComHirepost&")<br>"
		if ComHirecontact<>"" then response.write "联 系 人："&ComHirecontact&"　　"
		response.write "联系电话："
		if ComHiretelshowflag=0 then
		response.write "（合则约见、谢绝来电）<br>"
		else
		response.write ComHiretel&"<br>"
		end if
		if ComHirefax<>"" then response.write "传　　真："&ComHirefax&"<br>"
		response.write "电子邮件："
		if ComHireemailshowflag=0 then
		response.write "（请通过系统发送应聘意向）<br>"
		else
		response.write ComHireemail
		response.write "<br>注：请在邮件中注明应聘职位的名称或编号，并注明该招聘信息来源于"&SiteName&"。"
		end if
	end if
End Sub

if resumeid<>"" then
	cmember_login=Request.Cookies(FRHRCMS)("user_login")
	cmember_type=Request.Cookies(FRHRCMS)("user_type")
	conn.execute("update job_p_resume set resume_visitnum=resume_visitnum+1 where resume_id="&resumeid&"")
	'记录简历被浏览
	set rs=conn.execute("select resume_pmember,resume_name,resume_sex,resume_birth,resume_edu,resume_tel,resume_chat,resume_email,resume_url,resume_address,resume_post from job_p_resume where resume_id="&resumeid&"")
		if rs.eof then
			response.write "联系方式读取出错!"
		else
			PerResumetel=rs("resume_tel")
			PerResumechat=rs("resume_chat")
			PerResumeemail=rs("resume_email")
			PerResumeurl=rs("resume_url")
			PerResumeaddress=rs("resume_address")
			PerResumepost=rs("resume_post")
			PerMemberlogin=rs("resume_pmember")
			PerResumename=rs("resume_name")
			PerResumesex=rs("resume_sex")
			PerResumebirth=rs("resume_birth")
			PerResumeedu=rs("resume_edu")
		end if
	set rs=nothing
	member_login=Request.Cookies(FRHRCMS)("user_login")
	member_name=Request.Cookies(FRHRCMS)("user_name")
	if member_login="" then
		member_login="访客"
		member_name="访客"
	end if
	sql="Insert into JOB_P_resumehistory(resume_id,resume_pmember,member_login,brower_time,member_name) values('"&resumeid&"','"&PerMemberlogin&"','"&member_login&"','"&now()&"','"&member_name&"')"
	conn.execute(sql)
	if GuestSeePerContact=1 then
		if PerResumetel<>"" then response.write "联系电话："&PerResumetel&"<br>"
		if PerResumechat<>"" then response.write "聊天号码："&PerResumechat&"<br>"
		if PerResumeemail<>"" then response.write "电子邮件："&PerResumeemail&"<br>"
		if PerResumeurl<>"" then response.write "个人主页："&PerResumeurl&"<br>"
		if PerResumeaddress<>"" then response.write "联系地址："&PerResumeaddress&"("&PerResumepost&")"
		response.write "<br><input name='Submit' type='button' class='inputs' value='发送面试邀请' onClick=window.open('"&InstallDir&"company/company_interviewsend.asp?action=resume&checks="&resumeid&"')>&nbsp;<input name='Submit2' type='button' class='inputs' value='放入人才库' onClick=window.open('"&InstallDir&"company/company_myexpertadd.asp?checks="&resumeid&"')>&nbsp;<input name='Submit3' type='button' class='inputs' value='打印简历' onClick='window.print();'>&nbsp;<input name='Submit32' type='button' class='inputs' value='关闭窗口' onClick='window.close();'>"
	else
		if cmember_login<>"" and cmember_type="cmember" then
			if Cmflag=0 then
				response.write "<font color='#ff0000'>您的帐号还没有通过审核，无权查看联系方式!请联系客服中心进行帐号审核!</font>"
				response.End()
			end if
			set isdrs=conn.execute("select * from JOB_C_myexpert where myexpert_cmember='"&cmember_login&"' and myexpert_resumeid="&resumeid&" and myexpert_down=1")
			if isdrs.eof then
				if CheckCFlag("Climits",8)=False then
					response.write "<font color='#ff0000'>您现在所购买的服务无权查看联系方式!请联系客服中心进行帐号升级!</font>"
				else
					if UserSeeContact=1 and issee=0 then
					response.write "<li><font color='#ff0000'>友情提醒：如果该人才符合贵公司招聘要求，请点击<a style=""cursor:pointer"" onClick=""Contact("&resumeid&",1);"">这里查看此简历联系方式！</a></font></li>"
					else
						If CheckCFlag("Climits",9)=False then
							If CheckCFlag("Cdianshus",4)=False then
							response.write "<font color='#ff0000'>您的下载简历数达到最大限制（或无可用点数），暂不能继续查看，如需继续查看简历联系方式请联系网站客服进行升级！</font>"
							else
								conn.execute("update job_Member set Member_contactnums=Member_contactnums+1 where member_login='"&cmember_login&"'")
								Call ComAddDown()  '下载简历
								Call PerContact()  '输出联系方式
								Call PayLog(cmember_login,2,"下载"&PerMemberlogin&"的简历扣点",Group_Cdianshus(4),0)
							end if
						else
							conn.execute("update job_Member set Member_contactnums=Member_contactnums+1,Member_contactnum=Member_contactnum-1 where member_login='"&cmember_login&"'")
							Call ComAddDown()  '下载简历
							Call PerContact()  '输出联系方式
							Call PayLog(cmember_login,2,"下载"&PerMemberlogin&"的简历",0,0)
						end if
					end if
				end if
			else
				Call PerContact()  '输出联系方式
			end if
			set isdrs=nothing
			response.write "<li><input name='Submit' type='button' class='inputs' value='发送面试邀请' onClick=window.open('"&InstallDir&"company/company_interviewsend.asp?action=resume&checks="&resumeid&"')>&nbsp;<input name='Submit2' type='button' class='inputs' value='放入人才库' onClick=window.open('"&InstallDir&"company/company_myexpertadd.asp?checks="&resumeid&"')></li>"
		else
		response.write "<font color='#ff0000'><B>企业会员登录查看联系方式：</B></font>"
		response.write "<form name='form1' method='post' action='"&InstallDir&"company/check.asp?link="&InstallDir&"person/cnresume_view.asp?rid="&resumeid&"' onsubmit='return check(this)'><li>用户名：<input name='login' id='login' style='FONT-SIZE: 12px; FONT-FAMILY: Verdana' size=18 maxlength=20>&nbsp;&nbsp;&nbsp;&nbsp;密&nbsp;&nbsp;码：<input name=pwd type=password id='pwd' style='FONT-SIZE: 12px; FONT-FAMILY: Verdana' size=18 maxlength=20>&nbsp;&nbsp;&nbsp;<input name=submit type='submit' class='inputs' value='查看联系方式'></li></form>"
		response.write "<li>如果您还没有注册，请这点这里进行注册！<input name=regnow type='button' class='inputa2' value='　企业会员注册　' onClick=window.location='"&InstallDir&"Register.asp?Member_type=2'></li>"
		end if
	end if
end if
Sub ComAddDown()
set drs=conn.execute("select * from JOB_C_myexpert where myexpert_cmember='"&cmember_login&"' and myexpert_resumeid="&resumeid&"")
if not drs.eof then
	if drs("myexpert_down")<>1 then
	conn.execute("update JOB_C_myexpert set myexpert_down=1,myexpert_downdate='"&now()&"' where myexpert_cmember='"&cmember_login&"' and myexpert_resumeid="&resumeid&"")
	end if
else
conn.execute("Insert into JOB_C_myexpert (myexpert_resumeid,myexpert_name,myexpert_sex,myexpert_birth,myexpert_edu,myexpert_cmember,myexpert_pmember,myexpert_date,myexpert_down,myexpert_downdate) values('"&resumeid&"','"&PerResumename&"','"&PerResumesex&"','"&PerResumebirth&"','"&PerResumeedu&"','"&cmember_login&"','"&PerMemberlogin&"','"&now()&"',1,'"&now()&"')")
end if
set drs=Nothing 
End Sub
Sub PerContact()
response.write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""4"">"
if PerResumetel<>"" then response.write "<tr><td width=""80"" align=""right"">联系电话：</td><td>"&PerResumetel&"</td></tr>"
if PerResumechat<>"" then response.write "<tr><td width=""80"" align=""right"">聊天号码：</td><td>"&PerResumechat&"</td></tr>"
if PerResumeemail<>"" then response.write "<tr><td width=""80"" align=""right"">电子邮件：</td><td>"&PerResumeemail&"</td></tr>"
if PerResumeurl<>"" then response.write "<tr><td width=""80"" align=""right"">个人主页：</td><td>"&PerResumeurl&"</td></tr>"
if PerResumeaddress<>"" then response.write "<tr><td width=""80"" align=""right"">联系地址：</td><td>"&PerResumeaddress&"("&PerResumepost&")</td></tr>"
response.write "</table>"
end sub
CloseConn
%>