<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/Commoncode.asp"-->
<!--#include file="../inc/CommonFunction.asp"-->
<!--#include file="../inc/sendmail.asp" -->
<%link="company_interview.asp"%>
<!--#include file="checkcmember.asp" -->
<%
if trim(request("step"))="2" then
 checks=trim(request("checks"))
 subject=CheckStr(trim(request("subject")))
 content=CheckStrbox(trim(request("content")))
 set rs=Server.CreateObject("Adodb.Recordset")
 sql="select member_email,member_name from JOB_member where member_login='"&cmember_login&"'"
 rs.open sql,conn,1,1
  cemail=rs("member_email")
  comname=rs("member_name")
 rs.close
 person=split(checks,",")
 conn.begintrans
  for i=0 to ubound(person)
   id=trim(person(i))
   sql="select myreceive_hireid,myreceive_resumeid,myreceive_lang,myreceive_name,myreceive_pmember from job_c_myreceive where myreceive_id='"&id&"'"
   rs.open sql,conn,1,1
    hireid=rs("myreceive_hireid")
	resumeid=rs("myreceive_resumeid")
	lang=rs("myreceive_lang")
	name=rs("myreceive_name")
	pmember=rs("myreceive_pmember")
   rs.close
   '把工作申请记录中相应信息的回复标志置1
   conn.execute("update job_p_mysend set mysend_response=1 where mysend_hireid="&hireid&" and mysend_pmember='"&pmember&"'")
   sql="select resume_email,resume_enemail from resume where resume_id='"&resumeid&"'" '取简历的EMAIL
    rs.open sql,conn,1,1
	if lang="1" then
	 pemail=rs("resume_enemail")
	else
     pemail=rs("resume_email")
	end if 
    rs.close
	'发送邮件
    Set fs = CreateObject("Scripting.FileSystemObject")
    ForReading = 1
    '以只读模式打开文件。不能对此文件进行写操作。
    ForAppending = 8
    '打开文件并在文件末尾进行写操作。
    TristateUseDefault = -2
    TristateTrue = -1
    TristateFalse = 0
    '-----------取模板开始--------
    servermap=server.MapPath("../moban/")
    '映射系统物理路径
    temp=servermap&"\"&"response_send.htm"
    Set ss=fs.OpenTextFile(temp,ForReading,true)
    pencat=ss.Readall
    ss.Close
    set ss=nothing
    set fs=nothing
    pencat=replace(pencat,"<!--pmember_name-->",name)
    pencat=replace(pencat,"<!--comname-->",comname)
    pencat=replace(pencat,"<!--hire_id-->",hireid)
	pencat=replace(pencat,"<!--introduce-->",content)
    call sendmail(cemail,SiteName,subject,pencat,pemail)
   next
   conn.committrans
   set rs=nothing
 response.write("<script language=javascript>alert('您的简历回复已成功发送到求职者的邮箱！');location.href='javascript:window.close()';</script>")
 response.end
end if%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>发送面试邀请-企业招聘管理中心-<%=SiteTitle%></title>
<link href="../member/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/input.js"></script>
<script language="JavaScript">
<!--
 //功能：去掉字符串前后空格
//返回值：去掉空格后的字符串
function fnRemoveBrank(strSource)
{
 return strSource.replace(/^\s*/,'').replace(/\s*$/,'');
}
function Juge(theForm)
{
  if (fnRemoveBrank(theForm.subject.value) == "")
  {
    alert("请输入邮件主题!");
	theForm.subject.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.content.value) == "")
  {
    alert("请输入邮件内容!");
	theForm.content.focus();
    return (false);
  }
 }
//-->
</script></head>
<body>
<center>
<div id="head">
<div id="logo"><img src="<%=SiteUrl&InstallDir&LogoUrl%>" alt="欢迎访问<%=SiteName%>" /></div>
<div id="banner"><%Call Loginshow()%></div>
<ul><%Call Membernav(2)%></ul>
</div>
<%Call Cmembermenu(3)%>
<div class="maintaba">
<span class="maintit">发送面试邀请</span>
        <%
 checks=trim(request("checks"))
 set rst=server.createobject("adodb.recordset")
%>
        <br class="br">
        <table width="98%" height="26" border="0" align="center" cellpadding="3" cellspacing="0">
          <tbody>
            <tr>
              <td><img height="11" hspace="4"  src="../person/images/biao_01.gif" width="12"  align="absmiddle" /><span class="tit" style="font-size:14px"><strong>您要回复简历的人才如下：</strong></span></td>
              <td>&nbsp;</td>
            </tr>
          </tbody>
        </table>
        <table width="98%" height="28" 
                  border="0" align="center" cellpadding="3" cellspacing="3">
          <tbody>
            <tr bgcolor="#0099CC">
              <td align="center"><font color="#FFFFFF" style="font-size:14px"><b>姓 
                名</b></font></td>
              <td align="center"><font color="#FFFFFF" style="font-size:14px"><strong>性 
                别</strong></font></td>
              <td align="center"><font color="#FFFFFF" style="font-size:14px"><strong>年 
                龄</strong></font></td>
              <td align="center"><font color="#FFFFFF" style="font-size:14px"><strong>学 
                历</strong></font></td>
            </tr>
            <%
					  myreceive=split(checks,",")
                      for i=0 to ubound(myreceive)
                       id=trim(myreceive(i))
					   sql="select * from job_c_myreceive where myreceive_id="&id&""
					   rst.open sql,conn,1,1
					   response.write "<TR>"
					   response.write "<TD align=center><a href='"
					   if rst("myreceive_lang")="1" then
					    response.write "../person/enresume_view.asp"
					   else
					    response.write "../person/cnresume_view.asp"
					   end if
					   response.write "?rid="&rst("myreceive_resumeid")&"' target='_blank'>"&rst("myreceive_name")&"</a></TD>"
					   response.write "<TD align=center>"
					   select case rst("myreceive_sex")
					    case 1 
					     response.write "男" 
					    case 2
					     response.write "女" 
					   end select
					   response.write "</TD>"
					   response.write "<TD align=center>"&year(date())-year(rst("myreceive_birth"))&"</TD>"
					   response.write "<TD align=center>"&rst("edu_name")&"</TD>"
					   response.write "</TR>"
					   rst.close
					  next
					%>
          </tbody>
        </table>
        <br />
        <br />
        <table cellspacing="0" cellpadding="3" width="98%" align="center" 
                  border="0">
          <tbody>
            <tr>
              <td><img height="11" hspace="4"  src="../person/images/biao_01.gif" width="12"  align="absmiddle" /><span class="tit" style="font-size:14px"><strong>填写简历回复</strong></span></td>
            </tr>
          </tbody>
        </table>
        <%
         sql="select company_rsubject,company_rcontent from job_c_company where company_cmember='"&cmember_login&"'"
         rst.open sql,conn,1,1
        %>
        <table cellspacing="3" cellpadding="7" width="98%" align="center" border="0">
          <form action="response_send.asp?checks=<%=checks%>&amp;step=2" method="post" name="form1" id="form1" onsubmit="return Juge(this)">
            <tr>
              <td width="22%" height="33" bgcolor="#efefef"><div align="center">邮件主题：</div></td>
              <td width="78%" bgcolor="#efefef"><input name="subject" type="text" size="50" value="<%=rst("company_rsubject")%>" />
              </td>
            </tr>
            <tr>
              <td bgcolor="#f9f9f9"><div align="center">邮件内容：</div></td>
              <td bgcolor="#f9f9f9"><textarea name="content" cols="60" rows="10" id="content"><%if (rst("company_rcontent")<>"" and not isnull(rst("company_rcontent"))) then response.write ChangeStrbox(rst("company_rcontent")) else response.write ChangeStrbox("求职者：<br> &nbsp;&nbsp;&nbsp;&nbsp;您好，我们（某公司）已经收到您通过("&SiteName&")发来的应聘资料，感谢应聘本公司职位。<br /> &nbsp;&nbsp;&nbsp;&nbsp;在未来的一周时间内，我们会认真的阅读及评估您的资料。如果有进一步接触的必要，我们会及时与您联系。<br /> &nbsp;&nbsp;&nbsp;&nbsp;您已经对本公司职位投放了简历，除非您应聘不同职位或者本人的工作经历有了变化，否则不需要投第二份简历。如果在一个月内未收到我们的答复，您可以自行处理自己的资料。谢谢！") end if %></textarea>
              </td>
            </tr>
            <%
                     rst.close
                     set rst=nothing
                    %>
            <tr align="center" bgcolor="#efefef">
              <td colspan="2" valign="top"><img src="../images/fasong.gif" width="82" height="26" />
                  <input name="submit" type="submit" value=" 发 送 "  style="FONT-FAMILY: 宋体; FONT-SIZE: 13px; HEIGHT: 25px" />
                &nbsp;
                <input name="reset" type="reset" value=" 重 填 "  style="FONT-FAMILY: 宋体; FONT-SIZE: 13px; HEIGHT: 25px" />
                <img src="../images/chongtian.gif" width="82" height="26" /></td>
            </tr>
          </form>
        </table>
</div>
<%call bottom()
conn.close:set conn=nothing%>