ONLINE STORE
// Category Listing
$cat = mysql_query("SELECT ID, category FROM store_categories WHERE viewable = 'Y' ORDER BY priority");
$numcats = mysql_num_rows($cat);
if($numcats > 0) {
$count = 1;
while($row = mysql_fetch_array($cat)) {
?>
>
Notice: Undefined variable: row in /var/www/store/index.php on line 63
if($count < $numcats) { print(" | "); }
$count++;
}
}
mysql_free_result($cat);
?>
// Subcategory Listing - if any subcats
$sub = mysql_query("SELECT ID, subcategory FROM store_subcategories WHERE viewable = 'Y' AND catID = '$catID' ORDER BY priority");
$numsubs = mysql_num_rows($sub);
if($numsubs > 0) {
?>
}
else {
$subID = 0;
}
mysql_free_result($sub);
?>
|
|
|
if($numcats > 0) {
// Build result paging
$perPage = 10; //records per page
$maxrecords_sql = "SELECT COUNT(ID) as maxrecords FROM store_placement sp LEFT JOIN store_data sd ON sp.itemID = sd.ID WHERE sp.catID = '$catID' AND sp.subID = '$subID' AND sd.viewable = 'Y'";
$maxpages_sql = "SELECT CEILING(COUNT(ID) / ".$perPage.") AS maxpages FROM store_placement sp LEFT JOIN store_data sd ON sp.itemID = sd.ID WHERE sp.catID = '$catID' AND sp.subID = '$subID' AND sd.viewable = 'Y'";
$maxrecords_query = mysql_query($maxrecords_sql);
$temp = mysql_fetch_array($maxrecords_query);
$maxrecords = $temp[0];
mysql_free_result($maxrecords_query);
$maxpages_query = mysql_query($maxpages_sql);
$temp = mysql_fetch_array($maxpages_query);
$maxpages = $temp[0];
mysql_free_result($maxpages_query);
if($_REQUEST["page"] == "") {
$page = 1;
}
else {
$page = mysqlquerycleaner($_REQUEST["page"]);
}
?>
Notice: Undefined variable: subname in /var/www/store/index.php on line 141
Notice: Undefined variable: catname in /var/www/store/index.php on line 141
|
if($maxrecords > 0) {
?>
Notice: Undefined variable: maxrecords in /var/www/store/index.php on line 145
Notice: Undefined variable: maxpages in /var/www/store/index.php on line 145
item(s) on page(s).
|
}
?>
if($maxpages > 1) {
?>
for($i=1;$i<=$maxpages["maxpages"];$i++){
if($page==$i){print("");}
?>
Notice: Undefined variable: i in /var/www/store/index.php on line 160
if($page==$i){print("");}
if($i<=$maxpages["maxpages"]-1){print("|");}
}
?>
|
}
?>
|
// Store Item List
$fl = (($page-1) * $perPage);
$sql = "SELECT sd.* FROM store_placement sp LEFT JOIN store_data sd ON sp.itemID = sd.ID WHERE sp.catID = '$catID' AND sp.subID = '$subID' AND sd.viewable = 'Y' ORDER BY title LIMIT $fl, $perPage";
$items = mysql_query($sql);
if(mysql_num_rows($items) == 0) {
?>
No items to display.
}
else {
while($row = mysql_fetch_array($items)) {
$itemID = $row["ID"];
$title = stripslashes($row["title"]);
$description = stripslashes($row["description"]);
$forsale = $row["forsale"];
$viewable = $row["viewable"];
$mainthumb = $row["mainthumb"];
// get the first existing one if no mainthumb is selected
if($mainthumb == "") {
clearstatcache();
for($i=1;$i<=8;$i++) {
$file = "images/small/".$itemID."_".$i.".jpg";
if(file_exists($file)){
$mainthumbIMG = $itemID . "_" .$i. ".jpg";
break;
}
}
}
else {
$mainthumbIMG = $itemID . "_" .$mainthumb . ".jpg";
}
// build the description
$description = str_replace(chr(10)," ",$row["description"]);
$len = 200;
if(strlen($description) > $len) {
if(substr($description,$len,1) == " ") {
$description = substr($description,0,$len);
}
else {
for($i=$len;$i<=strlen($description);$i++) {
if(substr($description,$i,1) == " ") {
$description = substr($description,0,$i);
break;
}
}
}
$description = $description . "... [ More ]";
}
// Get pricing
$sql = "SELECT COUNT(ID) AS pricesTotal, MIN(price) AS priceMin, MAX(price) AS priceMax, MIN(saleprice) AS salepriceMin, MAX(saleprice) AS salepriceMax FROM store_options WHERE itemID = '$itemID' GROUP BY itemID";
$prices = mysql_query($sql);
$row = mysql_fetch_array($prices);
$pricesTotal = $row["pricesTotal"];
$priceMin = $row["priceMin"];
$priceMax = $row["priceMax"];
$salepriceMin = $row["salepriceMin"];
$salepriceMax = $row["salepriceMax"];
if($salepriceMin < $priceMin && $salepriceMin != 0) { $Min = $salepriceMin; } else { $Min = $priceMin; }
if($salepriceMax < $Min && $salepriceMax != 0) { $Min = $salepriceMax; }
if($salepriceMax > $priceMax) { $Max = $salepriceMax; } else { $Max = $priceMax; }
if($Min == $Max) { $price = "$".$Min; } else { $price = "$".$Min." - ".$Max; }
?>
if($mainthumbIMG != "") {
?>
|
$width = 450;
}
else {
$colspan = ' colspan="2"';
$width = 600;
}
?>
|
Notice: Undefined variable: colspan in /var/www/store/index.php on line 260
>
0 || $salepriceMax > 0) {?>}?>
Notice: Undefined variable: description in /var/www/store/index.php on line 264
if($pricesTotal != "") {
?>
PRICE:
Notice: Undefined variable: price in /var/www/store/index.php on line 268
}
// See if any items are OOS
$featureOOS = mysql_num_rows(mysql_query("SELECT oos FROM store_options WHERE itemID = '$itemID' AND oos <> ''"));
if($featureOOS > 0) {
?>
Some items may be out of stock, click here for details.
}
?>
|
|
}
}
mysql_free_result($items);
?>
|
}
?>
|