<?php
/**
 *----------------------------------------------------------------------------*
 * 版权所有 2005-2010 GV32.COM，并保留所有权利。
 * 网站地址: http://www.gv32.com；
 * 作者: GV32.COM
 *----------------------------------------------------------------------------*
**/
class Employ
{
	function Employ()
	{
		
		//缓存
		if($GLOBALS["WebConfig"]["webtmp"]==1)
		{
			$GLOBALS['Templ'] -> caching = true;
			if($GLOBALS["WebConfig"]["webtmptime"] > 0 )
			{
				$GLOBALS['Templ'] -> cache_lifetime = $GLOBALS["WebConfig"]["webtmptime"] ;
			}else{
				$GLOBALS['Templ'] -> cache_lifetime = 3600 ;  //60 *  60 * 24
			}
			$smdirid 	= trim($_REQUEST["id"]).trim($_REQUEST["pageNum"]);
			$GLOBALS['Templ'] -> cache_dir = ROOT_PATH.$GLOBALS['cache_path'].'/'.$GLOBALS['Helpe'] -> buildsmartydir( $type = 'e',$smdirid);
		}
		
		$getconfig = $GLOBALS['Helpe'] -> get_config();
		$GLOBALS['Templ'] -> assign('getconfig',$getconfig);

		$getmenu = $GLOBALS['Helpe'] -> get_menu();
		$GLOBALS['Templ'] -> assign('getmenu',$getmenu);
		
		$getprosort  = $GLOBALS['Helpe'] -> get_prosort();
		$GLOBALS['Templ'] -> assign('getprosort',$getprosort);
		
		$getlink = $GLOBALS['Helpe'] -> get_link();
		$GLOBALS['Templ'] -> assign('getlink',$getlink);	
		
		$getads = $GLOBALS['Helpe'] -> get_ads( $instr = '1,2,3,4,5,6,7,8,9,10,11' );
		$GLOBALS['Templ'] -> assign('getads',$getads);
		$getuserlink = $GLOBALS['WebSe']->getuserlink();
		$GLOBALS['Templ']->assign('getuserlink',$getuserlink);	
		
		$act = trim($_REQUEST["act"]);
		if($act=='')
		{
			$this -> infolist();
		}
			
	}
	
	function infolist()
	{	
		$webtitle = '职位应聘';
		//处理你现在的位置
		if( $GLOBALS["WebConfig"]["webhtml"] == 1 )
		{
			$nowaddress = '您的位置：<a href="'.BASE_WEBURL.'/">首页</a> > <a href="'.BASE_WEBURL.'/?load=employ&act=infolist">职位应聘</a>';
		}else{
		
		}
		$GLOBALS['Templ'] -> assign('webtitle',$webtitle);
		$GLOBALS['Templ'] -> assign('nowaddress',$nowaddress);

		$id  = $GLOBALS['Reque'] -> getval["id"];
		
		if($id  > 0 )
		{
			$sqlQuery 	= " SELECT inv_id, inv_position FROM  ".SQL_PREFIX."invite  WHERE inv_id = ".$id." ORDER BY  inv_id  ";

			$infodetail = $GLOBALS['MySql']  ->  selectOne($sqlQuery);
		}
		$GLOBALS['Templ'] -> assign('infodetail',$infodetail);
		if($sid !='' or $pageNum!='' or  $newkeyword !='')
		{
			$cache_id = $sid.'p'.$pageNum.'k'.$keyid;
		}
		$GLOBALS['Templ'] -> display('employ_tpl.html',$cache_id );
	}
	
	function addinfo()
	{
		$inv_idval 			= $GLOBALS['Reque'] -> funpost("inv_id");
		$eml_positionval 		= $GLOBALS['Reque'] -> funpost("eml_position");
		$eml_nameval  			= $GLOBALS['Reque'] -> funpost("eml_name");
		$eml_sexval  			= $GLOBALS['Reque'] -> funpost("eml_sex");	
		$eml_nativeval 			= $GLOBALS['Reque'] -> funpost("eml_native");
		$eml_educationalval  	= $GLOBALS['Reque'] -> funpost("eml_educational");
		$eml_birthdayval  		= $GLOBALS['Reque'] -> funpost("eml_birthday");
		$eml_schoolval 			= $GLOBALS['Reque'] -> funpost("eml_school");
		$eml_subjectval 		= $GLOBALS['Reque'] -> funpost("eml_subject");
		$eml_startworkval  		= $GLOBALS['Reque'] -> funpost("eml_startwork");
		$eml_payval  			= $GLOBALS['Reque'] -> funpost("eml_pay");
		$eml_yearval 			= $GLOBALS['Reque'] -> funpost("eml_year");
		$eml_phoneval  			= $GLOBALS['Reque'] -> funpost("eml_phone");
		$eml_emailval  			= $GLOBALS['Reque'] -> funpost("eml_email");
		$eml_resumeval  			= $GLOBALS['Reque'] -> funpost("eml_resume");
		$eml_enclosureval  		= $GLOBALS['Reque'] -> funpost("eml_enclosure");
		$eml_enclosurefileval  	= $GLOBALS['Reque'] -> funpost("eml_enclosurefile");

		$eml_addtimeval 			= time();
		
		$insertsql ="INSERT INTO `".SQL_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')"; 
	
		
		$GLOBALS['MySql'] -> querySql($insertsql);
		
		$GLOBALS['Templ'] -> assign('infomessage',$GLOBALS['_LANG']['bd_addsusse']);
		$GLOBALS['Templ'] -> assign('URL_TIME',URL_TIME);
		$GLOBALS['Templ'] -> assign('geturl',BASE_WEBURL."/?load=invite&act=detail&id=".$inv_idval );
		$GLOBALS['Templ'] -> display('suggestion_tpl.html');
		
	
	}	
}

$Employ = new Employ();

?>