compile_check = true; include_once("includes/Constants.php"); include_once("includes/Database.php"); include_once("includes/Functions.php"); include_once("includes/SiteSetting.php"); include_once("includes/common.lib.php"); include_once('libs/Smarty.class.php'); $dbObj = new database(); $dbObj->connect_db(); $fnObj = new Functions(); $area = "FAQ's"; $fnObj->csth($area); $fnObj->menurightlogin(); $fnObj->headeradd(); /**************************************************/ // get all categories here $category_sql = "select * from faq_cat as cat where del_status='0' order by f_cat asc"; $category_db = new database(); $category_db->myquery($category_sql); if($category_db->row_count > 0){ for($i=0; $i < $category_db->row_count; $i++){ $category_db->moveto($i); $category[$i]['id'] = $category_db->f_f_cat_id; $category[$i]['name'] = $category_db->f_f_cat; } } //echo "
";
//print_r($category);
//echo "
"; /**************************************************/ // get all faqs by categories for($i=0; $i < sizeof($category); $i++){ $faq_sql = "select * from tbl_faqs where f_cat_id = {$category[$i]['id']}"; $faq_db = new database(); $faq_db->myquery($faq_sql); if($faq_db->row_count > 0){ for($j=0; $j < $faq_db->row_count; $j++){ $faq_db->moveto($j); $faq[$i][$j]['catid'] = $faq_db->f_faqid; $faq[$i][$j]['faqid'] = $faq_db->f_faqid; $faq[$i][$j]['faqquestion'] = $faq_db->f_faqquestion; $faq[$i][$j]['faqanswer'] = nl2br($faq_db->f_faqanswer); $faq[$i][$j]['addeddt'] = $faq_db->f_addeddt; } } } //echo "
";
//print_r($faq);
//echo "
"; $smarty->assign("faqid",$faqid); $smarty->assign("category",$category); $smarty->assign("faq",$faq); $smarty->assign("siteroot",SITEROOT); //--------------------Blogs------------------------ $faq_sql = "select * from tbl_faqs as faq, faq_cat as cat where faq.f_cat_id=cat.f_cat_id order by cat.f_cat asc"; //$rs=$dbObj->cgs("tbl_faqs","","","","","",""); $rs = mysql_query($faq_sql); while($row=@mysql_fetch_array($rs)) { $faqs[]=$row; } $smarty->assign("faqs",$faqs); //--------------------End News------------------------ $smarty->assign("siteroot",SITEROOT); $smarty->assign("siteimg",SITEIMG); $smarty->assign("sitetitle",SITETITLE); $smarty->assign("siteslogan",SITESLOGAN); $smarty->assign("rounded_end","rounded_end.tpl"); $smarty->assign("rounded_start","rounded_start.tpl"); $smarty->assign("head","head.tpl"); $smarty->assign("menu","menu.tpl"); $smarty->assign("foot","footer.tpl"); $smarty->display("FAQs.tpl"); $fnObj->cstf(); ?>