public static function getAllTypes() { // creates index array $aRecipeTypes = array(); $connection = new Connection(); $sSQL = "SELECT RecipeTypeID\n FROM tbrecipetype\n "; $resultSet = $connection->query($sSQL); while ($row = $connection->fetch_array($resultSet)) { $iRecipeTypeID = $row['RecipeTypeID']; $oRecipeType = new RecipeType(); $oRecipeType->load($iRecipeTypeID); $aRecipeTypes[] = $oRecipeType; } $connection->close_connection(); return $aRecipeTypes; }
<?php require_once "includes/header.php"; $iRecipeTypeID = 1; if (isset($_GET["RecipeTypeID"])) { $iRecipeTypeID = $_GET["RecipeTypeID"]; } $oRecipeType = new RecipeType(); $oRecipeType->load($iRecipeTypeID); ?> <!-- recipes type nav --> <?php echo View::renderRecipeNav($aAllTypes); ?> <h1 class="textAlignCenter marginBottom30"> <?php echo $oRecipeType->typeName . ' '; ?> Recipes </h1> <!-- latest shop items section --> <div class="clearBoth floatLeft"> <h3 class="marginBottom30">Latest Recipes</h3> <div class="minimised8 singleBlock" id="minimised8"> <?php echo View::renderRecipeType($oRecipeType); ?> </div> </div>