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

". mysql_error()); } // Select the database $db_select = mysql_select_db($db_database); if (!$db_select){ die ("Could not select the database:
". mysql_error( )); } //************************************************************************************ function GetEbayResults($safeQuery, $priceRangeMax, $itemsPerRange, $connection ){ //$safeQuery = urlencode('Echo Hedge Trimmer'); //$safeQuery = 'Hedge Trimmer'; //$safeQuery = 'Echo Hedge Trimmer'; // $safeQuery = urlencode($safeQuery); // $siteID = $_GET['SiteID']; $siteID = 0; // 0 is the U.S. $priceRangeMin = 0.0; // $priceRangeMax = $_POST['MaxPrice']; // $priceRangeMax = 500; // $itemsPerRange = $_POST['ItemsPerRange']; // $itemsPerRange = 10; // $debug = (boolean) $_POST['Debug']; $debug = False; $ip=$_SERVER['REMOTE_ADDR']; $CurrentDate = date("Y-m-d"); $CurrentTime= date("g:i a"); // This is used to enter the first mid range search item into a db. $SearchDataEntewhiteFlag = No; echo" "; echo ""; $results = ''; $endpoint = 'http://open.api.ebay.com/shopping'; // URL to call $responseEncoding = 'XML'; // Format of the response $rangeArr = array('Low-Range', 'Mid-Range', 'High-Range'); $priceRange = ($priceRangeMax - $priceRangeMin) / 3; // find price ranges for three tables $priceRangeMin = sprintf("%01.2f", 0.00); $priceRangeMax = $priceRangeMin; // needed for initial setup foreach ($rangeArr as $range) { $priceRangeMax = sprintf("%01.2f", ($priceRangeMin + $priceRange)); $results .= "

$range : $priceRangeMin ~ $priceRangeMax

\n"; // Construct the FindItems call $apicall = "$endpoint?callname=FindItemsAdvanced" . "&version=537" . "&siteid=$siteID" . "&appid=SteveLow-df98-45b5-a264-77c172a7fa77" . "&QueryKeywords=$safeQuery" . "&MaxEntries=$itemsPerRange" . "&ItemSort=BestMatchCategoryGroup" //BestMatch, BestMatchCategoryGroup, BestMatchPlusPrice . "&GroupsMax=3" . "&GroupMaxEntries=20" . "&ItemType=AllItemTypes" // FixedPricedItem, AllItemTypes, AllItems . "&PriceMin.Value=$priceRangeMin" . "&PriceMax.Value=$priceRangeMax" . "&IncludeSelector=SearchDetails" //CategoryHistogram, SearchDetails // . "&CategoryHistogramMaxParents=3" //Max: 10. Default: 3. . "&DescriptionSearch=True" // true, false // . "&HideDuplicateItems=True" // true, false // . "&IncludeSelector=CategoryHistogram" // Details, CategoryHistogram . "&trackingpartnercode=9" // fill in your information in next 3 lines . "&trackingid=5336238492" . "&affiliateuserid=456" // . "&PageNumber=1" . "&responseencoding=$responseEncoding"; if ($debug) { print "GET call = $apicall
"; // see GET request generated } // Load the call and capture the document returned by the Shopping API $resp = simplexml_load_file($apicall); // Check to see if the response was loaded, else print an error // Probably best to split into two different tests, but have as one for brevity if ($resp && $resp->TotalItems > 0) { // this is to enter the first mid range product response into a db if ((($range == 'Low-Range') or ($range == 'Mid-Range'))and ($SearchDataEntewhiteFlag == No)) { $results .= "
"; } $results .= 'Total items : ' . $resp->TotalItems . "
\n"; $results .= '
» Lawn Care Business Product Reviews
' . "\n"; // $results .= "\n"; // If the response was loaded, parse it and build links foreach($resp->SearchResult->ItemArray->Item as $item) { if ($item->GalleryURL) { $picURL = $item->GalleryURL; } else { $picURL = "http://pics.ebaystatic.com/aw/pics/express/icons/iconPlaceholder_96x96.gif"; } $link = $item->ViewItemURLForNaturalSearch; $title = $item->Title; $price = sprintf("%01.2f", $item->ConvertedCurrentPrice); $ship = sprintf("%01.2f", $item->ShippingCostSummary->ShippingServiceCost); $total = sprintf("%01.2f", ((float)$item->ConvertedCurrentPrice + (float)$item->ShippingCostSummary->ShippingServiceCost)); // Determine currency to display - so far only seen cases where priceCurr = shipCurr, but may be others $priceCurr = (string) $item->ConvertedCurrentPrice['currencyID']; $shipCurr = (string) $item->ShippingCostSummary->ShippingServiceCost['currencyID']; if ($priceCurr == $shipCurr) { $curr = $priceCurr; } else { $curr = "$priceCurr / $shipCurr"; // potential case where price/ship currencies differ } $timeLeft = getPrettyTimeFromEbayTime($item->TimeLeft); $endTime = strtotime($item->EndTime); // returns Epoch seconds $endTime = $item->EndTime; // $results .= "" // . //""; $results .= ""; // this is to enter the first mid range product response into a db if (($range == 'Mid-Range') and ($SearchDataEntewhiteFlag == No)) { // insert the first mid-range product search return into db // $dbquery = "Insert INTO ProductSearches (Query, ImageURL, ProductName, Link, SearchTime, SearchDate, IP) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip')"; $dbquery = "Insert INTO ProductSearches (SearchQuery, ImageURL, ProductName, Link, SearchTime, SearchDate, IP, CategoryID) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip', '$CategoryID')"; if (!(@mysql_query($dbquery,$connection))) showerror; $SearchDataEntewhiteFlag = Yes; } } $results .= "
TitlePrice     Shipping     Total     Time LeftEnd Time
$title$price$ship$total$curr$timeLeft$endTime
$title  ".money_format('%n', $price)."
"; } // If there was no response, print an error else { $results = "

No additional items found

"; } $priceRangeMin = $priceRangeMax; // set up for next iteration } // foreach return $results; } //************************************************************************************ // for vbulletin echo "
"; if (isset($_POST['Search'])) { // *************************************************************** // BEGIN Display lawn care business product reviews FOR POST // *************************************************************** $ModelNumber = mysqlclean($_POST,"ModelNumber",100,$connection); $ManufacturerName = mysqlclean($_POST,"ManufacturerName",100,$connection); $CategoryID = mysqlclean($_POST,"CategoryID",100,$connection); $CategoryName = mysqlclean($_POST,"CategoryName",100,$connection); $Query = mysqlclean($_POST,"Query",100,$connection); //$Query = $CategoryName; // $safeQuery = urlencode($_POST['Query']); $safeQuery = urlencode($Query); // $siteID = $_POST['SiteID']; $siteID = 0; // 0 is the U.S. $priceRangeMin = 0.0; $priceRangeMax = $_POST['MaxPrice']; // $priceRangeMax = 500; // $itemsPerRange = $_POST['ItemsPerRange']; $itemsPerRange = 10; // $debug = (boolean) $_POST['Debug']; $debug = False; // This is used to enter the first mid range search item into a db. $SearchDataEntewhiteFlag = No; echo" "; echo ""; $results = ''; $endpoint = 'http://open.api.ebay.com/shopping'; // URL to call $responseEncoding = 'XML'; // Format of the response $rangeArr = array('Low-Range', 'Mid-Range', 'High-Range'); $priceRange = ($priceRangeMax - $priceRangeMin) / 3; // find price ranges for three tables $priceRangeMin = sprintf("%01.2f", 0.00); $priceRangeMax = $priceRangeMin; // needed for initial setup foreach ($rangeArr as $range) { $priceRangeMax = sprintf("%01.2f", ($priceRangeMin + $priceRange)); $results .= "

$range : $priceRangeMin ~ $priceRangeMax

\n"; // Construct the FindItems call $apicall = "$endpoint?callname=FindItemsAdvanced" . "&version=537" . "&siteid=$siteID" . "&appid=SteveLow-df98-45b5-a264-77c172a7fa77" . "&QueryKeywords=$safeQuery" . "&MaxEntries=$itemsPerRange" . "&ItemSort=BestMatchCategoryGroup" //BestMatch, BestMatchCategoryGroup, BestMatchPlusPrice . "&GroupsMax=3" . "&GroupMaxEntries=20" . "&ItemType=AllItemTypes" // FixedPricedItem, AllItemTypes, AllItems . "&PriceMin.Value=$priceRangeMin" . "&PriceMax.Value=$priceRangeMax" . "&IncludeSelector=SearchDetails" //CategoryHistogram, SearchDetails // . "&CategoryHistogramMaxParents=3" //Max: 10. Default: 3. . "&DescriptionSearch=True" // true, false // . "&HideDuplicateItems=True" // true, false // . "&IncludeSelector=CategoryHistogram" // Details, CategoryHistogram . "&trackingpartnercode=9" // fill in your information in next 3 lines . "&trackingid=5336238492" . "&affiliateuserid=456" // . "&PageNumber=1" . "&responseencoding=$responseEncoding"; if ($debug) { print "GET call = $apicall
"; // see GET request generated } // Load the call and capture the document returned by the Shopping API $resp = simplexml_load_file($apicall); // Check to see if the response was loaded, else print an error // Probably best to split into two different tests, but have as one for brevity if ($resp && $resp->TotalItems > 0) { // this is to enter the first mid range product response into a db if ((($range == 'Low-Range') or ($range == 'Mid-Range'))and ($SearchDataEntewhiteFlag == No)) { $results .= "
"; } $results .= 'Total items : ' . $resp->TotalItems . "
\n"; $results .= '' . "\n"; // $results .= "\n"; // If the response was loaded, parse it and build links foreach($resp->SearchResult->ItemArray->Item as $item) { if ($item->GalleryURL) { $picURL = $item->GalleryURL; } else { $picURL = "http://pics.ebaystatic.com/aw/pics/express/icons/iconPlaceholder_96x96.gif"; } $link = $item->ViewItemURLForNaturalSearch; $title = $item->Title; $price = sprintf("%01.2f", $item->ConvertedCurrentPrice); $ship = sprintf("%01.2f", $item->ShippingCostSummary->ShippingServiceCost); $total = sprintf("%01.2f", ((float)$item->ConvertedCurrentPrice + (float)$item->ShippingCostSummary->ShippingServiceCost)); // Determine currency to display - so far only seen cases where priceCurr = shipCurr, but may be others $priceCurr = (string) $item->ConvertedCurrentPrice['currencyID']; $shipCurr = (string) $item->ShippingCostSummary->ShippingServiceCost['currencyID']; if ($priceCurr == $shipCurr) { $curr = $priceCurr; } else { $curr = "$priceCurr / $shipCurr"; // potential case where price/ship currencies differ } $timeLeft = getPrettyTimeFromEbayTime($item->TimeLeft); $endTime = strtotime($item->EndTime); // returns Epoch seconds $endTime = $item->EndTime; // $results .= "" // . //""; $results .= ""; // this is to enter the first mid range product response into a db if (($range == 'Mid-Range') and ($SearchDataEntewhiteFlag == No)) { // insert the first mid-range product search return into db // $dbquery = "Insert INTO ProductSearches (Query, ImageURL, ProductName, Link, SearchTime, SearchDate, IP) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip')"; $dbquery = "Insert INTO ProductSearches (SearchQuery, ImageURL, ProductName, Link, SearchTime, SearchDate, IP, CategoryID) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip', '$CategoryID')"; if (!(@mysql_query($dbquery,$connection))) showerror; $SearchDataEntewhiteFlag = Yes; } } $results .= "
TitlePrice     Shipping     Total     Time LeftEnd Time
$title$price$ship$total$curr$timeLeft$endTime
$title  ".money_format('%n', $price)."
"; } // If there was no response, print an error else { $results = "

No additional items found

"; } $priceRangeMin = $priceRangeMax; // set up for next iteration } // foreach echo ""; echo "

$Query

Categories
    "; //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++; } echo "
"; echo "
"; echo ""; echo '
'; echo "
Search again? Max Price $ Items Per Range
$results

"; echo "
"; } // *************************************************************** // END Display lawn care business product reviews FOR POST // *************************************************************** elseif (isset($_GET['Submit'])) { // *************************************************************** // BEGIN Display lawn care business product reviews // *************************************************************** $ModelNumber = mysqlclean($_GET,"ModelNumber",100,$connection); $ManufacturerName = mysqlclean($_GET,"ManufacturerName",100,$connection); $CategoryID = mysqlclean($_GET,"CategoryID",100,$connection); $CategoryName = mysqlclean($_GET,"CategoryName",100,$connection); //$Query = mysqlclean($_GET,"Query",100,$connection); $Query = $CategoryName; // $safeQuery = urlencode($_GET['Query']); $safeQuery = urlencode($Query); // $siteID = $_GET['SiteID']; $siteID = 0; // 0 is the U.S. $priceRangeMin = 0.0; // $priceRangeMax = $_POST['MaxPrice']; $priceRangeMax = 500; // $itemsPerRange = $_POST['ItemsPerRange']; $itemsPerRange = 10; // $debug = (boolean) $_POST['Debug']; $debug = False; // This is used to enter the first mid range search item into a db. $SearchDataEntewhiteFlag = No; echo" "; echo ""; $results = ''; $endpoint = 'http://open.api.ebay.com/shopping'; // URL to call $responseEncoding = 'XML'; // Format of the response $rangeArr = array('Low-Range', 'Mid-Range', 'High-Range'); $priceRange = ($priceRangeMax - $priceRangeMin) / 3; // find price ranges for three tables $priceRangeMin = sprintf("%01.2f", 0.00); $priceRangeMax = $priceRangeMin; // needed for initial setup foreach ($rangeArr as $range) { $priceRangeMax = sprintf("%01.2f", ($priceRangeMin + $priceRange)); $results .= "

$range : $priceRangeMin ~ $priceRangeMax

\n"; // Construct the FindItems call $apicall = "$endpoint?callname=FindItemsAdvanced" . "&version=537" . "&siteid=$siteID" . "&appid=SteveLow-df98-45b5-a264-77c172a7fa77" . "&QueryKeywords=$safeQuery" . "&MaxEntries=$itemsPerRange" . "&ItemSort=BestMatchCategoryGroup" //BestMatch, BestMatchCategoryGroup, BestMatchPlusPrice . "&GroupsMax=3" . "&GroupMaxEntries=20" . "&ItemType=AllItemTypes" // FixedPricedItem, AllItemTypes, AllItems . "&PriceMin.Value=$priceRangeMin" . "&PriceMax.Value=$priceRangeMax" . "&IncludeSelector=SearchDetails" //CategoryHistogram, SearchDetails // . "&CategoryHistogramMaxParents=3" //Max: 10. Default: 3. . "&DescriptionSearch=True" // true, false // . "&HideDuplicateItems=True" // true, false // . "&IncludeSelector=CategoryHistogram" // Details, CategoryHistogram . "&trackingpartnercode=9" // fill in your information in next 3 lines . "&trackingid=5336238492" . "&affiliateuserid=456" // . "&PageNumber=1" . "&responseencoding=$responseEncoding"; if ($debug) { print "GET call = $apicall
"; // see GET request generated } // Load the call and capture the document returned by the Shopping API $resp = simplexml_load_file($apicall); // Check to see if the response was loaded, else print an error // Probably best to split into two different tests, but have as one for brevity if ($resp && $resp->TotalItems > 0) { // this is to enter the first mid range product response into a db if ((($range == 'Low-Range') or ($range == 'Mid-Range'))and ($SearchDataEntewhiteFlag == No)) { $results .= "
"; } $results .= 'Total items : ' . $resp->TotalItems . "
\n"; $results .= '' . "\n"; // $results .= "\n"; // If the response was loaded, parse it and build links foreach($resp->SearchResult->ItemArray->Item as $item) { if ($item->GalleryURL) { $picURL = $item->GalleryURL; } else { $picURL = "http://pics.ebaystatic.com/aw/pics/express/icons/iconPlaceholder_96x96.gif"; } $link = $item->ViewItemURLForNaturalSearch; $title = $item->Title; $price = sprintf("%01.2f", $item->ConvertedCurrentPrice); $ship = sprintf("%01.2f", $item->ShippingCostSummary->ShippingServiceCost); $total = sprintf("%01.2f", ((float)$item->ConvertedCurrentPrice + (float)$item->ShippingCostSummary->ShippingServiceCost)); // Determine currency to display - so far only seen cases where priceCurr = shipCurr, but may be others $priceCurr = (string) $item->ConvertedCurrentPrice['currencyID']; $shipCurr = (string) $item->ShippingCostSummary->ShippingServiceCost['currencyID']; if ($priceCurr == $shipCurr) { $curr = $priceCurr; } else { $curr = "$priceCurr / $shipCurr"; // potential case where price/ship currencies differ } $timeLeft = getPrettyTimeFromEbayTime($item->TimeLeft); $endTime = strtotime($item->EndTime); // returns Epoch seconds $endTime = $item->EndTime; // $results .= "" // . //""; $results .= ""; // this is to enter the first mid range product response into a db if (($range == 'Mid-Range') and ($SearchDataEntewhiteFlag == No)) { // insert the first mid-range product search return into db // $dbquery = "Insert INTO ProductSearches (Query, ImageURL, ProductName, Link, SearchTime, SearchDate, IP) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip')"; $dbquery = "Insert INTO ProductSearches (SearchQuery, ImageURL, ProductName, Link, SearchTime, SearchDate, IP, CategoryID) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip', '$CategoryID')"; if (!(@mysql_query($dbquery,$connection))) showerror; $SearchDataEntewhiteFlag = Yes; } } $results .= "
TitlePrice     Shipping     Total     Time LeftEnd Time
$title$price$ship$total$curr$timeLeft$endTime
$title  ".money_format('%n', $price)."
"; } // If there was no response, print an error else { $results = "

No additional items found

"; } $priceRangeMin = $priceRangeMax; // set up for next iteration } // foreach echo ""; echo "

$Query

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++; } echo "
"; echo "
"; echo ""; echo '
'; echo "
Search again? Max Price $ Items Per Range
$results
"; } // *************************************************************** // END Display lawn care business product reviews // *************************************************************** elseif (isset($_GET['ShowManufacturers'])) { // *************************************************************** // BEGIN Show manufacturers of that category // *************************************************************** $CategoryID = mysqlclean($_GET,"CategoryID",100,$connection); $CategoryName = mysqlclean($_GET,"CategoryName",100,$connection); echo ""; echo "

$CategoryName

Categories
>>$CategoryName:
    "; // get the list of equipment types. $query="SELECT Distinct EquipmentManufacturer.ManufacturerName, EquipmentManufacturer.UniqueID FROM EquipmentManufacturer Join EquipmentModel ON EquipmentModel.ManufacturerID = EquipmentManufacturer.UniqueID Where (EquipmentModel.TypeID = '$CategoryID') Order By ManufacturerName"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $ManufacturerName=mysql_result($result,$i,"ManufacturerName"); $ManufacturerID=mysql_result($result,$i,"UniqueID"); echo "
  • $ManufacturerName
  • "; $i++; } echo "
"; // **************************************************************************** $ModelNumber = mysqlclean($_GET,"ModelNumber",100,$connection); $ManufacturerName = mysqlclean($_GET,"ManufacturerName",100,$connection); $CategoryID = mysqlclean($_GET,"CategoryID",100,$connection); $CategoryName = mysqlclean($_GET,"CategoryName",100,$connection); //$Query = mysqlclean($_GET,"Query",100,$connection); $Query = $CategoryName; // $safeQuery = urlencode($_GET['Query']); // $safeQuery = urlencode($ManufacturerName.'+'.$Query); $safeQuery = $Query; // $siteID = $_GET['SiteID']; $siteID = 0; // 0 is the U.S. $priceRangeMin = 0.0; // $priceRangeMax = $_POST['MaxPrice']; $priceRangeMax = 500; // $itemsPerRange = $_POST['ItemsPerRange']; $itemsPerRange = 10; // $debug = (boolean) $_POST['Debug']; $debug = False; // This is used to enter the first mid range search item into a db. $SearchDataEntewhiteFlag = No; echo" "; echo ""; $results = ''; $endpoint = 'http://open.api.ebay.com/shopping'; // URL to call $responseEncoding = 'XML'; // Format of the response $rangeArr = array('Low-Range', 'Mid-Range', 'High-Range'); $priceRange = ($priceRangeMax - $priceRangeMin) / 3; // find price ranges for three tables $priceRangeMin = sprintf("%01.2f", 0.00); $priceRangeMax = $priceRangeMin; // needed for initial setup foreach ($rangeArr as $range) { $priceRangeMax = sprintf("%01.2f", ($priceRangeMin + $priceRange)); $results .= "

$range : $priceRangeMin ~ $priceRangeMax

\n"; // Construct the FindItems call $apicall = "$endpoint?callname=FindItemsAdvanced" . "&version=537" . "&siteid=$siteID" . "&appid=SteveLow-df98-45b5-a264-77c172a7fa77" . "&QueryKeywords=$safeQuery" . "&MaxEntries=$itemsPerRange" . "&ItemSort=BestMatchCategoryGroup" //BestMatch, BestMatchCategoryGroup, BestMatchPlusPrice . "&GroupsMax=3" . "&GroupMaxEntries=20" . "&ItemType=AllItemTypes" // FixedPricedItem, AllItemTypes, AllItems . "&PriceMin.Value=$priceRangeMin" . "&PriceMax.Value=$priceRangeMax" . "&IncludeSelector=SearchDetails" //CategoryHistogram, SearchDetails // . "&CategoryHistogramMaxParents=3" //Max: 10. Default: 3. . "&DescriptionSearch=True" // true, false // . "&HideDuplicateItems=True" // true, false // . "&IncludeSelector=CategoryHistogram" // Details, CategoryHistogram . "&trackingpartnercode=9" // fill in your information in next 3 lines . "&trackingid=5336238492" . "&affiliateuserid=456" // . "&PageNumber=1" . "&responseencoding=$responseEncoding"; if ($debug) { print "GET call = $apicall
"; // see GET request generated } // Load the call and capture the document returned by the Shopping API $resp = simplexml_load_file($apicall); // Check to see if the response was loaded, else print an error // Probably best to split into two different tests, but have as one for brevity if ($resp && $resp->TotalItems > 0) { // this is to enter the first mid range product response into a db if ((($range == 'Low-Range') or ($range == 'Mid-Range'))and ($SearchDataEntewhiteFlag == No)) { $results .= "
"; } $results .= 'Total items : ' . $resp->TotalItems . "
\n"; $results .= '
"; echo "
"; echo ""; echo '
'; echo "
Search again? Max Price $ Items Per Range
' . "\n"; // $results .= "\n"; // If the response was loaded, parse it and build links foreach($resp->SearchResult->ItemArray->Item as $item) { if ($item->GalleryURL) { $picURL = $item->GalleryURL; } else { $picURL = "http://pics.ebaystatic.com/aw/pics/express/icons/iconPlaceholder_96x96.gif"; } $link = $item->ViewItemURLForNaturalSearch; $title = $item->Title; $price = sprintf("%01.2f", $item->ConvertedCurrentPrice); $ship = sprintf("%01.2f", $item->ShippingCostSummary->ShippingServiceCost); $total = sprintf("%01.2f", ((float)$item->ConvertedCurrentPrice + (float)$item->ShippingCostSummary->ShippingServiceCost)); // Determine currency to display - so far only seen cases where priceCurr = shipCurr, but may be others $priceCurr = (string) $item->ConvertedCurrentPrice['currencyID']; $shipCurr = (string) $item->ShippingCostSummary->ShippingServiceCost['currencyID']; if ($priceCurr == $shipCurr) { $curr = $priceCurr; } else { $curr = "$priceCurr / $shipCurr"; // potential case where price/ship currencies differ } $timeLeft = getPrettyTimeFromEbayTime($item->TimeLeft); $endTime = strtotime($item->EndTime); // returns Epoch seconds $endTime = $item->EndTime; // $results .= "" // . //""; $results .= ""; // this is to enter the first mid range product response into a db if (($range == 'Mid-Range') and ($SearchDataEntewhiteFlag == No)) { // insert the first mid-range product search return into db // $dbquery = "Insert INTO ProductSearches (Query, ImageURL, ProductName, Link, SearchTime, SearchDate, IP) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip')"; $dbquery = "Insert INTO ProductSearches (SearchQuery, ImageURL, ProductName, Link, SearchTime, SearchDate, IP, CategoryID) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip', '$CategoryID')"; if (!(@mysql_query($dbquery,$connection))) showerror; $SearchDataEntewhiteFlag = Yes; } } $results .= "
TitlePrice     Shipping     Total     Time LeftEnd Time
$title$price$ship$total$curr$timeLeft$endTime
$title  ".money_format('%n', $price)."
"; } // If there was no response, print an error else { $results = "

No additional items found

"; } $priceRangeMin = $priceRangeMax; // set up for next iteration } // foreach // **************************************************************************** echo "
$results
"; } // *************************************************************** // END Show manufacturers of that category // *************************************************************** elseif (isset($_GET['ShowModels'])) { // *************************************************************** // BEGIN Show Models of a specific manufacturer // *************************************************************** $CategoryID = mysqlclean($_GET,"CategoryID",100,$connection); $CategoryName = mysqlclean($_GET,"CategoryName",100,$connection); $ManufacturerName = mysqlclean($_GET,"ManufacturerName",100,$connection); $ManufacturerID = mysqlclean($_GET,"ManufacturerID",100,$connection); // broaden the search a little if ($CategoryName == "Mower Ride On") { $CategoryName = "Mower"; $Query = "Mower"; } echo ""; echo "

$ManufacturerName $CategoryName

Categories:
$CategoryName
>>$ManufacturerName
    "; // get the list of equipment types. $query="SELECT * FROM EquipmentModel Where (EquipmentModel.TypeID = '$CategoryID') AND (ManufacturerID = '$ManufacturerID') Order By ModelNumber"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $ModelNumber=mysql_result($result,$i,"ModelNumber"); $UniqueID=mysql_result($result,$i,"UniqueID"); echo "
  • $ModelNumber
  • "; // 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); } // echo "$ManufacturerName - $PrintableModelName, Total Votes: $num2 - Average Vote: "; if ($AverageVote == 1) { echo "($num2)"; } if ($AverageVote == 2) { echo "($num2)"; } if ($AverageVote == 3) { echo "($num2)"; } if ($AverageVote == 4) { echo "($num2)"; } if ($AverageVote == 5) { echo "($num2)"; } // get product review this equipment. $ProductReviews = 0; $query2="SELECT ProductReview FROM EquipmentRate Where (EquipmentModelID = '$UniqueID') AND (ProductReview <> '') AND (ApprovedToDisplayReview = '1') "; $result2=mysql_query($query2); $num2=mysql_numrows($result2); $ProductReviews=$num2; // are there any product reviews for this product? if ($ProductReviews > 0) { echo ""; } $i++; } echo "
= Product Rating

= Product has been reviewed

(#) = Total Votes
"; echo "

"; // $safeQuery = urlencode($ManufacturerName.'+'.$CategoryName); //$safeQuery = $ManufacturerName.' '.$CategoryName; // $priceRangeMax = 500; // $itemsPerRange = 10; // $results = GetEbayResults($safeQuery, $priceRangeMax, $itemsPerRange, $connection ); // **************************************************************************** $ModelNumber = mysqlclean($_GET,"ModelNumber",100,$connection); $ManufacturerName = mysqlclean($_GET,"ManufacturerName",100,$connection); $CategoryID = mysqlclean($_GET,"CategoryID",100,$connection); //$CategoryName = mysqlclean($_GET,"CategoryName",100,$connection); //$Query = mysqlclean($_GET,"Query",100,$connection); $Query = $CategoryName; // $safeQuery = urlencode($_GET['Query']); // $safeQuery = urlencode($ManufacturerName.'+'.$Query); $safeQuery = $ManufacturerName.' '.$CategoryName; // $siteID = $_GET['SiteID']; $siteID = 0; // 0 is the U.S. $priceRangeMin = 0.0; // $priceRangeMax = $_POST['MaxPrice']; $priceRangeMax = 500; // $itemsPerRange = $_POST['ItemsPerRange']; $itemsPerRange = 10; // $debug = (boolean) $_POST['Debug']; $debug = False; // This is used to enter the first mid range search item into a db. $SearchDataEntewhiteFlag = No; echo" "; echo ""; $results = ''; $endpoint = 'http://open.api.ebay.com/shopping'; // URL to call $responseEncoding = 'XML'; // Format of the response $rangeArr = array('Low-Range', 'Mid-Range', 'High-Range'); $priceRange = ($priceRangeMax - $priceRangeMin) / 3; // find price ranges for three tables $priceRangeMin = sprintf("%01.2f", 0.00); $priceRangeMax = $priceRangeMin; // needed for initial setup foreach ($rangeArr as $range) { $priceRangeMax = sprintf("%01.2f", ($priceRangeMin + $priceRange)); $results .= "

$range : $priceRangeMin ~ $priceRangeMax

\n"; // Construct the FindItems call $apicall = "$endpoint?callname=FindItemsAdvanced" . "&version=537" . "&siteid=$siteID" . "&appid=SteveLow-df98-45b5-a264-77c172a7fa77" . "&QueryKeywords=$safeQuery" . "&MaxEntries=$itemsPerRange" . "&ItemSort=BestMatchCategoryGroup" //BestMatch, BestMatchCategoryGroup, BestMatchPlusPrice . "&GroupsMax=3" . "&GroupMaxEntries=20" . "&ItemType=AllItemTypes" // FixedPricedItem, AllItemTypes, AllItems . "&PriceMin.Value=$priceRangeMin" . "&PriceMax.Value=$priceRangeMax" . "&IncludeSelector=SearchDetails" //CategoryHistogram, SearchDetails // . "&CategoryHistogramMaxParents=3" //Max: 10. Default: 3. . "&DescriptionSearch=True" // true, false // . "&HideDuplicateItems=True" // true, false // . "&IncludeSelector=CategoryHistogram" // Details, CategoryHistogram . "&trackingpartnercode=9" // fill in your information in next 3 lines . "&trackingid=5336238492" . "&affiliateuserid=456" // . "&PageNumber=1" . "&responseencoding=$responseEncoding"; if ($debug) { print "GET call = $apicall
"; // see GET request generated } // Load the call and capture the document returned by the Shopping API $resp = simplexml_load_file($apicall); // Check to see if the response was loaded, else print an error // Probably best to split into two different tests, but have as one for brevity if ($resp && $resp->TotalItems > 0) { // this is to enter the first mid range product response into a db if ((($range == 'Low-Range') or ($range == 'Mid-Range'))and ($SearchDataEntewhiteFlag == No)) { $results .= "
"; } $results .= 'Total items : ' . $resp->TotalItems . "
\n"; $results .= '
"; echo "
"; echo ""; echo '
'; echo "
Search again? Max Price $ Items Per Range
' . "\n"; // $results .= "\n"; // If the response was loaded, parse it and build links foreach($resp->SearchResult->ItemArray->Item as $item) { if ($item->GalleryURL) { $picURL = $item->GalleryURL; } else { $picURL = "http://pics.ebaystatic.com/aw/pics/express/icons/iconPlaceholder_96x96.gif"; } $link = $item->ViewItemURLForNaturalSearch; $title = $item->Title; $price = sprintf("%01.2f", $item->ConvertedCurrentPrice); $ship = sprintf("%01.2f", $item->ShippingCostSummary->ShippingServiceCost); $total = sprintf("%01.2f", ((float)$item->ConvertedCurrentPrice + (float)$item->ShippingCostSummary->ShippingServiceCost)); // Determine currency to display - so far only seen cases where priceCurr = shipCurr, but may be others $priceCurr = (string) $item->ConvertedCurrentPrice['currencyID']; $shipCurr = (string) $item->ShippingCostSummary->ShippingServiceCost['currencyID']; if ($priceCurr == $shipCurr) { $curr = $priceCurr; } else { $curr = "$priceCurr / $shipCurr"; // potential case where price/ship currencies differ } $timeLeft = getPrettyTimeFromEbayTime($item->TimeLeft); $endTime = strtotime($item->EndTime); // returns Epoch seconds $endTime = $item->EndTime; // $results .= "" // . //""; $results .= ""; // this is to enter the first mid range product response into a db if (($range == 'Mid-Range') and ($SearchDataEntewhiteFlag == No)) { // insert the first mid-range product search return into db // $dbquery = "Insert INTO ProductSearches (Query, ImageURL, ProductName, Link, SearchTime, SearchDate, IP) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip')"; $dbquery = "Insert INTO ProductSearches (SearchQuery, ImageURL, ProductName, Link, SearchTime, SearchDate, IP, CategoryID) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip', '$CategoryID')"; if (!(@mysql_query($dbquery,$connection))) showerror; $SearchDataEntewhiteFlag = Yes; } } $results .= "
TitlePrice     Shipping     Total     Time LeftEnd Time
$title$price$ship$total$curr$timeLeft$endTime
$title  ".money_format('%n', $price)."
"; } // If there was no response, print an error else { $results = "

No additional items found

"; } $priceRangeMin = $priceRangeMax; // set up for next iteration } // foreach // **************************************************************************** echo "
$results
"; } // *************************************************************** // END Show Models of a specific manufacturer // *************************************************************** elseif (isset($_GET['ShowSpecificModel'])) { // *************************************************************** // BEGIN Show specific model // *************************************************************** $CategoryID = mysqlclean($_GET,"CategoryID",100,$connection); $CategoryName = mysqlclean($_GET,"CategoryName",100,$connection); $ManufacturerName = mysqlclean($_GET,"ManufacturerName",100,$connection); $ManufacturerID = mysqlclean($_GET,"ManufacturerID",100,$connection); $URLPassedModelNumber = mysqlclean($_GET,"ModelNumber",100,$connection); $URLPassedUniqueID = mysqlclean($_GET,"UniqueID",100,$connection); echo ""; echo "

$ManufacturerName $CategoryName Model #$URLPassedModelNumber

Categories:
$CategoryName
>>$ManufacturerName
    "; // get the list of equipment types. // $query="SELECT * FROM EquipmentModel Where (ModelNumber = '$ModelNumber')"; $query="SELECT * FROM EquipmentModel Where (EquipmentModel.TypeID = '$CategoryID') AND (ManufacturerID = '$ManufacturerID') Order By ModelNumber"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $ModelNumber=mysql_result($result,$i,"ModelNumber"); $UniqueID=mysql_result($result,$i,"UniqueID"); // $ImageURL=mysql_result($result,$i,"ImageURL"); // display in bold the selected model number if ($ModelNumber == $URLPassedModelNumber){ echo "
  • $ModelNumber
  • "; $ImageURL=mysql_result($result,$i,"ImageURL"); } else { echo "
  • $ModelNumber
  • "; } // 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); } // echo "$ManufacturerName - $PrintableModelName, Total Votes: $num2 - Average Vote: "; if ($AverageVote == 1) { echo "($num2)"; } if ($AverageVote == 2) { echo "($num2)"; } if ($AverageVote == 3) { echo "($num2) "; } if ($AverageVote == 4) { echo "($num2)"; } if ($AverageVote == 5) { echo "($num2)"; } // get product review this equipment. $ProductReviews = 0; $query2="SELECT ProductReview FROM EquipmentRate Where (EquipmentModelID = '$UniqueID') AND (ProductReview <> '') AND (ApprovedToDisplayReview = '1') "; $result2=mysql_query($query2); $num2=mysql_numrows($result2); $ProductReviews=$num2; // are there any product reviews for this product? if ($ProductReviews > 0) { echo ""; } $i++; } echo "
= Product Rating

= Product has been reviewed

(#) = Total Votes
"; echo "

"; // $safeQuery = urlencode($ManufacturerName.'+'.$CategoryName); //$safeQuery = $ManufacturerName.' '.$CategoryName; // $priceRangeMax = 500; // $itemsPerRange = 10; // $results = GetEbayResults($safeQuery, $priceRangeMax, $itemsPerRange, $connection ); // **************************************************************************** $ModelNumber = mysqlclean($_GET,"ModelNumber",100,$connection); $ManufacturerName = mysqlclean($_GET,"ManufacturerName",100,$connection); $CategoryID = mysqlclean($_GET,"CategoryID",100,$connection); $CategoryName = mysqlclean($_GET,"CategoryName",100,$connection); //$Query = mysqlclean($_GET,"Query",100,$connection); $Query = $CategoryName; // $safeQuery = urlencode($_GET['Query']); // $safeQuery = urlencode($ManufacturerName.'+'.$Query); $safeQuery = $ManufacturerName.' '.$Query; // $siteID = $_GET['SiteID']; $siteID = 0; // 0 is the U.S. $priceRangeMin = 0.0; // $priceRangeMax = $_POST['MaxPrice']; $priceRangeMax = 500; // $itemsPerRange = $_POST['ItemsPerRange']; $itemsPerRange = 10; // $debug = (boolean) $_POST['Debug']; $debug = False; // This is used to enter the first mid range search item into a db. $SearchDataEntewhiteFlag = No; echo" "; echo ""; $results = ''; $endpoint = 'http://open.api.ebay.com/shopping'; // URL to call $responseEncoding = 'XML'; // Format of the response $rangeArr = array('Low-Range', 'Mid-Range', 'High-Range'); $priceRange = ($priceRangeMax - $priceRangeMin) / 3; // find price ranges for three tables $priceRangeMin = sprintf("%01.2f", 0.00); $priceRangeMax = $priceRangeMin; // needed for initial setup foreach ($rangeArr as $range) { $priceRangeMax = sprintf("%01.2f", ($priceRangeMin + $priceRange)); $results .= "

$range : $priceRangeMin ~ $priceRangeMax

\n"; // Construct the FindItems call $apicall = "$endpoint?callname=FindItemsAdvanced" . "&version=537" . "&siteid=$siteID" . "&appid=SteveLow-df98-45b5-a264-77c172a7fa77" . "&QueryKeywords=$safeQuery" . "&MaxEntries=$itemsPerRange" . "&ItemSort=BestMatchCategoryGroup" //BestMatch, BestMatchCategoryGroup, BestMatchPlusPrice . "&GroupsMax=3" . "&GroupMaxEntries=20" . "&ItemType=AllItemTypes" // FixedPricedItem, AllItemTypes, AllItems . "&PriceMin.Value=$priceRangeMin" . "&PriceMax.Value=$priceRangeMax" . "&IncludeSelector=SearchDetails" //CategoryHistogram, SearchDetails // . "&CategoryHistogramMaxParents=3" //Max: 10. Default: 3. . "&DescriptionSearch=True" // true, false // . "&HideDuplicateItems=True" // true, false // . "&IncludeSelector=CategoryHistogram" // Details, CategoryHistogram . "&trackingpartnercode=9" // fill in your information in next 3 lines . "&trackingid=5336238492" . "&affiliateuserid=456" // . "&PageNumber=1" . "&responseencoding=$responseEncoding"; if ($debug) { print "GET call = $apicall
"; // see GET request generated } // Load the call and capture the document returned by the Shopping API $resp = simplexml_load_file($apicall); // Check to see if the response was loaded, else print an error // Probably best to split into two different tests, but have as one for brevity if ($resp && $resp->TotalItems > 0) { // this is to enter the first mid range product response into a db if ((($range == 'Low-Range') or ($range == 'Mid-Range'))and ($SearchDataEntewhiteFlag == No)) { $results .= "
"; } $results .= 'Total items : ' . $resp->TotalItems . "
\n"; $results .= '
"; echo ""; echo "

"; // get reviews for this product. $query2="SELECT ProductReview FROM EquipmentRate Where EquipmentModelID = '$URLPassedUniqueID'"; $result2=mysql_query($query2); $num2=mysql_numrows($result2); $j = 0; while ($j < $num2) { $ProductReview=mysql_result($result2,$j,"ProductReview"); $ProductReview = stripslashes($ProductReview); //dont print it if it's empty if ($ProductReview <> '') { echo "Product Review - \"$ProductReview\"

"; } $j++; } echo"
"; echo '
'; echo "
Rate this product:
What do you like and/or dislike about this product.


Enter the code you see above.
All submissions are reviewed before they are displayed.

"; echo ""; echo '
'; echo "
Search again? Max Price $ Items Per Range
' . "\n"; // $results .= "\n"; // If the response was loaded, parse it and build links foreach($resp->SearchResult->ItemArray->Item as $item) { if ($item->GalleryURL) { $picURL = $item->GalleryURL; } else { $picURL = "http://pics.ebaystatic.com/aw/pics/express/icons/iconPlaceholder_96x96.gif"; } $link = $item->ViewItemURLForNaturalSearch; $title = $item->Title; $price = sprintf("%01.2f", $item->ConvertedCurrentPrice); $ship = sprintf("%01.2f", $item->ShippingCostSummary->ShippingServiceCost); $total = sprintf("%01.2f", ((float)$item->ConvertedCurrentPrice + (float)$item->ShippingCostSummary->ShippingServiceCost)); // Determine currency to display - so far only seen cases where priceCurr = shipCurr, but may be others $priceCurr = (string) $item->ConvertedCurrentPrice['currencyID']; $shipCurr = (string) $item->ShippingCostSummary->ShippingServiceCost['currencyID']; if ($priceCurr == $shipCurr) { $curr = $priceCurr; } else { $curr = "$priceCurr / $shipCurr"; // potential case where price/ship currencies differ } $timeLeft = getPrettyTimeFromEbayTime($item->TimeLeft); $endTime = strtotime($item->EndTime); // returns Epoch seconds $endTime = $item->EndTime; // $results .= "" // . //""; $results .= ""; // this is to enter the first mid range product response into a db if (($range == 'Mid-Range') and ($SearchDataEntewhiteFlag == No)) { // insert the first mid-range product search return into db // $dbquery = "Insert INTO ProductSearches (Query, ImageURL, ProductName, Link, SearchTime, SearchDate, IP) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip')"; $dbquery = "Insert INTO ProductSearches (SearchQuery, ImageURL, ProductName, Link, SearchTime, SearchDate, IP, CategoryID) VALUES ('$Query','$picURL', '$title', '$link', '$CurrentTime', '$CurrentDate', '$ip', '$CategoryID')"; if (!(@mysql_query($dbquery,$connection))) showerror; $SearchDataEntewhiteFlag = Yes; } } $results .= "
TitlePrice     Shipping     Total     Time LeftEnd Time
$title$price$ship$total$curr$timeLeft$endTime
$title  ".money_format('%n', $price)."
"; } // If there was no response, print an error else { $results = "

No additional items found

"; } $priceRangeMin = $priceRangeMax; // set up for next iteration } // foreach // **************************************************************************** echo "
$results
"; } // *************************************************************** // END Show specific Model // *************************************************************** elseif (isset($_POST['SubmitReview'])) { // *************************************************************** // BEGIN Vote // *************************************************************** $SuggestedModelNumber = mysqlclean($_POST,"SuggestedModelNumber",100,$connection); $SuggestedManufacturerName = mysqlclean($_POST,"SuggestedManufacturerName",100,$connection); $CategoryID = mysqlclean($_POST,"CategoryID",100,$connection); $CategoryName = mysqlclean($_POST,"CategoryName",100,$connection); $ManufacturerName = mysqlclean($_POST,"ManufacturerName",100,$connection); $ManufacturerID = mysqlclean($_POST,"ManufacturerID",100,$connection); $URLPassedModelNumber = mysqlclean($_POST,"ModelNumber",100,$connection); $URLPassedUniqueID = mysqlclean($_POST,"URLPassedUniqueID",100,$connection); $Vote = mysqlclean($_POST,"Vote",100,$connection); $ProductReview = mysqlclean($_POST,"ProductReview",100,$connection); $ip=$_SERVER['REMOTE_ADDR']; $CurrentDate = date("Y-m-d"); $CurrentTime= date("g:i a"); echo ""; echo "

$ManufacturerName $CategoryName Model #$URLPassedModelNumber

Categories:
$CategoryName
>>$ManufacturerName
    "; // get the list of equipment types. // $query="SELECT * FROM EquipmentModel Where (ModelNumber = '$ModelNumber')"; $query="SELECT * FROM EquipmentModel Where (EquipmentModel.TypeID = '$CategoryID') AND (ManufacturerID = '$ManufacturerID') Order By ModelNumber"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $ModelNumber=mysql_result($result,$i,"ModelNumber"); $UniqueID=mysql_result($result,$i,"UniqueID"); // $ImageURL=mysql_result($result,$i,"ImageURL"); // display in bold the selected model number if ($ModelNumber == $URLPassedModelNumber){ echo "
  • $ModelNumber
  • "; $ImageURL=mysql_result($result,$i,"ImageURL"); } else { echo "
  • $ModelNumber
  • "; } // 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); } // echo "$ManufacturerName - $PrintableModelName, Total Votes: $num2 - Average Vote: "; if ($AverageVote == 1) { echo "($num2)"; } if ($AverageVote == 2) { echo "($num2)"; } if ($AverageVote == 3) { echo "($num2) "; } if ($AverageVote == 4) { echo "($num2)"; } if ($AverageVote == 5) { echo "($num2)"; } // get product review this equipment. $ProductReviews = 0; $query2="SELECT ProductReview FROM EquipmentRate Where (EquipmentModelID = '$UniqueID') AND (ProductReview <> '') AND (ApprovedToDisplayReview = '1')"; $result2=mysql_query($query2); $num2=mysql_numrows($result2); $ProductReviews=$num2; // are there any product reviews for this product? if ($ProductReviews > 0) { echo ""; } $i++; } echo "
= Product Rating

= Product has been reviewed

(#) = Total Votes
"; echo "

"; // check to see if they enter the proper code for the captcha include("./uploaded-files/pages/test12/captcha/securimage.php"); $img = new Securimage(); $valid = $img->check($_POST['code']); if($valid == true) { // Don't enter duplicate votes for same ip $query="SELECT UniqueID FROM EquipmentRate Where IPAddress = '$ip' and EquipmentModelID = '$URLPassedUniqueID'"; $result=mysql_query($query); $count=mysql_num_rows($result); if ($count == 0) { $query = "Insert INTO EquipmentRate (EquipmentModelID, Ranking, VoteDate, IPAddress, VoteTime, ProductReview, ApprovedToDisplayReview, SuggestedManufacturerName, SuggestedModelNumber) VALUES ('$URLPassedUniqueID','$Vote', '$CurrentDate', '$ip', '$CurrentTime', '$ProductReview', '0', '$SuggestedManufacturerName', '$SuggestedModelNumber')"; if (!(@mysql_query($query,$connection))) showerror; } echo ""; } else { echo ""; } echo "
"; echo ""; echo "

Thank you for submitting your review. It will appear shortly.
An improper security code was entewhite, go back and try again.
"; } // *************************************************************** // END Vote // *************************************************************** else // *************************************************************** // BEGIN Display Main Product Review Page // *************************************************************** { echo ""; echo "";

Lawn Care Equipment Product Reviews

Categories:
    "; // get the list of equipment types. $query="SELECT * FROM EquipmentType Order By TypeName"; $result3=mysql_query($query); $num3=mysql_numrows($result3); $i=0; while ($i < $num3) { $TypeName=mysql_result($result3,$i,"TypeName"); $UniqueID=mysql_result($result3,$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++; } echo "
"; // echo ""; // echo ""; // ****** END CREATE PIE CHART *************************************** echo "
"; // ****** BEGIN CREATE PIE CHART *************************************** //We've included ../Includes/FusionCharts.php, which contains //functions to help us easily embed the charts . include_once('./uploaded-files/pages/MyFCPHPClassCharts/Class/FusionCharts.php'); echo " "; //$strXML will be used to store the entire XML document generated //Generate the graph element $strXML = ""; // $strXML = ""; //Fetch all ride on mower voting records // $strQuery = "select EquipmentModelID, from EquipmentRate where Ranking = '4'"; // $strQuery="SELECT EquipmentModelID , TypeID, ModelNumber, ManufacturerName, ModelName FROM EquipmentRate JOIN EquipmentModel ON EquipmentRate.EquipmentModelID = EquipmentModel.UniqueID JOIN EquipmentManufacturer ON EquipmentModel.ManufacturerID = EquipmentManufacturer.UniqueID Where EquipmentModel.TypeID = '4' OR EquipmentModel.TypeID = '3' GROUP BY EquipmentModelID"; $strQuery="SELECT EquipmentModelID , TypeID, ModelNumber, ManufacturerName, ModelName FROM EquipmentRate JOIN EquipmentModel ON EquipmentRate.EquipmentModelID = EquipmentModel.UniqueID JOIN EquipmentManufacturer ON EquipmentModel.ManufacturerID = EquipmentManufacturer.UniqueID Where EquipmentModel.TypeID = '4' OR EquipmentModel.TypeID = '3' GROUP BY ManufacturerName"; // $query="SELECT ManufacturerName FROM EquipmentManufacturer Where UniqueID = $ors['EquipmentModelID']"; $result = mysql_query($strQuery) or die(mysql_error()); //Iterate through each factory if ($result) { while($ors = mysql_fetch_array($result)) { $TheModelNumber = $ors['EquipmentModelID']; $query="SELECT EquipmentModelID FROM EquipmentRate Where EquipmentModelID = '$TheModelNumber'"; $result2 = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result2); //Generate // $strXML .= ""; $strXML .= ""; } } //Fetch the average // $strQuery = "select avg(Price) as AvgPrice from AveragePrice where ServiceType = '1'"; // $result = mysql_query($strQuery) or die(mysql_error()); $i=0; // $result=mysql_query($query); // $AvgPrice=mysql_result($result,$i,"AvgPrice"); // i took this trend line out // $strXML .= ""; // mysql_close($connection); //Finally, close element $strXML .= ""; //Create the chart - Pie 3D Chart with data from $strXML echo renderChart("./uploaded-files/pages/FusionCharts/FCF_Pie3D.swf", "", $strXML, "FactorySum", 700, 450); // echo renderChart("../../FusionCharts/FCF_Column3D.swf", "", $strXML, "productSales", 400, 300); // echo "
".renderChart("./uploaded-files/pages/FusionCharts/FCF_Line.swf", "", $strXML, "productSales", 600, 300) . "
Vote for your favorite outdoor power equipment.

Compare your lawn care prices, snow plowing, gutter cleaning and leaf cleanup to other lawn care business owners.
"; echo "
"; // ****** BEGIN CREATE LINE TRIMMER PIE CHART *************************************** //We've included ../Includes/FusionCharts.php, which contains //functions to help us easily embed the charts . // include_once('./uploaded-files/pages/MyFCPHPClassCharts/Class/FusionCharts.php'); echo ""; //$strXML will be used to store the entire XML document generated //Generate the graph element $strXML = ""; // $strXML = ""; //Fetch all ride on mower voting records // $strQuery = "select EquipmentModelID, from EquipmentRate where Ranking = '4'"; // $strQuery="SELECT EquipmentModelID , TypeID, ModelNumber, ManufacturerName, ModelName FROM EquipmentRate JOIN EquipmentModel ON EquipmentRate.EquipmentModelID = EquipmentModel.UniqueID JOIN EquipmentManufacturer ON EquipmentModel.ManufacturerID = EquipmentManufacturer.UniqueID Where EquipmentModel.TypeID = '4' OR EquipmentModel.TypeID = '3' GROUP BY EquipmentModelID"; $strQuery="SELECT EquipmentModelID , TypeID, ModelNumber, ManufacturerName, ModelName FROM EquipmentRate JOIN EquipmentModel ON EquipmentRate.EquipmentModelID = EquipmentModel.UniqueID JOIN EquipmentManufacturer ON EquipmentModel.ManufacturerID = EquipmentManufacturer.UniqueID Where EquipmentModel.TypeID = '5' GROUP BY ManufacturerName"; // $query="SELECT ManufacturerName FROM EquipmentManufacturer Where UniqueID = $ors['EquipmentModelID']"; $result = mysql_query($strQuery) or die(mysql_error()); //Iterate through each factory if ($result) { while($ors = mysql_fetch_array($result)) { $TheModelNumber = $ors['EquipmentModelID']; $query="SELECT EquipmentModelID FROM EquipmentRate Where EquipmentModelID = '$TheModelNumber'"; $result2 = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result2); //Generate // $strXML .= ""; $strXML .= ""; } } //Fetch the average // $strQuery = "select avg(Price) as AvgPrice from AveragePrice where ServiceType = '1'"; // $result = mysql_query($strQuery) or die(mysql_error()); $i=0; // $result=mysql_query($query); // $AvgPrice=mysql_result($result,$i,"AvgPrice"); // i took this trend line out // $strXML .= ""; // mysql_close($connection); //Finally, close element $strXML .= ""; //Create the chart - Pie 3D Chart with data from $strXML echo renderChart("./uploaded-files/pages/FusionCharts/FCF_Pie3D.swf", "", $strXML, "FactorySum", 700, 450); // echo renderChart("../../FusionCharts/FCF_Column3D.swf", "", $strXML, "productSales", 400, 300); // echo ""; // echo ""; // echo ""; // ****** END CREATE PIE CHART *************************************** echo ""; // echo ""; // echo ""; // ****** END CREATE PIE CHART ********** echo "
".renderChart("./uploaded-files/pages/FusionCharts/FCF_Line.swf", "", $strXML, "productSales", 600, 300) . "
Vote for your favorite outdoor power equipment.

Compare your lawn care prices, snow plowing, gutter cleaning and leaf cleanup to other lawn care business owners.
"; // ****** BEGIN CREATE PIE CHART *************************************** //We've included ../Includes/FusionCharts.php, which contains //functions to help us easily embed the charts . // include_once('./uploaded-files/pages/MyFCPHPClassCharts/Class/FusionCharts.php'); echo " "; //$strXML will be used to store the entire XML document generated //Generate the graph element $strXML = ""; // $strXML = ""; //Fetch all ride on mower voting records // $strQuery = "select EquipmentModelID, from EquipmentRate where Ranking = '4'"; // $strQuery="SELECT EquipmentModelID , TypeID, ModelNumber, ManufacturerName, ModelName FROM EquipmentRate JOIN EquipmentModel ON EquipmentRate.EquipmentModelID = EquipmentModel.UniqueID JOIN EquipmentManufacturer ON EquipmentModel.ManufacturerID = EquipmentManufacturer.UniqueID Where EquipmentModel.TypeID = '8' GROUP BY EquipmentModelID"; $strQuery="SELECT EquipmentModelID , TypeID, ModelNumber, ManufacturerName, ModelName FROM EquipmentRate JOIN EquipmentModel ON EquipmentRate.EquipmentModelID = EquipmentModel.UniqueID JOIN EquipmentManufacturer ON EquipmentModel.ManufacturerID = EquipmentManufacturer.UniqueID Where EquipmentModel.TypeID = '8' GROUP BY ManufacturerName"; // $query="SELECT ManufacturerName FROM EquipmentManufacturer Where UniqueID = $ors['EquipmentModelID']"; $result = mysql_query($strQuery) or die(mysql_error()); //Iterate through each factory if ($result) { while($ors = mysql_fetch_array($result)) { $TheModelNumber = $ors['EquipmentModelID']; $query="SELECT EquipmentModelID FROM EquipmentRate Where EquipmentModelID = '$TheModelNumber'"; $result2 = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result2); //Generate // $strXML .= ""; $strXML .= ""; } } //Fetch the average // $strQuery = "select avg(Price) as AvgPrice from AveragePrice where ServiceType = '1'"; // $result = mysql_query($strQuery) or die(mysql_error()); $i=0; // $result=mysql_query($query); // $AvgPrice=mysql_result($result,$i,"AvgPrice"); // i took this trend line out // $strXML .= ""; // mysql_close($connection); //Finally, close element $strXML .= ""; //Create the chart - Pie 3D Chart with data from $strXML echo renderChart("./uploaded-files/pages/FusionCharts/FCF_Pie3D.swf", "", $strXML, "FactorySum", 700, 450); // echo renderChart("../../FusionCharts/FCF_Column3D.swf", "", $strXML, "productSales", 400, 300); // echo "
".renderChart("./uploaded-files/pages/FusionCharts/FCF_Line.swf", "", $strXML, "productSales", 600, 300) . "
Vote for your favorite outdoor power equipment.

Compare your lawn care prices, snow plowing, gutter cleaning and leaf cleanup to other lawn care business owners.
"; echo '
'; echo "

Review a product.


If you don't see a product listed here, please suggest it, along with a review.
Manufacturer Name:
Model #:
Category:
Rate this product:
What do you like and/or dislike about this product.

"; echo "
Enter the code you see above.
All submissions are reviewed before they are displayed.

"; echo ""; echo '
'; echo "
Search again? Max Price $ Items Per Range
"; } // *************************************************************** // END Display Main Product Review Page // *************************************************************** // for vbulletin echo "
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:53 PM.


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

All times are GMT -5. The time now is 06:53 PM.

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