<?php
$obj_tab_jobcategory=new cls_tab_hr_job_category();
$obj_tab_job=new cls_tab_hr_job();
$obj_tab_company=new cls_tab_hr_company();
$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."hr_job where job_id='".$get_id."'");
if($obj_rs = $obj_db->fetch_array($obj_result)){
	if($obj_rs["job_pay1"]==0&&$obj_rs["job_pay2"]==0){
		$obj_rs["pay"]="面议";
	}else{
		$obj_rs["pay"]=$obj_rs["job_pay1"]."~".$obj_rs["job_pay2"];
	}
	if($obj_rs["job_experience1"]==0&&$obj_rs["job_experience2"]==0){
		$obj_rs["experience"]="不限";
	}else if($obj_rs["job_experience1"]==0){
		$obj_rs["experience"]=$obj_rs["job_experience2"]." 年以下";
	}else if($obj_rs["job_experience2"]==0){
		$obj_rs["experience"]=$obj_rs["job_experience1"]." 年以上";
	}else{
		$obj_rs["experience"]=$obj_rs["job_experience1"]."~".$obj_rs["job_experience1"]." 年";
	}
	if($obj_rs["job_age1"]==0&&$obj_rs["job_age2"]==0){
		$obj_rs["age"]="不限";
	}else if($obj_rs["job_age1"]==0){
		$obj_rs["age"]=$obj_rs["job_age2"]." 岁以下";
	}else if($obj_rs["job_age2"]==0){
		$obj_rs["age"]=$obj_rs["job_age1"]." 岁以上";
	}else{
		$obj_rs["age"]=$obj_rs["job_age1"]."~".$obj_rs["job_age2"]." 岁";
	}
	if($obj_rs["job_sex"]==""){
		$obj_rs["sex"]="不限";
	}else{
		$obj_rs["sex"]=$obj_rs["job_sex"];
	}
	if($obj_rs["job_num"]>0){
		$obj_rs["num"]=$obj_rs["job_num"]." 人";
	}else{
		$obj_rs["num"]="不限";
	}
	$obj_rs["addtime"]=format_date($obj_rs["job_addtime"],"Y-m-d");
	if($obj_rs["job_validdate"]>0){
		$obj_rs["validdate"]=format_date($obj_rs["job_validdate"],"Y-m-d");
	}else{
		$obj_rs["validdate"]="长期";
	}
	$arr_degree=$obj_tab_job->degree;
	$obj_rs["degree"]=array_search($obj_rs["job_degree"],$arr_degree);
	if($obj_rs["degree"]==""){
		$obj_rs["degree"]="不限";
	}else{
		$obj_rs["degree"]=$obj_rs["degree"]."以上";
	}
	$this_job=$obj_rs;
}else{
	$obj_msg->alert("没有找到相关职位！");
	exit;
}
$obj_result = $obj_db->query("SELECT job_id,job_name FROM ".DB_PRE."hr_job where job_user_id='".$this_job["job_user_id"]."'");
while($obj_rs = $obj_db->fetch_array($obj_result)){
	$obj_rs["url"]=$obj_tab_job->get_url($obj_rs["job_id"]);
	$arr_job[]=$obj_rs;
}
$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."hr_company where company_user_id='".$this_job["job_user_id"]."'");
if($obj_rs = $obj_db->fetch_array($obj_result)){
	$this_company=$obj_rs;
}
if($this_job["job_linkmethod"]==1){
	$this_job["linkman"]=$this_company["company_linkname"];
	$this_job["tel"]=$this_company["company_tel"];
	$this_job["email"]=$this_company["company_email"];
}else{
	$this_job["linkman"]=$this_job["job_linkman"];
	$this_job["tel"]=$this_job["job_tel"];
	$this_job["email"]=$this_job["job_email"];
}
//增加职位点击量
$str_sql="update ".DB_PRE."hr_job set job_hits=job_hits+1 where job_id='".$get_id."'";
$obj_db->execute($str_sql);
//是个人的话增加个人游览记录
if($obj_ctl_user->type=="personal"){
	require_once(SYS_ROOT.'/cls_tab/tab.hr.job.view.php');
	$obj_tab_job_view=new cls_tab_hr_job_view();
	$arr_fields=array();
	$arr_fields["view_user_id"]=$obj_ctl_user->id;
	$arr_fields["view_company_id"]=$this_company["company_id"];
	$arr_fields["view_job_id"]=$this_job["job_id"];
	$arr_msg=$obj_tab_job_view->on_save($arr_fields);
	unset($obj_tab_job_view);
}

//是否生成html文件
$this_html=$obj_tab_job->get_htmlinfo($this_job["job_id"]);

$this_company_url=$obj_tab_company->get_url($this_company["company_id"]);
?>