<?php
/* =============================================================== *\
|		Module name:      FAQ										|
|																	|
\* =============================================================== */

if (!defined('IN_SITE')){
     die('Hacking attempt!');
}
//Module language
//$Func->import_module_language("home/lang_faq". PHP_EX);

//Call global functions --------------
$HomeGlobal->cat_menu();
$HomeGlobal->show_poll();
$HomeGlobal->show_logos();
$HomeGlobal->show_events();
$HomeGlobal->show_news_picture();
$HomeGlobal->show_global_hotarticles();
$HomeGlobal->show_latest_box();
//------------------------------------

$Faq = new FAQ;

class FAQ
{
	function FAQ(){
		$this->view_faqs();
	}

	function view_faqs(){
		global $DB, $Info, $Template, $Lang, $Func;

		$Info->tpl_main		= "faq_list";

		$DB->query("SELECT * FROM ". $DB->prefix ."faq ORDER BY faq_order ASC");
		$faq_count	= $DB->num_rows();
		$faq_data	= $DB->fetch_all_array();
		$DB->free_result();

		for ($i=0; $i<$faq_count; $i++){
			$Template->set_block_vars("faqrow", array(
				"ID"			=> $faq_data[$i]["faq_id"],
				"QUESTION"		=> $faq_data[$i]["question"],
				"ANSWER"		=> html_entity_decode($faq_data[$i]["answer"]),
				'U_VIEW'		=> $Func->compile_url(array('mod' => 'faq')),
			));
		}

		$Template->set_vars(array(
			"L_FAQS"			=> $Lang->data["faqs"],
			'BROWSER_NAVIGATOR'	=> ' - '. $Lang->data['general_faq'],
		));
	}
}

?>