/** * Wing list * CODE:wing_index */ public function executeIndex(sfWebRequest $request) { #security if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getUri()); $this->redirect('dashboard/index'); } $this->wing_list = WingPeer::doSelect(new Criteria()); }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(WingPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(WingPeer::DATABASE_NAME); $criteria->add(WingPeer::ID, $pks, Criteria::IN); $objs = WingPeer::doSelect($criteria, $con); } return $objs; }
<?php echo $form['long_desc']; ?> </td> </tr> <tr> <th><?php echo "Participating Wings"; //echo $form['wing_id'] ?> </th> <td> <ul class="checkbox_list"> <?php $wing = new Criteria(); $wings = WingPeer::doSelect($wing); foreach ($wings as $wing_list) { ?> <li> <input type="checkbox" <?php if ($form->getObject()->getId() != '') { foreach ($ch as $ch_list) { if ($ch_list->getWingId() == $wing_list->getId()) { echo 'checked="checked"'; } } } ?> id="event_wing_id_<?php echo $wing_list->getId(); ?>
public function executeAvailableMissions(sfWebRequest $request) { $pilot = PilotPeer::retrieveByPK($this->getUser()->getPilotId()); if (!$pilot instanceof Pilot) { return sfView::NONE; } if ($pilot->getPrimaryAirportId()) { $this->mission_legs = MissionLegPeer::getPilotNear($pilot->getPrimaryAirportId()); } else { $this->mission_legs = array(); } $this->home_airport = $pilot->getAirport(); $ids = array(); foreach ($this->mission_legs as $leg) { $ids[] = $leg->getId(); } $c = new Criteria(); $c->add(MissionLegPeer::TRANSPORTATION, 'air_mission'); $c->add(MissionLegPeer::ID, $ids, Criteria::NOT_IN); $c->add(MissionLegPeer::CANCELLED, null, Criteria::ISNULL); $c1 = $c->getNewCriterion(MissionLegPeer::PILOT_ID, null, Criteria::ISNULL); $c2 = $c->getNewCriterion(MissionLegPeer::COPILOT_ID, null, Criteria::ISNULL); $c->add($c1->addOr($c2)); $c->setLimit(50); $this->interest_legs = MissionLegPeer::doSelectJoinMission($c); $c->clear(); $c->addJoin(MissionLegPeer::ID, PilotRequestPeer::LEG_ID, Criteria::LEFT_JOIN); $c->add(PilotRequestPeer::ACCEPTED, 1, Criteria::NOT_EQUAL); $c->add(MissionLegPeer::TRANSPORTATION, 'air_mission'); //$c->addAscendingOrderByColumn(); $c->setLimit(50); $this->pending_legs = MissionLegPeer::doSelectJoinMission($c); //ziyed // validity $person = PersonPeer::retrieveByPK($this->getUser()->getId()); //$this->forward404Unless($person); $member = $person->getMember(); //$this->forward404Unless($member); if ($member) { $pilot = $member->getPilot(); } else { $pilot = null; } // filter related $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text')); if ($pilot) { $this->personal_flights = $pilot->getPersonalFlights(); } else { $this->personal_flights = array(); } $this->wings = WingPeer::doSelect(new Criteria()); $this->idents = AirportPeer::doSelect(new Criteria()); $this->states = sfConfig::get('app_short_states'); $this->mission_types = MissionTypePeer::doSelect(new Criteria()); $this->member = $member; $this->pilot = $pilot; if ($pilot) { $this->airport = $pilot->getAirport(); } else { $this->airport = null; } if ($request) { $this->processFilterForm($request); } if ($request->getParameter('needs') == 1) { $this->needs_pilot = 1; } $this->pager = MissionPeer::getPilotAvailablePager($this->max, $this->airport, $this->page, $this->sort_by, $this->date_range1, $this->date_range2, $this->weekdays, $this->wing_id, $this->ident, $this->city, $this->state, $this->zip, $this->origin, $this->dest, $this->needs_pilot, $this->co_pilot, $this->ifr, $this->selected_types, $this->filled, $this->open, $this->max_pass, $this->max_weight, $this->max_distance, $this->min_efficiency, false, $this->ignore_availability); $this->miss_array = $this->pager->getResults(); $this->total_mission_available = $this->pager->getNbResults(); $this->missions = MissionPeer::getByMayInterested($this->airport, $this->min_efficiency); $ident = $request->getParameter('airport_ident'); if (!empty($ident)) { $this->airport_ident = $request->getParameter('airport_ident'); } else { $this->airport_ident = ""; } //end ziyed }
public function executePilotRequestAcceptedView(sfWebRequest $request) { #security if (!$this->getUser()->hasCredential(array('Administrator', 'Pilot', 'Staff', 'Coordinator', 'Volunteer'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer()); $this->redirect('dashboard/index'); } $person = PersonPeer::retrieveByPK($this->getUser()->getId()); $this->forward404Unless($person); $member = $person->getMember(); if ($member) { $pilot = $member->getPilot(); } else { $pilot = null; } $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text')); if ($pilot) { $this->personal_flights = $pilot->getPersonalFlights(); } else { $this->personal_flights = array(); } $this->wings = WingPeer::doSelect(new Criteria()); $this->idents = AirportPeer::doSelect(new Criteria()); $this->states = sfConfig::get('app_short_states'); $this->mission_types = MissionTypePeer::doSelect(new Criteria()); $this->member = $member; $this->pilot = $pilot; if ($pilot) { $this->airport = $pilot->getAirport(); } else { $this->airport = null; } if ($request->getParameter('needs') == 1) { $this->needs_pilot = 1; } $c = new Criteria(); $c->add(PilotRequestPeer::ACCEPTED, 1); $c->add(PilotRequestPeer::MEMBER_ID, $member->getId()); $c->addJoin(PilotRequestPeer::LEG_ID, MissionLegPeer::ID); $c->addJoin(MissionLegPeer::MISSION_ID, MissionPeer::ID); //$this->result = MissionPeer::doSelect($c); $this->page = $request->getParameter("page", 1); $this->max = $request->getParameter("max", 10); $this->pager = new sfPropelPager('MissionLeg', $this->max); $this->pager->setCriteria($c); $this->pager->setPage($this->page); $this->pager->init(); $this->miss_legs = $this->pager->getResults(); $this->url = 'pilotRequestAcceptedView'; }
public function executeWingslist(sfWebRequest $request) { $this->flight_statuses = sfConfig::get('app_flight_statuses', array()); $this->email_lists = EmailListPeer::doSelect(new Criteria()); $this->wings = WingPeer::doSelect(new Criteria()); $this->states = sfConfig::get('app_states'); }
/** * Available missions for a pilot * CODE: mission_view * CODE: mission_available */ public function executeRequestLegs(sfWebRequest $request) { #security if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getUri()); $this->redirect('dashboard/index'); } // validity $person = PersonPeer::retrieveByPK($this->getUser()->getId()); $this->forward404Unless($person); $member = $person->getMember(); //$this->forward404Unless($member); if ($member) { $pilot = $member->getPilot(); } else { $pilot = null; } // filter related $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text')); if ($pilot) { $this->personal_flights = $pilot->getPersonalFlights(); } else { $this->personal_flights = array(); } $this->wings = WingPeer::doSelect(new Criteria()); $this->idents = AirportPeer::doSelect(new Criteria()); $this->states = sfConfig::get('app_short_states'); $this->mission_types = MissionTypePeer::doSelect(new Criteria()); $this->member = $member; $this->pilot = $pilot; if ($pilot) { $this->airport = $pilot->getAirport(); } else { $this->airport = null; } $this->processFilterForm($request); if ($request->getParameter('needs') == 1) { $this->needs_pilot = 1; } $this->pager = MissionPeer::getPilotAvailablePager($this->max, $this->airport, $this->page, $this->sort_by, $this->date_range1, $this->date_range2, $this->weekdays, $this->wing_id, $this->ident, $this->city, $this->state, $this->zip, $this->origin, $this->dest, $this->needs_pilot, $this->co_pilot, $this->ifr, $this->selected_types, $this->filled, $this->open, $this->max_pass, $this->max_weight, $this->max_distance, $this->min_efficiency, false, $this->ignore_availability); // $this->pager = MissionPeer::getMissionsAvailable(); $this->miss_array = $this->pager->getResults(); //echo "<pre>"; //print_r($this->miss_array);exit; $this->missions = MissionPeer::getByMayInterested($this->airport, $this->min_efficiency); $ident = $request->getParameter('airport_ident'); if (!empty($ident)) { $this->airport_ident = $request->getParameter('airport_ident'); } else { $this->airport_ident = ""; } }
/** * Missing waivers * CODE:missing_waivers * TODO: */ public function executeMissingWaivers(sfWebRequest $request) { #security if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer()); $this->redirect('dashboard/index'); } # filter $this->processMissingWaiversFilter($request); $this->pager = MissionLegPeer::getMissingWaiversPager($this->max, $this->page, $this->mission_date1, $this->mission_date2, $this->pass_name, $this->pilot_name, $this->wing); $this->leg_list = $this->pager->getResults(); $this->wings = WingPeer::doSelect(new Criteria()); $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text')); }