<?php

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

	$category_id = isset($_GET['category_id']) ? (is_numeric($_GET['category_id']) ? $_GET['category_id'] : 18) : 18;
	
	$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 = ' . $category_id;
	$result = mysql_query($sql);
	$category = mysql_fetch_assoc($result);
	mysql_free_result($result);

	$sql = 'SELECT * FROM ' . CONTENT_TABLE . ' WHERE category_id = ' . $category_id;
	$result = mysql_query($sql);
	$veille = mysql_fetch_assoc($result);
	mysql_free_result($result);


	$template->assign_vars(array(
		'T_VEILLE_NAME'		=>	$category['category_s_name_' . $l],
		'T_VEILLE'			=>	$veille['content_text_' . $l],

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

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

	$db->sql_close();

?>
