"education", "36" => "restaurants", "35" => "bars_and_pubs", "7" => "hotels"); $vibesasia_sql = "SELECT category_id FROM `cms_category` WHERE `category_parent` = 1"; $vibesasia_result = $db->query($vibesasia_sql); while($r = mysql_fetch_array($vibesasia_result)) { $vibesasia_group[$r["category_id"]] = "shopping"; } $result = $db->query($sql); $category_cnt = array(); while($r = mysql_fetch_array($result)) { $category_cnt[$r["business_classification"]] = $r["cnt"]; } $cat_coll = new CategoryCollection($db); $catListArr = $cat_coll->getCategoryList(); //print_r($catListArr); $all_cat = $checker = array(); foreach ($catListArr as $key => $value) { $all_cat[$key] = $checker[$key] = $value; } if(isset($_GET["by_keyword"])) { //$category_header = "Directory > Keyword Search "; $category_header = "Directory > Keyword Search "; $namex = ""; if(isset($_GET["bc"])) { foreach($checker[0] as $cat_key => $category) { $matched = false; foreach($all_cat[$cat_key] as $sub_cat_key => $sub_category) { if($sub_category['category_id'] == $_GET["bc"]) { $matched = true; $namex = $sub_category['category_name']; break; } } if($matched) break; } } if($namex != "") { $category_header .= " > ".$namex.""; } } else { //$category_header = "Directory > "; $category_header = "Directory > "; } $current_header = ""; $parent_header = ""; foreach($checker[0] as $cat_key => $category) { foreach($all_cat[$cat_key] as $sub_cat_key => $sub_category) { if($sub_category['category_id'] == $_GET["category"]) { $sub_category_name = $sub_category['category_name']; //array_push($tmp_header_arr, "".$sub_category['category_name'].""); //$current_header = "".$sub_category_name.""; $parent_cat = $checker[0][$sub_category['category_parent']]; $current_header = "".$sub_category_name."";//redirect link if($parent_header == "") { //$parent_header = "".$parent_cat['category_name'].""; $parent_header = "".$parent_cat['category_name'].""; } } } } if(isset($_GET["by_keyword"])) { //$$category_header .= $_GET["cname"]; } else { $category_header .= $parent_header." > ".$current_header; } if(isset($_GET["name"])) { $category_header .= " > ".urldecode($_GET["name"]); } //get article(s) $artilce_coll = new ArticleCollection($db); $article_ary = $artilce_coll -> getArticleByBc($_GET['category'],$iMenuNoOfArticle+1); //get article(e) foreach ($article_ary as $article_key => $article_info){ if (get_magic_quotes_gpc()) { $article_ary[$article_key]['title_text'] = stripslashes($article_info['title_text']); $article_ary[$article_key]['title_text_short'] = stripslashes($article_info['title_text_short']); $article_ary[$article_key]['author_text'] = stripslashes($article_info['author_text']); } } if(isset($_GET["category"])) { include("../class/Category.php"); $page = 1; if(isset($_GET["page"]) && is_int($_GET["page"]+0) ) { $page = $_GET["page"]; } $content_collection = new ContentCollection($db); $cat = array(); $cat["RECORD_PER_PAGE"] = 10; $cat["offset"] = ($page-1)*10; $cat["major_cat"] = $_GET["category"]; if(isset($_GET["district"])) { $cat["district_id"] = addslashes($_GET["district"]); } $cat["orderby"] = "content_name_eng"; if(isset($_GET["orderby"])) { if($_GET["orderby"] == "name" ) $cat["orderby"] = "content_name_eng"; else if( $_GET["orderby"] == "location" ) $cat["orderby"] = "content_district_eng"; } $content_collection->loadContents($cat); $r = $content_collection->getContentArr(); $imgs = $content_collection->getContentImage(); $right_html = ""; if($content_collection->getCollectionSize() > 0) { $right_html .= ""; foreach ($r as $key => $content_info_ary){ //get article(s) $param = ''; $param['biz_id'] = $content_info_ary['business_id']; $param['orderby'] = ''; $param['approved'] = 'Yes'; //$param['RECORD_PER_PAGE'] = '6'; $artilce_coll_tmp = new ArticleCollection($db); $artilce_coll_tmp -> loadArticles($param); $r[$key]['article_ary'] = $artilce_coll_tmp -> getArticleArr(); //get article(e) if ($r[$key]['article_ary']){ foreach ($r[$key]['article_ary'] as $article_key => $article_info){ if (get_magic_quotes_gpc()) { $r[$key]['article_ary'][$article_key]['title_text'] = stripslashes($article_info['title_text']); $r[$key]['article_ary'][$article_key]['title_text_short'] = stripslashes($article_info['title_text_short']); $r[$key]['article_ary'][$article_key]['author_text'] = stripslashes($article_info['author_text']); } } } //get product(s) $aProductQuery['cid'] = $content_info_ary['content_id']; $oProductCollection = new ProductCollection($db); $aResult = $oProductCollection->searchByQueryStr($aProductQuery); $iTotal = $oProductCollection->getTotal(); if ($iTotal > 0) $r[$key]['product'] = true; //get product(e) } $right_html .= Content::getContentListHTML ($r, $imgs ,$sub_category_name); $right_html .= "
".Content::getPagingStyle1($page, ceil($content_collection->getCollectionSize()/10))."
"; } else { $right_html .= "
"; } $right_html .= ""; $cat = array(); $cat["RECORD_PER_PAGE"] = 1000; //$cat["offset"] = ($page-1)*10; $cat["major_cat"] = $_GET["category"]; $cat["orderby"] = "content_district_eng"; $content_collection->loadContents($cat); $r = $content_collection->getContentArr(); $district_cnt = array(); $district_collection = array(); foreach($r as $k => $v) { if(!isset($district_cnt[$v["content_district_eng"]])) { $district_cnt[$v["content_district_eng"]] = 1; $district_collection[$v["content_district_eng"]] = $v["district_name"]; } else { $district_cnt[$v["content_district_eng"]]++; } } $district_html = ""; $unknown_text = ""; $total = 0; //print_r($_GET);die; foreach($district_collection as $k => $v) { if(isset($district_cnt[$k])) $total += $district_cnt[$k]; if (strlen($v)>23){ $v = substr($v, 0, 20); $v .= '...'; } //$tmp = "".(($v=="")?"Unknown district":stripslashes($v))." (".((isset($district_cnt[$k]) && $district_cnt[$k] > 0)?$district_cnt[$k]:"0").")"."
"; $tmp = ""; if($v == "") { $unknown_text .= $tmp; } else { $district_html .= $tmp; } } $district_html .=""; //if(0) if($total > 0) { $left_html = ''; $left_html .= ''; $left_html .= '
'; //$left_html .= "All Districts (".$total.")"."
"; //$left_html .= ""; $left_html .= ""; $left_html .= $unknown_text; //$left_html .= "
"; $left_html .= $district_html; $left_html .= ''; $left_html .= ''; } else { } ?> window.location.href = 'content_list.php?category=36'; "; echo ""; } ?>
 
$article_info){$rec_count++;?>
Featured Article