"; include ("templates/header.htm"); // // start content // get category details $c_query = " SELECT title, description FROM $categories WHERE category_id = $current_category_id"; $c_result = db_query($c_query); if (!$c_result || db_num_rows($c_result) < 1) { $category_title = ""; $category_description = ""; } else { $c_row = db_fetch_array($c_result); $category_title = $c_row['title']; $category_description = $c_row['description']; } // if product_id is avaiable, display products // otherwise, display category details // end content echo ""; if (!isset($product_id)) { // display category details if (file_exists("$root/prodimages/catt-$category_id.jpg")) $ti = ""; else $ti = ""; echo ""; echo "
$ti

$category_title

$category_description
"; // display product ranges for category $p_query = " SELECT product_id, title FROM $products WHERE category_id = $current_category_id AND status = 'active' ORDER BY list_order ASC"; $p_result = db_query($p_query); if (!$p_result || db_num_rows($p_result) < 1) { do_error("

Error

There were no products found in this category
", "", $SCRIPT_NAME); include ("templates/footer.htm"); exit; } else { echo ""; $col = 1; while ($p_row = db_fetch_array($p_result)) { if ($col == 1) echo ""; ///////////////////////////// // alias feature to add here /* if ($p_row['product_id'] == 99) echo ""; } } if ($col == 2) echo ""; if ($col == 3) echo ""; echo ""; } echo "
" . $p_row['title'] . "

"; else echo "
" . $p_row['title'] . "

"; */ //////////////////////////// echo "
" . $p_row['title'] . "
"; $col ++; if ($col == 4) { $col = 1; echo "
  
"; } else { if ($product_id == "") $query_append = ""; else { if ($product_id == (0 + $product_id)) $query_append = " AND $products.product_id = $product_id"; } // get product details from database $products_query = " SELECT $products.product_id AS product_id, $products.title AS product_title, $products.short_desc AS product_short_desc, $products.long_desc AS product_long_desc, $products.image AS product_image, DATE_FORMAT($products.date, \"%m %Y\") AS product_date, $versions.version_id AS version_id, $versions.product_code AS product_code, $versions.version_no AS version_no, $versions.title AS version_title, $versions.short_desc AS version_short_desc, $versions.long_desc AS version_long_desc, $versions.image AS version_image, $versions.price AS version_price, $versions.rrp AS version_rrp, ($versions.rrp - $versions.price) AS version_yousave, DATE_FORMAT($versions.date, \"%m %Y\") AS version_date, $versions.stock AS version_stock FROM $products, $versions WHERE $products.product_id = $versions.product_id AND $versions.price > 0 AND $versions.status = 'active' " . $query_append . " ORDER BY $products.list_order ASC, $versions.list_order ASC"; if (isset($version_id)) $big = true; else $big = false; if ($big) $products_query = " SELECT $products.product_id AS product_id, $products.title AS product_title, $products.short_desc AS product_short_desc, $products.long_desc AS product_long_desc, $products.image AS product_image, DATE_FORMAT($products.date, \"%m %Y\") AS product_date, $versions.version_id AS version_id, $versions.product_code AS product_code, $versions.version_no AS version_no, $versions.title AS version_title, $versions.short_desc AS version_short_desc, $versions.long_desc AS version_long_desc, $versions.image AS version_image, $versions.price AS version_price, $versions.rrp AS version_rrp, ($versions.rrp - $versions.price) AS version_yousave, DATE_FORMAT($versions.date, \"%m %Y\") AS version_date, $versions.stock AS version_stock FROM $products, $versions WHERE $products.product_id = $versions.product_id AND $versions.price > 0 AND $versions.status = 'active' " . $query_append . " AND $versions.version_id = $version_id"; $products_result = db_query($products_query); if (!isset($products_result) || db_num_rows($products_result) < 1) { do_error("No Products Found", "", $SCRIPT_NAME); include ("templates/footer.htm"); exit; } // start content // display product list $last_id = 0; $form_loop = 0; if ($big) { $prod_image = "prod-"; $version_url = ""; } else { $prod_image = "prodt-"; } while ($products_row = db_fetch_array($products_result)) { if (!$big) $version_url = "&version_id=" . $products_row['version_id']; $form_loop ++; $product_title = $products_row['product_title']; // display category details // display product line title & info if ($last_id != $products_row['product_id']) { echo ""; $last_id = $products_row['product_id']; if (file_exists("$root/prodimages/prod-" . $products_row['product_id'] . "jpg")) $i = ""; else $i = ""; echo "$i

" . $products_row['product_title'] . "

" . $products_row['product_long_desc'] . "
"; } echo ""; // display product info if (isset($version_id)) { $imagesize = ""; $v = "#"; } else { $imagesize = "t"; $v = "&version_id="; } if (file_exists("$root/prodimages/prodt-" . $products_row['version_id'] . ".jpg")) $i = "\"""; else $i = ""; echo "$i" . $products_row['version_title'] . "
" . $products_row['product_code'] . "

"; echo $products_row['version_short_desc']; if (isset($version_id)) echo "

" . $products_row['version_long_desc']; if ($products_row['version_stock'] > 0 && !$stock_ignore) echo "
In Stock: " . $products_row['version_stock']; if ($show_rrp && $products_row['version_yousave'] > 0) echo "
RRP: £" . $products_row['version_rrp'] . ""; echo "
Our price*
£" . $products_row['version_price'] . "
"; if ($show_rrp && $products_row['version_yousave'] > 0) echo "
YOU SAVE:
£" . $products_row['version_yousave'] . "
"; //echo "

£" . $products_row['version_price'] . "

"; echo "

tell a friend about this item"; /////////// FORM ///////////// if ($products_row['version_stock'] < 1 && !$stock_ignore) { echo "OUT OF STOCK"; // if user is logged in, place a simple link to add their email address to the stock notify list // if user is not logged in, add a form to take the users email address and add it to the stock notify list if (isset($customer_id) && $customer_id != "") { echo "
Email me when in stock"; } else { echo "

"; } } else { echo "
"; ?> "; //echo "
more...
"; echo ""; // display options if ($last_title != $products_row['product_title']) { // get options details $licence_query = " SELECT licence_id, price_extra, short_desc, long_desc, version_id, title, image FROM $licences WHERE version_id = " . $products_row['version_id'] . " AND status = 'active' AND stock = 'in' ORDER BY list_order ASC"; $licence_result = db_query($licence_query); if (!isset($licence_result) || db_num_rows($licence_result) < 1) {} else { echo "
"; //echo " none"; echo ""; if (file_exists("$root/prodimages/optt-$first_licence.jpg")) echo ""; echo "
"; } // get sub option details $options2_query = " SELECT option2_id, price_extra, short_desc, long_desc, version_id, title FROM $options2 WHERE version_id = " . $products_row['version_id'] . " AND status = 'active' AND stock = 'in' ORDER BY list_order ASC"; $options2_result = db_query($options2_query); if (!$options2_result || db_num_rows($options2_result) < 1) {} else { echo "
"; //echo " none"; echo ""; if (file_exists("$root/prodimages/opt2t-$first_option2.jpg")) echo ""; echo "
"; } }//end show options loop echo "
"; echo ""; echo "
"; } echo ""; echo ""; echo "top"; } //end if isset product id ?>