* SPDX-License-Identifier: AGPL-3.0-only ************************************/ require_once('include/utils/utils.php'); function getNoofFaqsPerCategory($category_name) { $faq_array = $_SESSION['faq_array']; $count = 0; for($i=0;$i'; $list .= '
'; for($i=0;$i'.$faq_array[$i]['question'].' '; } if(!$record_exist) $list .= getTranslatedString('LBL_NO_FAQ'); $list .= '
'.$faq_array[$i]['answer'].'
'; return $list; } function ListFaqsPerCategory($category_index) { $list = ''; $category_array = $_SESSION['category_array']; $faq_array = $_SESSION['faq_array']; $category = $category_array[$category_index]; $list = '
'.getTranslatedString('LNK_CATEGORY').': '.portal_purify($category).'
'; $list .= '
'; for($i=0;$i'.$faq_array[$i]['question'].' '; } } if(!$flag) $list .= getTranslatedString('LBL_NO_FAQ_IN_THIS_CATEGORY'); $list .= '
'.$faq_array[$i]['answer'].'
'; return $list; } function ListFaqsPerProduct($productid) { $list = ''; $product_array = $_SESSION['product_array']; $faq_array = $_SESSION['faq_array']; $list = '
'.getTranslatedString('LBL_PRODUCT').': '.getProductname(portal_purify($productid)).'
'; $list .= '
'; for($i=0;$i'.$faq_array[$i]['question'].' '; } } if(!$flag) $list .= getTranslatedString('LBL_NO_FAQ_IN_THIS_PRODUCT'); $list .= '
'.$faq_array[$i]['answer'].'
'; return $list; } function getArticleIdTime($faqid,$product_id,$faqcategory,$faqcreatedtime,$faqmodifiedtime) { $list .='
'.getTranslatedString('LBL_FAQ_ID').': '.$faqid.'
'.getTranslatedString('LBL_PRODUCT').': '.getProductName($product_id).'
'.getTranslatedString('LBL_CATEGORY').': '.$faqcategory.'
'.getTranslatedString('LBL_CREATED_DATE').': '.substr($faqcreatedtime,0,10).'
'.getTranslatedString('LBL_MODIFIED_DATE').': '.substr($faqmodifiedtime,0,10).'
'; return $list; } function getPageOption() { $list .= '
'.getTranslatedString('LBL_PRINT_THIS_PAGE').' '.getTranslatedString('LBL_EMAIL_THIS_PAGE').' '.getTranslatedString('LBL_ADD_TO_FAVORITES').'
'; $list .= ''; return $list; } function getProductName($productid) { $product_array = $_SESSION['product_array']; $productname = ''; for($i=0;$i'.$category_array[$i].''; } $comboarray .= ''; $comboarray .= ''; for($i=0;$i'.$product_array[$i]['productname'].''; } $comboarray .= ''; $comboarray .= ''; return $comboarray; } function getSearchResult($search_text,$search_value,$search_by) { $faq_array = $_SESSION['faq_array']; $list = '
'.getTranslatedString('LBL_SEARCH_RESULT').'
'; $list .= '
'; if($search_value == 'All') { if (is_array($faq_array)){ //crmv@122368 for($i=0;$i'.$faq_array[$i]['question'].' '; } } } //crmv@122368 if(!$record_exist) $list .= getTranslatedString('LBL_NO_FAQ_IN_THIS_SEARCH_CRITERIA'); } elseif($search_by == 'category') { if(is_array($faq_array)){ //crmv@122368 for($i=0;$i'.$faq_array[$i]['question'].' '; } } } //crmv@122368 if(!$record_exist) $list .= getTranslatedString('LBL_NO_FAQ_IN_THIS_SEARCH_CRITERIA'); } elseif($search_by == 'products') { $product_array = $_SESSION['product_array']; $faq_array = $_SESSION['faq_array']; for($i=0;$i'.$faq_array[$j]['question'].' '; } } } } if(!$record_exist) $list .= getTranslatedString('LBL_NO_FAQ_IN_THIS_SEARCH_CRITERIA'); } $list .= '
'.$faq_array[$i]['answer'].'
'.getTranslatedString('LBL_CATEGORY').': '.$faq_array[$i]['category'].'
'.$faq_array[$i]['answer'].'
'.$faq_array[$j]['answer'].'
'; return $list; } function text_length($str){ $length = strlen($str); if($length > 25){ $str = substr($str,0,25).".."; return $str; } return $str; } ?>