<?php
$obj_tab_resume=new cls_tab_hr_resume();
$arr_resume=array();
(!isset($get_id))? $get_id=0:$get_id=intval($get_id);
if(isset($get_act)){
	if($get_act=="refresh"){
		//刷新简历
		$obj_db->execute("update ".DB_PRE."hr_resume set resume_updatetime='".TIME."' where resume_user_id='".$obj_ctl_user->id."'");
		$obj_msg->alert("成功刷新简历！");
	}
}

$obj_tab_verify=new cls_tab_sys_verify;
$this_verify=$obj_tab_verify->get_verify($obj_ctl_user->id);

$this_company_view=0;
$this_company_view_new=0;
$this_job_invite_new=0;
$this_job_collect=0;
$this_job_apply=0;
$this_job_invite=0;
$this_privacy="完全公开";
$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."hr_resume where resume_user_id='".$obj_ctl_user->id."'");
if($obj_rs = $obj_db->fetch_array($obj_result))
{
	$obj_rs["resume_updatetime"]=format_date($obj_rs["resume_updatetime"],"Y-m-d H:i");
	$arr_resume = $obj_rs;
	$arr_x=explode(",",$arr_resume["resume_progress_info"]);
	$lng_x=count($arr_x);
	for($i=1;$i<=$lng_x;$i++){
		$arr_state["step".$i]=$arr_x[$i-1];
	}
	if($lng_x<6){
		for($i=$lng_x+1;$i<7;$i++){
			$arr_state["step".$i]=0;
		}
	}
	if($arr_resume["resume_privacy"]==1){
		$this_privacy="本站用户";
	}else if($arr_resume["resume_privacy"]==2){
		$this_privacy="企业会员";
	}else if($arr_resume["resume_privacy"]==3){
		$this_privacy="VIP认证会员";
	}else if($arr_resume["resume_privacy"]==-1){
		$this_privacy="关闭简历";
	}else{
		$this_privacy="完全公开";
	}
	//被企业查看情况
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_resume_view where view_resume_id='".$arr_resume["resume_id"]."'");
	$this_company_view=$obj_rs["num"];
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_resume_view where view_resume_id='".$arr_resume["resume_id"]."' and view_state=0");
	$this_company_view_new=$obj_rs["num"];
	//职位申请记录
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_apply where apply_user_id='".$obj_ctl_user->id."'");
	$this_job_apply=$obj_rs["num"];
	//面试邀请通知
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_invite where invite_resume_user_id='".$arr_resume["resume_user_id"]."'");
	$this_job_invite=$obj_rs["num"];
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_invite where invite_resume_user_id='".$arr_resume["resume_user_id"]."' and invite_state=0");
	$this_job_invite_new=$obj_rs["num"];
	//
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_collect where collect_user_id='".$obj_ctl_user->id."'");
	$this_job_collect=$obj_rs["num"];
}else{
	//没有简介时，初始数据
	$arr_x=$obj_db->get_fields(DB_PRE."hr_resume");
	foreach($arr_x as $item){
		$arr_resume[$item]="";
	}
	$arr_state["step1"]=$arr_state["step2"]=$arr_state["step3"]=$arr_state["step4"]=$arr_state["step5"]=$arr_state["step6"]=0;
}
?>