public static function StartApplication() { self::Initialised(); //self::$_viewBag= new ArrayObject(); self::$request = new Request(); self::$context = new IContextView(); self::_process(); ContextManager::PartialView(DEFAULT_ACTION, DEFAULT_LOAD_CONTROLLER); self::displayView(); }
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); }
<div class='container'> <div class="row "> <div class="col-lg-7"> <?php include_once "Create.php"; ?> </div> </div> <?php ContextManager::PartialView("display", "plane"); ContextManager::PartialView("display"); ?> </div>
public final function _Default() { ContextManager::PartialView(DEFAULT_ACTION); }