"; // *************************************************** // BEGIN Email the order to the customer // *************************************************** //error_reporting(E_ALL); error_reporting(E_STRICT); date_default_timezone_set('America/Toronto'); //date_default_timezone_set(date_default_timezone_get()); include_once('../forum/uploaded-files/pages/class.phpmailer.php'); //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(); //$body = $mail->getFile('contents.html'); //$body = eregi_replace("[\]",'',$body); // $body = "$EmailMultiPartBodyFromTextSection $EmailMultiPartBodyToTextSection $EmailMultiPartBodyTopHeaderTextSection $EmailMultiPartBodyMaterialTextSection $EmailMultiPartBodyAdditionalExpensesTextSection $EmailMultiPartBodyEstimateDescriptionTextSection"; $body = "Thank you for ordering. The products you ordered will be processed and shipped by the individual vendors selling the products. Contact them with any questions you may have. To review your order status visit this page http://www.gopherforum.com/index.php?pageid=Order-Review-Page&CustomerID=$CustomerID"; $body = eregi_replace("[\]",'',$body); $mail->IsSMTP(); // telling the class to use SMTP //$mail->Host = "mail.worxteam.com"; // SMTP server //$mail->Host = "mail.internection.com"; // SMTP server $mail->Host = "localhost" ; // SMTP server // test $CompanyEmail = "slow@gophersoftware.com"; $CompanyName = "Gopher Forum"; $mail->From = "$CompanyEmail"; $mail->FromName = "$CompanyName"; // $mail->Subject = "Estimate from $CompanyName"; $mail->Subject = "Your Gopher Forum Store Receipt"; // $mail->AltBody = "$EmailBodyFromTextSection \n\n$EmailBodyToTextSection \n\n$EmailBodyTopHeaderTextSection \n\n$EmailBodyMaterialTextSection\n\n$EmailBodyAdditionalExpensesTextSection\n\n$EmailBodyEstimateDescriptionTextSection"; // $mail->AltBody = "Testing"; $mail->AltBody = "Thank you for ordering. The products you ordered will be processed and shipped by the individual vendors selling the products. Contact them with any questions you may have. To review your order status visit this page http://www.gopherforum.com/index.php?pageid=Order-Review-Page&CustomerID=$CustomerID"; // optional, comment out and test $mail->MsgHTML($body); // $mail->AddAddress("$CustomerEmail", "$FirstName $LastName"); $mail->AddAddress("$Email", "$FullName"); //$mail->AddCC($CompanyEmail, "$CompanyName"); // $mail->AddAttachment("phpmailer.gif"); // attachment if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { // echo "Message sent!"; } // *************************************************** // END Email the order to the customer // *************************************************** } // *************************************************************** // END CHECK OUT STEP 2 // *************************************************************** // *************************************************************** // BEGIN SUBMIT ORDER // *************************************************************** if (isset($_POST['Submit'])) { $UserFirstName = $_POST["UserFirstName"]; $_SESSION['UserFirstName']= $UserFirstName ; // if there is no season registered create one. if(!session_is_registered(CustomerID)){ //so we use the MD5 algorithm to generate a random hash $RandomHash = md5(date('r', time())); $CustomerID = $RandomHash; $_SESSION['CustomerID'] = $CustomerID; } else { $CustomerID = $_SESSION['CustomerID']; // $ProductID = $_POST["ChosenProductID01"]; $ProductID = mysqlclean($_POST,"ChosenProductID",100,$connection); // $Quantity = $_POST["ChosenQuantity01"]; $Quantity = mysqlclean($_POST,"ChosenQuantity",100,$connection); $ProductCount = mysqlclean($_POST,"ProductCount",100,$connection); } // Does this item and qty already exist in the db? if so, don't enter it again. Also don't enter 0 for a product ID if ((!($ProductID == null) ) and ($ProductID > 0)) { $query1="SELECT * FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; $result1=mysql_query($query1); $num1=mysql_numrows($result1); } else { $num1=0; } // if there is no record, enter it. if (($num1 == 0) and ($ProductID > 0)) { // if there is data to be entered, enter it. Just don't enter 0 $query = "Insert INTO ShoppingCartOrderItems (CustomerID, ProductID, Quantity, OrderDate, OrderTime, IPAddress) VALUES ('$CustomerID','$ProductID', '$Quantity', '$CurrentDate', '$CurrentTime', '$ip')"; if (!(@mysql_query($query,$connection))) showerror; } // Did someone decide to change their quantity to 0 from a previous number? if (!($ProductID == null) and ($Quantity == 0) ) { // let's first see if there is a record $query2="SELECT * FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; $result2=mysql_query($query2); $num2=mysql_numrows($result2); // if a record exists, then delete it. if ($num2 > 0) { $query = "DELETE FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; if (!(@mysql_query($query,$connection))) showerror; } } // The quantity has been updated to a number other than 0 so let's update the table elseif (!($ProductID == null) and ($Quantity > 0) ) { $query3="UPDATE ShoppingCartOrderItems SET Quantity='$Quantity' WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; if (!(@mysql_query($query3,$connection))) showerror; } } // *************************************************************** // END SUBMIT ORDER // *************************************************************** // *************************************************************** // BEGIN DISPLAY PRODUCTS // *************************************************************** // ***** BEGIN Did It pass a category variable? if (isset($_GET['CategoryID'])) { $CategoryID = mysqlclean($_GET,"CategoryID",100,$connection); $CategoryName = mysqlclean($_GET,"CategoryName",100,$connection); //echo "Store"; echo "
Lawn Care Business Forum Lawn Care Business Book Lawn Care Business Blog Lawn Care Software
Home Forum Contract & Flyer Templates Blog Software Videos Podcast Calculators / Estimators Store Mower Review Design It Yourself Lawn Business School

Go Back   GopherHaul Landscaping & Lawn Care Business Marketing Forum

"; } // *************************************************************** // END CHECK OUT STEP 1 // *************************************************************** // *************************************************************** // BEGIN CHECK OUT STEP 2 // *************************************************************** if (isset($_POST['CheckOutStep2'])) { // if there is no season registered create one. if(!session_is_registered(CustomerID)){ //so we use the MD5 algorithm to generate a random hash $RandomHash = md5(date('r', time())); $CustomerID = $RandomHash; $_SESSION['CustomerID'] = $CustomerID; } else { $CustomerID = $_SESSION['CustomerID']; } $FullName = mysqlclean($_POST,"FullName",100,$connection); $Company = mysqlclean($_POST,"Company",100,$connection); $Email = mysqlclean($_POST,"Email",100,$connection); $Phone = mysqlclean($_POST,"Phone",100,$connection); $HeardOfSource = mysqlclean($_POST,"HeardOfSource",100,$connection); $Street1 = mysqlclean($_POST,"Street1",100,$connection); $Street2 = mysqlclean($_POST,"Street2",100,$connection); $City = mysqlclean($_POST,"City",100,$connection); $OrderState = mysqlclean($_POST,"OrderState",100,$connection); $Zip = mysqlclean($_POST,"Zip",100,$connection); $Country = mysqlclean($_POST,"Country",100,$connection); echo "
". mysql_error()); } // Select the database $db_select = mysql_select_db($db_database); if (!$db_select){ die ("Could not select the database:
". mysql_error( )); } function imageResize($width, $height, $target) { //takes the larger size of the width and height and applies the formula accordingly...this is so this script will work dynamically with any size image if ($width > $height) { $percentage = ($target / $width); } else { $percentage = ($target / $height); } //gets the new value and applies the percentage, then rounds the value $width = round($width * $percentage); $height = round($height * $percentage); //returns the new sizes in html image tag format...this is so you can plug this function inside an image tag and just get the return "width=\"$width\" height=\"$height\""; } // for vbulletin echo ""; echo "
» Shop The GopherHaul Lawn Care Business Forum Store
"; // *************************************************************** // BEGIN CHECK OUT STEP 1 // *************************************************************** if (isset($_POST['CheckOutStep1'])) { // if there is no season registered create one. if(!session_is_registered(CustomerID)){ //so we use the MD5 algorithm to generate a random hash $RandomHash = md5(date('r', time())); $CustomerID = $RandomHash; $_SESSION['CustomerID'] = $CustomerID; } else { $CustomerID = $_SESSION['CustomerID']; } echo '
'; echo ""; // echo "
Contact person's name:
Company name:
E-mail address:
Phone:
How did you hear about us?:
The following fields must match the address your credit card statement is mailed to.
Street Address (line 1):
Street Address (line 2):
City:
State/Province: (2-letter abbrev)
State:
Zip/Postal Code:
Country: (leave blank for US)
"; echo "

"; //echo '
'; //echo "
Contact person's name: $FullName
Company name: $Company
E-mail address: $Email
Phone: $Phone
How did you hear about us?: $HeardOfSource
Street Address (line 1): $Street1
Street Address (line 2): $Street2
City: $City
State/Province: $OrderState
Zip/Postal Code: $Zip
Country: $Country

"; $query="SELECT ShoppingCartOrderItems.ProductID, ShoppingCartOrderItems.Quantity, StoreProducts.ProductName, StoreProducts.VendorID, StoreProducts.Price, StoreProducts.ChargeSalesTax FROM ShoppingCartOrderItems Join StoreProducts ON ShoppingCartOrderItems.ProductID = StoreProducts.ProductID WHERE ShoppingCartOrderItems.CustomerID='$CustomerID' Order BY StoreProducts.VendorID"; //$query="SELECT sampletable.CompanyName, ShoppingCartOrderItems.ProductID, ShoppingCartOrderItems.Quantity, StoreProducts.ProductName FROM StoreProducts Join ShoppingCartOrderItems ON ShoppingCartOrderItems.ProductID = StoreProducts.ProductID JOIN StoreProducts ON StoreProducts.VendorID = sampletable.id WHERE ShoppingCartOrderItems.CustomerID='$CustomerID'"; $result=mysql_query($query); $num=mysql_numrows($result); //initialize order total $OrderTotal = 0; echo "Your Order List - By ordering, you agree to allow individual vendors to process and ship their products to you at the prices listed below.
"; // echo ""; $i=0; while ($i < $num) { $Price=mysql_result($result,$i,"Price"); $VendorID=mysql_result($result,$i,"VendorID"); $ProductName=mysql_result($result,$i,"ProductName"); $ProductID=mysql_result($result,$i,"ProductID"); $Quantity=mysql_result($result,$i,"Quantity"); $ChargeSalesTax=mysql_result($result,$i,"ChargeSalesTax"); $query2 = "SELECT CompanyName, SalesTaxRate, AddressState, Email, UserFirstName FROM sampletable WHERE id = '$VendorID'"; if (!(@mysql_query($query2,$connection))) showerror; $result2=mysql_query($query2); $num2=mysql_numrows($result2); $j=0; while ($j < $num2) { $AddressState=mysql_result($result2,$j,"AddressState"); $CompanyName=mysql_result($result2,$j,"CompanyName"); $SalesTaxRate=mysql_result($result2,$j,"SalesTaxRate"); $VendorEmail=mysql_result($result2,$j,"Email"); $VendorUserFirstName=mysql_result($result2,$j,"UserFirstName"); $j++; } // *************************************************** // BEGIN Email the order to the vendor // *************************************************** //error_reporting(E_ALL); error_reporting(E_STRICT); date_default_timezone_set('America/Toronto'); //date_default_timezone_set(date_default_timezone_get()); include_once('../forum/uploaded-files/pages/class.phpmailer.php'); //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(); //$body = $mail->getFile('contents.html'); //$body = eregi_replace("[\]",'',$body); // $body = "$EmailMultiPartBodyFromTextSection $EmailMultiPartBodyToTextSection $EmailMultiPartBodyTopHeaderTextSection $EmailMultiPartBodyMaterialTextSection $EmailMultiPartBodyAdditionalExpensesTextSection $EmailMultiPartBodyEstimateDescriptionTextSection"; $body = "You have just made a sale through the Gopher Forum. To review your sale please log in at this page http://www.gopherforum.com/uploaded-files/pages/main_login.php
Thanks, Steve"; $body = eregi_replace("[\]",'',$body); $mail->IsSMTP(); // telling the class to use SMTP //$mail->Host = "mail.worxteam.com"; // SMTP server //$mail->Host = "mail.internection.com"; // SMTP server $mail->Host = "localhost" ; // SMTP server // test $CompanyEmail = "slow@gophersoftware.com"; $CompanyName = "Gopher Forum"; $mail->From = "$CompanyEmail"; $mail->FromName = "$CompanyName"; // $mail->Subject = "Estimate from $CompanyName"; $mail->Subject = "You made a sale at the Gopher Forum"; // $mail->AltBody = "$EmailBodyFromTextSection \n\n$EmailBodyToTextSection \n\n$EmailBodyTopHeaderTextSection \n\n$EmailBodyMaterialTextSection\n\n$EmailBodyAdditionalExpensesTextSection\n\n$EmailBodyEstimateDescriptionTextSection"; // $mail->AltBody = "Testing"; $mail->AltBody = "You have just made a sale through the Gopher Forum. To review your sale please log in at this page http://www.gopherforum.com/uploaded-files/pages/main_login.php \n\n Thanks, Steve"; // optional, comment out and test $mail->MsgHTML($body); // $mail->AddAddress("$CustomerEmail", "$FirstName $LastName"); $mail->AddAddress("$VendorEmail", "$VendorUserFirstName"); //$mail->AddCC($CompanyEmail, "$CompanyName"); // $mail->AddAttachment("phpmailer.gif"); // attachment if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { // echo "Message sent!"; } // *************************************************** // END Email the order to the vendor // *************************************************** // does sales tax apply to this customer? // do they live in the same sate? if ($AddressState == $OrderState) { // is this product set to collect sales tax? 1 = yes if ($ChargeSalesTax == 1) { $SalesTaxAmount = (($Quantity * $Price)* ($SalesTaxRate/100) ); } else { $SalesTaxAmount = 0; } } $Amount = (($Quantity * $Price) + $SalesTaxAmount); // echo ""; echo ""; $OrderTotal = $OrderTotal + $Amount; $i++; } echo " "; echo ""; echo "
Order Date - $CurrentDate
QuantityProduct IDProductVendorUnit PriceSales TaxAmount
$Quantity$ProductID$ProductName // // $CompanyName".money_format('%n', $Price)."".money_format('%n', $SalesTaxAmount)."".money_format('%n', $Amount)."
$Quantity$ProductID$ProductName $CompanyName".money_format('%n', $Price)."".money_format('%n', $SalesTaxAmount)."".money_format('%n', $Amount)."
Total".money_format('%n', $OrderTotal)."

"; //echo '
'; //echo "
"; //echo ''; echo ""; echo ''; echo ""; // echo ""; // echo ""; // echo " "; echo "

$CategoryName

Categories:
    "; // get the list of equipment types. $query="SELECT * FROM EquipmentType Order By TypeName"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $TypeName=mysql_result($result,$i,"TypeName"); $UniqueID=mysql_result($result,$i,"UniqueID"); // echo "
  • $TypeName
  • "; //if it equals books or software, go back to the store page to display it so it doesnt search it on ebay if (($TypeName == Books) OR ($TypeName == Software)) { echo "
  • $TypeName
  • "; } // don't display the category 'other' elseif ($TypeName <> Other) { echo "
  • $TypeName
  • "; } $i++; } // if this is to list books or software do this ***************************************************************** if (($CategoryID == 21) or ($CategoryID == 22)) { echo "
"; //$query="SELECT ProductID, ProductName, ProductImageURL, PurchaseLink, ImageWidth, ImageHeight, AvailableOnsite, VendorID FROM StoreProducts where (ApprovedForDisplay='1') AND (IsProductActive='1')"; $query="SELECT StoreProducts.ProductID, StoreProducts.ProductName, StoreProducts.ProductImageURL, StoreProducts.PurchaseLink, StoreProducts.ImageWidth, StoreProducts.ImageHeight, StoreProducts.AvailableOnsite, StoreProducts.VendorID, sampletable.CompanyName FROM StoreProducts Join sampletable ON StoreProducts.VendorID = sampletable.id where (StoreProducts.ApprovedForDisplay='1') AND (StoreProducts.IsProductActive='1')"; $result=mysql_query($query); $num=mysql_numrows($result); $ItemsRowCounter = 1; $i=0; while ($i < $num) { // echo "testing - $ProductArray[$ProductArrayPosition], $ProductArray[$QuantityArrayPosition]"; $ProductName=mysql_result($result,$i,"ProductName"); $ProductID=mysql_result($result,$i,"ProductID"); $ProductImageURL=mysql_result($result,$i,"ProductImageURL"); $PurchaseLink=mysql_result($result,$i,"PurchaseLink"); $ImageWidth=mysql_result($result,$i,"ImageWidth"); $ImageHeight=mysql_result($result,$i,"ImageHeight"); $AvailableOnsite=mysql_result($result,$i,"AvailableOnsite"); $CompanyName=mysql_result($result,$i,"CompanyName"); // ********************************************************************************** if ($ItemsRowCounter == 1){ echo ""; // echo ''; echo " "; // if this is the last item in the row, close the if ($num == $i) { echo ""; } $ItemsRowCounter++; } // ********************************************************************************** // is this item somewhere in the middle of the row? elseif (($ItemsRowCounter > 1) and ($ItemsRowCounter < $ItemsPerRow)) { // echo ''; echo " "; // if this is the last item in the row, close the if ($num == $i) { echo ""; } $ItemsRowCounter++; } // ********************************************************************************** // is this the last item in the row? then close the row elseif ($ItemsRowCounter == $ItemsPerRow) { // echo ''; echo " "; echo ""; $ItemsRowCounter = 1; } $i++; } echo "
"; // "; echo ""; // echo ""; echo ""; // echo ''; // echo ""; echo ''; // is this product available onsite? 1 = yes, 0 = no if ($AvailableOnsite == 1) { // only do this if there is a customer session if(session_is_registered(CustomerID)) { $CustomerID = $_SESSION['CustomerID']; $j=0; //initialize this to 0 $QuantityFromDB=0; $query1="SELECT Quantity FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; if (!(@mysql_query($query1,$connection))) showerror; $result1=mysql_query($query1); $num1=mysql_numrows($result1); while ($j < $num1) { $QuantityFromDB=mysql_result($result1,$j,"Quantity"); $j++; } } else { $QuantityFromDB=0; } echo ""; } else { echo "
$ProductName
$ProductName
// // //
Qty.
"; } echo "
"; // "; echo ""; // echo ""; echo ""; // echo ''; // echo ""; echo ''; // is this product available onsite? 1 = yes, 0 = no if ($AvailableOnsite == 1) { // only do this if there is a customer session if(session_is_registered(CustomerID)) { $CustomerID = $_SESSION['CustomerID']; $j=0; //initialize this to 0 $QuantityFromDB=0; $query1="SELECT Quantity FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; if (!(@mysql_query($query1,$connection))) showerror; $result1=mysql_query($query1); $num1=mysql_numrows($result1); while ($j < $num1) { $QuantityFromDB=mysql_result($result1,$j,"Quantity"); $j++; } } else { $QuantityFromDB=0; } echo ""; } else { echo "
$ProductName
$ProductName
// // //
Qty.
"; } echo "
"; // "; echo ""; // echo ""; echo ""; // echo ''; // echo ""; echo ''; // is this product available onsite? 1 = yes, 0 = no if ($AvailableOnsite == 1) { // only do this if there is a customer session if(session_is_registered(CustomerID)) { $CustomerID = $_SESSION['CustomerID']; $j=0; //initialize this to 0 $QuantityFromDB=0; $query1="SELECT Quantity FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; if (!(@mysql_query($query1,$connection))) showerror; $result1=mysql_query($query1); $num1=mysql_numrows($result1); while ($j < $num1) { $QuantityFromDB=mysql_result($result1,$j,"Quantity"); $j++; } } else { $QuantityFromDB=0; } echo ""; } else { echo "
$ProductName
$ProductName
// // //
Qty.
"; } echo "
First Name:
Your name is = $UserFirstName
"; } else // *************************** SOMETHING BESIDES BOOKS OR SOFTWARE WAS CHOSEN { echo "
"; echo '
'; echo "Search: Max Price $ Items Per Range

"; // get the list of models for this category type. $query="SELECT EquipmentModel.ModelName, EquipmentModel.ModelNumber, EquipmentModel.ManufacturerID, EquipmentModel.UniqueID, EquipmentManufacturer.ManufacturerName FROM EquipmentModel Join EquipmentManufacturer on EquipmentModel.ManufacturerID = EquipmentManufacturer.UniqueID Where TypeID = '$CategoryID' Order By ManufacturerID"; $result=mysql_query($query); $num=mysql_numrows($result); echo ""; $i=0; while ($i < $num) { $ModelName=mysql_result($result,$i,"ModelName"); $ModelNumber=mysql_result($result,$i,"ModelNumber"); $ManufacturerID=mysql_result($result,$i,"ManufacturerID"); $UniqueID=mysql_result($result,$i,"UniqueID"); $ManufacturerName=mysql_result($result,$i,"ManufacturerName"); // echo "
  • $TypeName
  • "; $PrintableModelName = stripslashes($ModelName); // echo "
    // echo ''; // get total number of votes for this equipment. $TotalRanking = 0; $AverageVote = 0; $query2="SELECT Ranking FROM EquipmentRate Where EquipmentModelID = '$UniqueID'"; $result2=mysql_query($query2); $num2=mysql_numrows($result2); $j = 0; while ($j < $num2) { $Ranking=mysql_result($result2,$j,"Ranking"); $TotalRanking = $TotalRanking + $Ranking; $j++; } // don't divide by 0 if ($num2 == 0) { $AverageVote = 0; } else { $AverageVote = round($TotalRanking/$num2); } // if the model name and number are the same, don't print both. // if ($PrintableModelName == $ModelNumber) // { // echo "$ManufacturerName - $PrintableModelName, Total Votes: $num2 - Average Vote: "; // } // else // { // echo "$ManufacturerName - $PrintableModelName - $ModelNumber, Total Votes: $num2 - Average Vote: "; // } /* if ($AverageVote == 1) { echo ""; } if ($AverageVote == 2) { echo " "; } if ($AverageVote == 3) { echo " "; } if ($AverageVote == 4) { echo " "; } if ($AverageVote == 5) { echo " "; } echo "
    "; */ $i++; } echo "
    "; } } // ****************** It didn't pass a category variable. ******************************************* else { //echo "Store"; echo ""; //echo ''; echo ""; echo ''; //echo ""; // echo ""; // echo ""; // echo " "; echo "
    Categories:
      "; // get the list of equipment types. $query="SELECT * FROM EquipmentType Order By TypeName"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $TypeName=mysql_result($result,$i,"TypeName"); $UniqueID=mysql_result($result,$i,"UniqueID"); //echo "
    • $TypeName
    • "; //if it equals books or software, go back to the store page to display it so it doesnt search it on ebay if (($TypeName == Books) OR ($TypeName == Software)) { echo "
    • $TypeName
    • "; } // don't display the category 'other' elseif ($TypeName <> Other) { echo "
    • $TypeName
    • "; } $i++; } $ProductQuery = mysqlclean($_GET,"ProductQuery",100,$connection); echo ''; echo "
    Search for product: Max Price $ Items Per Range

    "; //$query="SELECT ProductID, ProductName, ProductImageURL, PurchaseLink, ImageWidth, ImageHeight, AvailableOnsite, VendorID FROM StoreProducts where (ApprovedForDisplay='1') AND (IsProductActive='1')"; $query="SELECT StoreProducts.ProductID, StoreProducts.ProductName, StoreProducts.ProductImageURL, StoreProducts.PurchaseLink, StoreProducts.ImageWidth, StoreProducts.ImageHeight, StoreProducts.AvailableOnsite, StoreProducts.VendorID, sampletable.CompanyName FROM StoreProducts Join sampletable ON StoreProducts.VendorID = sampletable.id where (StoreProducts.ApprovedForDisplay='1') AND (StoreProducts.IsProductActive='1')"; $result=mysql_query($query); $num=mysql_numrows($result); $ItemsRowCounter = 1; $i=0; while ($i < $num) { // echo "testing - $ProductArray[$ProductArrayPosition], $ProductArray[$QuantityArrayPosition]"; $ProductName=mysql_result($result,$i,"ProductName"); $ProductID=mysql_result($result,$i,"ProductID"); $ProductImageURL=mysql_result($result,$i,"ProductImageURL"); $PurchaseLink=mysql_result($result,$i,"PurchaseLink"); $ImageWidth=mysql_result($result,$i,"ImageWidth"); $ImageHeight=mysql_result($result,$i,"ImageHeight"); $AvailableOnsite=mysql_result($result,$i,"AvailableOnsite"); $CompanyName=mysql_result($result,$i,"CompanyName"); // ********************************************************************************** if ($ItemsRowCounter == 1){ echo ""; // echo ''; echo " "; // if this is the last item in the row, close the if ($num == $i) { echo ""; } $ItemsRowCounter++; } // ********************************************************************************** // is this item somewhere in the middle of the row? elseif (($ItemsRowCounter > 1) and ($ItemsRowCounter < $ItemsPerRow)) { // echo ''; echo " "; // if this is the last item in the row, close the if ($num == $i) { echo ""; } $ItemsRowCounter++; } // ********************************************************************************** // is this the last item in the row? then close the row elseif ($ItemsRowCounter == $ItemsPerRow) { // echo ''; echo " "; echo ""; $ItemsRowCounter = 1; } $i++; } echo "
    "; // "; echo ""; // echo ""; echo ""; // echo ''; // echo ""; echo ''; // is this product available onsite? 1 = yes, 0 = no if ($AvailableOnsite == 1) { // only do this if there is a customer session if(session_is_registered(CustomerID)) { $CustomerID = $_SESSION['CustomerID']; $j=0; //initialize this to 0 $QuantityFromDB=0; $query1="SELECT Quantity FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; if (!(@mysql_query($query1,$connection))) showerror; $result1=mysql_query($query1); $num1=mysql_numrows($result1); while ($j < $num1) { $QuantityFromDB=mysql_result($result1,$j,"Quantity"); $j++; } } else { $QuantityFromDB=0; } echo ""; } else { echo "
    $ProductName
    $ProductName
    // // //
    Qty.
    "; } echo "
    "; // "; echo ""; // echo ""; echo ""; // echo ''; // echo ""; echo ''; // is this product available onsite? 1 = yes, 0 = no if ($AvailableOnsite == 1) { // only do this if there is a customer session if(session_is_registered(CustomerID)) { $CustomerID = $_SESSION['CustomerID']; $j=0; //initialize this to 0 $QuantityFromDB=0; $query1="SELECT Quantity FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; if (!(@mysql_query($query1,$connection))) showerror; $result1=mysql_query($query1); $num1=mysql_numrows($result1); while ($j < $num1) { $QuantityFromDB=mysql_result($result1,$j,"Quantity"); $j++; } } else { $QuantityFromDB=0; } echo ""; } else { echo "
    $ProductName
    $ProductName
    // // //
    Qty.
    "; } echo "
    "; // "; echo ""; // echo ""; echo ""; // echo ''; // echo ""; echo ''; // is this product available onsite? 1 = yes, 0 = no if ($AvailableOnsite == 1) { // only do this if there is a customer session if(session_is_registered(CustomerID)) { $CustomerID = $_SESSION['CustomerID']; $j=0; //initialize this to 0 $QuantityFromDB=0; $query1="SELECT Quantity FROM ShoppingCartOrderItems WHERE CustomerID='$CustomerID' AND ProductID='$ProductID'"; if (!(@mysql_query($query1,$connection))) showerror; $result1=mysql_query($query1); $num1=mysql_numrows($result1); while ($j < $num1) { $QuantityFromDB=mysql_result($result1,$j,"Quantity"); $j++; } } else { $QuantityFromDB=0; } echo ""; } else { echo "
    $ProductName
    $ProductName
    // // //
    Qty.
    "; } echo "
    First Name:
    Your name is = $UserFirstName
    "; } // *************************************************************** // END DISPLAY PRODUCTS // *************************************************************** // for vbulletin echo ""; ?>
    Powered by vBadvanced CMPS v3.1.0

    All times are GMT -5. The time now is 02:58 PM.


    (C) 2011 Riggs Publications - Terms of use & Privacy Policy

    All times are GMT -5. The time now is 02:58 PM.

    (C) 2011 Riggs Publications - Terms of use & Privacy Policy