<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp" -->
<%
sUploadDir=UpFilesPath("Person")
If Not FRAdminLevel(302) Then
	Call ErrorMsg()
End If
Response.Expires = 0 
Response.CacheControl = "no-cache" 
Response.ExpiresAbsolute = Now() - 1 
keyword=CheckStr(trim(request("keyword"))) 
segment=CheckStr(trim(request("segment")))
operate=trim(request("operate"))
group=trim(request("group"))
usergroup=trim(request("usergroup"))
trade=Replace(trim(request("trade")),"'","")
trades=Replace(trim(request("trades")),"'","")
usergroup=Replace(trim(request("usergroup")),"'","")
edu1=Replace(trim(request("edu1")),"'","")
edu2=Replace(trim(request("edu2")),"'","")
sex=Replace(trim(request("sex")),"'","")
age1=Replace(trim(request("age1")),"'","")
age2=Replace(trim(request("age2")),"'","")
profession=Replace(trim(request("profession")),"'","")
position=Replace(trim(request("position")),"'","")
nowworkadd=Replace(trim(request("nowworkadd")),"'","")
workadd=Replace(trim(request("workadd")),"'","")
datetime=Replace(trim(request("datetime")),"'","")

Dim Action
Dim page,i
Dim totalPut
Dim strFileName
MaxPerpage=20
strFileName="resume_searchlist.asp?segment="&segment&"&keyword="&keyword&"&operate="&operate&"&group="&group&"&usergroup="&usergroup&""
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
step=trim(request("step"))
resume_id=trim(request("id"))
jobtype=trim(request("jobtype"))
openness=trim(request("openness"))
if request("member")<>"" then
resume_id=request("member")
end if

if trim(request("step"))<>"" then
	set rsw=conn.execute("select * from job_p_resume where resume_id in ("&resume_id&")")
	do while not rsw.eof
		member=rsw("resume_pmember")
		resume_ids=rsw("resume_id")
		select case step
		 case "del"
		   conn.execute("delete from job_p_education where education_pmember='"&member&"' and education_resumeid="&resume_ids)
		   conn.execute("delete from job_p_training where train_pmember='"&member&"' and train_resumeid="&resume_ids)
		   conn.execute("delete from job_p_lang where lang_pmember='"&member&"' and lang_resumeid="&resume_ids)
		   conn.execute("delete from job_p_work where work_pmember='"&member&"' and work_resumeid="&resume_ids)
		   conn.execute("delete from job_p_resume where resume_pmember='"&member&"' and resume_id="&resume_ids)
		 case "audit"
			conn.execute("update job_p_resume set resume_flag=1 where resume_pmember='"&member&"' and resume_id="&resume_ids)
		 case "unaudit"
			conn.execute("update job_p_resume set resume_flag=0 where resume_pmember='"&member&"' and resume_id="&resume_ids)
		end select
	rsw.movenext
	loop
	set rsw=nothing
	if step="active" then
		conn.execute("Update JOB_p_resume Set resume_cnstatus=0 Where resume_pmember='"&member&"'")
		conn.execute("Update JOB_p_resume Set resume_cnstatus=1 Where resume_id="&resume_id)
	end if
	response.redirect "resume_searchlist.asp?currentpage="&currentpage&"&keyword="&keyword&"&operate="&operate&"&segment="&segment&"&usergroup="&usergroup&"&openness="&openness&"&jobtype="&jobtype&""
	response.end
end if
function UserMob(UserID)
set rsu=conn.execute("select member_login,Member_mobile,member_name from job_member where member_login='"&UserID&"'")
if not rsu.eof and not rsu.bof then
	if rsu("Member_mobile")<>"" then
		UserMob="<a onClick=""sendsms('"&rsu("member_login")&"',1,'"&rsu("Member_mobile")&"','"&rsu("member_name")&"','"&SiteUrl&InstallDir&"');"" style=""cursor:pointer""><span id=""s_"&rsu("member_login")&""">发短信</span></a>"
	else
		UserMob="<font color='#666666'>发短信</font>"
	end if
else
	UserMob="<font color='#666666'>发短信</font>"
end if
set rsu=nothing
end function
%>
<html>
<head>
<title>简历列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/style<%=sk%>.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../inc/input.js"></script>
<script language="javascript" src="../Inc/Admin.js"></script>
<script language="javascript" src="../../Js/Sms.js"></script>
<style type="text/css">
<!--
.style11 {color: #0066CC;
	font-weight: bold;
}
-->
</style>
</head>

<body>

<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1"  class="tableBorder">
   <tr> 
	   <th  height=25 class="tableHeaderText">简历管理</th>
   </tr>
  <form action="resume_searchlist.asp" method="post">
    <tr >
      <td align="left"><font color="ff6600"><b class="style11">　管理选项</b></font>：&nbsp;<a href="pmember_searchlist.asp" target="main">管理首页</a> | <a href="pmember_searchlist.asp" target="main">人才管理</a> | <a href="resume_searchlist.asp" target="main">简历管理</a> | <a href="person_addresume.asp" target="main">简历添加</a> | <a href="resume_search.asp" target="main">人才查询</a> | [<a href="javascript:location.reload()">刷新页面</a>]</td>
    </tr>
    <tr >
      <td align="left"><font color="ff6600"><b class="style11">　二级选项</b></font>： <a href="?operate=0&jobtype=<%=jobtype%>">待审简历</a> | <a href="?operate=1&jobtype=<%=jobtype%>">已审简历</a> | <a href="?operate=2&jobtype=<%=jobtype%>">未激活</a> |  <a href="?operate=3&jobtype=<%=jobtype%>">已激活</a> | <a href="?operate=4&jobtype=<%=jobtype%>">待审照片</a> | <a href="?operate=5&jobtype=<%=jobtype%>">未公开简历</a> | <a href="?operate=6&jobtype=<%=jobtype%>">普通人才</a> | <a href="?operate=7&jobtype=<%=jobtype%>">毕业生</a> | <a href="?operate=8&jobtype=<%=jobtype%>">高级人才</a></td>
    </tr>
    <tr > 
      <td align="left"> 
          &nbsp;&nbsp;&nbsp;&nbsp;关键字： 
          <input name="keyword" type="text" id="keyword" size="10">
          <select name="segment" size="1" id="segment">
            <option value="resume_name">姓名</option>
            <option value="resume_login">会员帐号</option>
          </select>
          <select name="usergroup" id="usergroup">
		    <option value="" selected>所有简历类型</option>
            <option value="0">普通</option>
            <option value="1">毕业生</option>
            <option value="2">高级人才</option>
          </select>
          <select name="openness" id="openness">
		    <option value="" selected>所有公开程度</option>
            <option value="0">对所有公开</option>
            <option value="1">完全保密</option>
          </select>
          <input type="submit" name="Submit" class="inputs" value="搜索"> <a href="resume_search.asp"><font color="#FF0000">[高级搜索]</font></a></td>
    </tr>
  </form>
</table>
<%Call main()
if FoundErr=True then
	call Show_Err()
end if
%>
<%sub main()
sql="select resume_id,resume_name,resume_sex,resume_birth,resume_position,resume_usergroup,resume_openness,resume_cnstatus,resume_personinfo,resume_education,resume_train,resume_lang,resume_work,resume_careerwill,resume_pmember,resume_flag from job_p_resume,job_member where resume_pmember=member_login and member_typeid=1 and resume_pmember is not null"
if keyword<>"" then                              
	if segment="resume_login" then
	sql=sql&" and resume_pmember like '%"& keyword &"%'"
	else
	sql=sql&" and resume_name like '%"& keyword &"%'"
	end if
end if
usergroup=trim(request("usergroup"))
if usergroup<>"" then sql=sql&" and resume_usergroup="&usergroup&""
jobtype=trim(request("jobtype"))
if jobtype<>"" then sql=sql&" and resume_jobtype="&jobtype&""
openness=trim(request("openness"))
if openness<>"" then sql=sql&" and resume_openness="&openness&""
if operate<>"" then
	select case operate
		case 0:sql=sql&" and resume_flag=0"
		case 1:sql=sql&" and resume_flag=1"
		case 2:sql=sql&" and resume_cnstatus=0"
		case 3:sql=sql&" and resume_cnstatus=1"
		case 4:sql=sql&" and member_logostatus=0"
		case 5:sql=sql&" and resume_openness=1"
		case 6:sql=sql&" and resume_usergroup=0"
		case 7:sql=sql&" and resume_usergroup=1"
		case 8:sql=sql&" and resume_usergroup=2"
	end select	
end if
if nowworkadd<>"" and nowworkadd<>"0000" then
mystring=split(nowworkadd,",")
  for i=0 to ubound(mystring)
  if i=0 then
  mysstring=split(mystring(i),"*")
	  for j=0 to ubound(mysstring)
	  if j=0 then
	  sql=sql&" and (resume_provinceid like '%"&trim(mysstring(j))&"%' or resume_capitalid like '%"&trim(mysstring(j))&"%' or resume_cityid like '%"&trim(mysstring(j))&"%'"
	  else
	  sql=sql&" or resume_provinceid like '%"&trim(mysstring(j))&"%' or resume_capitalid like '%"&trim(mysstring(j))&"%' or resume_cityid like '%"&trim(mysstring(j))&"%'"
	  end if
	  next
	else
	mysstring=split(mystring(i),"*")
	  for j=0 to ubound(mysstring)
	  if j=0 then
	  sql=sql&" or resume_provinceid like '%"&trim(mysstring(j))&"%' or resume_capitalid like '%"&trim(mysstring(j))&"%' or resume_cityid like '%"&trim(mysstring(j))&"%'"
	  else
	  sql=sql&" or resume_provinceid like '%"&trim(mysstring(j))&"%' or resume_capitalid like '%"&trim(mysstring(j))&"%' or resume_cityid like '%"&trim(mysstring(j))&"%'"
	  end if
	  next
	 end if
  next
   sql=sql&")"
end if
if trade<>"" and trade<>"0000" then
mystring=split(trade,",")
  for i=0 to ubound(mystring)
  if i=0 then
    sql=sql&" and (resume_trade  like '%"&trim(mystring(i))&"%'"
   else
    sql=sql&" or resume_trade like '%"&trim(mystring(i))&"%'"
   end if
  next
   sql=sql&")"
end if
if position<>"" and position<>"0000" then
mystring=split(position,",")
  for i=0 to ubound(mystring)
  if i=0 then
    sql=sql&" and (resume_position like '%"&trim(mystring(i))&"%'"
   else
    sql=sql&" or resume_position like '%"&trim(mystring(i))&"%'"
   end if
  next
   sql=sql&")"
end if
if workadd<>"" and workadd<>"0000" then
mystring=split(workadd,",")
  for i=0 to ubound(mystring)
  if i=0 then
    sql=sql&" and (resume_workadd  like '%"&trim(mystring(i))&"%'"
   else
    sql=sql&" or resume_workadd like '%"&trim(mystring(i))&"%'"
   end if
  next
   sql=sql&")"
end if
if datetime<>"" and IsNumeric(datetime) then sql=sql&" and datediff("&FR_HR_d&",resume_announcedate,"&FR_HR_Now&"-"&datetime&")<=0"
if edu1<>"" and IsNumeric(edu1) then sql=sql&" and resume_edu>="&edu1
if edu2<>"" and IsNumeric(edu2) then sql=sql&" and resume_edu<="&edu2
if sex<>"" and IsNumeric(sex) then
	select case sex
	case 1:sql=sql&" and resume_sex=1"
	case 2:sql=sql&" and resume_sex=2"
	end select
end if

''''''''''''''''''''''年龄
if age1<>"" and IsNumeric(age1) then birth_enddate=cdate((year(date())-age1)&"-12-30")
if age2<>"" and IsNumeric(age2) then birth_startdate=cdate((year(date())-age2)&"-1-1")
if age1<>"" and age2<>"" then sql=sql&" and (resume_birth>='"&birth_startdate&"' and resume_birth<='"&birth_enddate&"')"
if keyword<>"" then sql=sql&" and (resume_appraise like '%"&keyword&"%' or resume_name like '%"&keyword&"%' or resume_request like '%"&keyword&"%' or resume_title like '%"&keyword&"%')"
select case taxis
	case 1:sql=sql&" order by resume_announcedate desc"
	case 2:sql=sql&" order by resume_announcedate asc"
	case 3:sql=sql&" order by resume_visitnum desc"
end select
sql=sql&" order by resume_announcedate desc,resume_name desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>暂无简历，请添加后再进行管理！</li>"
	exit sub
else
	totalPut=rs.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
			rs.move  (page-1)*MaxPerpage
			dim bookmark
			bookmark=rs.bookmark
			Call MainInfo()
		else
			page=1
			Call MainInfo()
		end if
	end if
end if
rs.close
set rs=nothing
end sub	
%>
<%Sub MainInfo()%> 
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
        <tr> 
    		<th  height=25 colspan="13" class="tableHeaderText">简历列表</th>
  		</tr>
<form name="form2" action="resume_searchlist.asp" method="post">	
		<tr> 
		  <td width="30" align="center"><b>编号</b></td>
          <td width="40" align="center"><b>姓名</b></td>
          <td width="30" align="center"><b>性别</b></td>
          <td width="30" align="center"><b>年龄</b></td>
		  <td align="center"><b>意向职位</b></td>
		  <td width="60" align="center"><b>简历类型</b></td>
          <td width="60" align="center"><b>公开程度</b></td>
          <td width="60" align="center"><b>完整程度</b></td>
          <td width="60" align="center"><b>激活状态</b></td>
          <td width="40" align="center"><b>短信</b></td>
          <td width="80" align="center"><b>会员帐号</b></td>
	      <td width="40" align="center"><b>状态</b></td>
	      <td width="30" align="center"><input name="checkSelect" type="checkbox" class="checkbox" onClick="javascript: checkAll(this)" value="checkbox"></td>
        </tr>
      	<%
		dim i
		i=0
		do while not rs.eof
		i=i+1
		%>
        <tr onMouseOver="this.style.background='#FFFFCC'" onMouseOut="this.style.background='#EEF7FD'"> 
          <td align="center"><a href="cnresume.asp?rid=<%=rs("resume_id")%>" target="_blank"><%=rs("resume_id")%></a></td>
          <td align="center"><a href="cnresume.asp?rid=<%=rs("resume_id")%>" target="_blank" title="点击查看简历！"><%=rs("resume_name")%></a></td>
		  <td align="center"><%
			select case rs("resume_sex")
			 case 1 
			  response.write "男" 
			 case 2
			  response.write "女" 
			end select
		   %></td>
		  <td align="center"><%=year(date())-year(rs("resume_birth"))%></td>
		  <td align="left" title="<%=Hireposition(rs("resume_position"),1)%>"><%=Hireposition(rs("resume_position"),1)%></td>
		  <td align="center"><%
		  select case rs("resume_usergroup")
		   case 0
		    usergroup1= "普通"
		   case 1
		    usergroup1= "毕业生"
		   case 2
		    usergroup1= "高级人才"
		  end select
		  response.Write "<a href='#' onclick=""window.open ('pmember_changeresumesort.asp?id="&rs("resume_id")&"','win_point','height=150,width=550,top=150,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');""><font color=red>"&usergroup1&"</font></a>"
		  %></td>
          <td align="center"><%
		  select case rs("resume_openness")
		   case 0
		    useropen= "所有公开"
		   case 1
		    useropen= "公开"
		   case 2
		    useropen= "完全保密"
		  end select
		  response.Write "<a href='#' onclick=""window.open ('pmember_changeresumeopen.asp?id="&rs("resume_id")&"','win_point','height=150,width=550,top=150,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');""><font color=red>"&useropen&"</font></a>"
		  %></td>
          <td align="center"><%if rs("resume_personinfo")<>1 or rs("resume_education")<>1 or rs("resume_train")<>1 or rs("resume_lang")<>1 or rs("resume_work")<>1 or rs("resume_careerwill")<>1 then%><font color="#FF0000">不完整 </font></strong><%else%>完整<%end if%></td>
          <td align="center"><%if rs("resume_cnstatus")=0 then %><font color='#666666'><a href="#" onClick="window.location='resume_searchlist.asp?id=<%=rs("resume_id")%>&step=active&currentpage=<%=currentpage%>&keyword=<%=keyword%>&segment=<%=segment%>&usergroup=<%=usergroup%>&openness=<%=openness%>';"><font color='#666666'>未激活</font></a></font><%else%>已激活<%end if%></td>
          <td align="center"><%=UserMob(rs("resume_pmember"))%></td>
		  <td align="center"><%=rs("resume_pmember")%></td>
		  <td align="center"><%
			if rs("resume_flag")=0 then	  
				response.write "<font color='#666666'>未审核</font>"
			else
				response.write "正常"
			end if
		  %>
		  </td>
		  <td align="center"><input name="member" type="checkbox" class="checkbox" value="<%=rs("resume_id")%>"></td>
        </tr>
        <%
		if i>=MaxPerPage then exit do
		rs.movenext
		loop
  %>
	<input type="hidden" name="usergroup" value="<%=usergroup%>">
	<input type="hidden" name="openness" value="<%=openness%>">     
	<input type="hidden" name="keyword" value="<%=keyword%>"> 
	<input type="hidden" name="segment" value="<%=segment%>">
  <tr bgcolor="#FFFFFF" class="tabbgcolorli">
    <td colspan="13" align="right" aligh="right">
      <input name="button" type="button" class="inputs" onClick="confirmX(1);" value="简历审核">
      <input name="button" type="button" class="inputs" onClick="confirmX(2);" value="撤销审核">
	  <input name="button" type="button" class="inputs" onClick="confirmX(3);" value="删  除">
    </td>
  </tr>
  <tr bgcolor="#FFFFFF" class="tabbgcolorli">
    <td colspan="13" aligh="right"> <%If totalput>0 Then
	Call Showpage(strFileName,totalput,MaxPerPage,false,true,"份简历")
End If%></td>
  </tr></form>
</table>
<%end sub%>
<!--#include file="../inc/copy.asp" -->
</body>
</html>
<script language="javascript">
function confirmX(num)
{
	var ids = document.getElementsByName("member");
	var check=false;
	if (ids != null) {
		
		for (i=0; i<ids.length; i++) 
		{
			var obj = ids(i);
			if (obj.checked==true)
			{
				check=true;
				
			}
		}
		if(check==false){alert("请选择操作对象！");return false;}
	}
	if(num==1)
	{
		if(confirm("你确定要审核你所选择的简历吗？"))	
		{
			document.form2.action="resume_searchlist.asp?step=audit";
			document.form2.submit();		
		}
	}
	if(num==2)
	{
		if(confirm("你确定要撤销审核你所选择的简历吗？"))	
		{
			document.form2.action="resume_searchlist.asp?step=unaudit";
			document.form2.submit();		
		}
	}
	if(num==3)
	{
		if(confirm("警告:此操作将会删除该简历及于该简历相关的所有信息！\n是否继续操作？"))	
		{
			document.form2.action="resume_searchlist.asp?step=del";
			document.form2.submit();		
		}
	}
	return false;	
}
function checkAll(box1) {
    var ids = document.getElementsByName("member");
	if (ids != null) {
		for (i=0; i<ids.length; i++) {
			var obj = ids(i);
			obj.checked = box1.checked;
		}
	}
}
</script></html>