function PrintHouseList($query) { echo "<div id='PopList'>\n\t\t\t<h1> Most Popular </h1>\n\t\t\t<div class='HouseList'>"; $MyRows = GetResult($query); if (count($MyRows) == 0) { echo "<h1>No Houses Match Search Criteria</h1>"; } foreach ($MyRows as $row) { PrintHouse($row["id"], $row["address"], $row["housedesc"], $row["beds"], $row["toilets"], $row["garages"], $row["image"]); } echo "</div></div></body></HTML>"; }
function PrintHouseList($query) { echo "<div id='PopList'>\n\t\t\t\t<h1> House Results </h1>\n\t\t\t\t<div class='HouseList'>"; $MyRows = GetResult($query); if (count($MyRows) == 0) { echo "<h1>No Houses Match Search Criteria</h1>"; } foreach ($MyRows as $row) { $myHouse = new House($row); PrintHouse($myHouse); } echo "</div></div></body></HTML>"; }
function PrintHouseByID($id) { $query = "Select * from Houses where ID = '{$id}'"; $row = GetResult($query)[0]; PrintHouse($row["ID"], $row["Address"], $row["HouseDesc"], $row["Beds"], $row["Toilets"], $row["Garages"], $row["Image"]); }
<div class="HomePage"> <h1>Staff Home</h1> <div class="StaffHome"> <h2> Upcoming Bookings </h2> <?php //returns all bookings for current staff member $userbookings = GetManagerBookings(Username()); echo "<div id='PopList'>\n\t\t\t<div class='HouseList'>"; if (count($userbookings) == 0) { echo "<h2> You have no upcoming open house bookings </h2>"; } //prints user bookings foreach ($userbookings as $booking) { $datestring = $booking->GetStringDate(); echo "<h2> {$datestring} </h2>"; $house = GetHouseByID($booking->HouseID); PrintHouse($house); } echo "</div></div>"; ?> <h2> Recent Enquiries </h2> <div class="EnquireList"> <?php //Show enquires with this username ShowManagerEnquires(Username()); ?> </div> </div> </div> </body> </html>