<?php
if(!isset($obj_tab_company)){
	$obj_tab_company=new cls_tab_hr_company();
}
$obj_tab_jobcategory=new cls_tab_hr_job_category();
$obj_tab_job=new cls_tab_hr_job();

if(isset($get_id)&&$get_id>0){
	$get_id=intval($get_id);
	$str_where=" where company_id='".$get_id."'";
}else if(isset($get_uid)){
	$get_uid=intval($get_uid);
	$str_where=" where company_user_id='".$get_uid."'";
}else if($obj_ctl_user->id>0&&$obj_ctl_user->type=="company"){
	$get_uid=$obj_ctl_user->id;
	$str_where=" where company_user_id='".$get_uid."'";
}else{
	$obj_msg->alert("企业不存在！");
	exit;
}
$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."hr_company".$str_where);
if($obj_rs = $obj_db->fetch_array($obj_result)){
	$obj_rs["info"]="";
	if($obj_rs["company_idnum"]!="") $obj_rs["info"].="<li>营业执照：".$obj_rs["company_idnum"]."</li>";
	if($obj_rs["company_industry"]!="") $obj_rs["info"].="<li>所属行业：".$obj_rs["company_industry"]."</li>";
	if($obj_rs["company_nature"]!="") $obj_rs["info"].="<li>企业性质：".$obj_rs["company_nature"]."</li>";
	if($obj_rs["company_builddate"]>0) $obj_rs["info"].="<li>成立日期：".format_date($obj_rs["company_builddate"],"Y-m-d")."</li>";
	if($obj_rs["company_regcapital"]>0) $obj_rs["info"].="<li>注册资金：".$obj_rs["company_regcapital"].$obj_rs["company_currency"]."</li>";
	if($obj_rs["company_scale"]!="") $obj_rs["info"].="<li>员工人数：".$obj_rs["company_scale"]."</li>";
	$this_company=$obj_rs;
}else{
	$obj_msg->alert("企业不存在！");
	exit;
}
//增加企业点击量
$str_sql="update ".DB_PRE."hr_company set company_hits=company_hits+1".$str_where;
$obj_db->execute($str_sql);
$arr_job=array();
$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."hr_job where job_user_id='".$this_company["company_user_id"]."'");
while($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"];
	}
	$obj_rs["url"]=$obj_tab_job->get_url($obj_rs["job_id"]);
	$obj_rs["updatetime"]=format_date($obj_rs["job_updatetime"],"Y-m-d");
	$arr_job[]=$obj_rs;
}

//是否生成html文件
$this_html=$obj_tab_company->get_htmlinfo($this_company["company_id"]);

?>