<?php
/**
 *----------------------------------------------------------------------------*
 * 版权所有 2010-2016 HuCart.COM，并保留所有权利。
 * 网站地址: http://Www.HuCart.Com；
 * 作者: HuCart.COM
 *----------------------------------------------------------------------------*
**/

class Personal
{
	function Personal()
	{
		//缓存
		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
			}
 
			$this -> view -> cache_dir = ROOT_PATH.$GLOBALS['cache_path'];
		}

 

		$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 index()
	{
		$typeval = $GLOBALS['Reque']  ->  delUrl($GLOBALS['Webur'] -> getval["idval"]);

		if($typeval =='')
		{
			$typeval = 'index';
		}
		
		$infoper = array();
		
		$sql_query 	= " SELECT per_id,per_name,per_main  FROM  ".$this -> db -> prefix."personal  WHERE per_type = '".$typeval."' ORDER BY `per_id`  ";
			
		$infoper 	= $this -> db ->  select_one($sql_query);
		
		if($infoper["per_name"]!='')
		{
			$webtitle  = $infoper["per_name"];
		}
		//var_dump($infoper);
		
		$allInfo = $this -> personal -> get_per_item($infoper);
		
		if($typeval !='' )
		{
			$cache_id = $typeval;
		}
		$this -> view ->assign('webtitle', $webtitle);
		$this -> view ->assign('allInfo', $allInfo);
		
		$this -> view -> display('personal_tpl.html',$cache_id);
	
	}

}

$Personal = new Personal();



if($GLOBALS['Webur'] -> getval["idval"] != '')
{
	$Personal -> index();
}else{
	//404error
	$this -> error('404');
}


?>