<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/Commoncode.asp"-->
<!--#include file="../inc/CommonFunction.asp"-->
<%link="company_myexpert.asp"%>
<!--#include file="checkcmember.asp" -->
<%
Dim page,i
Dim totalPut
const MaxPerpage=10
Const strFileName="company_myexpert.asp"
page=Trim(Request("page"))
If page<>"" And IsNumeric(page) Then
	If page<1 Or Len(page)>10 Then
		page=1
	Else
    	page=CLng(page)
	End If
Else
	page=1
End If
 if trim(request("action"))<>"" then
  action=trim(request("action"))
  checks=trim(request("checks"))
  myexpert=split(checks,",")
  select case action
   case "delete"
    for i=0 to ubound(myexpert)
     id=Chkint(trim(myexpert(i)))
	 conn.execute("delete from job_c_myexpert where myexpert_id="&id&" and myexpert_down<>1")
	 conn.execute("update job_c_myexpert set myexpert_exp=2 where myexpert_id="&id&" and myexpert_down=1")
	next
  end select
  response.redirect "company_myexpert.asp?page="&page&""
  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 language="JavaScript">
<!--
  function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
  function showconfirm(id,page)
{
	var flag=false; //是否有选择职位信息
	var k=0;
	var refid;
	for(i=0;i<document.thisForm.elements.length;i++) 
	{
		if (document.thisForm.elements[i].name=="checks")
		{		
			if (document.thisForm.elements[i].checked==true) 
			{
				flag=true;
				break;
			}
		}
	}
	if (flag==false)
	{
		alert("请先选择一个职位！");
		return false;
	}
	//发送面试邀请
	if (id==1)
	{
		if(confirm("您确定要发送面试邀请吗？")==true)
		{
			document.thisForm.action="company_interviewsend.asp?action=myexpert";
			document.thisForm.target="_blank";
			thisForm.submit();
		}
	}
	//删除
	if (id==2)
	{
		if(confirm("您确定要删除简历吗？")==true)
		{
			document.thisForm.action="company_myexpert.asp?action=delete&page="+page+"";
			thisForm.submit();
		}
	}					
}
  //-->
</script>
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
-->
</style>
</head>
<body>
<div class="memmenul">
<div class="leftmenutit"><span>企业人才库</span></div>
<%
Set rsw= Server.CreateObject(FR_HR_RS)
'If CheckInfo(4)=False Then
'sqlOther=" top "&OutInfo("JOB_C_cmembertype","type_id","expertnums",session("user_type"))
'End If
'sql="select "& sqlOther &" * from job_c_myexpert where myexpert_cmember='"&cmember_login&"' order by myexpert_date desc"
sql="select * from job_c_myexpert where myexpert_cmember='"&cmember_login&"' and myexpert_exp=1 order by myexpert_date desc"
	rsw.open sql,conn,1,1
	if rsw.eof and rsw.bof then
		response.Write("<center><br><br>暂无人才，请添加后再进行管理!<br></center>")
		response.Write("<center><br><br><a href=index.asp target=_blank>浏览人才</a>  <a href=company_searchresume.asp target=main>搜索人才</a><br><br><br><br></center>")
		response.End()
	else
		totalPut=rsw.recordcount
		if (page-1)*MaxPerpage>totalput then
			if (totalPut mod MaxPerpage)=0 then
				page= totalPut \ MaxPerpage
			else
				page= totalPut \ MaxPerpage + 1
			end if
		end if
		if page=1 then
			Call MainInfo()
		else
			if (page-1)*MaxPerpage<totalPut then
				rsw.move  (page-1)*MaxPerpage
				dim bookmark
				bookmark=rsw.bookmark
				Call MainInfo()
			else
				page=1
				Call MainInfo()
			end if
		end if
	end if
	rsw.close
	set rsw=nothing
if FoundErr=True then
	call Show_Err()
end if
%>
<%Sub MainInfo()%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="mtable">
  <tr>
    <td width="15%" align="center"><strong>姓名</strong></td>
    <td width="15%" align="center"><strong>性别</strong></td>
    <td width="17%" align="center"><strong>年龄</strong></td>
    <td width="21%" align="center"><strong>学历</strong></td>
    <td width="24%" align="center"><strong>收藏时间</strong></td>
    <td width="8%" align="center"><IMG src="../images/sel_ico.gif" width=13 height=12 class="STYLE1"></td>
  </tr>
<FORM name="thisForm" action="" method="post">
<%do while not rsw.eof%>
  <tr>
    <td align="center"><a href="../person/cnresume_view.asp?rid=<%=rsw("myexpert_resumeid")%>" target="_blank"><%=rsw("myexpert_name")%></a></td>
    <td align="center"><%=Hiresex(rsw("myexpert_sex"))%></td>
    <td align="center"><%=year(date())-year(rsw("myexpert_birth"))%></td>
    <td align="center"><%=Hireedu(rsw("myexpert_edu"))%></td>
    <td align="center"><%=rsw("myexpert_date")%></td>
    <td align="center"><input type="checkbox" name="checks" value="<%=rsw("myexpert_id")%>"></td>
  </tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rsw.movenext
loop
%>
  <tr>
    <td colspan="6" align="right">
<INPUT name=chkall onClick="CheckAll(this.form)" type=checkbox value=on>
选中所有简历&nbsp;&nbsp;
<!--面试邀请-->
<input name="Submit" type="button" class="inputs" value="发送面试邀请" onclick=javascrpt:showconfirm(1,<%=page%>)>&nbsp;
<input name="Submit2" type="button" class="inputs" value="删　除" onClick=javascript:showconfirm(2,<%=page%>)>
&nbsp;  </td>
    </tr>
  <tr>
    <td colspan="6">
<%
If totalput>0 Then
	Call Showpage(strFileName,totalput,MaxPerPage,false,true,"个人才")
End If
%>	</td>
    </tr>
	</FORM>
</table>
<%End Sub%>
</div>
<%CloseConn%>