Exemple #1
0
                ?>
 disabled="disabled" <?php 
            }
            ?>
 name="backup_miss_assis_mail[]" />
              </div>
              <div class="leglabel">Email: </div>
              <div class="leg_filed">
                  <?php 
            echo $backup_miss_assis_id->getPerson()->getEmail();
            ?>
              </div>
          </div>
          <?php 
        }
        $pilot_aircraft_id = PilotAircraftPeer::retrieveByPK($miss_leg->getPilotAircraftId());
        if ($pilot_aircraft_id) {
            ?>
           <div class="legemail_box">
               <div class="heading">Pilot Aircraft: <?php 
            echo $pilot_aircraft_id->getMember()->getPerson()->getFirstName();
            ?>
 <?php 
            echo $pilot_aircraft_id->getMember()->getPerson()->getLastName();
            ?>
 </div>
              <div class="chbox">
                  <input type="checkbox" <?php 
            if ($pilot_aircraft_id->getMember()->getPerson() && $pilot_aircraft_id->getMember()->getPerson()->getEmail()) {
                ?>
 value="<?php 
Exemple #2
0
 public function executeAjaxDeleteAircraft(sfWebRequest $request)
 {
     if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $pilot_aircraft = PilotAircraftPeer::retrieveByPK($request->getParameter('id'));
     $this->forward404Unless($pilot_aircraft);
     $this->forward404Unless($pilot_aircraft->getMemberId() == $this->getUser()->getMemberId());
     $pilot_aircraft->delete();
     return sfView::NONE;
 }
Exemple #3
0
        ?>
        <?php 
        if ($sf_user->hasCredential(array('Administrator'), false)) {
            ?>
<a href="<?php 
            echo url_for('account/newAircraft?id=' . $pilot->getMemberId() . '&leg=' . $leg->getId());
            ?>
" class="link-add"></a><?php 
        }
        ?>
    <br />
    <?php 
        if (isset($pilot)) {
            ?>
        <?php 
            $has_p_aircrafts = PilotAircraftPeer::getByMemberId($pilot_member->getId());
            ?>
        <?php 
            $aircrafts = array();
            $c = 0;
            if (isset($has_p_aircrafts)) {
                foreach ($has_p_aircrafts as $pilot_aircraft) {
                    if ($pilot_aircraft->getAircraftId()) {
                        $aircrafts[$c] = AircraftPeer::retrieveByPK($pilot_aircraft->getAircraftId());
                        $c++;
                    }
                }
            }
            ?>
        <?php 
            if (count($aircrafts)) {
Exemple #4
0
                            <th class="aa">Seats</th>
                            <th class="aa">Weights</th>
                            <th class="aa">Multiple Stops?</th>
                            <th class="aa">Comments</th>
                          </tr>
                      </thead>
                      <tbody>

                      <?php 
    foreach ($requests_of_this_date as $rq) {
        $member_id = $rq->getMemberId();
        $pilot_req = PilotRequestPeer::retrieveByPK($rq->getPilotRequestId());
        $pilot = PilotPeer::getByMemberId($member_id);
        if (isset($pilot) && $pilot instanceof Pilot) {
            $person = $pilot->getMember()->getPerson();
            $pilot_aircraft = PilotAircraftPeer::getPrimary($member_id);
            #pilot's aircraft
            if (isset($pilot_aircraft) && $pilot_aircraft instanceof PilotAircraft) {
                $aircraft = $pilot_aircraft->getAircraft();
            }
        }
        ?>
                      <?php 
        if (isset($pilot) && $pilot instanceof Pilot) {
            ?>
                          <tr>
                          <td  class="aa"><?php 
            if (isset($person) && $person instanceof Person) {
                echo $person->getLastName() . ' ' . $person->getFirstName();
            }
            ?>
Exemple #5
0
 /**
  * Get the associated PilotAircraft object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     PilotAircraft The associated PilotAircraft object.
  * @throws     PropelException
  */
 public function getPilotAircraft(PropelPDO $con = null)
 {
     if ($this->aPilotAircraft === null && $this->pilot_aircraft_id !== null) {
         $c = new Criteria(PilotAircraftPeer::DATABASE_NAME);
         $c->add(PilotAircraftPeer::ID, $this->pilot_aircraft_id);
         $this->aPilotAircraft = PilotAircraftPeer::doSelectOne($c, $con);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aPilotAircraft->addMissionLegs($this);
         		 */
     }
     return $this->aPilotAircraft;
 }
Exemple #6
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Aircraft is new, it will return
  * an empty collection; or if this Aircraft has previously
  * been saved, it will retrieve related PilotAircrafts from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in Aircraft.
  */
 public function getPilotAircraftsJoinMember($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     if ($criteria === null) {
         $criteria = new Criteria(AircraftPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collPilotAircrafts === null) {
         if ($this->isNew()) {
             $this->collPilotAircrafts = array();
         } else {
             $criteria->add(PilotAircraftPeer::AIRCRAFT_ID, $this->id);
             $this->collPilotAircrafts = PilotAircraftPeer::doSelectJoinMember($criteria, $con, $join_behavior);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(PilotAircraftPeer::AIRCRAFT_ID, $this->id);
         if (!isset($this->lastPilotAircraftCriteria) || !$this->lastPilotAircraftCriteria->equals($criteria)) {
             $this->collPilotAircrafts = PilotAircraftPeer::doSelectJoinMember($criteria, $con, $join_behavior);
         }
     }
     $this->lastPilotAircraftCriteria = $criteria;
     return $this->collPilotAircrafts;
 }
/*echo "<pre>";
print_r($mission_leg);
die();
*/
if ($mission_leg->getFboId()) {
    $fbo = FboPeer::retrieveByPK($mission_leg->getFboId());
    if ($fbo->getAirportId()) {
        $fbo_airport = AirportPeer::retrieveByPK($fbo->getAirportId());
    }
}
//Pilot
if ($mission_leg->getPilotId()) {
    $pilot = PilotPeer::retrieveByPK($mission_leg->getPilotId());
    $pilotMember = $pilot->getMember();
    $pilot_person = PersonPeer::retrieveByPK($pilotMember->getPersonId());
    $pilot_aircrafts = PilotAircraftPeer::getByMemberId($pilot->getMemberId());
}
// Mission Assistant
if ($mission_leg->getMissAssisId()) {
    $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);
?>
  </small></td>
</tr>
</table>
<table border="0" cellpadding="2" width="650" cellspacing="0">
</table>
<?php 
if ($mission_legs) {
    $index = 0;
    $totabaggage = 0;
    foreach ($mission_legs as $mleg) {
        $totabaggage += $mleg->getBaggageWeight();
        if ($mleg->getPilotId()) {
            $pilot_info = PilotPeer::retrieveByPK($mleg->getPilotId());
            $pilot_person = $pilot_info->getMember()->getPerson();
            $pilot_aircrafts = PilotAircraftPeer::getByMemberId($pilot_info->getMember()->getId());
        }
        if ($mleg->getMissAssisId()) {
            $memberMiss = MemberPeer::retrieveByPK($mleg->getMissAssisId());
            $miss_assi_persopn = $memberMiss->getPerson();
        }
        if ($mleg->getBackupPilotId()) {
            $backup_pilot_info = PilotPeer::retrieveByPK($mleg->getPilotId());
            $backupPilot_person = $backup_pilot_info->getMember()->getPerson();
        }
        if ($mleg->getCoordinatorId()) {
            $coordinator = CoordinatorPeer::retrieveByPK($mleg->getCoordinatorId());
            if ($coordinator->getMemberId()) {
                $coordiPerson = $coordinator->getMember()->getPerson();
            }
        }
Exemple #9
0
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = PilotAircraftPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setMemberId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setAircraftId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setNNumber($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setOwn($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setPrimary($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setSeats($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setKnownIce($arr[$keys[7]]);
     }
 }
Exemple #10
0
        ?>
    <?php 
    }
    ?>
  <?php 
}
?>
     <h3>Pilot's Aircraft</h3>
  <?php 
if (sizeof($ids) != 0) {
    ?>
  <?php 
    for ($i = 0; $i < sizeof($ids); $i++) {
        ?>
  <?php 
        $pilot_airc = PilotAircraftPeer::retrieveByPK($ids[$i]);
        ?>
  <?php 
        if (isset($pilot_airc)) {
            ?>
  <?php 
            $aircraft = AircraftPeer::retrieveByPK($pilot_airc->getAircraftId());
            ?>
  <?php 
        }
        ?>
  <div class="person-info">
    <dl class="person-data">
      <?php 
        if ($sf_user->hasCredential(array('Administrator', 'Staff'), false)) {
            ?>
Exemple #11
0
 /**
  * Remove Pilot's aircraft(s) from
  * CODE: pilot_aircraft_delete
  */
 public function executeRemoveGroupAircraft(sfWebRequest $request)
 {
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     if ($request->getParameter('actions')) {
         $ids = $request->getParameter('actions');
     }
     foreach ($ids as $id) {
         $aircraft = PilotAircraftPeer::retrieveByPK($id);
         if (isset($aircraft) && $aircraft instanceof PilotAircraft) {
             $aircraft->delete();
         }
     }
     $this->getUser()->setFlash('success', 'Selected Pilot\'s are deleted!');
     $this->redirect('account_pilot');
 }
Exemple #12
0
 /**
  * Pilot Request =  Mission Available for Pilot
  */
 public function executeUpdate(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');
     }
     if ($request->getParameter('id')) {
         $this->mission_leg = MissionLegPeer::retrieveByPK($request->getParameter('id'));
         $this->forward404Unless($this->mission_leg);
         $member = MemberPeer::retrieveByPK($this->getUser()->getMemberId());
         if (!$member instanceof Member) {
             $this->getUser()->setFlash('warning', 'Sorry! Your permission could have been assigned. But you don\'t have member record!');
             $this->redirect($request->getReferer());
         }
         if ($member) {
             $pilot = $member->getPilot();
         } else {
             $pilot = null;
         }
         $this->pilot = $pilot;
         if ($pilot) {
             $this->airport = $pilot->getAirport();
         } else {
             $this->airport = null;
         }
         // Select Mission Assistant from pilot request
         $c = new Criteria();
         $c->add(PilotRequestPeer::LEG_ID, $request->getParameter('id'));
         $c->add(PilotRequestPeer::PILOT_TYPE, "Mission Assistant");
         $this->mission_assistants = PilotRequestPeer::doSelect($c);
         //TODO optimize
         //print_r($this->mission_assistants);
         if (isset($member)) {
             $this->pilot = PilotPeer::getByMemberId($member->getId());
             $this->pilot_aircrafts = PilotAircraftPeer::getByMemberId($member->getId());
         }
         $this->pre_requests = PilotRequestPeer::getByMemnerIdLegId($member->getId(), $this->mission_leg->getId());
     } else {
         $this->getUser()->setFlash('success', 'No Mission Leg have been selected!');
     }
     //Pilot Request
     if ($request->isMethod('post')) {
         if ($request->getParameter('other_pilot') == 1) {
             if ($request->getParameter('date') != null) {
                 //die("OK");
                 $pilot_request = new PilotRequest();
                 $pilot_request->setMemberId($member->getId());
                 $pilot_request->setLegId($request->getParameter('id'));
                 $pilot_request->setDate($request->getParameter('date'));
                 $pilot_request->setPilotType($request->getParameter('pilot_type'));
                 $pilot_request->setMissionAssistantWanted(0);
                 $pilot_request->setIfrBackupWanted(0);
                 $pilot_request->setAccepted(0);
                 $pilot_request->setProcessed(0);
                 $pilot_request->setOnHold(0);
                 $pilot_request->setComment($request->getParameter('comment'));
                 $pilot_request->setAircraftId($request->getParameter('aircraft'));
                 $pilot_request->setTail($request->getParameter('tail'));
                 $person = PersonPeer::retrieveByPK($this->getUser()->getId());
                 $pilot_request->setCreatedAt(date('m/d/y'));
                 $pilot_request->save();
                 $mail_text = "Dear " . trim($person->getName()) . ", you have requested a mission from Angel Flight West. Your request has been sent successfully";
                 $this->getComponent('mail', 'missionReqCreate', array('email' => $person->getEmail(), 'name' => $person->getName(), 'subject' => 'Request Mission', 'text' => $mail_text));
                 $this->getUser()->setFlash('success', 'Your request has been saved on Mission Leg #' . $this->mission_leg->getId());
                 $this->redirect('@pilot_thanks?id=' . $request->getParameter('id'));
             } else {
                 if ($request->getParameter('date') == null) {
                     $this->date_e = 1;
                     $this->date_other_e = 1;
                     $this->type = $request->getParameter('pilot_type');
                 }
             }
         } else {
             if ($request->getParameter('date') != null) {
                 //die('OK');
                 $pilot_request = new PilotRequest();
                 if (isset($member)) {
                     $pilot_request->setMemberId($member->getId());
                 }
                 $pilot_request->setLegId($request->getParameter('id'));
                 $pilot_request->setDate($request->getParameter('date'));
                 $pilot_request->setPilotType($request->getParameter('pilot_type'));
                 $pilot_request->setComment($request->getParameter('comment'));
                 $pilot_request->setProcessed(1);
                 $pilot_request->setAircraftId($request->getParameter('aircraft'));
                 $pilot_request->setTail($request->getParameter('tail'));
                 if ($request->getParameter('acc_cre') == 'yes') {
                     $pilot_request->setMissionAssistantWanted(1);
                     $pilot_request->setMissAssisId($request->getParameter('ma_ids'));
                 } else {
                     $pilot_request->setMissionAssistantWanted(0);
                 }
                 if ($request->getParameter('IFR') == 0) {
                     $pilot_request->setIfrBackupWanted(0);
                 } else {
                     $pilot_request->setIfrBackupWanted(1);
                 }
                 $pilot_request->setCreatedAt(date('m/d/y'));
                 $person = PersonPeer::retrieveByPK($this->getUser()->getId());
                 $pilot_request->save();
                 $mail_text = "Dear " . trim($person->getName()) . ", you have requested a mission from Angel Flight West. Your request has been sent successfully";
                 $this->getComponent('mail', 'missionReqCreate', array('email' => $person->getEmail(), 'name' => $person->getName(), 'subject' => 'Request Mission', 'text' => $mail_text));
                 $this->getUser()->setFlash('success', 'Your request has been saved on Mission Leg #' . $this->mission_leg->getId());
                 $this->redirect('@pilot_thanks?id=' . $request->getParameter('id'));
             } else {
                 if ($request->getParameter('date') == null) {
                     $this->date_e = 1;
                     $this->type = $request->getParameter('pilot_type');
                 }
             }
         }
     }
 }
Exemple #13
0
 /**
  * Request a group Missions 
  * CODE:mission_request_group_create
  */
 public function executeRequestGroupMission(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');
     }
     $camp = CampPeer::retrieveByPK($request->getParameter('id'));
     if (isset($camp) && $camp instanceof Camp) {
         $this->camp_id = $camp->getId();
         $missions = MissionPeer::getByCampId($camp->getId());
     }
     $this->dates = array();
     $this->home_base = null;
     $this->number_of_seats = null;
     $this->total_carry = null;
     $this->multi_pick = null;
     $this->date_choice = null;
     $this->comment = null;
     $this->request_as = null;
     $this->acc_cre = null;
     $this->pilot_ma = null;
     $this->IFR = null;
     $this->aircraft = null;
     $this->tail = null;
     $this->other_pilot = null;
     $miss_dates = array();
     //$appt_dates = array();
     //$count = 0;
     //$count2 = 0;
     foreach ($missions as $mission) {
         if ($mission->getMissionDate()) {
             $miss_dates[$mission->getMissionDate('m/d/Y')] = $mission->getMissionDate();
             //$count++;
             //it may change
             $this->mission_date = $mission->getMissionDate();
             $this->appt_date = $mission->getApptDate();
             //
         }
         /*
               if($mission->getApptDate()){
                 $appt_dates[$count2] = $mission->getApptDate();
                 $count2++;
               }*/
         $miss_id = $mission->getId();
     }
     $this->mission_dates = array();
     $this->mission_dates = $miss_dates;
     if (isset($miss_id)) {
         $legs = MissionLegPeer::getbyMissId($miss_id);
         $this->mission = MissionPeer::retrieveByPK($miss_id);
         foreach ($legs as $leg) {
             if ($leg->getToAirportId()) {
                 $this->leg = $leg;
                 $airport = AirportPeer::retrieveByPK($leg->getToAirportId());
                 if (isset($airport) && $airport instanceof Airport) {
                     $this->destination_airport = $airport;
                 }
             }
         }
     }
     /*
     if(isset($miss_dates[$count-1])){
       $this->mission_date = $miss_dates[$count-1];
     }
     if(isset($appt_dates[$count2-1])){
       $this->appt_date = $appt_dates[$count2-1];
     }
     */
     //$this->mission_leg = MissionLegPeer::retrieveByPK($request->getParameter('id'));
     $member = MemberPeer::getByPersonId($this->getUser()->getId());
     if (isset($member)) {
         $this->pilot = PilotPeer::getByMemberId($member->getId());
         $this->pilot_aircrafts = PilotAircraftPeer::getByMemberId($member->getId());
         $this->pre_requests = PilotRequestPeer::getByMemnerIdLegIdCamp($member->getId(), $this->leg->getId());
     }
     if ($request->isMethod('post')) {
         if ($request->getParameter('id')) {
             //set post variables
             $this->dates = $request->getParameter('dates[]', array());
             $this->home_base = $request->getParameter('home_base');
             $this->number_of_seats = $request->getParameter('number_of_seats');
             $this->total_carry = $request->getParameter('total_carry');
             $this->multi_pick = $request->getParameter('multi_pick');
             $this->date_choice = $request->getParameter('date_choice');
             $this->comment = $request->getParameter('comment');
             $this->request_as = $request->getParameter('request_as');
             $this->acc_cre = $request->getParameter('acc_cre');
             $this->pilot_ma = $request->getParameter('pilot_ma');
             $this->IFR = $request->getParameter('IFR');
             $this->aircraft = $request->getParameter('aircraft');
             $this->tail = $request->getParameter('tail');
             $this->other_pilot = $request->getParameter('other_pilot');
             if (count($this->dates) > 0 && $request->getParameter('home_base') && $request->getParameter('number_of_seats') && $request->getParameter('total_carry')) {
                 //check if this pilot requested this camp already?
                 $c = $has_requested = PilotRequestPeer::getByMemberIdCampId($member->getId(), $request->getParameter('camp_id'));
                 if (!$has_requested) {
                     $pilot_request = new PilotRequest();
                     if ($member) {
                         $pilot_request->setMemberId($member->getId());
                     }
                     $pilot_request->setGroupCampId($request->getParameter('camp_id'));
                     if ($request->getParameter('home_base')) {
                         $airport_hb = AirportPeer::getByIdent($request->getParameter('home_base'));
                         if (isset($airport_hb) && $airport_hb instanceof Airport) {
                             $pilot_request->setHomeBase($airport_hb->getIdent());
                         } else {
                             $this->getUser()->setFlash('warning', 'Home Base is not found!');
                             $this->redirect($request->getReferer());
                         }
                     }
                     if ($request->getParameter('number_of_seats')) {
                         if (is_integer((int) $request->getParameter('number_of_seats'))) {
                             $pilot_request->setNumberSeats((int) $request->getParameter('number_of_seats'));
                         } else {
                             $this->getUser()->setFlash('warning', 'Number of seats is in wrong format!');
                             $this->redirect($request->getReferer());
                         }
                     }
                     if ($request->getParameter('total_carry')) {
                         if (is_int((int) $request->getParameter('total_carry'))) {
                             $pilot_request->setTotalWeight((int) $request->getParameter('total_carry'));
                         } else {
                             $this->getUser()->setFlash('success', 'Total of carry value is in wrong format!');
                             $this->redirect($request->getReferer());
                         }
                     }
                     $pilot_request->setMultiplePick($request->getParameter('multi_pick'));
                     $pilot_request->save();
                     if (count($this->dates) > 0) {
                         #check is has Pilot Date
                         //$has_pilot_date = PilotDatePeer::getByMemberId($member->getId());
                         for ($y = 0; $y < count($this->dates); $y++) {
                             $pilot_date = new PilotDate();
                             $pilot_date->setMemberId($member->getId());
                             $pilot_date->setDate($this->dates[$y]);
                             $pilot_date->setPilotRequestId($pilot_request->getId());
                             $pilot_date->save();
                         }
                     }
                     if (count($this->dates) == 0) {
                         $pilot_request->setDate($this->dates[0]);
                     }
                     $pilot_request->setNumberDateAssign($request->getParameter('date_choice', 1));
                     $pilot_request->setPilotType($request->getParameter('request_as'));
                     $pilot_request->setComment($request->getParameter('comment'));
                     $pilot_request->setAircraftId($request->getParameter('aircraft'));
                     $pilot_request->setTail($request->getParameter('tail'));
                     //check pilot_type
                     if ($request->getParameter('other_pilot') == 1) {
                         ////mission assistant,earth angel
                         $pilot_request->setMissionAssistantWanted(0);
                         $pilot_request->setIfrBackupWanted(0);
                         $pilot_request->setAccepted(0);
                         $pilot_request->setProcessed(0);
                         $pilot_request->setOnHold(0);
                     } else {
                         ////command pilot
                         $pilot_request->setProcessed(1);
                         if ($request->getParameter('acc_cre') == 1) {
                             $pilot_request->setMissionAssistantWanted(0);
                             #set pilot as mission assistant
                             if ($member->getPerson()) {
                                 $pilot_request->setMissionAssistantName($member->getPerson()->getLastName() . ' ' . $member->getPerson()->getFirstName());
                             }
                         } else {
                             $pilot_request->setMissionAssistantWanted(0);
                             #set pilot's mission assistant as mission assistant
                             if ($request->getParameter('pilot_ma')) {
                                 $pilot_request->setMissionAssistantName($request->getParameter('pilot_ma'));
                             }
                         }
                         if ($request->getParameter('IFR') == 0) {
                             $pilot_request->setIfrBackupWanted(0);
                         } else {
                             $pilot_request->setIfrBackupWanted(1);
                         }
                     }
                     $pilot_request->setCreatedAt(date('m/d/y'));
                     $pilot_request->save();
                     $this->getUser()->setFlash('success', 'Your request has been saved on Camp ID#' . $request->getParameter('camp_id'));
                     //            $this->redirect('@pilot_thanks?id='.$request->getParameter('id'));
                 } else {
                     $this->getUser()->setFlash('success', 'You have already requested this Camp Mission!');
                     //            $this->redirect('@pilot_thanks?id='.$request->getParameter('id'));
                 }
             } else {
                 if (count($this->dates) < 1) {
                     $this->date_other_e = 1;
                     $this->type = $request->getParameter('request_as');
                 }
                 if (!$request->getParameter('home_base')) {
                     $this->home = 1;
                 }
                 if (!$request->getParameter('number_of_seats')) {
                     $this->number_of = 1;
                 }
                 if (!$request->getParameter('total_carry')) {
                     $this->carry = 1;
                 }
             }
         }
     }
 }
Exemple #14
0
 protected function processStep3Check(sfWebRequest $request)
 {
     $default_airport = AirportPeer::getByIdent(sfConfig::get('app_default_airport_ident'));
     $this->forward404Unless($default_airport);
     $app = $this->application_temp;
     $person = $this->person;
     if (!$person instanceof Person) {
         $person = new Person();
     }
     /* @var $app ApplicationTemp */
     /* @var $person Person */
     // Person
     $tmp_arr = $app->toArray(BasePeer::TYPE_FIELDNAME);
     $tmp_arr['evening_phone'] = $tmp_arr['eve_phone'];
     $tmp_arr['evening_comment'] = $tmp_arr['eve_comment'];
     unset($tmp_arr['id']);
     $person->fromArray($tmp_arr, BasePeer::TYPE_FIELDNAME);
     $person->save();
     // Member
     $member = MemberPeer::retrieveByPK($app->getMemberId());
     if (!$member instanceof Member) {
         $member = new Member();
     }
     $member->setActive(1);
     $member->setCoPilot($app->getApplicantCopilot());
     $member->setContact('By Email');
     $member->setDateOfBirth($app->getDateOfBirth());
     $member->setDriversLicenseState($app->getDriversLicenseState());
     $member->setDriversLicenseNumber($app->getDriversLicenseNumber());
     $member->setEmergencyContactName($app->getEmergencyContactName());
     $member->setEmergencyContactPhone($app->getEmergencyContactPhone());
     $member->setFlightStatus($app->getApplicantPilot() ? 'Verify Orientation' : 'Non-pilot');
     //$member->setJoinDate(time());
     $member->setLanguages($app->getLanguagesSpoken());
     //Farazi
     //$member->setMasterMemberId($app->getMasterMemberId());
     // Get Last renewal date
     $this->member = MemberPeer::retrieveByPK($app->getMemberId());
     $lastRenewalDate = strtotime($this->member->getRenewalDate());
     $member->setMemberClassId($app->getMemberClassId());
     $member->setPersonId($person->getId());
     $member->setRenewedDate(time());
     ///Farazi Renewal Date From Memberclass
     if ($app->getMemberClassId()) {
         $memclass = MemberClassPeer::retrieveByPK($app->getMemberClassId());
         $renewal_period = $memclass->getRenewalPeriod();
         $renewalTime = strtotime('+' . $renewal_period . ' month', $lastRenewalDate);
         //echo $renewalTime;
         $member->setRenewalDate($renewalTime);
         //$member->setRenewalDate(strtotime('+'.$renewal_period.' month'));
     }
     // Farazi End
     //$member->setRenewalDate(strtotime('+1 year'));
     $member->setSpouseName($app->getSpouseFirstName() . ' ' . $app->getSpouseLastName());
     $member->setWeight($app->getWeight());
     $member->setWingId($app->getWingId());
     $member->save();
     // Pilot
     if ($app->getApplicantPilot()) {
         $pilot = $member->getPilot();
         if (!$pilot instanceof Pilot) {
             $pilot = new Pilot();
         }
         if ($pilot->isNew()) {
             // remove aircrafts
             foreach ($member->getPilotAircrafts() as $p_a) {
                 PilotAircraftPeer::doDelete($p_a);
             }
         }
         $pilot->setMemberId($member->getId());
         $airport = AirportPeer::getByIdent($app->getHomeBase());
         if (!$airport instanceof Airport) {
             $airport = $default_airport;
         }
         $pilot->setPrimaryAirportId($airport->getId());
         $pilot->setTotalHours($app->getTotalHours());
         $pilot->setLicenseType('Private');
         foreach (sfConfig::get('app_pilot_license_types') as $key => $val) {
             if (stripos($app->getRatings(), $key) !== false) {
                 $pilot->setLicenseType($key);
             }
         }
         $pilot->setIfr(stripos($app->getRatings(), 'ifr') !== false ? 1 : 0);
         $pilot->setMultiEngine(stripos($app->getRatings(), 'multi') !== false ? 1 : 0);
         $pilot->setSeInstructor('No');
         // @see ApplicationForm
         foreach (sfConfig::get('app_pilot_se_instructor') as $key => $val) {
             if (stripos($app->getRatings(), $key) !== false) {
                 $pilot->setSeInstructor($key);
             }
         }
         $pilot->setMeInstructor($pilot->getSeInstructor());
         $pilot->save();
         // Availability
         $availability = $member->getAvailability();
         if (!$availability instanceof Availability) {
             $availability = new Availability();
         }
         $availability->setMemberId($member->getId());
         $availability->setNotAvailable(0);
         $availability->setNoWeekday($app->getAvailabilityWeekdays() == 0);
         $availability->setNoNight($app->getAvailabilityWeeknights() == 0);
         $availability->setLastMinute($app->getAvailabilityLastMinute());
         $availability->setAsMissionMssistant($app->getAvailabilityCopilot());
         $availability->setNoWeekend($app->getAvailabilityWeekends() == 0);
         $availability->save();
         //Farazi
         //Delete all aircrafts
         $pilot_aircrafts = PilotAircraftPeer::getByMemberId($member->getId());
         foreach ($pilot_aircrafts as $pilot_aircraft) {
             $pilot_aircraft->delete();
         }
         // Primary aircraft
         if ($app->getAircraftPrimaryId() && ($aircraft = AircraftPeer::retrieveByPK($app->getAircraftPrimaryId()))) {
             $pilot_aircraft = new PilotAircraft();
             $pilot_aircraft->setMemberId($member->getId());
             $pilot_aircraft->setAircraftId($aircraft->getId());
             $pilot_aircraft->setNNumber($app->getAircraftPrimaryNNumber());
             $pilot_aircraft->setOwn($app->getAircraftPrimaryOwn());
             $pilot_aircraft->setSeats($app->getAircraftPrimarySeats());
             $pilot_aircraft->setKnownIce($app->getAircraftPrimaryIce());
             $pilot_aircraft->save();
         }
         // Secondary aircraft
         if ($app->getAircraftSecondaryId() && ($aircraft = AircraftPeer::retrieveByPK($app->getAircraftSecondaryId()))) {
             $pilot_aircraft = new PilotAircraft();
             $pilot_aircraft->setMemberId($member->getId());
             $pilot_aircraft->setAircraftId($aircraft->getId());
             $pilot_aircraft->setNNumber($app->getAircraftSecondaryNNumber());
             $pilot_aircraft->setOwn($app->getAircraftSecondaryOwn());
             $pilot_aircraft->setSeats($app->getAircraftSecondarySeats());
             $pilot_aircraft->setKnownIce($app->getAircraftSecondaryIce());
             $pilot_aircraft->save();
         }
         // Third aircraft
         if ($app->getAircraftThirdId() && ($aircraft = AircraftPeer::retrieveByPK($app->getAircraftThirdId()))) {
             $pilot_aircraft = new PilotAircraft();
             $pilot_aircraft->setMemberId($member->getId());
             $pilot_aircraft->setAircraftId($aircraft->getId());
             $pilot_aircraft->setNNumber($app->getAircraftThirdNNumber());
             $pilot_aircraft->setOwn($app->getAircraftThirdOwn());
             $pilot_aircraft->setSeats($app->getAircraftThirdSeats());
             $pilot_aircraft->setKnownIce($app->getAircraftThirdIce());
             $pilot_aircraft->save();
         }
     }
     // Application_temp
     $app->setPersonId($person->getId());
     $app->setMemberId($member->getId());
     $app->setProcessedDate(time());
     $app->save();
     // Application
     $tmp_arr = $app->toArray(BasePeer::TYPE_FIELDNAME);
     $tmp_arr['date'] = $tmp_arr['application_date'];
     $tmp_arr['company'] = $tmp_arr['company_name'];
     foreach (sfConfig::get('app_pilot_license_types') as $key => $val) {
         if (stripos($tmp_arr['ratings'], $key) !== false) {
             $tmp_arr['license_type'] = $key;
         }
     }
     $tmp_arr['ifr'] = stripos($tmp_arr['ratings'], 'ifr') !== false ? 1 : 0;
     $tmp_arr['multi_engine'] = stripos($tmp_arr['ratings'], 'multi') !== false ? 1 : 0;
     $tmp_arr['se_instructor'] = 'No';
     // @see ApplicationForm
     foreach (sfConfig::get('app_pilot_se_instructor') as $key => $val) {
         if (stripos($tmp_arr['ratings'], $key) !== false) {
             $tmp_arr['se_instructor'] = $key;
         }
     }
     $tmp_arr['me_instructor'] = $tmp_arr['se_instructor'];
     $tmp_arr['other_ratings'] = $tmp_arr['ratings'];
     $tmp_arr['fbo'] = $tmp_arr['fbo_name'];
     $tmp_arr['member_meetings'] = 0;
     $tmp_arr['executive_board'] = 0;
     $tmp_arr['dues_amount_paid'] = $tmp_arr['dues_amount_paid'] ? $tmp_arr['dues_amount_paid'] : 0;
     $tmp_arr['donation_amount_paid'] = $tmp_arr['donation_amount_paid'] ? $tmp_arr['donation_amount_paid'] : 0;
     unset($tmp_arr['id']);
     $application = new Application();
     $application->fromArray($tmp_arr, BasePeer::TYPE_FIELDNAME);
     $application->save();
     $this->getUser()->setFlash('success', 'Membership renewal completed successfully.');
     //$this->redirect('renewal/processComplete?id='.$member->getId());
     $this->redirect('renewal/processStep3?id=' . $this->application_temp->getId());
     //$this->redirect('renewal/index?id='.$member->getId());
 }
Exemple #15
0
 public function executeUpdate(sfWebRequest $request)
 {
     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');
     }
     $mission_leg = MissionLegPeer::retrieveByPK($request->getParameter('leg_id'));
     $this->forward404Unless($mission_leg);
     $this->form = new MissionReportForm($mission_leg->getMissionReport());
     $this->processForm($request, $this->form, $mission_leg);
     $this->pilot_aircrafts = PilotAircraftPeer::getByMemberId($this->getUser()->getMemberId(), 'doSelectJoinAircraft');
     $this->setTemplate('edit');
 }
 /**
  * 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(PilotAircraftPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(PilotAircraftPeer::DATABASE_NAME);
         $criteria->add(PilotAircraftPeer::ID, $pks, Criteria::IN);
         $objs = PilotAircraftPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
 public static function getEmailAddressesOfPersonsRelatedToMissionLeg(MissionLeg $mission_leg)
 {
     $receivers = array();
     // Get Coordinator email address
     $coordinator = CoordinatorPeer::retrieveByPK($mission_leg->getCoordinatorId());
     if ($coordinator && ($coordinator = $coordinator->getMember())) {
         $coordinator = $coordinator->getPerson()->getEmail();
         if (!empty($coordinator)) {
             //            $receivers['coordinator_'.$mission_leg->getId()] = $coordinator;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $coordinator)) {
                 $receivers[] = $coordinator;
             }
         }
     }
     unset($coordinator);
     // Get Pilot email address
     $pilot = PilotPeer::retrieveByPK($mission_leg->getPilotId());
     if ($pilot && ($pilot = $pilot->getMember())) {
         $pilot = $pilot->getPerson()->getEmail();
         if (!empty($pilot)) {
             //        $receivers['pilot_'.$mission_leg->getId()] = $pilot;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $pilot)) {
                 $receivers[] = $pilot;
             }
         }
     }
     unset($pilot);
     // Get Backup Pilot email address
     $backup_pilot = PilotPeer::retrieveByPK($mission_leg->getBackupPilotId());
     if ($backup_pilot && ($backup_pilot = $backup_pilot->getMember())) {
         $backup_pilot = $backup_pilot->getPerson()->getEmail();
         if (!empty($backup_pilot)) {
             //            $receivers['backup_pilot_'.$mission_leg->getId()] = $backup_pilot;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $backup_pilot)) {
                 $receivers[] = $backup_pilot;
             }
         }
     }
     unset($backup_pilot);
     // Get Co-Pilot which is relate to Member
     $co_pilot = MemberPeer::retrieveByPK($mission_leg->getCopilotId());
     if ($co_pilot) {
         $co_pilot = $co_pilot->getPerson()->getEmail();
         if (!empty($co_pilot)) {
             //            $receivers['co_pilot_'.$mission_leg->getId()] = $co_pilot;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $co_pilot)) {
                 $receivers[] = $co_pilot;
             }
         }
     }
     unset($co_pilot);
     // Get Backup Co-pilot email address
     $backup_co_pilot = MemberPeer::retrieveByPK($mission_leg->getBackupCopilotId());
     if ($backup_co_pilot) {
         $backup_co_pilot = $backup_co_pilot->getPerson()->getEmail();
         if (!empty($backup_co_pilot)) {
             //            $receivers['backup_co_pilot_'.$mission_leg->getId()] = $backup_co_pilot;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $backup_co_pilot)) {
                 $receivers[] = $backup_co_pilot;
             }
         }
     }
     unset($backup_co_pilot);
     // Get mission assist email address
     $mission_assist = MemberPeer::retrieveByPK($mission_leg->getMissAssisId());
     if ($mission_assist) {
         $mission_assist = $mission_assist->getPerson()->getEmail();
         if (!empty($mission_assist)) {
             //            $receivers['mission_assist_'.$mission_leg->getId()] = $mission_assist;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $mission_assist)) {
                 $receivers[] = $mission_assist;
             }
         }
     }
     unset($mission_assist);
     // Get Backup mission assist email address
     $backup_mission_assist = MemberPeer::retrieveByPK($mission_leg->getBackupMissAssisId());
     if ($backup_mission_assist) {
         $backup_mission_assist = $backup_mission_assist->getPerson()->getEmail();
         if (!empty($backup_mission_assist)) {
             //            $receivers['backup_mission_assist_'.$mission_leg->getId()] = $backup_mission_assist;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $backup_mission_assist)) {
                 $receivers[] = $backup_mission_assist;
             }
         }
     }
     unset($backup_mission_assist);
     // Get Pilot Aircraft email address
     $pilot_aircraft = PilotAircraftPeer::retrieveByPK($mission_leg->getPilotAircraftId());
     if ($pilot_aircraft && ($pilot_aircraft = $pilot_aircraft->getMember())) {
         $pilot_aircraft = $pilot_aircraft->getPerson()->getEmail();
         if (!empty($pilot_aircraft)) {
             //            $receivers['pilot_aircraft_'.$mission_leg->getId()] = $pilot_aircraft;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $pilot_aircraft)) {
                 $receivers[] = $pilot_aircraft;
             }
         }
     }
     unset($pilot_aircraft);
     // Get Share AFA ORG email address
     $afa_org = AfaOrgPeer::retrieveByPK($mission_leg->getShareAfaOrgId());
     if ($afa_org) {
         $afa_org = $afa_org->getRefContactEmail();
         if (!empty($afa_org)) {
             //            $receivers['afa_org_'.$mission_leg->getId()] = $afa_org;
             if (preg_match('/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/', $afa_org)) {
                 $receivers[] = $afa_org;
             }
         }
     }
     unset($afa_org);
     return $receivers;
 }
    <th>Make</th>
    <th>Model</th>
    <th>Primary</th>
    <th>Tail Number</th>
    <th>Own</th>
    <th>Seats</th>
    <th>Known Ice</th>
  </tr>
 </thead>  
 <tbody>
 <?php 
  foreach ($ids as $id) {
      ?>
  <tr>
  <?php 
      $pilot_air = PilotAircraftPeer::retrieveByPK($id);
      ?>
  <?php 
      if (isset($pilot_air) && $pilot_air instanceof PilotAircraft) {
          $air = AircraftPeer::retrieveByPK($pilot_air->getAircraftId());
      }
      ?>
   <td>
    <?php 
      echo $air->getId();
      ?>
    </td>
  <td>
    <?php 
      echo $id;
      ?>
Exemple #19
0
 /**
  * Selects a collection of MissionLeg objects pre-filled with all related objects except Fbo.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of MissionLeg objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptFbo(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     MissionLegPeer::addSelectColumns($c);
     $startcol2 = MissionLegPeer::NUM_COLUMNS - MissionLegPeer::NUM_LAZY_LOAD_COLUMNS;
     MissionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (MissionPeer::NUM_COLUMNS - MissionPeer::NUM_LAZY_LOAD_COLUMNS);
     AirportPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (AirportPeer::NUM_COLUMNS - AirportPeer::NUM_LAZY_LOAD_COLUMNS);
     AirportPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (AirportPeer::NUM_COLUMNS - AirportPeer::NUM_LAZY_LOAD_COLUMNS);
     CoordinatorPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + (CoordinatorPeer::NUM_COLUMNS - CoordinatorPeer::NUM_LAZY_LOAD_COLUMNS);
     PilotPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + (PilotPeer::NUM_COLUMNS - PilotPeer::NUM_LAZY_LOAD_COLUMNS);
     MemberPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + (MemberPeer::NUM_COLUMNS - MemberPeer::NUM_LAZY_LOAD_COLUMNS);
     PilotPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + (PilotPeer::NUM_COLUMNS - PilotPeer::NUM_LAZY_LOAD_COLUMNS);
     MemberPeer::addSelectColumns($c);
     $startcol10 = $startcol9 + (MemberPeer::NUM_COLUMNS - MemberPeer::NUM_LAZY_LOAD_COLUMNS);
     MissionReportPeer::addSelectColumns($c);
     $startcol11 = $startcol10 + (MissionReportPeer::NUM_COLUMNS - MissionReportPeer::NUM_LAZY_LOAD_COLUMNS);
     PilotAircraftPeer::addSelectColumns($c);
     $startcol12 = $startcol11 + (PilotAircraftPeer::NUM_COLUMNS - PilotAircraftPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(MissionLegPeer::MISSION_ID), array(MissionPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::FROM_AIRPORT_ID), array(AirportPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::TO_AIRPORT_ID), array(AirportPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::COORDINATOR_ID), array(CoordinatorPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::PILOT_ID), array(PilotPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::COPILOT_ID), array(MemberPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::BACKUP_PILOT_ID), array(PilotPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::BACKUP_COPILOT_ID), array(MemberPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::MISSION_REPORT_ID), array(MissionReportPeer::ID), $join_behavior);
     $c->addJoin(array(MissionLegPeer::PILOT_AIRCRAFT_ID), array(PilotAircraftPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = MissionLegPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = MissionLegPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = MissionLegPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             MissionLegPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Mission rows
         $key2 = MissionPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = MissionPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = MissionPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 MissionPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj2 (Mission)
             $obj2->addMissionLeg($obj1);
         }
         // if joined row is not null
         // Add objects for joined Airport rows
         $key3 = AirportPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = AirportPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = AirportPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 AirportPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj3 (Airport)
             $obj3->addMissionLegRelatedByFromAirportId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Airport rows
         $key4 = AirportPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = AirportPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = AirportPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 AirportPeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj4 (Airport)
             $obj4->addMissionLegRelatedByToAirportId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Coordinator rows
         $key5 = CoordinatorPeer::getPrimaryKeyHashFromRow($row, $startcol5);
         if ($key5 !== null) {
             $obj5 = CoordinatorPeer::getInstanceFromPool($key5);
             if (!$obj5) {
                 $omClass = CoordinatorPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj5 = new $cls();
                 $obj5->hydrate($row, $startcol5);
                 CoordinatorPeer::addInstanceToPool($obj5, $key5);
             }
             // if $obj5 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj5 (Coordinator)
             $obj5->addMissionLeg($obj1);
         }
         // if joined row is not null
         // Add objects for joined Pilot rows
         $key6 = PilotPeer::getPrimaryKeyHashFromRow($row, $startcol6);
         if ($key6 !== null) {
             $obj6 = PilotPeer::getInstanceFromPool($key6);
             if (!$obj6) {
                 $omClass = PilotPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj6 = new $cls();
                 $obj6->hydrate($row, $startcol6);
                 PilotPeer::addInstanceToPool($obj6, $key6);
             }
             // if $obj6 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj6 (Pilot)
             $obj6->addMissionLegRelatedByPilotId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Member rows
         $key7 = MemberPeer::getPrimaryKeyHashFromRow($row, $startcol7);
         if ($key7 !== null) {
             $obj7 = MemberPeer::getInstanceFromPool($key7);
             if (!$obj7) {
                 $omClass = MemberPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj7 = new $cls();
                 $obj7->hydrate($row, $startcol7);
                 MemberPeer::addInstanceToPool($obj7, $key7);
             }
             // if $obj7 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj7 (Member)
             $obj7->addMissionLegRelatedByCopilotId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Pilot rows
         $key8 = PilotPeer::getPrimaryKeyHashFromRow($row, $startcol8);
         if ($key8 !== null) {
             $obj8 = PilotPeer::getInstanceFromPool($key8);
             if (!$obj8) {
                 $omClass = PilotPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj8 = new $cls();
                 $obj8->hydrate($row, $startcol8);
                 PilotPeer::addInstanceToPool($obj8, $key8);
             }
             // if $obj8 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj8 (Pilot)
             $obj8->addMissionLegRelatedByBackupPilotId($obj1);
         }
         // if joined row is not null
         // Add objects for joined Member rows
         $key9 = MemberPeer::getPrimaryKeyHashFromRow($row, $startcol9);
         if ($key9 !== null) {
             $obj9 = MemberPeer::getInstanceFromPool($key9);
             if (!$obj9) {
                 $omClass = MemberPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj9 = new $cls();
                 $obj9->hydrate($row, $startcol9);
                 MemberPeer::addInstanceToPool($obj9, $key9);
             }
             // if $obj9 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj9 (Member)
             $obj9->addMissionLegRelatedByBackupCopilotId($obj1);
         }
         // if joined row is not null
         // Add objects for joined MissionReport rows
         $key10 = MissionReportPeer::getPrimaryKeyHashFromRow($row, $startcol10);
         if ($key10 !== null) {
             $obj10 = MissionReportPeer::getInstanceFromPool($key10);
             if (!$obj10) {
                 $omClass = MissionReportPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj10 = new $cls();
                 $obj10->hydrate($row, $startcol10);
                 MissionReportPeer::addInstanceToPool($obj10, $key10);
             }
             // if $obj10 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj10 (MissionReport)
             $obj10->addMissionLeg($obj1);
         }
         // if joined row is not null
         // Add objects for joined PilotAircraft rows
         $key11 = PilotAircraftPeer::getPrimaryKeyHashFromRow($row, $startcol11);
         if ($key11 !== null) {
             $obj11 = PilotAircraftPeer::getInstanceFromPool($key11);
             if (!$obj11) {
                 $omClass = PilotAircraftPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj11 = new $cls();
                 $obj11->hydrate($row, $startcol11);
                 PilotAircraftPeer::addInstanceToPool($obj11, $key11);
             }
             // if $obj11 already loaded
             // Add the $obj1 (MissionLeg) to the collection in $obj11 (PilotAircraft)
             $obj11->addMissionLeg($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }