0 && $category_id1 == '' ) { $category_id1 = attribValue("product_categories", "id", "where section_id='". $section_id ."' order by sort_order limit 1"); $_SESSION['PRODUCT_CATEGORY_SELECTED'] = $category_id1; } if ( $_GET['section'] == '' ) { if ( $category_id1 == '' ) $sq = "select * from sections where stype='2' order by id asc LIMIT 1"; else $sq = "select * from sections where stype='2' and id IN (select section_id from product_categories where id=". $category_id1 ." order by sort_order) LIMIT 1"; $result = mysql_query($sq); if ( $r = mysql_fetch_assoc($result) ) { $section_id = $r['id']; } } if ( $_SESSION['PRODUCT_CATEGORY_SELECTED'] == '' ) { $_SESSION['PRODUCT_CATEGORY_SELECTED'] = $category_id; if ( $category_filter == '' ) $category_filter = " AND category_id='". $_SESSION['PRODUCT_CATEGORY_SELECTED'] ."' "; } $_SESSION['PRODUCT_SECTION'] = $section_id; if ( $section_id > 0 && $category_id1 == '' ) $section_filter = " AND category_id IN (select id from product_categories where section_id=$section_id) "; if ($_SESSION['PRODUCT_CATEGORY_SELECTED'] == '' || $category_id1 != '' ) { $category_id = isset($category_id1) ? $category_id1 : 0; $_SESSION['PRODUCT_CATEGORY_SELECTED'] = $category_id; if ($category_id > 0 ) if ( $section_filter == '' ) $category_filter = " AND category_id='". $_SESSION['PRODUCT_CATEGORY_SELECTED'] ."' "; else $category_filter = ' '; } $fe_limit = $section_filter . $category_filter . ' order by sort_order '; $term = 'keyword search'; if ( isset ($_POST['keyword_search']) ) { $_SESSION['SEARCH_FILTER'] = $_POST['keyword_search']; $term = $_POST['keyword_search']; //echo "select * from products where featured ='no' and active='yes' and title LIKE '%". $term ."%' "; $rst = mysql_query("select * from products where featured ='no' and active='yes' and title LIKE '%". $term ."%'") ; $tot_searched = mysql_num_rows($rst); $search_results = 'Search result for "'. $term .'" showing '. $tot_searched .' matches'; } else { $_SESSION['SEARCH_FILTER'] = ''; } $sql = "select * from products where featured ='no' and active='yes' ". $section_filter ."" ; $_SESSION['SELECTED_MENU_SECTION'] = $section_id; include_once("includes/header.php"); ?>