<?php
/**
 * @package		Ad Platform
 * @author		Uta Marian - Alexandru ( -uMarian- )
 * @license		http://codecanyon.net/licenses
 * @link		http://www.uta-marian.com
 * @version		Version 1.0
 */

require_once(dirname(__FILE__).'/../../config.php');
require_once(DIR_SYSTEM.'/users/session.user.php');

$USER_ID	=	$_SESSION[USER_SESSION]['0']['user_id'];

$view->countries = $db->Query("SELECT `country_id`, `country_name` FROM countries");

$view->profile = $profile = $db->Query("select `user_email`, `up_first_name`, `up_last_name`, `up_birthday`, `up_phone`, `up_tax_id`, `ua_country`, `ua_state`, `ua_city`, `ua_zip`, `ua_address` from users left join users_profiles on users_profiles.up_user_id = users.user_id left join users_address on users_address.ua_user_id = users.user_id where user_id=?","s",$USER_ID);

$birthday	=	array();
$birthday['m']	=	date( "n" , $profile['0']['up_birthday'] );
$birthday['d']	=	date( "j" , $profile['0']['up_birthday'] );
$birthday['y']	=	date( "Y" , $profile['0']['up_birthday'] );

$view->birthday	=	$birthday;





/* set page title */
$view->title = $LANG["WBS_PROFILE_SEO"];
$view->description = $LANG["WBS_PROFILE_SEO"];
$view->keywords = $LANG["WBS_PROFILE_SEO"];

//**DEFINE CUSTOM CSS/JS FILLES**//
$view->customCode = '<link href="'.HTTP_SERVER_WEBSITE.'templates/'.WEBSITE_TEMPLATE.'/assets/css/dashboard.css" rel="stylesheet">';

$view->menu = $view->render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/plugins/users/dashboard-menu.php');
$view->header = $view->render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/header.php');
$view->footer = $view->render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/footer.php');

echo $view->render(DIR_TEMPLATE.WEBSITE_TEMPLATE.'/plugins/users/profile.php');
?>