<?php
$obj_tab_search=new cls_tab_hr_resume_search();
switch($get_app){
	case "search_edit":
		$obj_tab_resume=new cls_tab_hr_resume();
		$obj_tab_jobcategory=new cls_tab_hr_job_category();
		$arr_search=array();
		(isset($get_id))? $get_id=intval($get_id):$get_id=0;
		if($get_id>0){
			$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."hr_resume_search where search_id='".$get_id."' and search_user_id='".$obj_ctl_user->id."'");
			if($obj_rs = $obj_db->fetch_array($obj_result))
			{
				$arr_search=$obj_rs;
				$arr_search["jobtype"]=get_radio_html($obj_tab_resume->jobtype,"search_jobtype",$arr_search["search_jobtype"]);
				$arr_search["jobcategory"]=$obj_tab_jobcategory->get_select_category("search_jobcategory",$arr_search["search_jobcategory"]);
				$arr_search["degree"]=get_select_html($obj_tab_resume->degree,$arr_search["search_degree"]);
			}
		}
		if(count($arr_search)<1){
			$arr_x=$obj_db->get_fields(DB_PRE."hr_resume_search");
			foreach($arr_x as $item){
				$arr_search[$item]="";
			}
			$arr_search["jobtype"]=get_radio_html($obj_tab_resume->jobtype,"search_jobtype");
			$arr_search["jobcategory"]=$obj_tab_jobcategory->get_select_category("search_jobcategory");
			$arr_search["degree"]=get_select_html($obj_tab_resume->degree);
		}
		break;
	case "search_save":
		$arr_fields=array();
		(isset($get_id))? $get_id=intval($get_id):$get_id=0;
		$arr_fields["search_id"]=$get_id;
		$arr_fields["search_user_id"]=$obj_ctl_user->id;
		if(isset($get_search_name)) $arr_fields["search_name"]=$get_search_name;
		if(isset($get_search_jobtype)) $arr_fields["search_jobtype"]=$get_search_jobtype;
		if(isset($get_search_jobcategory)) $arr_fields["search_jobcategory"]=$get_search_jobcategory;
		if(isset($get_search_degree)) $arr_fields["search_degree"]=$get_search_degree;
		if(isset($get_search_experience)) $arr_fields["search_experience"]=$get_search_experience;
		if(isset($get_search_sex)) $arr_fields["search_sex"]=$get_search_sex;
		if(isset($get_search_age1)) $arr_fields["search_age1"]=$get_search_age1;
		if(isset($get_search_age2)) $arr_fields["search_age2"]=$get_search_age2;
		if(isset($get_search_marry)) $arr_fields["search_marry"]=$get_search_marry;
		if(isset($get_search_height1)) $arr_fields["search_height1"]=$get_search_height1;
		if(isset($get_search_height2)) $arr_fields["search_height2"]=$get_search_height2;
		if(isset($get_search_school)) $arr_fields["search_school"]=$get_search_school;
		if(isset($get_search_area)) $arr_fields["search_area"]=$get_search_area;
		if(isset($get_search_keyword)) $arr_fields["search_keyword"]=$get_search_keyword;
		if(isset($get_search_pubtime)) $arr_fields["search_pubtime"]=$get_search_pubtime;
		if(count($arr_fields)>2){
			$arr_msg=$obj_tab_search->on_save($arr_fields);
		}
		break;
	case "search_list":
		if(isset($get_act)&&$get_act=="del"&&isset($get_id)&&$get_id>0){
			$arr_msg=$obj_tab_search->on_del($get_id);
			if($arr_msg["err"]!="")
			{
				$obj_msg->alert($arr_msg["err"]);
			}
		}
		if(isset($get_act)&&$get_act=="del_s"&&isset($get_jobids)){
			$arr_msg=$obj_tab_search->on_del($get_jobids);
			if($arr_msg["err"]!="")
			{
				$obj_msg->alert($arr_msg["err"]);
			}
		}
		$str_where=" where search_user_id='".$obj_ctl_user->id."'";
		$arr_search=array();
		$arr_resume_id=array();
		$obj_result = $obj_db->query("SELECT * FROM ".DB_PRE."hr_resume_search".$str_where);
		while($obj_rs = $obj_db->fetch_array($obj_result))
		{
			$obj_rs["search_addtime"]=format_date($obj_rs["search_addtime"]);
			$arr_search[]=$obj_rs;
		}
}


?>