Ejemplo n.º 1
0
    }
}
// category block
// timing out ocasionally
//echo "Your vehicle: " . $Vehicle->getVehicle()->getYear() . " " . $Vehicle->getVehicle()->getMake() . " " . $Vehicle->getVehicle()->getModel() . " " . $Vehicle->getVehicle()->getStyle();
$Category = new happpi\Category();
echo "<hr />";
echo "<h1>Categories</h1>";
echo "<hr />";
foreach ($Category->getParentCategories() as $parentCat) {
    echo '<a href="category.php?catID=' . $parentCat->getCatID() . '">';
    echo '<img src="' . $parentCat->getImage() . '" title="' . $parentCat->getCatTitle() . '" width="100" />';
    echo '</a>';
}
// latest parts block
echo "<h1>Latest Parts</h1>";
$LatestParts = new happpi\Part();
foreach ($LatestParts->getLatestParts() as $lp) {
    echo "<hr />";
    echo '<a href="part.php?partID=' . $lp->getPartID() . '">';
    echo "<h2>" . $lp->getShortDesc() . "</h2>";
    echo "</a>";
}
?>
			</form>
		</div>
		</header>
		<section class="content">
		</section>
	</body>
</html>
Ejemplo n.º 2
0
 echo "<br /><br /><br />";
 echo "<hr />";
 $subCatCount = count($cat->getSub_categories());
 if ($subCatCount != 0) {
     echo "<h2>Sub Categories</h2>";
     foreach ($cat->getSub_categories() as $subCat) {
         echo $subCat->getCatTitle();
         echo "<br />";
         echo '<a href="category.php?catID=' . $subCat->getCatID() . '">';
         echo '<img src="' . $subCat->getImage() . '" width="200" />';
         echo "</a>";
         echo "<br />";
         echo "<br />";
     }
 } else {
     $Part = new happpi\Part();
     echo "<h2>Parts</h2>";
     $i = 0;
     $perPage = 10;
     $page = 1;
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
     }
     $totalPages = $Part->getCategoryPartsCount($_GET['catID']) / $perPage;
     echo "Page: ";
     while ($i < $totalPages) {
         $i++;
         echo '<a href="category.php?catID=' . $_GET['catID'] . '&page=' . $i . '">';
         echo $i . "";
         echo "</a>";
         echo " ";
Ejemplo n.º 3
0
<?php

require_once 'libraries/happpi/LoadAll.php';
if (isset($_GET['partID'])) {
    $Part = new happpi\Part();
    $Part->setPartID($_GET['partID']);
    $Part = $Part->getPart();
    // breadcrumbs for parts
    $cat = $Part->getPartCategories()[0];
    $numItems = count($Part->getPartBreadCrumbs());
    $i = 0;
    foreach ($Part->getPartBreadCrumbs($cat->getCatID()) as $partBreadCrumb) {
        $i += 1;
        if ($numItems == 1) {
            echo '<a href="category.php?catID=' . $partBreadCrumb->getCatID() . '">';
            echo $catBreadCrumb->getCatTitle();
            echo "</a>";
        } elseif ($numItems > 1) {
            echo '<a href="category.php?catID=' . $partBreadCrumb->getCatID() . '">';
            echo $partBreadCrumb->getCatTitle();
            echo "</a>";
            echo " > ";
        }
    }
    echo $Part->getShortDesc();
    echo "<br />";
    if (isset($_COOKIE["vehicleID"])) {
        $Vehicle = new happpi\Vehicle();
        $Vehicle->setYear($_COOKIE["vehicle_year"]);
        $Vehicle->setMake($_COOKIE["vehicle_make"]);
        $Vehicle->setModel($_COOKIE["vehicle_model"]);