/** * Fetch all sub categories for a category * * @param $catId integer category ID to fetch its child categories * @param $catName string category name * @return boolean on failure * @return string on success */ public function fetchAllSubCategories($catId = "", $catName = "") { global $gdbObj; $sql = "SELECT s.sub_category_id,s.name FROM " . self::$table_cat . " m," . self::$table_sub_cat . " s where\n\t\ts.main_category_id = '{$catId}' AND m.main_category_id = s.main_category_id"; $resut = $gdbObj->query($sql); $existCount = $gdbObj->num_rows($resut); if ($existCount < 1) { return false; } else { $counter = 1; while ($row = mysql_fetch_array($resut)) { $subCatId = $row[0]; $subCatName = $row[1]; $results .= formatSubCategory($catId, $catName, $subCatId, $subCatName); $counter++; } return $results; } }
<script src="http://cdn.printfriendly.com/printfriendly.js" type="text/javascript"></script> <a href="http://www.printfriendly.com" class="printfriendly" onclick="window.print(); return false;" title="Print"><img src="http://cdn.printfriendly.com/pf-print-icon.gif" alt="Print"/></a> <a href="http://www.printfriendly.com" class="printfriendly" onclick="window.print(); return false;" title="PDF"> <img src="http://cdn.printfriendly.com/pf-pdf-icon.gif" alt="PDF"/></a> </div> </div> <!--Ends listing_share_bar--> <div class="grid_17" id="listing_general"> <div class="grid_10"> <div id="title"> <h1><?php echo $title; ?> </h1> </div> <div id="category"> <ul> <?php echo formatSubCategory($mainCatId, $mainCategory, $subCatId, $subCategory); ?> <?php echo formatCategory($mainCatId, $mainCategory); ?> </ul> </div> <div id="rating" > <div class="srtgs" id="rt_listing_<?php echo $lid; ?> " <?php if ($package == 'b' || $package == 's') { ?> style="display:none" <?php }