<?php
/******************************************************************************/
//                                                                            //
//                             Smarty plugin                                  //
//                            @package Smarty                                 //
//							 @subpackage plugins                              //
//                        http://life-style.uz/                               //
//                   produced by Life Style, life-style.uz                    //
//                                                                            //
/******************************************************************************/

function smarty_function_fetch_faqs($params, &$smarty){

	$assign        = fetch_getParam('assign', $params, 'faqs');
	$fields        = fetch_getParam('fields', $params, 'faqId, question, answer, status');
	$status        = fetch_getParam('status', $params, 'V');
    $limit         = (int) fetch_getParam('limit', $params);

	if(!empty($status)) connect()->where('status', $status);

	if(!empty($limit)) connect()->limit($limit);

	$faqs =  connect()->table('faq')->select($fields)->getAll('array');
	$smarty->assign($assign, $faqs);

}