} elseif ($leg->getTransportation() == 'ground_mission') { ?> <?php echo $leg->getGroundDestination(); ?> <?php } ?> <em>PST</em></dd> </dl> </td> <td class="cell-3"> <dl class="mission-ad-info"> <dt>Passengers:</dt> <dd><?php $comps = CompanionPeer::getByPassId($pass->getId()); $county = 0; $weg = 0; foreach ($comps as $comp) { $county++; $weg = $weg + $comp->getWeight(); } // wtf? if ($county != 0 && isset($pass)) { echo $county + 1; } else { echo "1"; } ?> </dd> <dt>Weight:</dt>
$mission_assistant = MemberPeer::retrieveByPK($mission_leg->getMissAssisId()); $miss_assi_persopn = PersonPeer::retrieveByPK($mission_assistant->getPersonId()); } // Backup Pilot if ($mission_leg->getBackupPilotId()) { $backupPilot = PilotPeer::retrieveByPK($mission_leg->getBackupPilotId()); $backupPilotMember = $pilot->getMember(); $backupPilot_person = PersonPeer::retrieveByPK($backupPilotMember->getPersonId()); } /* echo "<pre>"; print_r($pilotMember); die(); //*/ //Companions information $companions = CompanionPeer::getByPassId($passenger->getId()); if ($passenger) { $passenger_type = $passenger->getPassengerType(); } $is_air = $mission_leg->getTransportation() == 'air_mission'; if ($is_air) { $to_airport = $mission_leg->getAirportRelatedByToAirportId(); $from_airport = $mission_leg->getAirportRelatedByFromAirportId(); } ?> <html xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-16"> <title>Air Charity Network™ Mission Itinerary Form</title> <style> html {
public function executePrintMissionLeg(sfWebRequest $request) { #Security if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer()); $this->redirect('dashboard/index'); } if ($request->getParameter('id')) { $this->leg = MissionLegPeer::retrieveByPK($request->getParameter('id')); if (isset($this->leg)) { $this->mission = MissionPeer::retrieveByPK($this->leg->getMissionId()); $this->requester = RequesterPeer::retrieveByPK($this->mission->getRequesterId()); $this->req_person = $this->requester->getPerson(); $this->agency = $this->requester->getAgency(); // Camp information if ($this->mission->getCampId()) { $this->camp = CampPeer::retrieveByPK($this->mission->getCampId()); } //Coordinator if ($this->mission->getCoordinatorId()) { $this->coordinator = CoordinatorPeer::retrieveByPK($this->mission->getCoordinatorId()); $this->coordiPerson = PersonPeer::retrieveByPK($this->coordinator->getMember()->getPersonId()); } if (isset($this->mission)) { $this->itinerary = ItineraryPeer::retrieveByPK($this->mission->getItineraryId()); $pass = PassengerPeer::retrieveByPK($this->mission->getPassengerId()); //Companions information $this->companions = CompanionPeer::getByPassId($this->mission->getPassengerId()); if (isset($pass) && $pass instanceof Passenger) { $this->pass = $pass; //print_r($this->pass); //die(); $this->person = PersonPeer::retrieveByPK($pass->getPersonId()); $this->itinerary = $this->mission->getItinerary(); // Pre-define addresses for ground missions $this->ground_addresses = array('patient' => '', 'facility' => '', 'lodging' => '', 'airport' => ''); $this->ground_addr_sel = sfConfig::get('app_ground_address_type', array()); if ($this->itinerary) { //$this->ground_addresses['lodging'] = $this->ground_addresses['facility'] = $this->itinerary->getDestCity().', '.$this->itinerary->getDestState(); } } else { unset($this->passenger); } } } if (isset($this->leg) && $this->leg instanceof MissionLeg) { if ($this->leg->getPilotId()) { $this->pilot = PilotPeer::retrieveByPK($this->leg->getPilotId()); $this->pilot_member = MemberPeer::retrieveByPK($this->pilot->getMemberId()); $this->copilot = PilotPeer::retrieveByPK($this->leg->getCoPilotId()); $this->mission_assistant = PilotPeer::getByMemberId($this->leg->getMissAssisId()); $this->back_up_mission_assistant = PilotPeer::retrieveByPK($this->leg->getBackupMissAssisId()); } } if ($this->getUser()->hasAttribute('pilotAddToLegview')) { $this->getUser()->setFlash("success", 'Pilot is added to this mission leg successfully !'); $this->getUser()->getAttributeHolder()->remove('pilotAddToLegview'); } } }