<?php

	define('IN_HUGLO', true);
	require_once('./common.php');
	require_once(ROOT_PATH . 'includes/menu_cabinet.php');

	$members_id = isset($_GET['members_id']) ? (is_numeric($_GET['members_id']) ? $_GET['members_id'] : 0) : 0;

	$sql = 'SELECT c2.category_id, c2.category_parent_id, c1.category_name_fr , c2.category_name_fr AS category_s_name_fr, c1.category_name_en , c2.category_name_en AS category_s_name_en, c2.category_bg_img, c2.category_bg_color FROM ' . CATEGORY_TABLE . ' c1 LEFT JOIN ' . CATEGORY_TABLE . ' c2 ON c2.category_parent_id = c1.category_id WHERE c2.category_id = 14';
	$result = mysql_query($sql);
	$category = mysql_fetch_assoc($result);
	mysql_free_result($result);

	$sql = 'SELECT * FROM ' . MEMBERS_TABLE . ' WHERE members_id = ' . $members_id;
	$result = mysql_query($sql);
	$members = mysql_fetch_assoc($result);
	mysql_free_result($result);

	$template->assign_vars(array(
		'T_IMG'				=>	$members['members_img'],
		'T_M_NAME'			=>	$members['members_name'],
		'T_M_JOB'			=>	$members['members_job_' . $l],
		'T_M_CONTACT'		=>	$members['members_contact_' . $l],
		'T_M_INTRO'			=>	$members['members_intro_' . $l],
		'T_M_CV'			=>	preg_replace('/(\r\n|\n|\r)/', '', $members['members_cv_' . $l]),

		'T_NAME_PAGE'		=>	$category['category_s_name_' . $l],
		'V_C_NAME'			=>	$category['category_s_name_' . $l],
		'V_BG'				=>	true,
		'V_BG_IMG'			=>	$category['category_bg_img'],
		'V_BG_COLOR'		=>	$category['category_bg_color'],
		'V_CV_PRINT'		=>	true
		
	));

	$template->set_filenames(array('body' => 'view_members.html'));
	$template->display('body');

	unset($members);
	$db->sql_close();

?>
