<?php
/**
 *----------------------------------------------------------------------------*
 * 版权所有 2005-2013 GV32.COM，并保留所有权利。
 * 网站地址: http://www.gv32.com；
 * 作者: GV32.COM
 *----------------------------------------------------------------------------*
**/

class Index
{
	function Index()
	{
		$GLOBALS['Helpe']-> get_usermenu();
		$getmenu = $GLOBALS['Helpe']->get_menu();
		$GLOBALS['Templ']->assign('getmenu',$getmenu);
		
		$getlink = $GLOBALS['Helpe']->get_link();
		$GLOBALS['Templ']->assign('getlink',$getlink);
		
		$getuserlink = $GLOBALS['WebSe']->getuserlink();
		$GLOBALS['Templ']->assign('getuserlink',$getuserlink);

	}
	
	function infolist()
	{


		$userdetail = $this -> userdetail();
		
		$webtitle = '用户中心';
		//处理你现在的位置
		$nowaddress = '您的位置：<a href="'.BASE_WEBURL.'/">首页</a> > <a href="'.BASE_WEBURL.'/user/">用户中心</a>';


		$GLOBALS['Templ'] -> assign('webtitle',$webtitle);
		$GLOBALS['Templ'] -> assign('nowaddress',$nowaddress);
		
		//echo $GLOBALS['tpl_path'];
		
		$GLOBALS['Templ']-> display('index_tpl.html');
	}

	function userdetail()
	{
		$webuse_id = $_SESSION["webUser"]["use_id"] ;
		
		$sqluser = " SELECT *  FROM  ".SQL_PREFIX."userdetail  WHERE use_id = ".$webuse_id."  GROUP BY use_id ORDER BY `use_id` LIMIT 1 ";
		
		$UserDetail = $GLOBALS['MySql'] -> selectOne($sqluser);
		
		$UserDetail["usd_rankimg"] = $GLOBALS['Helpe'] -> get_rank($UserDetail["usd_rankpoints"],'all'); 
		
		$GLOBALS['Templ'] -> assign('UserDetail',$UserDetail);
		//var_dump( $UserDetail );
		
	}
	
	function update()
	{
		//var_dump($_REQUEST);
		$use_idval 			    = $_SESSION["webUser"]["use_id"];
		$usd_sexval 			= $GLOBALS['Reque'] -> funpost("usd_sex");
		$usd_nickval 			= $GLOBALS['Reque'] -> funpost("usd_nick");
		$usd_birthdayval 		= $GLOBALS['Reque'] -> funpost("usd_birthday");
		$usd_saltval 			= $GLOBALS['Reque'] -> funpost("usd_salt");
		$usd_msnval 			= $GLOBALS['Reque'] -> funpost("usd_msn");
		$usd_qqval 				= $GLOBALS['Reque'] -> funpost("usd_qq");
		$usd_officephoneval 	= $GLOBALS['Reque'] -> funpost("usd_officephone");
		$usd_homephoneval 		= $GLOBALS['Reque'] -> funpost("usd_homephone");
		$usd_mobileval 			= $GLOBALS['Reque'] -> funpost("usd_mobile");
		$usd_provinceval 		= $GLOBALS['Reque'] -> funpost("usd_province");
		$usd_addressval 		= $GLOBALS['Reque'] -> funpost("usd_address");
		$usd_truenameval 		= $GLOBALS['Reque'] -> funpost("usd_truename");
		
		if($use_idval)
		{
			$updatesql = "UPDATE `".SQL_PREFIX."userdetail` SET  usd_sex = '".$usd_sexval."' , usd_nick = '".$usd_nickval."' , usd_birthday = '".$usd_birthdayval."' , usd_salt = '".$usd_saltval."' , usd_msn = '".$usd_msnval."' , usd_qq = '".$usd_qqval."' , usd_officephone = '".$usd_officephoneval."' , usd_homephone = '".$usd_homephoneval."' , usd_mobile = '".$usd_mobileval."' , usd_province = '".$usd_provinceval."' , usd_address = '".$usd_addressval."' , usd_truename = '".$usd_truenameval."'  WHERE  use_id = '".$use_idval."' ";
			
			$GLOBALS['MySql'] -> querySql( $updatesql );
		}
			$GLOBALS['Templ'] -> assign('infomessage',$GLOBALS["Templ"]->tpl_vars["LA_editsusse"]->value);
			$GLOBALS['Templ'] -> assign('URL_TIME',URL_TIME);
			$GLOBALS['Templ'] -> assign('geturl',WEBURL."/user/index.php/");
			$GLOBALS['Templ'] -> display('suggestion_tpl.html');
		
	}
	

	
	
}

$Index = new Index();

?>