Exemplo n.º 1
0
 public function validated()
 {
     include_once "models/FlightModel.php";
     $flightModel = new FlightModel();
     $okay = true;
     if (!$flightModel->IsExistId($this->flight_id)) {
         $okay = false;
         $this->setError("Session expired contact admin or stage over again");
     } else {
         if (intval($this->adult_no) == 0 || $this->adult_no == NULL) {
             $okay = false;
             $this->setError("Specify the number of adults please!");
         } else {
             if ($this->ticket_cat == NULL || trim($this->ticket_cat) == "") {
                 $okay = false;
                 $this->setError("Select ticket category!");
             } else {
                 if ($this->ticket_type == NULL || trim($this->ticket_type) == "") {
                     $okay = false;
                     $this->setError("Select ticket ticket!");
                 } else {
                     return $okay;
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 function SaveChange($id, $planeId, $from, $to, $depatureDate, $landingDate, $boardingtime, $landingTime, $noOfStops, $ticketPrice, $option = null)
 {
     $flight = new Flight();
     $flight->set($planeId, $from, $to, $depatureDate, $landingDate, $boardingtime, $landingTime, $ticketPrice, $noOfStops);
     $flight->Id = $id;
     $this->flightModelView->flight = $flight;
     $flight->mode = "edit";
     $flightModel = new FlightModel();
     if ($flightModel->IsExistId($id)) {
         $flightModel->Update($flight->Id, $flight);
     }
     $this->flightModelView->flightList = $flightModel->GetAllFlights();
     return $this->View($this->flightModelView, "Flight", "Index");
 }
Exemplo n.º 3
0
<?php

include_once "entities/Flight.php";
include_once "models/FlightModel.php";
$model = new FlightModel();
$flightList = $model->GetAllDistinctFlights();
?>


<?php 
$object = new ArrayIterator();
$object->offsetSet("method", "post");
$object->offsetSet("class", "form form-horizontal ");
ContextManager::BeginForm("Flight", "Search", $object);
?>
        

<?php 
if (Session::get("db_username") == null) {
    ?>
 
    <div class="title border-sm-1">Search Flights</div>
    <?php 
} else {
    ?>
    <div class="title borderless ">Agent Flights Search </div>
<?php 
}
?>

Exemplo n.º 4
0
 function Flight()
 {
     $id = Request::RequestParams("id");
     include_once "models/FlightModel.php";
     $flightModel = new FlightModel();
     $this->viewModel->flightDbModel = $flightModel;
     $this->viewModel->flight = $flightModel->GetFlightById($id);
     $this->ViewBag("Title", "Booking");
     $this->ViewBag("Controller", "Booking");
     $this->ViewBag("Page", "Flight");
     return $this->View($this->viewModel, "Home", "Index");
 }
depending on the action.
*/
session_start();
include "../classes/User.php";
include "../classes/BookingDetails.php";
include "../classes/FlightSearchParameters.php";
include "../classes/FlightDetails.php";
include "../classes/Review.php";
include "../classes/Passenger.php";
include "../model/UserAccountModel.php";
include "../model/BookingModel.php";
include "../model/FlightModel.php";
include "../model/ReviewModel.php";
$userModel = new UserAccountModel();
$bookingModel = new BookingModel();
$flightModel = new FlightModel();
$reviewModel = new ReviewModel();
if ($_SESSION['action'] == "login") {
    $user = unserialize($_SESSION['user']);
    $arrayOfBookings = array();
    if ($userModel->isUserPresent($user->getLoginId(), $user->getPassword()) == true) {
        $user = $userModel->getUserInstance($user->getLoginId(), $user->getPassword());
        $_SESSION['userId'] = $user->getUserId();
        $_SESSION['userMiles'] = $user->getMiles();
        $_SESSION['loginName'] = $user->getLoginId();
        $arrayOfBookings = $bookingModel->getBookings($user->getUserId());
        $_SESSION['bookingsArray'] = serialize($arrayOfBookings);
        header("Location: ../view/Startup.php");
    } else {
        $_SESSION['loginToken'] = "invalid";
        header("Location: ../view/Login.php");