<?php

	if (!defined('IN_HUGLO')) {
		exit;
	}
	
	$navct = array();
	
	$sql = 'SELECT * FROM ' . CATEGORY_TABLE . ' WHERE category_parent_id IN (5,30) AND category_display = 1 ORDER BY category_sort ASC';
	$result = mysql_query($sql);
	while($row = mysql_fetch_assoc($result)) {
		$navct[$row['category_id']] = array(
			'category_parent_id'=>	$row['category_parent_id'],
			'category_name_fr'	=>	$row['category_name_fr'],
			'category_name_en'	=>	$row['category_name_en'],
			'category_page'		=>	$row['category_page'],
			'category_url'		=>	$row['category_url'],
			'category_is'		=>	$row['category_is'],
			'category_var'		=>	$row['category_var']
		);
	}
	mysql_free_result($result);
	
	foreach($navct as $key => $value) {
		if($value['category_parent_id'] == 5) {
			$template->assign_block_vars('navctrow', array(
				'V_C_IS'	=>	($value['category_is']) ? true : false,
				'T_C_NAME'	=>	$value['category_name_' . $l],
				'U_C_LINK'	=>	($value['category_url']) ? $value['category_url'] : (BASE_PATH . '/' . $value['category_page'] . '.php' . (($value['category_var']) ? '?category_id=' . $key : ''))
			));
		}

		foreach($navct as $skey => $svalue) {
			if($key == $svalue['category_parent_id']) {
				$template->assign_block_vars('navctrow.navctsrow', array(
					'U_SC_LINK'	=>	($svalue['category_url']) ? $svalue['category_url'] : (BASE_PATH . '/' . $svalue['category_page'] . '.php' . (($svalue['category_var']) ? '?category_id=' . $skey : '')),
					'T_SC_NAME'	=>	$svalue['category_name_' . $l]
				));
			}
		}
	}

	unset($navct);

?>
