/** * This function is used to show the brand with count * * @return string */ function dispBrandWithCount() { $id = $_POST['catsel']; if ($_SESSION['subcategory'] != "") { $id = $_SESSION['subcategory']; $mycat = " where b.category_id=" . $id; } else { $id = $_SESSION['category']; $mycat = " where b.category_parent_id=" . $id; } //if(isset($_POST['search'])) if ($id == -1) { $mycat = ''; } $sql = "Select a.brand,count(a.brand) as cnt from products_table a inner join category_table b on a.category_id=b.category_id " . $mycat . " and a.intro_date <= '" . date('Y-m-d') . "' and a.status=1 group by a.brand"; $obj = new Bin_Query(); $obj->executeQuery($sql); $res = $obj->records; return Display_DKeywordSearch::dispBrandWithCount($res, $id); }
/** * Function returns the brand,count for the search query * * * @return string */ function dispBrandWithCount() { $catid = 2; $sql = 'Select brand, count(*)as cnt from products_table where category_id=' . $catid . ' group by brand having count(*) > 0 '; $obj = new Bin_Query(); $obj->executeQuery($sql); return Display_DKeywordSearch::dispBrandWithCount($obj->records); }