$v) { // if the current item isn't called "network_id" or "product_name" it's likely this product name contains an & if($g != "network_id" && $g != "product_name" && $g != "review") { // add the name of the current field with an escaped & to the product name to be looked up (no = sign, means just looking for a field name - not a value) $temp_name.= "&".$g; } } // any spaces in the name reverse back to + $temp_name = str_replace(" ", "+", $temp_name); // any hyphens can be converted to spaces $temp_name = str_replace("-", " ", $temp_name); // any underscores can be converted to hyphens $temp_name = str_replace("_", "-", $temp_name); // strip off any .htm extension $temp_name = str_replace(".htm", "", $temp_name); // strip off any -htm extension that could have become a victim of the above str_replace actions with the & in the product name $temp_name = str_replace("-htm", "", $temp_name); // specific rewrite to update 'i mate' to 'i-mate' from old URLs $temp_name = str_replace("i mate", "i-mate", $temp_name); $temp_name = str_replace("K JAM", "K-JAM", $temp_name); // escape the phone name for safe querying $temp_name = mysql_escape_string($temp_name); // lookup the product and its stock status $sql = "SELECT product.*, stockmessage.shorttext FROM product LEFT JOIN stockmessage ON product.stock_msg = stockmessage.office_id WHERE ("; $sql.= "name = '".$temp_name."' "; // if the network can sell all simfree phones if($network_row["sell_all_simfree"] == 1) { // add into the sql to check for "Sim Free Mobile Phone - " or " " possibilities $sql.= "OR name= 'Sim Free Mobile Phone - ".$temp_name."' OR name= '".$network_row["network_name"]." ".$temp_name."' "; } else if($network_row["network_id"] != 2) { // else, for all other networks aside from 3, check for " " possibilities $sql.= "OR name= '".$network_row["network_name"]." ".$temp_name."' "; } // specify just products available for sale, and of SIMFREE type! $sql.= ") AND sort = 'SIMFREE'"; $sql_log.= $sql."\n\n"; $result = mysql_query($sql); // if more than 1 product was found if(mysql_num_rows($result) > 1) { // lookup the product information again $sql = "SELECT product.*, stockmessage.shorttext FROM product LEFT JOIN stockmessage ON product.stock_msg = stockmessage.office_id WHERE ("; $sql.= "name = '".$temp_name."' "; // if the network can sell all simfree phones if($network_row["sell_all_simfree"] == 1) { // just check for " " possibilities this time $sql.= "OR name= '".$network_row["network_name"]." ".$temp_name."' OR name= 'Sim Free Mobile Phone - ".$temp_name."'"; } else if($network_row["network_id"] != 2) { $sql.= "OR name= '".$network_row["network_name"]." ".$temp_name."' "; } // again, confine to SIMFREE products that are available for sale $sql.= ") AND sort = 'SIMFREE' AND (type_id = 4 OR type_id = 7 OR type_id = 9)"; $sql_log.= $sql."\n\n"; $result = mysql_query($sql); } // if(mysql_num_rows($result) > 0) { $product_row = mysql_fetch_array($result); if ($product_row["type_id"] == 4 || $product_row["type_id"] == 7 || $product_row["type_id"] == 9) { logKPIClick($network_row["network_name"]."_PRODUCT", $product_row["product_id"], NULL, NULL, 'BM'); $sql = "SELECT * FROM products_tariffs LEFT JOIN tariff_types USING (tariff_sort) WHERE tariff_types.network_id = ".$_GET["network_id"]." AND products_tariffs.product_id = ".$product_row["product_id"]; $sql_log.= $sql."\n\n"; $result = mysql_query($sql); if(mysql_num_rows($result) > 0) { // phone is available on this network! $page_title = str_replace("Sim Free Mobile Phone -", $network_row["network_name"], $product_row["name"]); $product_row["name"] = $page_title; } else { if($network_row["sell_all_simfree"] == 1 && $product_row["forsale"] <> 0) { $page_title = str_replace("Sim Free Mobile Phone -", $network_row["network_name"], $product_row["name"]); $product_row["name"] = $page_title; } else { $sql = " SELECT DISTINCT networks.network_id, networks.url, networks.network_name FROM products_tariffs INNER JOIN tariff_types USING (tariff_sort) INNER JOIN networks ON tariff_types.network_id = networks.network_id WHERE products_tariffs.product_id = ".$product_row["product_id"]; $sql_log.= $sql."\n\n"; $result = mysql_query($sql); if(mysql_num_rows($result) == 1) { $tmp_row = mysql_fetch_array($result); $product_row["name"] = str_replace("Sim Free Mobile Phone -", $tmp_row["network_name"], $product_row["name"]); $product_row["name"] = str_replace("-", "_", $product_row["name"]); $product_row["name"] = str_replace(" ", "-", $product_row["name"]); $url = "http://".$_SERVER["HTTP_HOST"]."/".$product_row["name"].".htm"; sendBuzzMobileDebugEmail("BUZZ REDIRECT\n================================\n".$sql_log); header("HTTP/1.1 301 Redirect"); header("Location: ".$url); exit(); } else { $page_title = str_replace("Sim Free Mobile Phone -", "", $product_row["name"]); $error = TRUE; } } } } else { $error = FALSE; $discontinued = TRUE; $page_title = str_replace("Sim Free Mobile Phone -", $network_row["network_name"], $product_row["name"]); $product_row["name"] = $page_title; } } else { sendBuzzMobileDebugEmail($sql_log); header("HTTP/1.1 307 Redirect"); header("Location: http://www.buzz-mobile.co.uk"); exit(); $error = TRUE; } } else { sendBuzzMobileDebugEmail($sql_log); header("HTTP/1.1 307 Redirect"); header("Location: http://www.buzz-mobile.co.uk"); exit(); $error = TRUE; } if(!$error && !$discontinued) { if($product_row["type_id"] == 9) { $bits = explode(",", $product_row["bundle"]); foreach($bits AS $b) { $sql = "SELECT product_id FROM product WHERE sort='SIMFREE' AND product_id = ".$b; $result = mysql_query($sql); if(mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result); $tmp_id = $row["product_id"]; } } } else { $tmp_id = $product_row["product_id"]; } $aliases = array(); $bundles_available = FALSE; $colours_available = FALSE; $tmp = array(); $sql = "SELECT product_id, product_aliases, alt_colour_products FROM product WHERE ( (bundle LIKE '".$tmp_id."%' OR bundle LIKE '%".$tmp_id."%' OR bundle LIKE '%".$tmp_id."') OR product_id = $tmp_id ) AND (type_id = 4 OR type_id = 7 OR type_id = 9) AND product_id <> ".$product_row["product_id"]; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { array_push($tmp, $row["product_id"]); if(!empty($row["alt_colour_products"])) { $bits = explode(",", $row["alt_colour_products"]); foreach($bits AS $b) { if(!in_array($b, $tmp) && !empty($b)) { array_push($tmp, $b); $colours_available = TRUE; } } } } foreach($tmp AS $p) { if(!in_array($p, $aliases) && !empty($p)) { $sql = "SELECT product_id FROM product WHERE (type_id = 4 OR type_id = 7 OR type_id = 9) AND product_id = ".$p." AND product_id <> ".$product_row["product_id"]; $result2 = mysql_query($sql); if(mysql_num_rows($result2) == 1) { array_push($aliases, $p); $bundles_available = TRUE; } } } $sql = "SELECT product_id, product_aliases, alt_colour_products FROM product WHERE ( product_id = $tmp_id OR (alt_colour_products LIKE '".$tmp_id."%' OR alt_colour_products LIKE '%".$tmp_id."%' OR alt_colour_products LIKE '%".$tmp_id."') ) AND (type_id = 4 OR type_id = 7 OR type_id = 9) AND product_id <> ".$product_row["product_id"]; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $tmp = array(); array_push($tmp, $row["product_id"]); if(!empty($row["alt_colour_products"])) { $bits = explode(",", $row["alt_colour_products"]); foreach($bits AS $b) { if(!in_array($b, $tmp) && !empty($b)) { array_push($tmp, $b); } } } foreach($tmp AS $p) { if(!in_array($p, $aliases) && !empty($p)) { $sql = "SELECT product_id FROM product WHERE (type_id = 4 OR type_id = 7 OR type_id = 9) AND product_id = ".$p." AND product_id <> ".$product_row["product_id"]; $result2 = mysql_query($sql); if(mysql_num_rows($result2) == 1) { array_push($aliases, $p); $colours_available = TRUE; } } } } } // end error check if($error) { $document_title = "Buzz Mobile - Unbeatable Deals on Mobile Phones - "; $sql = " /* mobilefun.contractphones.inc.php:printBuzzMobileLogo() Buzz Mobile Website -> Looking up active networks to print Buzz logo */ SELECT network_name FROM networks WHERE network_active = 1 ORDER BY weight DESC"; $result = mysql_query($sql); $temp = array(); while($row = mysql_fetch_array($result)) { array_push($temp, $row["network_name"]); } $document_title .= implode(", ", $temp); if($discontinued) { $page_title = $product_row["name"]; } else { $page_title = "404 - Page Not Found"; } } else { if($discontinued) { $document_title = $page_title; } else { if(isset($_GET["review"])) { if($_GET["review"] == "write") { $document_title = $page_title." - Write A Review"; } else if($_GET["review"] == "read") { $document_title = $page_title." Reviews"; } } else { $document_title = $page_title." at unbeatable prices - order now!"; } } } ?> <?php print $document_title; ?>
   
   
"; print ""; print ""; print ""; print ""; print ""; print ""; } else { $largeimages = checkForLargerImages($product_row["product_id"]); print "
"; print "
"; print "
"; if(!isset($_GET["review"])) { print "

".$page_title."

"; } else { if($_GET["review"] == "write") { print "

".$page_title." - Write A Review

"; } else { print "

".$page_title." Reviews

"; } } print "
"; print "
"; if(!$error) { if(!strstr($network_row["network_name"], "Mobile")) { $url = "http://".$_SERVER["HTTP_HOST"]."/".$network_row["network_name"]."-Mobile-Phones.htm"; $name = $network_row["network_name"]." Mobile Phones"; } else { $url = "http://".$_SERVER["HTTP_HOST"]."/".$network_row["network_name"]."-Phones.htm"; $name = $network_row["network_name"]." Phones"; } print ""; print "\"".$name."\""; print ""; } else { print " "; } print "
"; if($error) { print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "
"; if($discontinued) { print "

This phone has been discontinued and is no longer available.

"; print "

Please continue to our home page or use the navigation to the left to try and find a phone that suits you.

"; } else { print "

Unfortunately we could not find the page you requested - you may have followed an old or outdated link.

"; print "

An email has been sent to our technical team so this can be fixed.

"; print "

Please continue to our home page or use the navigation to the left to try and find a phone that suits you.

"; } /* print "
"; print "\"404"; print "
"; print "

The ".$page_title." is not currently available on ".$network_row["network_name"].".

"; print "

Please consider the following options:

"; print "
"; print "\"".$page_title."\""; print "
"; printNetworkOptions($product_row["product_id"], 8, "product"); */ print "
"; print "
"; print ""; print ""; print ""; print ""; print "
"; print "
"; if($largeimages) { print ""; } print "\"".$product_row["name"]."\""; if($largeimages) { print ""; } print "
"; if($largeimages) { print "Larger images available"; } print "
"; if($discontinued) { print "Important"; print "

This phone has been discontinued by the manufacturer, and unfortunately is no longer available.

"; print "

If you would like some suggestions of alternative phones then contact us"; $sql = "SELECT shortname, name FROM categories LEFT JOIN products_categories ON categories.id = products_categories.category_id WHERE products_categories.product_id = ".$product_row["product_id"]." AND categories.visible <> 0 AND categories.parent_id = ".$network_row["category_id"]; $result = mysql_query($sql); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_array($result); if(!strstr($row["shortname"], $network_row["network_name"])) { $link_name = $network_row["network_name"]." ".$row["shortname"]; } else { $link_name = $row["shortname"]; } print " or browse ".$link_name." Phones for alternative phones.

"; } else { print ".

"; } } else { // verify the default tariff for this phone $tariff_id = checkHandsetTariffCombo($product_row["product_id"], $network_row["default_tariff"]); // get the deal for this tariff/phone combo $deal = getHandsetTariffDeal($product_row["product_id"], $tariff_id); if(strstr($deal[0], "ONLY")) { $tariff_id = getBestHandsetNetworkTariff($product_row["product_id"], $network_row["network_id"], $network_row["default_tariff_sort"]); $deal = getHandsetTariffDeal($product_row["product_id"], $tariff_id); } //$deal[3] = str_replace("O2 Business", "Tariff", $deal[3]); //$deal[3] = str_replace("O2", "Tariff", $deal[3]); if($deal[0] == "FREE") { $deal[0] = $deal[0]." ".trim(strtoupper(str_replace($network_row["network_name"], "", $product_row["name"]))); } print "
"; print ""; print "
"; print "Available on ".$deal[3]."
"; print "
+ ".strip_tags($deal[0])."
"; printBuzzMobileTariff($product_row, $network_row, TRUE, $tariff_id, NULL, $in_stock); print "
"; print ""; print "
"; print "
"; $num_reviews = checkForProductReviews($product_row["product_id"]); if($num_reviews > 0) { print "
"; $tmp_counter = 0; $average_product_rating = getAverageProductRating($product_row["product_id"]); if($average_product_rating >= 4) { print "Rated ".$average_product_rating." out of 5!"; } else { print "Customer rating"; } printRating($average_product_rating); if(!isset($_GET["review"]) || $_GET["review"] == "write") { print ""; $review_product_url = str_replace("-Write-A-Review.htm", ".htm", $_SERVER["REDIRECT_URL"]); $review_product_url = str_replace(".htm", "-Review.htm", $review_product_url); print ""; print "Read reviews"; print ""; print ""; } } else { print "
"; print "Customer rating"; print "
This phone hasn't been reviewed yet
"; $average_product_rating = 0; } if(!isset($_GET["review"]) || $_GET["review"] == "read") { print ""; if(!isset($_GET["review"])) { print " : "; } $writereview_product_url = str_replace("-Review.htm", ".htm", $_SERVER["REDIRECT_URL"]); $writereview_product_url = str_replace(".htm", "-Write-A-Review.htm", $writereview_product_url); print ""; print "Write a review"; print ""; print ""; print "
"; print ""; print ""; print "
"; } print "
"; if($product_row["shorttext"] == "In stock") { print "".$product_row["shorttext"]." - order now!"; print ""; $in_stock = TRUE; } else { print "Availability: "; print $product_row["shorttext"]; $in_stock = FALSE; } if(isset($_GET["review"])) { print ""; $main_product_url = str_replace("-Write-A-Review", "", $_SERVER["REDIRECT_URL"]); $main_product_url = str_replace("-Review", "", $main_product_url); print "
Read: Product description"; print "
"; } else if($num_reviews > 0) { print ""; $review_product_url = str_replace("-Write-A-Review", "", $_SERVER["REDIRECT_URL"]); $review_product_url = str_replace("-Review", "", $review_product_url); print "
Read: "; print "Customer reviews"; print ""; print "
"; } if($colours_available) { print "
Consider: Different ".$product_row["model"]." colours"; } if($bundles_available) { if(!empty($product_row["model"])) { $bundle_type = $product_row["model"]; } else { $bundle_type = "value"; } if($colours_available) { print " & $bundle_type bundles
"; } else { print "
Consider: ".ucfirst($bundle_type)." bundles
"; } } else { if($colours_available) { print ""; } } $sql = "SELECT shortname, name FROM categories LEFT JOIN products_categories ON categories.id = products_categories.category_id WHERE products_categories.product_id = ".$product_row["product_id"]." AND categories.visible <> 0 AND categories.parent_id = ".$network_row["category_id"]; $result = mysql_query($sql); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_array($result); if(!strstr($row["shortname"], $network_row["network_name"])) { $link_name = $network_row["network_name"]." ".$row["shortname"]; } else { $link_name = $row["shortname"]; } print "
Browse: "; /*if(!strstr($network_row["network_name"], "Mobile")) { $url = "http://".$_SERVER["SERVER_NAME"]."/".$network_row["network_name"]."-Mobile-Phones.htm"; $name = $network_row["network_name"]." Mobile Phones"; } else { $url = "http://".$_SERVER["SERVER_NAME"]."/".$network_row["network_name"]."-Phones.htm"; $name = $network_row["network_name"]." Phones"; } print "".$network_row["network_name"]." > ";*/ print "".$link_name." Phones"; } print "
"; } print "
"; print ""; print ""; if(isset($_GET["review"])) { if($_GET["review"] == "read") { print ""; print ""; print "
"; print "

Customer Reviews of the ".$page_title."

"; print "
"; print ""; print ""; print ""; print ""; printProductReviews($product_row["product_id"], getAverageProductRating($product_row["product_id"]), "test"); print ""; print ""; } else if($_GET["review"] == "write") { print ""; print ""; print "
"; print "

Write A Review for ".$page_title."

"; print "
"; print ""; print ""; print ""; print ""; // if a product ID has been posted, and this is not a final submission of a review if(is_numeric($product_row["product_id"]) && !isset($product_row["submit_review"])) { // fetch the data for the product $sql = "SELECT REPLACE(name, 'Sim Free Mobile Phone - ', '') AS name, product_id FROM product WHERE product_id = ".$product_row["product_id"]; $result = mysql_query($sql); // if a product was found if(mysql_num_rows($result) == 1) { // start off with submitted values as false $values_ok = TRUE; $postvars = array(); $postvars = $_POST; if(isset($_POST["preview_review"])) { print "

Preview Your Review

"; if( empty($postvars["customer_name"]) && $postvars["customer_name_option"] != "anonymous") { $values_ok = FALSE; } if( empty($postvars["review_title"]) ) { $values_ok = FALSE; } if( empty($postvars["review"]) ) { $values_ok = FALSE; } } // fetch the data $row = mysql_fetch_array($result); // print a header block of information with product image etc. print "

Thank you for reviewing the ".$row["name"].".

"; print "

Please focus your review on the item itself, and refrain from using profanity, commenting on Mobile Fun's service or responding to other users' reviews. For other guidelines on writing your review please click here.

"; print ""; print ""; print ""; print ""; print "
"; // if we're previewing and the values are OK if(isset($_POST["preview_review"]) && $values_ok) { // if the customer has chosen to be anonymous if($postvars["customer_name_option"] == "anonymous") { $postvars["customer_name"] = "Anonymous"; } $postvars["review"] = htmlspecialchars($postvars["review"], ENT_QUOTES); print "
"; print " < Back to the product page"; print "

Preview of your review

"; print "

This is what you review is going to look like:

"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "
"; print "".stripslashes(strip_tags($postvars["customer_name"])).""; // print the customers location if provided if(!empty($postvars["customer_location"])) { print "
".stripslashes(strip_tags($postvars["customer_location"])); } // print the product rating printRating($postvars["customer_rating"]); print "
"; print date("jS M Y"); print "
"; print "
"; print "".stripslashes(strip_tags($postvars["review_title"]))."
"; print nl2br(trim(stripslashes(strip_tags($postvars["review"])))); print "
"; print ""; print ""; print "
"; print ""; print "\n"; foreach($postvars AS $n => $v) { if($n != "preview_review") { print "\n"; } } print "\n"; print "
"; print "
"; print "
"; // print a hidden div around the existing print "
"; } else if(isset($_POST["preview_review"]) && !$values_ok) { print " < Back to the product page"; print "

Some information is missing

"; print "
    "; if( empty($postvars["review_title"]) ) { print "
  • Choose a title for this review
  • "; } if( empty($postvars["review"]) ) { print "
  • Please write some comments about the item
  • "; } if( empty($postvars["customer_name"]) && $postvars["customer_name_option"] != "anonymous" ) { print "
  • Please give us a name to display alongside your review. Choose 'Anonymous' if you wish it to remain private
  • "; } if( empty($postvars["customer_location"]) ) { print "
  • Please tell us where you are
  • "; } print "
"; } else { print " < Back to the product page"; print "

Write your review

"; } print "
"; print ""; print "
"; print "
"; print "How do you rate this item?"; printChooseProductRating($row["product_id"], $_POST["customer_rating"]); print ""; print "
"; print "Please enter a title or headline for your review "; print "
"; print ""; print "
"; print "
"; print "

"; print "Please review the item below "; print "
"; print ""; print "
"; print "
"; print "
"; print "Display name
"; print " "; print "
"; print " "; print "

"; print "Where are you?
"; print ""; print ""; print ""; print ""; print "

"; print ""; print "
"; print "
"; print ""; print "
"; if(isset($_POST["preview_review"])) { print "

"; print "

Other information:

"; print "
  • Please notice that all submitted reviews become the licensed property of Mobile Fun Limited.
  • "; print "
  • Your review will be posted within seven business days
"; print "
< Back to the product page"; print "
"; // end the div that hides the original form submission } else { print "

"; print "

Other information:

"; print "
  • Please notice that all submitted reviews become the licensed property of Mobile Fun Limited.
  • "; print "
  • Your review will be posted within seven business days
"; print "
< Back to the product page"; } print "
"; } } else if(isset($_POST["submit_review"])) { print "

Thank you

"; insertProductReview(); // fetch the data for the product $sql = "SELECT REPLACE(name, 'Sim Free Mobile Phone - ', '') AS name, product_id, forsale FROM product WHERE product_id = ".$_POST["product_id"]; $result = mysql_query($sql); $row = mysql_fetch_array($result); /* if($row["forsale"] == 0) { // lookup a default url to link to this product (/vodafone/, /o2/ etc) $product_url = getProductMainUrl($row["product_id"]); } else { $product_url = "product"; }*/ print "

Your product review has been received.

"; print "

Our team will post it on the website within seven business days.

"; print "

Please click here to go back to the ".$row["name"]." product page.

"; print "

People who liked the ".$row["name"]." were also interested in the following products:

"; printGridofProducts(2, 3, 20, 1, "relatedproducts", $row["product_id"]); print "
"; printGridofProducts(2, 3, 20, 1, "latest"); print "
"; printGridofProducts(2, 3, 20, 1, "topsellers"); } else { print "Hello"; } print ""; print ""; } } else { if(!$discontinued) { $sql = "SELECT name AS num_tariffs FROM products_tariffs INNER JOIN tariff_types USING (tariff_sort) INNER JOIN product ON tariff_types.tariff_product_id = product.product_id WHERE products_tariffs.product_id = ".$product_row["product_id"]." AND type_id = 4"; $result = mysql_query($sql); if(mysql_num_rows($result) == 0) { $sql = "SELECT name FROM product INNER JOIN tariff_types ON tariff_types.tariff_product_id = product.product_id WHERE tariff_types.tariff_sort = '".$network_row["default_tariff_sort"]."' AND type_id = 4"; $result = mysql_query($sql); } $num_tariffs = mysql_num_rows($result); if($num_tariffs > 1) { print ""; print ""; print "
"; print "More ".$network_row["network_name"]." Tariffs"; print "
"; print ""; printBuzzMobileTariffNetworkSelectBox($product_row, $network_row); print ""; print ""; print ""; print ""; print ""; printBuzzMobileTariff($product_row, $network_row, FALSE, FALSE, $tariff_id, $in_stock); } print ""; print ""; } print ""; print ""; print "
"; print "

".$page_title." Description

"; print "
"; print ""; print ""; print ""; print ""; $product_row["description"] = str_replace("Mobile Fun", "Buzz Mobile", $product_row["description"]); $product_row["description"] = str_replace("http://images.mobilefun.co.uk/graphics/rightarrow.gif", "http://images.mobilefun.co.uk/graphics/spacer.gif", $product_row["description"]); $product_row["description"] = str_replace("src=\"/graphics/", "src=\"http://images.mobilefun.co.uk/graphics/", $product_row["description"]); $product_row["description"] = str_replace("src='/graphics/", "src='http://images.mobilefun.co.uk/graphics/", $product_row["description"]); $product_row["description"] = str_replace("
", "
", $product_row["description"]); print $product_row["description"]; if(!$discontinued) { $network_row["short_terms"] = str_replace("�", "", $network_row["short_terms"]); print "
    "; print $network_row["short_terms"]; print "
"; } print ""; print ""; if($product_row["forsale"] <> 0 && !$discontinued) { print ""; print ""; print "
"; print "Also Available"; print "
"; print ""; print ""; printNetworkOptions($product_row["product_id"], 9, $network_row["url"]); } } // end review check if(count($aliases) > 0 && !$discontinued) { print ""; print ""; print "
"; print ""; print "

".$product_row["manufacturer"]." ".$product_row["model"]; if($colours_available) { print " Colour Options"; } if($bundles_available) { if($colours_available) { print " &"; } print " Value Bundles"; } print "

"; print "
"; print ""; print ""; /*print ""; print "";*/ $i = 0; $num_rows = count($aliases); foreach($aliases AS $p) { $sql = "SELECT REPLACE(name, 'Sim Free Mobile Phone -', '') AS name, product_id FROM product WHERE (type_id = 4 OR type_id = 7 OR type_id = 9) AND product_id = ".$p; $result = mysql_query($sql); if(mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result); $row["name"] = htmlspecialchars(trim(str_replace($network_row["name"], "", $row["name"]))); $url = "http://".$_SERVER["HTTP_HOST"]."/"; if($network_row["network_id"] == 2) { $url = $url."3-Mobile"; $name = $row["name"]; } else { $url = $url.$network_row["network_name"]; $name = $network_row["network_name"]." ".$row["name"]; } $filename = str_replace("-", "_", $row["name"]); $filename = str_replace(" ", "-", $filename); $url = $url."-".$filename.".htm"; $i++; if($i >= $num_rows) { $print_bottom_border = FALSE; } else { $print_bottom_border = TRUE; } printBuzzMobileHandsetRow($row["product_id"], $network_row["network_id"], $network_row["default_tariff"], 2, $print_bottom_border); } //print "
".$name.""; } /* print ""; print "";*/ } printBuzzMobileRelatedPhones($product_row["product_id"], $network_row); if(!isset($_GET["review"])) { print ""; print ""; print "
"; print "

Browse for Similar Phones to ".$page_title."

"; print "
"; print ""; print ""; print ""; print ""; $sql = "SELECT shortname, name FROM categories LEFT JOIN products_categories ON categories.id = products_categories.category_id WHERE products_categories.product_id = ".$product_row["product_id"]." AND categories.visible <> 0 AND categories.parent_id = ".$network_row["category_id"]; $result = mysql_query($sql); if(mysql_num_rows($result) > 0) { while($row = mysql_fetch_array($result)) { if(!strstr($row["shortname"], $network_row["network_name"])) { $link_name = $network_row["network_name"]." ".$row["shortname"]; } else { $link_name = $row["shortname"]; } print "".$link_name." Mobile Phones
"; } if(!strstr($network_row["network_name"], "Mobile")) { $url = "http://".$_SERVER["HTTP_HOST"]."/".$network_row["network_name"]."-Mobile-Phones.htm"; $name = $network_row["network_name"]." Mobile Phones"; } else { $url = "http://".$_SERVER["HTTP_HOST"]."/".$network_row["network_name"]."-Phones.htm"; $name = $network_row["network_name"]." Phones"; } print "".$name.""; } print ""; print ""; } } printBuzzMobileBodyBottom(); ?>