code from details.php
Hey Neil,
Rather than me destroy my site I copied the code from my detail.php file. Perhaps you can direct me to the correct part of my page to add a white background.
<?php require_once('../../../Connections/PowerStoreConnection.php'); ?>
<?php require_once('../../../WA_DigitalFilePro/HelperPHP.php'); ?>
<?php
if(!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
$WAAddToCart = new WA_Include('../shopping_cart/add_to_cart.php');
require($WAAddToCart->BaseName);
$WAAddToCart->Initialize(true);
?>
<?php
$ParamProductID_WADAProducts = "-1";
if(isset($_GET['ProductID'])) {
$ParamProductID_WADAProducts = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
}
mysql_select_db($database_PowerStoreConnection, $PowerStoreConnection);
$query_WADAProducts = sprintf("SELECT * FROM ps4_products WHERE ProductID = %s", GetSQLValueString($ParamProductID_WADAProducts, "int"));
$WADAProducts = mysql_query($query_WADAProducts, $PowerStoreConnection) or die(mysql_error());
$row_WADAProducts = mysql_fetch_assoc($WADAProducts);
$totalRows_WADAProducts = mysql_num_rows($WADAProducts);
?>
<html>
<head>
<?php echo($WAAddToCart->Head); ?>
<link rel="stylesheet" type="text/css" href="css/products_detail.css"/>
<title><?php echo str_replace("|","<br />",$row_WADAProducts["ProductName"]); ?></title>
</head>
<body>
<a name="top"></a>
<h1 class="larger">
<span id="WADAPageTitle"><?php echo str_replace("|","<br />",$row_WADAProducts["ProductName"]); ?></span>
<span class="price">
<span class="ProductPrice">Price: $<span id="ProductPrice"><?php echo number_format($row_WADAProducts["ProductPrice"], 2); ?></span></span>
<span id="retailRow" class="ProductRetailPrice errorText" <?php echo((!empty($row_WADAProducts["ProductRetailPrice"]) && $row_WADAProducts["ProductRetailPrice"] > $row_WADAProducts["ProductPrice"])?' style="display:block"':' style="display:none"'); ?>>Retail Price: $<span id="ProductRetailPrice" class="strike"><?php echo number_format($row_WADAProducts["ProductRetailPrice"], 2); ?></span> (Save $<span id="ProductRetailPriceSave"><?php echo number_format(floatval($row_WADAProducts["ProductRetailPrice"]) - floatval($row_WADAProducts["ProductPrice"]), 2); ?></span>)</span>
</span>
</h1>
<div class="contentBox ps_pod1 borderColor block">
<?php if ($totalRows_WADAProducts > 0) { // Show if recordset not empty ?>
<div class="productDetailWrapper">
<div class="image">
<div class="imageWrapper">
<?php
$imgWidth = 300;
$imgSrc = "../../../" . ($WAGLOBAL_Images_Folder) . ((isset($row_WADAProducts['ProductImage']) && $row_WADAProducts['ProductImage'] != "default-product.png")?$row_WADAProducts['ProductImage']:$row_WADAProducts['ProductThumb']);
$imgSrc = abs2rel(rel2abs($imgSrc,dirname(__FILE__)),dirname($_SERVER['PHP_SELF']));
$WAResultsImage = new WA_Include('scripts/resize_image.php');
require($WAResultsImage->BaseName);
$WAResultsImage->Initialize(true);
?>
<img class="WADAResultThumb" border="0" src="<?php echo(abs2rel(rel2abs($WAResultsImage->Body,dirname($_SERVER['PHP_SELF'])),dirname(__FILE__))); ?>" id="ProductImage" />
</div>
</div>
<div class="addToCart"><?php echo($WAAddToCart->Body); ?></div>
</div>
<div id="ProductLongDesc"><?php echo wa_evaluate($row_WADAProducts["ProductLongDesc"]); ?></div>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAProducts == 0) { // Show if recordset empty ?>
<em>No product found.</em>
<?php } // Show if recordset empty ?>
</div>
<div class="productDetails-bottomShadow"></div>
<div class="bottomLinkWrapper">
<div class="links">
<span class="button"><a href="../../../products_results.php" class="ps_buttons">Back to Product Catalog</a></span>
</div>
</div>
</body>
</html>
<?php
if(isset($WADAProducts)) mysql_free_result($WADAProducts); ?>
Thanks,
Lisa