-1 order by CG_Sort"); $CG_G_count = mysql_num_rows($ReSetG); $g = 0; while ($g < $CG_G_count) { $CG_IDselect = mysql_result($ReSetG, $g, "CG_ID"); $CG_perma = mysql_result($ReSetG, $g, "perma"); $CG_DESCselect = mysql_result($ReSetG, $g, "CG_Description"); $ReSetS = mysql_query("select * from Catalogue_Sub_Groups where CS_Group_ID=" . $CG_IDselect . " order by CS_Sort,CS_Description;"); $CG_S_count = mysql_num_rows($ReSetS); if ( isset($_SESSION["CGID"]) == false || $CG_IDselect == $_SESSION["CGID"]) { // resets session for group is to prevent js error for null id div. $_SESSION["CGID"] = 0; } $list_option .= '
  • ' . strtoupper($CG_DESCselect) . ''; if ($CG_S_count == 0) { // there are no sub-groups if ($CG_IDselect == $_SESSION["CGID"]) { // resets session for group is to prevent js error for null id div. $_SESSION["CGID"] = 0; } } else { // there are sub-groups $list_option .= ' \n"; } $list_option .= "
  • \n"; ++$g; } $list_option .= '
  • BIKE SALE'; $list_option .= '
  • COMPONENT SALE'; $list_option .= '
  • BUILD YOUR BIKE'; $list_option .= '
  • MY ACCOUNT'; $item_count = 0; $cart_value = 0; $in_basket = ''; // first sum any VAT applicable items $query_items = mysql_query("select sum(SB_Quantity) as total_cart_items2,sum(SB_Quantity*SB_Price) as total_cart_value2 from (Shopping_Basket LEFT JOIN Catalogue_Items on SB_Item=CI_ID) where Catalogue_Items.CI_Tax_Treatment=2 AND SB_Session_ID='".session_id()."'"); $sum_items = mysql_fetch_array($query_items); $item_count = $sum_items['total_cart_items2']; $cart_value = $sum_items['total_cart_value2']*(1+$vat_rate); // then sum any VAT FREE items $query_items = mysql_query("select sum(SB_Quantity) as total_cart_items1,sum(SB_Quantity*SB_Price) as total_cart_value1 from (Shopping_Basket LEFT JOIN Catalogue_Items on SB_Item=CI_ID) where CI_Tax_Treatment!=2 AND SB_Session_ID='".session_id()."'"); $sum_items = mysql_fetch_array($query_items); $item_count = $sum_items['total_cart_items1']+$item_count ; $cart_value = $sum_items['total_cart_value1']+$cart_value; if ($item_count > 0) { $in_basket = 'Basket '.$item_count.''; }else{ $in_basket = 'Basket '; } ?>