<?php
/**
 *----------------------------------------------------------------------------*
 * 版权所有 2010-2016 HuCart.COM，并保留所有权利。
 * 网站地址: http://Www.HuCart.Com；
 * 作者: HuCart.COM
 *----------------------------------------------------------------------------*
**/
class Employ
{
	function Employ()
	{
		
		//缓存
		if($GLOBALS["WebConfig"]["webtmp"]==1)
		{
			$this -> view -> caching = true;
			if($GLOBALS["WebConfig"]["webtmptime"] > 0 )
			{
				$this -> view -> cache_lifetime = $GLOBALS["WebConfig"]["webtmptime"] ;
			}else{
				$this -> view -> cache_lifetime = 3600 ;  //60 *  60 * 24
			}
			$smdirid 	= intval(trim($_REQUEST["id"])).intval(trim($_REQUEST["page_num"]));
			$this -> view -> cache_dir = ROOT_PATH.$GLOBALS['cache_path'].'/'.$this -> helper -> buildsmartydir( $type = 'e',$smdirid);
		}
		
 

		$getmenu = $this -> helper -> get_menu();
		$this -> view -> assign('getmenu',$getmenu);
		
		$getprosort  = $this -> personal -> get_prosort();
		$this -> view -> assign('getprosort',$getprosort);
		
		$getlink = $this -> helper -> get_link();
		$this -> view -> assign('getlink',$getlink);	
		
		$getads = $this -> helper -> get_ads( $instr = '1,2,3,4,5,6,7,8,9,10,11' );
		$this -> view -> assign('getads',$getads);
		$getuserlink = $GLOBALS['WebSe']->getuserlink();
		$this -> view ->assign('getuserlink',$getuserlink);	
		

			
	}
	
	function infolist()
	{	
		$webtitle = '应聘职位';
		//处理你现在的位置
		$now_address = '您的位置：<a href="'.BASE_WEBURL.'/">首页</a> > <a href="'.BASE_WEBURL.'?/resume.html">应聘职位</a>';

		$this -> view -> assign('webtitle',$webtitle);
		$this -> view -> assign('now_address',$now_address);

		$id  = intval($GLOBALS['Reque'] -> getval["id"]);
		
		if($id  > 0 )
		{
			$sql_query 	= " SELECT inv_id, inv_position FROM  ".$this -> db -> prefix."invite  WHERE inv_delete = 0 AND inv_id = ".$id." ORDER BY  inv_id  ";

			$infodetail = $this -> db ->  select_one($sql_query);
		}
		$this -> view -> assign('infodetail',$infodetail);
		if($sid !='' or $page_num!='' or  $newkeyword !='')
		{
			$cache_id = $sid.'p'.$page_num.'k'.$keyid;
		}
		$this -> view -> display('employ_tpl.html',$cache_id );
	}
	
	function add_info()
	{
		$inv_idval 				= $this -> input -> req["inv_id"];
		$eml_positionval 		= $this -> input -> req["eml_position"];
		$eml_nameval  			= $this -> input -> req["eml_name"];
		$eml_sexval  			= $this -> input -> req["eml_sex"];	
		$eml_nativeval 			= $this -> input -> req["eml_native"];
		$eml_educationalval  	= $this -> input -> req["eml_educational"];
		$eml_birthdayval  		= $this -> input -> req["eml_birthday"];
		$eml_schoolval 			= $this -> input -> req["eml_school"];
		$eml_subjectval 		= $this -> input -> req["eml_subject"];
		$eml_startworkval  		= $this -> input -> req["eml_startwork"];
		$eml_payval  			= $this -> input -> req["eml_pay"];
		$eml_yearval 			= $this -> input -> req["eml_year"];
		$eml_phoneval  			= $this -> input -> req["eml_phone"];
		$eml_emailval  			= $this -> input -> req["eml_email"];
		$eml_resumeval  		= $this -> input -> req["eml_resume"];
		$eml_enclosureval  		= $this -> input -> req["eml_enclosure"];
		$eml_enclosurefileval  	= $this -> input -> req["eml_enclosurefile"];

		$eml_addtimeval 		= time();
		
		$insertsql ="INSERT INTO `".$this -> db -> prefix."employ` (`eml_position` , `eml_name` , `eml_sex` , `eml_native` , `eml_educational`, `eml_birthday` , `eml_school` , `eml_subject`,`eml_startwork` , `eml_pay` , `eml_year` , `eml_phone` , `eml_email`,`eml_resume`,`eml_enclosure`,`eml_enclosurefile`,`eml_addtime` ) 
		VALUES (  '$eml_positionval', '$eml_nameval', '$eml_sexval', '$eml_nativeval', '$eml_educationalval', '$eml_birthdayval', '$eml_schoolval', '$eml_subjectval','$eml_startworkval', '$eml_payval', '$eml_yearval', '$eml_phoneval', '$eml_emailval', '$eml_resumeval','$eml_enclosureval', '$eml_enclosurefileval', '$eml_addtimeval')"; 
	
		
		$this -> db -> query_sql($insertsql);
		
		$this -> view -> assign('info_title',$_LANG['bd_addsusse']);
		$this -> view -> assign('URL_TIME',URL_TIME);
		$this -> view -> assign('get_url',BASE_WEBURL."/?resume.html&type=infolist&id=".$inv_idval );
		$this -> view -> display('suggestion.tpl');
		
	
	}	
}

$Employ = new Employ();

if($GLOBALS['Webur'] -> getval["type"]=='infolist')
{
	$Employ -> infolist();
}else if($GLOBALS['Webur'] -> getval["type"]=='add_info')
{
	$Employ -> add_info();
}else{
	$this -> error('404');
}

?>