Example #1
0
 /**
  * Display a list of rooms using
  * @param $selected
  * @param $showBuildingName
  */
 public function displayRoomList($selected, $showBuildingName)
 {
     if ($showBuildingName) {
         //Get building info
         $buildingName = getBuildingById($this->buildingId)->name;
         //Output a list item for the room and include building name
         echo "<option value='" . $this->id . "' data-id='" . $this->id . "'>" . $buildingName . " - " . $this->name . "</option>";
     } else {
         if ($selected) {
             //Output a list item for the room and mark it as selected
             echo "<option selected='selected' value='" . $this->id . "' data-id='" . $this->id . "'>" . $this->name . "</option>";
         } else {
             //Output a list item for the room
             echo "<option value='" . $this->id . "' data-id='" . $this->id . "'>" . $this->name . "</option>";
         }
     }
 }
Example #2
0
/**
 * Display the specified buildings description
 * @param $buildingId int the id of the building
 */
function displayBuildingDescription($buildingId)
{
    echo getBuildingById($buildingId)->description;
}