public function seats($reload = false)
 {
     if ($reload or !$this->seats_cache) {
         $id = mysql_real_escape_string($this->id);
         $this->seats_cache = Seat::find_all("seats.seating_plan_id = '{$id}'");
     }
     return $this->seats_cache;
 }
Example #2
0
 public function Update($seatId, $planeID, $seatNo, $rate, $type, $Desc, $press = null)
 {
     $seat = new Seat();
     $seat->set($seatNo, $planeID, $Desc, $type, $rate);
     $seat->id = $seatId;
     $seat->mode = "edit";
     $this->modelview->seat = $seat;
     Session::set("selected_plane_id", $planeID);
     Session::set("type_plane", $type);
     $model = new SeatModel($seat, $this->db);
     if (!$model->IsIdExists($seatId)) {
         ContextManager::ValidationFor("warning", "Oops! there is no flight seats selected to modify");
         return $this->View($this->modelview, "Seat", "Index");
     }
     $model->Update();
     $this->modelview->seatModel = $model;
     $this->ViewBag("Title", "Seats");
     $this->ViewBag("Controller", "Seat");
     $this->ViewBag("Page", "Index");
     return $this->View($this->modelview, "Account", "Index");
 }
Example #3
0
 public function __toString()
 {
     if ($this->state == 0) {
         // Wenn der PLatz frei ist ...
         $theTemplate = new Template("screen.tpl");
         $theTemplate->load("SEAT_WHEELCHAIR");
         // ... wird ein anderes Template geladen ...
         $theTemplate->tag("number", $this->getNumber());
         return (string) $theTemplate;
     } else {
         return parent::__toString();
         // ...ansonsten ruft sie die __toString der Eltern-Klasse auf
     }
 }