DoForm(); $strSection = "Public"; $intProductID = UrlData("hdnProductID", 10, 0, "Number"); if ($clsBasket->GetMessage() == "") { $_SESSION["Back"] = $_SERVER["HTTP_REFERER"]; } //end if $strQuery = "SELECT c2.id, c1.title AS parent_title, c2.title AS sub_category_title, p.*, s.title AS supplier_title, s.image AS supplier_image, p.title AS product_title FROM categories c1 INNER JOIN categories c2 ON (c1.id = c2.parent_id) INNER JOIN products p ON (p.category_id = c2.id) LEFT JOIN suppliers s ON (p.supplier_id = s.id) WHERE (p.id = ?) AND (c1.display = ?) AND (c2.display = ?) AND (p.display_product = ?)"; $clsDB->Execute($strQuery, array($intProductID, "Y", "Y", "Y")); if ($aryProductData = mysql_fetch_array($clsDB->GetResourceQueryID(), MYSQL_ASSOC)) { $intCategoryID = $aryProductData["id"]; $strPage = $aryProductData["parent_title"]; $strHeading = $strPage . " ~ " . $aryProductData["sub_category_title"]; } else { Redirect("index.php"); } //end if $clsDB->FreeResult(); $blnHasVariant = GetProductVariantCount($aryProductData["id"]); ### Outputing HTML Code ### include(DIR_INCLUDES . "inc-header.php"); echo("

" . $aryProductData["product_title"] . "

"); if ($clsBasket->GetMessage() != "") { echo("

" . $clsBasket->GetMessage() . "

"); } //end if echo("
"); ShowProductImages(); if ($aryProductData["description"] != "") { echo("
"); echo("Description"); echo("
" . nl2br($aryProductData["description"]) . "
"); echo("
"); } //end if if ($aryProductData["features"] != "") { $aryFeatures = split(CRLF, $aryProductData["features"]); echo("
"); echo("Features"); echo("
"); echo("
    "); for($i = 0; $i < count($aryFeatures); $i++) { if (trim($aryFeatures[$i]) != "") { echo("
  • " . $aryFeatures[$i] . "
  • "); } //end if } //end for echo("
"); echo("
"); echo("
"); } //end if echo("
"); echo("
"); echo("
"); echo("Information"); if ($blnHasVariant) { $clsDB->Execute("SELECT id, ref, size, information, price FROM product_variants WHERE (product_id = ?) AND (display = ?) ORDER BY ref ASC", array($aryProductData["id"], "Y")); echo("
"); echo(""); echo(""); if ($aryProductData["display_basket_button"] == "Y") { echo(""); } //end if echo(""); echo(""); echo(""); echo(""); echo(""); $blnOdd = true; $blnFirst = true; while ($aryVariantData = mysql_fetch_array($clsDB->GetResourceQueryID(), MYSQL_ASSOC)) { if ($blnFirst) $intProductVariantID = $aryVariantData["id"]; $blnOdd = !$blnOdd; echo(""); if (($aryProductData["display_basket_button"] == "Y") && ($aryProductData["display_price"] == "Y")) { echo(""); } //end if echo(""); echo(""); echo(""); echo(""); echo(""); $blnFirst = false; } //end while echo("
Ref NoSizeInformation"); if ($aryProductData["display_price"] == "Y") echo("Price"); echo("
"); EchoRadio("", "rdoProductVariant", $aryVariantData["id"], $intProductVariantID); echo("" . $aryVariantData["ref"] . "" . $aryVariantData["size"] . "" . $aryVariantData["information"] . ""); if ($aryProductData["display_price"] == "Y") echo("£" . PoundFormat($aryVariantData["price"], true)); echo("
"); echo("
"); $clsDB->FreeResult(); } //end if echo("
    "); if (!$blnHasVariant) { echo("
  • "); EchoLabel("txtRefNo", "Ref No:"); EchoInput("text", "txtRefNo", $aryProductData["ref"], "255", "readonly=\"readonly\" class=\"readonly width\""); echo("
  • "); } //end if if (!is_null($aryProductData["supplier_title"])) { echo("
  • "); EchoLabel("txtSupplier", "Supplier:"); EchoInput("text", "txtSupplier", $aryProductData["supplier_title"], "255", "readonly=\"readonly\" class=\"readonly width\""); echo("
  • "); } //end if if (!$blnHasVariant) { if ($aryProductData["display_price"] == "Y") { echo("
  • "); EchoLabel("txtPrice", "Price:"); EchoInput("text", "txtPrice", "£" . PoundFormat($aryProductData["product_price"]) , "255", "readonly=\"readonly\" class=\"readonly width\""); echo("
  • "); } //end if } //end if ShowProductOptions($aryProductData, 1); ShowProductOptions($aryProductData, 2); ShowProductOptions($aryProductData, 3); if (($aryProductData["display_basket_button"] == "Y") && ($aryProductData["display_price"] == "Y")) { echo("
  • "); EchoLabel("sltQty", "Quantity:"); EchoSelect("sltQty", array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), 1, "", true); echo("
  • "); echo("
  • "); EchoLabel("btnBuy", ""); EchoButton("submit", "btnAction", "Buy Product", "class=\"button buy\""); echo("
  • "); } //end if echo("
"); echo("
"); EchoHidden("hdnProductID", $intProductID); echo("
"); echo("
"); echo("
"); echo("<< Back to Previous Page"); echo("
"); include(DIR_INCLUDES . "inc-footer.php"); ### User Define Routines ### function ShowProductOptions($aryData, $intIndex) { if (!empty($aryData["option_title_" . $intIndex])) { $strTitle = $aryData["option_title_" . $intIndex]; $aryOptions = explode(LF, $aryData["option_list_" . $intIndex]); echo("
  • "); if (count($aryOptions) > 3) { EchoLabel("mixOption" . $intIndex . "ID", $strTitle . ":"); EchoSelect("mixOption" . $intIndex . "ID", $aryOptions, 0); } else { EchoRadioGroup($strTitle . ":", false, "mixOption" . $intIndex . "ID", $aryOptions, 0, "Horizontal", "class=\"radio\""); } //end if echo("
  • "); } //end if } //ShowProductOptions function ShowProductImages() { global $intProductID, $aryProductData; $strMainImage = ""; $aryMoreImages = array(); $clsDB = new clsDB; $clsDB->Execute("SELECT id, title, image, `default` FROM product_images WHERE (product_id = ?) AND (display = ?) ORDER BY `default` ASC", array($intProductID, "Y")); if (!$clsDB->GetRecordCount()) { $strMainImage = "\"""; } else { while ($aryData = mysql_fetch_array($clsDB->GetResourceQueryID(), MYSQL_ASSOC)) { if ($aryData["default"] == "Y") { $strMainImage = "\"""; } //end if if ($clsDB->GetRecordCount() > 1) { $aryMoreImages[] = "\"""; } //end if } //end while } //end if $clsDB->FreeResult(); if (!empty($aryProductData["supplier_image"])) { $aryMoreImages[] = "\"""; } //end if echo("
    "); echo("
    "); echo("Main Image"); echo("
    "); echo($strMainImage); echo("
    "); echo("
    "); if (!empty($aryMoreImages)) { echo("
    "); echo("More Image"); echo("
    "); echo("
      "); for ($i = 0; $i < count($aryMoreImages); $i++) { //echo("
    • " . $aryMoreImages[$i] . "
    • "); echo("
    • " . $aryMoreImages[$i] . "
    • "); } //end if echo("
    "); echo("
    "); echo("

    Please click on the images to view them.

    "); echo("
    "); } //end if echo("
    "); //echo("
    "); } //ShowProductImages ?>