/** * Function gets the cross product brand details from the table * @param array $arr * * @return string */ function corBrand($arr) { $sql = 'select distinct brand,product_id from products_table group by brand asc'; $obj = new Bin_Query(); $obj->executeQuery($sql); return Display_DProductEntry::corBrand($obj->records, $arr); }
/** * Function gets the attributes details from the database for the selected product * * * * @return string */ function displayAttributes() { $id = (int) $_GET['id']; if (is_int($id)) { // $sql = "select a.attrib_id,c.attrib_value,c.attrib_value_id,b.attrib_name from category_attrib_table a inner join attribute_table b on a.attrib_id=b.attrib_id inner join attribute_value_table c on c.attrib_id=b.attrib_id where a.subcategory_id=".$id ; $sql = 'SELECT attrib_id FROM category_attrib_table WHERE subcategory_id=' . $id; $query = new Bin_Query(); $query->executeQuery($sql); $cnt = count($query->records); for ($i = 0; $i < $cnt; $i++) { $sq = 'SELECT a.attrib_name,b.* FROM attribute_table a,attribute_value_table b WHERE a.attrib_id=b.attrib_id AND a.attrib_id=' . $query->records[$i]['attrib_id']; $que = new Bin_Query(); if ($que->executeQuery($sq)) { $tmp[] = $que->records; } } return Display_DProductEntry::displayAttributes($tmp); } }