function GetManagerHouses($ManagerUsername) { global $conn; $query = $conn->prepare('Select * From HouseManagers Where ManagerUsername = :managerusername'); $query->bindValue(':managerusername', $ManagerUsername); $query->execute(); $managerList = $query->fetchAll(); $myhouses = array(); foreach ($managerList as $row) { $myhouses[] = GetHouseByID($row["HouseID"]); } return $myhouses; }
function PrintEnquiryForStaff($enq) { $house = GetHouseByID($enq->HouseID); $usr = GetUserByUsername(Username()); echo "<div class='EnquireItem'>\n\t\t\t\t<div id='Username' class='TextLine'> {$enq->Username} </div>\n\t\t\t\t<div id='Misc'>\n\t\t\t\t\t<div class='TextLine'> {$enq->Time} </div>\n\t\t\t\t\t<div class='TextLine'> <a href='HouseDisplay.php?HouseID={$house->ID}'> {$house->Address} </a> </div>\n\t\t\t\t</div>\n\t\t\t\t<div id='body' class='TextLine'> {$enq->Body} </div>\n\t\t\t\t<input type='button' onclick=\"alert('Email Customer: ' + '{$usr->Email}')\" value='Reply'>\n\t\t\t\t<input type='button' onclick=\"location.href='Actions.php?Action=DeleteEnq&EnqID={$enq->ID}'\" value='Delete'>\n\t\t\t</div>"; }
<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>
function ShowUserApplication($app) { $house = GetHouseByID($app->HouseID); $user = GetUserByUsername($app->Username); echo "<div class='EnquireItem'>\n\t\t\t\t<h3> Status: {$app->State} </h3>\n\t\t\t\t<div id='Misc'>\n\t\t\t\t\t<div class='TextLine'> <a href='HouseDisplay.php?HouseID={$house->ID}'> {$house->Address} </a> </div>\n\t\t\t\t\t<div class='TextLine'> Start Date: {$app->StartDate} </div>\n\t\t\t\t\t<div class='TextLine'> Duration: {$app->Length} Months </div>\n\t\t\t\t</div>\n\t\t\t\t<div class='inputbuttons'>\n\t\t\t\t\t<input type='button' onclick=\"location.href='Actions.php?Action=CancelApp&AppID={$app->ID}'\" value=\"Cancel\">\n\t\t\t\t</div>\n\t\t\t</div>"; }
<?php //Check if there is a house id //display large house preview include "SiteBanner.php"; include_once "DaveLib.php"; if (isset($_GET['HouseID'])) { $HouseID = $_GET['HouseID']; $myhouse = GetHouseByID($HouseID); DisplayBigHouse($myhouse); }