<?php
$obj_tab_resume=new cls_tab_hr_resume();
$obj_tab_hr_photo=new cls_tab_hr_photo();
$arr_resume=array();
(!isset($get_id))? $get_id=0:$get_id=intval($get_id);
$arr_state=$obj_tab_hr_photo->state;

//是否生成html文件
$this_html=$obj_tab_resume->get_htmlinfo($obj_ctl_user->id);

if($get_act=="del" && $get_id>0){
	$obj_tab_hr_photo->on_del($get_id,$obj_ctl_user->id);
}

if($get_act=="show" && $get_id>0){
	$obj_tab_hr_photo->on_state($get_id,1,$obj_ctl_user->id);
}
if($get_act=="hide" && $get_id>0){
	$obj_tab_hr_photo->on_state($get_id,-1,$obj_ctl_user->id);
}

$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_photo"]=get_html_url($obj_rs["resume_photo"]);
	$arr_resume = $obj_rs;
}else{
	//没有简介时，初始数据
	$arr_x=$obj_db->get_fields(DB_PRE."hr_resume");
	foreach($arr_x as $item){
		$arr_resume[$item]="";
	}
}
$obj_result = $obj_db->query("SELECT resume_progress_info FROM ".DB_PRE."hr_resume where resume_user_id='".$obj_ctl_user->id."'");
if($obj_rs = $obj_db->fetch_array($obj_result))
{
	$arr_x=explode(",",$obj_rs["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;
		}
	}
}else{
	$arr_state["step1"]=$arr_state["step2"]=$arr_state["step3"]=$arr_state["step4"]=$arr_state["step5"]=$arr_state["step6"]=0;
}

$arr_photo=array();
$lng_num=0;
if($obj_tab_sys_config->get_val("personal","photo_num")!="") $lng_num=intval($obj_tab_sys_config->get_val("personal","photo_num")!="");
$obj_result=$obj_db->query("select * from ".DB_PRE."hr_photo where photo_user_id=".$obj_ctl_user->id);
$ii=0;
while($obj_rs=$obj_db->fetch_array($obj_result)){
	$obj_rs["index"]=$ii;
	$obj_rs["state"]=array_search($obj_rs["photo_state"],$arr_state);
	$arr_photo[]=$obj_rs;
	$ii++;
}
if(count($arr_photo)<$lng_num){
	for($i=count($arr_photo);$i<$lng_num;$i++){
		$arr_photo[]=array("photo_id"=>0,"photo_url"=>"","index"=>$i);
	}
}


?>