Example #1
0
 function Modify()
 {
     $check = Request::RequestParams("chkseats");
     $btnDelete = Request::RequestParams("btnDelete");
     $this->modelview->seatModel = new SeatModel();
     if ($_SERVER["REQUEST_METHOD"] == "POST" && sizeof($check) > 0) {
         if (isset($btnDelete)) {
             foreach ($check as $key => $value) {
                 $this->modelview->seatModel->Delete($value);
             }
         } else {
             if (sizeof($check) == 1) {
                 $id = $check[0];
                 $this->modelview->seat = new Seat();
                 $this->modelview->seat = $this->modelview->seatModel->Get($id);
                 $this->modelview->seat->mode = "edit";
                 Session::set("selected_plane_id", $this->modelview->seat->planeID);
                 Session::set("type_plane", $this->modelview->seat->type);
                 Session::set("id_seatSelected", $this->modelview->seat->id);
             } else {
                 ContextManager::ValidationFor("warning", "Only one item can not be modifier at same time , select an item again");
             }
         }
     }
     $this->ViewBag("Title", "Seats");
     $this->ViewBag("Controller", "Seat");
     $this->ViewBag("Page", "Index");
     return $this->View($this->modelview, "Account", "Index");
 }
Example #2
0
 function Modify()
 {
     $checks = Request::RequestParams("chkplanes");
     $btnPressedEdit = Request::RequestParams("btnEdit");
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $this->modelView->planeModel = new PlaneModel();
         if (isset($btnPressedEdit)) {
             //edit only items
             if (sizeof($checks) == 1) {
                 foreach ($checks as $id) {
                     $this->modelView->plane = $this->modelView->planeModel->GetPlaneById($id);
                     $this->modelView->plane->mode = 'edit';
                 }
             }
         } else {
             foreach ($checks as $id) {
                 $this->modelView->planeModel->Delete($id);
             }
         }
     }
     $this->ViewBag("Title", "Modify Plane");
     $this->ViewBag("Controller", "Plane");
     $this->ViewBag("Page", "Index");
     return $this->View($this->modelView, "Account", "Index");
 }
Example #3
0
 function Search()
 {
     $arry = new ArrayIterator();
     $chkOptionType = Request::RequestParams("rbticketType");
     $txtForm = Request::RequestParams("txtForm");
     $txtTo = Request::RequestParams("txtTo");
     $txtDepatureDate = Request::RequestParams("txtDepatureDate");
     $txtreturndate = Request::RequestParams("txtreturndate");
     $sltflight = Request::RequestParams("sltflight");
     $sltTicketType = Request::RequestParams("sltTicketType");
     $txtadults = Request::RequestParams("txtadults");
     $txtchildren = Request::RequestParams("txtchildren");
     Session::set("children", $txtchildren);
     Session::set("adults", $txtadults);
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         //search on flights base on the given informations
         $this->db = new Database();
         $statement = "select *from tbl_flight where to_where =:to_where or from_where=:from_where or " . " landingDate =:landingDate or BoardDate =:BoardDate or BoardingTime =:BoardingTime or " . " price =:price ";
         $smt = $this->db->prepare($statement);
         $smt->bindValue(":to_where", $txtTo);
         $smt->bindValue(":from_where", $txtForm);
         $smt->bindValue(":landingDate", $statement);
         $smt->bindValue(":BoardDate", $txtDepatureDate);
         $smt->bindValue(":BoardingTime", $txtreturndate);
         $smt->bindValue(":price", $statement);
         $status = $smt->execute();
         if (!$status) {
             print_r($smt->errorInfo());
         }
         //get all the results
         //  $flight= new Flight();
         Session::set("Searching", "1");
         $counter = 0;
         while ($row = $smt->fetch(PDO::FETCH_ASSOC)) {
             $flight = new Flight();
             $flight->Id = $row["id"];
             $flight->Landingtime = $row["LandingTime"];
             $flight->boardingTime = $row["BoardingTime"];
             $flight->deptureDate = $row["BoardDate"];
             $flight->from = $row["from_where"];
             $flight->landindDate = $row["landingDate"];
             $flight->stops = $row["noofstop"];
             $flight->ticketPrice = $row["price"];
             $flight->to = $row["to_where"];
             $flight->seats = $row["seats"];
             $flight->status = $row["status"];
             $flight->planeID = $row["planeID"];
             $arry->offsetSet($counter, $flight);
             $counter++;
         }
     }
     $this->ViewBag("Title", "Search flight");
     $this->ViewBag("Controller", "Flight");
     $this->ViewBag("Page", "SearchFlights");
     $this->flightModelView->flightList = $arry;
     $controller = "Home";
     $action = "Index";
     ContextManager::PartialView("SearchFlights", "Flight");
     Session::set("SubView", "SearchFlights");
     return $this->View($this->flightModelView, $controller, $action);
 }
Example #4
0
 function Modify()
 {
     $checkList = Request::RequestParams("chkboxes");
     $buttonCancel = Request::RequestParams("btnCancel");
     $buttonModifer = Request::RequestParams("btnModifer");
     if (isset($checkList) && is_array($checkList)) {
         if (isset($buttonCancel)) {
             foreach ($checkList as $key => $checkbox) {
                 $this->deleteAgent($checkbox);
             }
         } else {
             if (isset($buttonModifer)) {
                 foreach ($checkList as $key => $checkbox) {
                     $this->suspendAgent($checkbox);
                 }
             }
         }
     }
     //end if seet array
     $agentModel = new AgentModel();
     $this->agentModelView->agentList = $agentModel->GetUsers();
     return $this->View($this->agentModelView, "Account", "Index");
 }
Example #5
0
 public function MakePayment()
 {
     $firstname = Request::RequestParams("txtfirstname");
     $txtlastname = Request::RequestParams("txtlastname");
     $email = Request::RequestParams("email");
     $phone = Request::RequestParams("phone");
     $streetname = Request::RequestParams("streetname");
     $city = Request::RequestParams("city");
     $state = Request::RequestParams("state");
     $txtpostcode = Request::RequestParams("txtpostcode");
     $country = Request::RequestParams("txtcountry");
     $cardtype = Request::RequestParams("txtcardtype");
     $cardnumber = Request::RequestParams("txtcardnumber");
     $expireddate = Request::RequestParams("expirydate");
     $svc = Request::RequestParams("svcnumber");
     $this->makeReservation($firstname, $txtlastname, $phone, $email, $streetname, $streetname, $city, $state, $txtpostcode, $country, $cardtype, $cardnumber, $expireddate, $svc, null);
 }