<?php
$arr_company=array();
(!isset($get_id))? $get_id=0:$get_id=intval($get_id);

//刷新过期职位
if($get_act=="refreshjob"){
	$lng_time=TIME+2592000;  //延迟三十天
	$msg_x = $obj_db->execute("update ".DB_PRE."hr_job set job_validdate=".$lng_time." where job_user_id='".$obj_ctl_user->id."' and job_validdate>0 and job_validdate<'".TIME."'");
}

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


$this_job_num=0;
$this_job_use=0;
$this_job_view=0;
$this_job_view_new=0;
$this_job_apply=0;
$this_job_pause=0;
$this_job_apply_new=0;
$this_job_expired=0;
$this_job_invite=0;
$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."hr_company where company_user_id='".$obj_ctl_user->id."'");
if($obj_rs = $obj_db->fetch_array($obj_result))
{
	$obj_rs["company_updatetime"]=format_date($obj_rs["company_updatetime"],"Y-m-d H:i");
	$obj_rs["vip"]=website_get_vip($obj_rs["company_vip_id"],$obj_rs["company_vip_time"]);
	$arr_company = $obj_rs;

	//被个人查看情况
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_view where view_company_id='".$arr_company["company_id"]."'");
	$this_job_view=$obj_rs["num"];
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_view where view_company_id='".$arr_company["company_id"]."' and view_state=0");
	$this_job_view_new=$obj_rs["num"];
	//收到的应聘简历
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_apply where apply_company_user_id='".$arr_company["company_user_id"]."'");
	$this_job_apply=$obj_rs["num"];
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_apply where apply_company_user_id='".$arr_company["company_user_id"]."' and apply_state=0");
	$this_job_apply_new=$obj_rs["num"];
	//已发面试邀请通知
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job_invite where invite_user_id='".$arr_company["company_user_id"]."'");
	$this_job_invite=$obj_rs["num"];
	//已发招聘职位数
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job where job_user_id='".$arr_company["company_user_id"]."'");
	$this_job_num=$obj_rs["num"];
	//有效招聘职位数
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job where job_user_id='".$arr_company["company_user_id"]."' and job_state>=0 and (job_validdate=0 or job_validdate>='".TIME."')");
	$this_job_use=$obj_rs["num"];
	//暂停招聘职位数
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job where job_user_id='".$arr_company["company_user_id"]."' and job_state=-2");
	$this_job_pause=$obj_rs["num"];
	//过期招聘职位数
	$obj_rs = $obj_db->get_one("SELECT count(*) as num FROM ".DB_PRE."hr_job where job_user_id='".$arr_company["company_user_id"]."' and job_validdate>0 and job_validdate<'".TIME."'");
	$this_job_expired=$obj_rs["num"];

}else{
	//没有简介时，初始数据
	$arr_x=$obj_db->get_fields(DB_PRE."hr_company");
	foreach($arr_x as $item){
		$arr_company[$item]="";
	}
}
?>