Ejemplo n.º 1
0
 /**
  * Defines whether this leg have command pilot request
  * @return boolean
  */
 public function getPilotAssigned()
 {
     $c = new Criteria();
     $c->add(PilotRequestPeer::LEG_ID, $this->getId());
     $c->add(PilotRequestPeer::PILOT_TYPE, 'Command Pilot');
     return PilotRequestPeer::doCount($c) > 0;
 }
Ejemplo n.º 2
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Camp is new, it will return
  * an empty collection; or if this Camp has previously
  * been saved, it will retrieve related PilotRequests 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 Camp.
  */
 public function getPilotRequestsJoinMissionLeg($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     if ($criteria === null) {
         $criteria = new Criteria(CampPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collPilotRequests === null) {
         if ($this->isNew()) {
             $this->collPilotRequests = array();
         } else {
             $criteria->add(PilotRequestPeer::GROUP_CAMP_ID, $this->id);
             $this->collPilotRequests = PilotRequestPeer::doSelectJoinMissionLeg($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(PilotRequestPeer::GROUP_CAMP_ID, $this->id);
         if (!isset($this->lastPilotRequestCriteria) || !$this->lastPilotRequestCriteria->equals($criteria)) {
             $this->collPilotRequests = PilotRequestPeer::doSelectJoinMissionLeg($criteria, $con, $join_behavior);
         }
     }
     $this->lastPilotRequestCriteria = $criteria;
     return $this->collPilotRequests;
 }
Ejemplo n.º 3
0
                        <!-- edited by ziyed start -->                        
                             <div  sytle="background-color: rgb(255, 255, 153); display: none;">--<?php 
                    echo $mission->getMissionSpecificComments();
                    ?>
--</div>
                        <!-- edited by ziyed end -->

                        <?php 
                    if ($mission->getMissionDate() && $mission->getApptDate()) {
                        ?>
			<?php 
                        if ($leg->getTransportation() == 'air_mission') {
                            ?>
                           <?php 
                            if ($member) {
                                $is_has_requested = PilotRequestPeer::getByMemnerIdLegId($member->getId(), $leg->getId());
                            }
                            ?>
                           <?php 
                            if (!isset($is_has_requested)) {
                                ?>
                                  <a href="<?php 
                                echo url_for('@pilot_request?id=' . $leg->getId());
                                ?>
" class="btn-request">
                                      <span>Request This Mission</span>
                                  </a>
                            <?php 
                            } else {
                                ?>
                                <a href="#" class="btn-request"> <span>Already requested!</span> </a>
Ejemplo n.º 4
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 = PilotRequestPeer::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->setGroupCampId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setHomeBase($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setNumberSeats($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setTotalWeight($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setMultiplePick($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setLegId($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setDate($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setPilotType($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setComment($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setAccepted($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setProcessed($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setPilotStatus($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setOnHold($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setMissionAssistantWanted($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setMissAssisId($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setMissionAssistantName($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setIfrBackupWanted($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setCreatedAt($arr[$keys[19]]);
     }
     if (array_key_exists($keys[20], $arr)) {
         $this->setNumberDateAssign($arr[$keys[20]]);
     }
     if (array_key_exists($keys[21], $arr)) {
         $this->setAircraftId($arr[$keys[21]]);
     }
     if (array_key_exists($keys[22], $arr)) {
         $this->setTail($arr[$keys[22]]);
     }
 }
Ejemplo n.º 5
0
                          <tr>
                              <th class="aa">Pilot</th>
                            <th  class="aa">Aircraft</th>
                            <th class="aa">Home Base</th>
                            <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 
Ejemplo n.º 6
0
 public function executeAssignPassenger(sfWebRequest $request)
 {
     /*$camp_passenger = new CampPilotPassenger();
       $camp_passenger->setCampId($request->getParameter('camp_id'));
       $camp_passenger->setMemberId($request->getParameter('member_id'));
       $camp_passenger->setPassengerId($request->getParameter('pass_id'));
        *
        */
     $this->setLayout(false);
     $this->pilot_req_id = $request->getParameter('pilot_req_id');
     $this->flight_date = $request->getParameter('flight_date');
     $this->message = '';
     if (!$request->getParameter('camp_id') || !$request->getParameter('member_id') || !$request->getParameter('pass_id') || !$request->getParameter('pilot_req_id')) {
         //$this->getUser()->setFlash('error', 'Incomplete data!');
         $this->message = 'Incomplete data!';
     } else {
         $pilot = PilotPeer::getByMemberId($request->getParameter('member_id'));
         if (!$pilot) {
             $this->message = 'Pilot not found!';
             ////$this->getUser()->setFlash('error', 'Pilot not found!');
             return;
         }
         $pilot_request = PilotRequestPeer::retrieveByPK($request->getParameter('pilot_req_id'));
         if (!$pilot_request) {
             $this->message = 'Pilot request not found!';
             return;
         }
         //check if passenger is linked
         $camp_passenger = CampPassengerPeer::retrieveByPK($request->getParameter('camp_id'), $request->getParameter('pass_id'));
         $pass = PassengerPeer::retrieveByPK($request->getParameter('pass_id'));
         $mission = MissionPeer::getByCampPass($request->getParameter('camp_id'), $request->getParameter('pass_id'));
         if (!$camp_passenger || !$pass || !$mission) {
             $this->message = 'Passenger or mission info not found!';
             return;
         }
         $total_weight = $pass->getWeight();
         $num_of_pass = 1;
         $pass_linked = null;
         if ($camp_passenger->getLink() != null) {
             $mission_linked = MissionPeer::getByCampPass($request->getParameter('camp_id'), $camp_passenger->getLink());
             $pass_linked = PassengerPeer::retrieveByPK($camp_passenger->getLink());
             //now check if mission dates are same
             if ($mission_linked && $pass_linked) {
                 if ($mission_linked->getMissionDate('m/d/Y') != $mission->getMissionDate('m/d/Y')) {
                     $this->message = 'Linked passengers mission dates are should be same!';
                     return;
                 } else {
                     $total_weight += $pass_linked->getWeight();
                     $num_of_pass += 1;
                 }
             }
         }
         /*
         //check pilots assigned number of day
         //TODO
         $pilot_assigned_dates = MissionPeer::getCampPilotDates($request->getParameter('camp_id'), $pilot->getId());
         if(sizeof($pilot_assigned_dates) == $pilot_request->getNumberDateAssign()){
             foreach ($pilot_assigned_dates as $key => $value){
                 //if($value==)
             }
         }
         */
         //TODO:check pilots max weight
         //TODO:check pilots number of seats
         //set pilot to passenger's leg
         $camp_mission_legs = MissionLegPeer::getByCampIdPassengerId($request->getParameter('camp_id'), $request->getParameter('pass_id'));
         if ($camp_mission_legs) {
             foreach ($camp_mission_legs as $leg) {
                 $leg->setPilotId($pilot->getId());
                 $leg->save();
             }
         }
         //set pilot to linked passenger's leg if exists a link
         if ($pass_linked) {
             $camp_mission_legs = MissionLegPeer::getByCampIdPassengerId($request->getParameter('camp_id'), $pass_linked->getId());
             if ($camp_mission_legs) {
                 foreach ($camp_mission_legs as $leg) {
                     $leg->setPilotId($pilot->getId());
                     $leg->save();
                 }
             }
         }
     }
 }
Ejemplo n.º 7
0
 /**
  * Get the associated PilotRequest object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     PilotRequest The associated PilotRequest object.
  * @throws     PropelException
  */
 public function getPilotRequest(PropelPDO $con = null)
 {
     if ($this->aPilotRequest === null && $this->pilot_request_id !== null) {
         $c = new Criteria(PilotRequestPeer::DATABASE_NAME);
         $c->add(PilotRequestPeer::ID, $this->pilot_request_id);
         $this->aPilotRequest = PilotRequestPeer::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->aPilotRequest->addPilotDates($this);
         		 */
     }
     return $this->aPilotRequest;
 }
Ejemplo n.º 8
0
 public function executeAjax(sfWebRequest $request)
 {
     $this->setLayout(false);
     if ($request->getParameter('start_date') && $request->getParameter('end_date')) {
         $pliot_reqs = PilotRequestPeer::getDateRanges($request->getParameter('start_date'), $request->getParameter('end_date'));
         $ids = array();
         $count = 0;
         foreach ($pliot_reqs as $pliot_req) {
             $ids[$count] = '|' + $pliot_req->getId();
         }
         return $this->renderText($ids);
     }
 }
Ejemplo n.º 9
0
 public function executeIndex(sfWebRequest $request)
 {
     $text = $request->getParameter('search_by');
     $this->results = array();
     $this->messages = array();
     $this->uris = array();
     //person search
     if ($this->getUser()->hasRights('person_index')) {
         $c = new Criteria();
         $c1 = $c->getNewCriterion(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $c2 = $c->getNewCriterion(PersonPeer::LAST_NAME, $text . '%', Criteria::LIKE);
         //$c->setDistinct(PersonPeer::FIRST_NAME);
         //$c->setDistinct(PersonPeer::LAST_NAME);
         $c->add($c1->addOr($c2));
         $this->results['person'] = PersonPeer::doCount($c);
         $this->messages['person'] = ' person results';
         $this->uris['person'] = 'person/index?filter=1&findperson=1&firstname=' . $text;
     }
     //passenger search
     if ($this->getUser()->hasRights('passenger_index')) {
         $c = new Criteria();
         $c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['passenger'] = PassengerPeer::doCount($c);
         $this->messages['passenger'] = ' passenger results';
         $this->uris['passenger'] = 'passenger/index?filter=1&firstname=' . $text;
     }
     //companion search
     if ($this->getUser()->hasRights('companion_index')) {
         $c = new Criteria();
         $c->add(CompanionPeer::NAME, $text . '%', Criteria::LIKE);
         $this->results['companion'] = CompanionPeer::doCount($c);
         $this->messages['companion'] = ' companion results';
         $this->uris['companion'] = 'companion/index?filter=1&name=' . $text;
     }
     //mission search
     if ($this->getUser()->hasRights('mission_index')) {
         $c = new Criteria();
         if (is_numeric($text)) {
             $c->add(MissionPeer::ID, $text . '%', Criteria::LIKE);
             $this->results['mission'] = MissionPeer::doCount($c);
             $this->uris['mission'] = 'mission/index?filter=1&miss_id=' . $text;
         } else {
             $c->addJoin(MissionPeer::PASSENGER_ID, PassengerPeer::ID, Criteria::LEFT_JOIN);
             $c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
             $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
             $this->results['mission'] = MissionPeer::doCount($c);
             $this->uris['mission'] = 'mission/index?filter=1&pass_fname=' . $text;
         }
         $this->messages['mission'] = ' mission results';
     }
     //leg search
     if ($this->getUser()->hasRights('leg_index')) {
         $c = new Criteria();
         $c->addJoin(MissionLegPeer::MISSION_ID, MissionPeer::ID, Criteria::LEFT_JOIN);
         $c->addJoin(MissionPeer::PASSENGER_ID, PassengerPeer::ID, Criteria::LEFT_JOIN);
         $c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['leg'] = MissionLegPeer::doCount($c);
         $this->messages['leg'] = ' mission leg results';
         $this->uris['leg'] = 'missionLeg/index?filter=1&pass_fname=' . $text;
     }
     //requester search
     if ($this->getUser()->hasRights('requester_index')) {
         $c = new Criteria();
         $c->addJoin(RequesterPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['requester'] = RequesterPeer::doCount($c);
         $this->messages['requester'] = ' requester results';
         $this->uris['requester'] = 'requester/index?filter=1&firstname=' . $text;
     }
     //agency search
     if ($this->getUser()->hasRights('agency_index')) {
         $c = new Criteria();
         $c->add(AgencyPeer::NAME, $text . '%', Criteria::LIKE);
         $this->results['agency'] = AgencyPeer::doCount($c);
         $this->messages['agency'] = ' agency results';
         $this->uris['agency'] = 'agency/index?filter=1&name=' . $text;
     }
     //coordinator search
     if ($this->getUser()->hasRights('coordinator_index')) {
         $c = new Criteria();
         $c->addJoin(CoordinatorPeer::MEMBER_ID, MemberPeer::ID);
         $c->addJoin(PersonPeer::ID, MemberPeer::PERSON_ID);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['coordinator'] = CoordinatorPeer::doCount($c);
         $this->messages['coordinator'] = ' coordinator results';
         $this->uris['coordinator'] = 'coordinator/index?filter=1&firstname=' . $text;
     }
     //camp search
     if ($this->getUser()->hasRights('camp_index')) {
         $c = new Criteria();
         $c->add(CampPeer::CAMP_NAME, $text . '%', Criteria::LIKE);
         $this->results['camp'] = CampPeer::doCount($c);
         $this->messages['camp'] = ' camp results';
         $this->uris['camp'] = 'camp/index?filter=1&camp_name=' . $text;
     }
     //airport search
     if ($this->getUser()->hasRights('airport_index')) {
         $c = new Criteria();
         $c->add(AirportPeer::NAME, $text . '%', Criteria::LIKE);
         $this->results['airport'] = AirportPeer::doCount($c);
         $this->messages['airport'] = ' airport results';
         $this->uris['airport'] = 'airport/index?filter=1&name=' . $text;
     }
     //member search
     if ($this->getUser()->hasRights('member_index')) {
         $c = new Criteria();
         if (is_numeric($text)) {
             $c->add(MemberPeer::ID, $text . '%', Criteria::LIKE);
             $this->results['member'] = MemberPeer::doCount($c);
             $this->uris['member'] = 'member/index?filter=1&member_id=' . $text;
         } else {
             $c->addJoin(MemberPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
             $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
             $this->results['member'] = MemberPeer::doCount($c);
             $this->uris['member'] = 'member/index?filter=1&firstname=' . $text;
         }
         $this->messages['member'] = ' member results';
     }
     //pilot search
     if ($this->getUser()->hasRights('pilot_index')) {
         $c = new Criteria();
         $c->addJoin(PilotPeer::MEMBER_ID, MemberPeer::ID, Criteria::LEFT_JOIN);
         $c->addJoin(MemberPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
         $this->results['pilot'] = PilotPeer::doCount($c);
         $this->messages['pilot'] = ' pilot results';
         $this->uris['pilot'] = 'pilot/index?filter=1&firstname=' . $text;
     }
     //pilot request search
     if ($this->getUser()->hasRights('mission_available_list')) {
         $c = new Criteria();
         if ($text) {
             $c->add(PilotRequestPeer::DATE, date('Y-m-d', strtotime($text)), Criteria::GREATER_EQUAL);
         }
         $this->results['pilotRequest'] = PilotRequestPeer::doCount($c);
         $this->messages['pilotRequest'] = ' pilot request results';
         $this->uris['pilotRequest'] = 'pilotRequest/index?filter=1&req_date2=' . $text;
     }
     //mission request search
     if ($this->getUser()->hasRights('mission_request_index')) {
         $c = new Criteria();
         if ($text) {
             $c->add(MissionRequestPeer::REQUESTER_DATE, date('Y-m-d', strtotime($text)), Criteria::GREATER_EQUAL);
         }
         $this->results['missionRequest'] = MissionRequestPeer::doCount($c);
         $this->messages['missionRequest'] = ' missionRequest results';
         $this->uris['missionRequest'] = 'missionRequest/index?filter=1&request_date2=' . $text;
     }
     //mission report search
     if ($this->getUser()->hasRights('mission_report_review')) {
         $c = new Criteria();
         $c->add(MissionReportPeer::COPILOT_NAME, $text . '%', Criteria::LIKE);
         $this->results['missionReport'] = MissionReportPeer::doCount($c);
         $this->messages['missionReport'] = ' missionReport results';
         $this->uris['missionReport'] = 'mission_report/review?filter=1&pilot_name=' . $text;
     }
     //role search
     if (1 == 1) {
         $c = new Criteria();
         if (isset($text)) {
             $c->add(RolePeer::TITLE, $text . '%', Criteria::LIKE);
         }
         $this->results['role'] = RolePeer::doCount($c);
         $this->messages['role'] = ' role results';
         $this->uris['role'] = 'role_permission/index?search_by=' . $text;
     }
     $this->text = $text;
 }
Ejemplo n.º 10
0
 public function executeInstrumentNotication(sfWebRequest $request)
 {
     $c = new Criteria();
     $c->add(PersonRolePeer::PERSON_ID, $this->getUser()->getId());
     $c->addJoin(PersonRolePeer::ROLE_ID, RoleNotificationPeer::ROLE_ID);
     $personNotification = RoleNotificationPeer::doSelect($c);
     $this->mid = 0;
     foreach ($personNotification as $key => $value) {
         $this->mid = $value->getMid();
         $this->notification = $value->getNotification();
         //5. person add
         if ($this->mid == 5 && ($this->notification == 2 || $this->notification == 3)) {
             $c = new Criteria();
             $c->addDescendingOrderByColumn(PersonPeer::ID);
             $c->setLimit(5);
             $this->newperson = PersonPeer::doSelect($c);
         }
     }
     $this->host = $request->getHost();
     $this->memberId = $this->getUser()->getMemberId();
     //$query = "SELECT COUNT(pilot_request.accepted) FROM pilot_request ";
     //$query .="WHERE pilot_request.accepted = 1 AND pilot_request.processed = 1 AND pilot_request.member_id = ".$this->memberId;
     //$con = Propel::getConnection();
     //$stmt = $con->prepare($query);
     //$stmt->execute();
     /*if($rs = $stmt->fetch(PDO::FETCH_NUM)) {
         $count = (int)$rs[0];
       }else{
         $count = 0;
       }*/
     $c = new Criteria();
     $c->add(PilotRequestPeer::ACCEPTED, 1);
     $c->add(PilotRequestPeer::PROCESSED, 1);
     $c->add(PilotRequestPeer::MEMBER_ID, $this->memberId);
     $this->totalAccepted = PilotRequestPeer::doCount($c);
     /* $this->memberId = $this->getUser()->getMemberId();
          $query = "SELECT COUNT(pilot_request.accepted) FROM pilot_request ";
          $query .="WHERE pilot_request.accepted = 0 AND pilot_request.member_id = $this->memberId";
          $con = Propel::getConnection();
          $stmt = $con->prepare($query);
          $stmt->execute();
     
          if($rs = $stmt->fetch(PDO::FETCH_NUM)) {
            $count = (int)$rs[0];
          }else{
            $count = 0;
          }*/
     $c = new Criteria();
     $c->add(PilotRequestPeer::ACCEPTED, 0);
     $c->add(PilotRequestPeer::MEMBER_ID, $this->memberId);
     $this->totaldeclined = PilotRequestPeer::doCount($c);
     $c = new Criteria();
     $c->add(MissionLegPeer::PILOT_ID, $this->getUser()->getPilotId());
     $c->add(MissionLegPeer::CANCEL_MISSION_LEG, 0);
     $this->totalMissionCancellation = MissionLegPeer::doCount($c);
     //total signup events count
     $pilot_id = $this->getUser()->getPilotId();
     if ($pilot_id) {
         $pilot = PilotPeer::retrieveByPK($pilot_id);
         $member_id = $pilot->getMemberId();
         $date = date('Y-m-d');
         $c = new Criteria();
         $c->add(EventReservationPeer::MEMBER_ID, $member_id, Criteria::EQUAL);
         $c->addJoin(EventPeer::ID, EventReservationPeer::EVENT_ID);
         $c->add(EventPeer::EVENT_DATE, $date, Criteria::GREATER_EQUAL);
         $this->totalSignupEvents = EventReservationPeer::doCount($c);
     }
     //
 }
Ejemplo n.º 11
0
 /**
  * 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(PilotRequestPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(PilotRequestPeer::DATABASE_NAME);
         $criteria->add(PilotRequestPeer::ID, $pks, Criteria::IN);
         $objs = PilotRequestPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Ejemplo n.º 12
0
 public function executeSave(sfWebRequest $request)
 {
     if ($request->isMethod('post')) {
         $mission_leg = MissionLegPeer::retrieveByPK($request->getParameter('id'));
         if (isset($mission_leg) && $mission_leg instanceof MissionLeg) {
             $leg_number = $request->getParameter('leg_number');
             $waiver_rec = $request->getParameter('waiver_rec');
             $coor_web_off = $request->getParameter('coor_web_off');
             $cancel_reason = $request->getParameter('cancel_reason');
             $cancel_comment = $request->getParameter('cancel_comment');
             $co_pilot_wanted = $request->getParameter('cop_wanted');
             $private_coor = $request->getParameter('private_coor_note');
             $public_coor = $request->getParameter('public_coor_note');
             if ($request->getParameter('leg_id')) {
                 $leg_id = $request->getParameter('leg_id');
                 $is_leg = MissionLegPeer::getByIdNumber($mission_leg->getMissionId(), $leg_number);
                 if (isset($is_leg) && $is_leg instanceof MissionLeg) {
                     if ($mission_leg->getLegNumber() != $leg_number) {
                         $this->getUser()->setFlash('success', 'Leg number ' . $leg_number . ' has already used in Leg #' . $request->getParameter('leg_id') . '!');
                         $this->redirect('@leg_edit?id=' . $leg_id);
                     }
                 }
             } else {
                 $this->redirect($request->getReferer());
             }
             $mission_leg->setLegNumber($leg_number);
             $mission_leg->setWaiverReceived($waiver_rec);
             if ($coor_web_off == 'on') {
                 $mission_leg->setWebCoordinated(1);
             } else {
                 $mission_leg->setWebCoordinated(0);
             }
             $mission_leg->setCancelled($cancel_reason);
             $mission_leg->setCancelComment($cancel_comment);
             if ($co_pilot_wanted == 'on') {
                 $mission_leg->setCopilotWanted(1);
             } else {
                 $mission_leg->setCopilotWanted(0);
             }
             if ($request->getParameter('coordinator_name') && $request->getParameter('coordinator_id')) {
                 $coordinator = new Coordinator();
                 $coordinator->setMemberId($request->getParameter('coordinator_id'));
                 if ($coordinator->save()) {
                     /*$coordinatorPerson=$coordinator->getMember()->getPerson();
                       $eoordiEmail=$coordinatorPerson->getEmail();
                       $legNo=$mission_leg->getLegNumber();
                       $missionExter=$mission_leg->getMission()->getExternalId();
                       $legId=$missionExter."-".$legNo;
                       //echo $legId;
                       if($eoordiEmail){                       
                         $this->getComponent('mail', 'missionCoordinatedAdded', array('email' => $eoordiEmail, 'leg_id' => $legId, 'name' => $coordinatorPerson->getFirstName().' '.$coordinatorPerson->getLastName()));
                       }*/
                 }
                 $codinatorId = $coordinator->getId();
                 $mission_leg->setCoordinatorId($codinatorId);
             }
             // die();
             // New add 28-02-2011
             $pilot_id = $request->getParameter('pilot_id');
             $copilot_id = $request->getParameter('copilot_id');
             $backup_pilot_id = $request->getParameter('backup_pilot_id');
             $backup_copilot_id = $request->getParameter('backup_copilot_id');
             $miss_assis_id = $request->getParameter('miss_assis_id');
             $backup_miss_assis_id = $request->getParameter('backup_miss_assis_id');
             $pilot_aircraft_id = $request->getParameter('pilot_aircraft_id');
             /// Manual add pilot
             if ($request->getParameter('pilot_name') && $pilot_id) {
                 $pilotInfo = PilotPeer::retrieveByPK($pilot_id);
                 $memberId = $pilotInfo->getMemberId();
                 $pilotRequester = PilotRequestPeer::getPilotByRequestersLegIdMemberId($request->getParameter('id'), $memberId);
                 if (!$pilotRequester) {
                     // Manual Add pilot request
                     $pilot_request = new PilotRequest();
                     $pilot_request->setMemberId($memberId);
                     $pilot_request->setLegId($request->getParameter('id'));
                     $pilot_request->setMissionAssistantWanted(0);
                     $pilot_request->setIfrBackupWanted(0);
                     $pilot_request->setAccepted(1);
                     $pilot_request->setProcessed(1);
                     $pilot_request->setPilotStatus(0);
                     $pilot_request->setOnHold(0);
                     $pilot_request->setComment('Manual Assinged');
                     $pilot_request->setCreatedAt(date('Y-m-d H:i:s'));
                     $pilotReqSave = $pilot_request->save();
                 } else {
                     //if pilot exist pilot request will be update
                     $pilotRequester->setAccepted(1);
                     $pilotRequester->setProcessed(1);
                     $pilotRequester->setPilotStatus(0);
                     $pilotRequester->setCreatedAt(date('Y-m-d H:i:s'));
                     $pilotReqSave = $pilotRequester->save();
                 }
                 // Without Accepted pilot all pilot requesters will be decline
                 $notAcceptedPilots = PilotRequestPeer::getByRequestersLegIdMemberId($request->getParameter('id'), $memberId);
                 if ($notAcceptedPilots) {
                     foreach ($notAcceptedPilots as $pilotrequester) {
                         $pilotrequester->setAccepted(0);
                         $pilotrequester->setProcessed(0);
                         $pilotrequester->setPilotStatus(3);
                         // 2 Pilot Delete 1 Pilot Reopen 3 Pilot Decline
                         $pilotrequester->save();
                         // Member information
                         $member = MemberPeer::retrieveByPK($pilotrequester->getMemberId());
                         // Person information
                         $person = PersonPeer::retrieveByPK($member->getPersonId());
                         $frist_name = $person->getFirstName();
                         $last_name = $person->getLastName();
                         $name = $frist_name . ' ' . $last_name;
                         $email = $person->getEmail();
                         // Leg information
                         $legNo = $mission_leg->getLegNumber();
                         $missionExter = $mission_leg->getMission()->getExternalId();
                         $missionDate = $mission_leg->getMission()->getMissionDate();
                         //Send email who will not accepted
                         if ($email) {
                             $this->getComponent('mail', 'pilotRequestNotAccepted', array('email' => $email, 'name' => $name, 'externalID' => $missionExter, 'leg_number' => $legNo, 'missionDate' => $missionDate));
                         }
                     }
                 }
                 // added pilot and send email to mission coordinator
                 if ($pilotReqSave) {
                     $mission_leg->setPilotId($request->getParameter('pilot_id'));
                     $member = MemberPeer::retrieveByPK($memberId);
                     $pilotPerson = PersonPeer::retrieveByPK($member->getPersonId());
                     $pilot_name = $pilotPerson->getTitle() . " " . $pilotPerson->getFirstName() . " " . $pilotPerson->getLastName();
                     $coordinator = CoordinatorPeer::retrieveByPK($mission_leg->getCoordinatorId());
                     if ($coordinator && $coordinator->getMemberId()) {
                         $coordinatorPerson = $coordinator->getMember()->getPerson();
                         $coordinatorEmail = $coordinatorPerson->getEmail();
                         $legNo = $mission_leg->getLegNumber();
                         $missionExter = $mission_leg->getMission()->getExternalId();
                         $legId = $missionExter . "-" . $legNo;
                         //echo $legId;
                         if ($coordinatorEmail) {
                             $this->getComponent('mail', 'missionPilotAdded', array('email' => $coordinatorEmail, 'leg_id' => $legId, 'pilot_name' => $pilot_name, 'name' => $coordinatorPerson->getTitle() . ' ' . $coordinatorPerson->getFirstName() . ' ' . $coordinatorPerson->getLastName()));
                         }
                     }
                 }
                 $mission_leg->setPilotId($request->getParameter('pilot_id'));
             }
             if ($copilot_id) {
                 $mission_leg->setCopilotId($request->getParameter('copilot_id'));
             }
             if ($backup_pilot_id) {
                 $mission_leg->setBackupPilotId($request->getParameter('backup_pilot_id'));
             }
             if ($backup_copilot_id) {
                 $mission_leg->setBackupCopilotId($request->getParameter('backup_copilot_id'));
             }
             if ($miss_assis_id) {
                 $mission_leg->setMissAssisId($request->getParameter('miss_assis_id'));
             }
             if ($backup_miss_assis_id) {
                 $mission_leg->setBackupMissAssisId($request->getParameter('backup_miss_assis_id'));
             }
             if ($pilot_aircraft_id) {
                 $mission_leg->setPilotAircraftId($request->getParameter('pilot_aircraft_id'));
             }
             // End
             $mission_leg->setPrivateCNote($private_coor);
             $mission_leg->setPublicCNote($public_coor);
             $mission_leg->setCancelMissionLeg(1);
             $mission_leg->save();
             $this->getUser()->setFlash('success', 'Mission Leg #' . $request->getParameter('leg_id') . ' has edited !');
             if ($request->getParameter('leg_id')) {
                 $back = '@leg_view?id=' . $request->getParameter('leg_id');
             } else {
                 $back = $request->getReferer();
             }
             $this->redirect($back);
         }
     }
 }
Ejemplo n.º 13
0
 public function executeAjaxGetPilotRequests(sfWebRequest $request)
 {
     # arrived requests
     $this->mission_requests = MissionRequestPeer::getRsNonProcessed($count);
     $this->mission_requests_count = $count;
     # available missions
     $this->available_mission_legs = MissionLegPeer::getRsAvailable($count);
     $this->available_mission_legs_count = $count;
     # coordinated missions
     $this->coordinated_mission_legs = MissionLegPeer::getRsCoordinated($count);
     $this->coordinated_mission_legs_count = $count;
     # pilot requests
     //return $this->renderText($request->getParameter('req_date1').'  '.$request->getParameter('req_date2'));
     # filter
     $this->processPilotRequestFilter($request);
     $this->pager = PilotRequestPeer::getPager($this->max, $this->page, $this->req_date1, $this->req_date2, $this->miss_date1, $this->miss_date2, $this->not_process, $this->hold, $this->process);
     $this->pilot_reqs = $this->pager->getResults();
     $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text'));
     # member requests
     $c = new Criteria();
     $c->add(ApplicationTempPeer::RENEWAL, null, Criteria::ISNULL);
     $c->add(ApplicationTempPeer::MEMBER_ID, null, Criteria::ISNULL);
     $c->add(ApplicationTempPeer::PROCESSED_DATE, null, Criteria::ISNULL);
     $c->setLimit(50);
     $this->member_requests = ApplicationTempPeer::doSelect($c);
     $this->transportations = array('air_mission' => 'Air Mission', 'ground_mission' => 'Ground Mission', 'commercial_mission' => 'Commercial Mission');
 }
Ejemplo n.º 14
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;
                 }
             }
         }
     }
 }
Ejemplo n.º 15
0
?>
<table class="pass">
    <?php 
if (isset($message)) {
    ?>
<tr>
    <td colspan="4"><?php 
    echo $message;
    ?>
</td>
</tr>
    <?php 
}
?>
    <?php 
$pilot_req = PilotRequestPeer::retrieveByPK($pilot_req_id);
#get passengers assigned to this pilot date
if (isset($pilot_req) && $pilot_req instanceof PilotRequest) {
    if ($pilot_req->getGroupCampId()) {
        $camp_id = $pilot_req->getGroupCampId();
        $pilot = PilotPeer::getByMemberId($pilot_req->getMemberId());
        #get Missions which has selected Camp
        if (isset($camp_id) && $pilot) {
            //                            $camp_pilot_passengers = CampPilotPassengerPeer::getByCampPilot($camp_id, $pilot_req->getMemberId());
            //                            foreach ($camp_pilot_passengers as $cpp){
            $passengers = array();
            $missions = MissionPeer::getByCampId($camp_id);
            foreach ($missions as $miss) {
                $legs = MissionLegPeer::getbyMissId($miss->getId());
                if (isset($legs) && $legs[0]->getPilotId() == $pilot->getId() && $miss->getMissionDate('Ymd') == $flight_date) {
                    $passengers[$miss->getPassengerId()] = $miss;
Ejemplo n.º 16
0
 /**
  * Selects a collection of PilotDate objects pre-filled with all related objects except Member.
  *
  * @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 PilotDate objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptMember(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     foreach (sfMixer::getCallables('BasePilotDatePeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable) {
         call_user_func($callable, 'BasePilotDatePeer', $c, $con);
     }
     $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);
     }
     PilotDatePeer::addSelectColumns($c);
     $startcol2 = PilotDatePeer::NUM_COLUMNS - PilotDatePeer::NUM_LAZY_LOAD_COLUMNS;
     PilotRequestPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (PilotRequestPeer::NUM_COLUMNS - PilotRequestPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(PilotDatePeer::PILOT_REQUEST_ID), array(PilotRequestPeer::ID), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = PilotDatePeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = PilotDatePeer::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 = PilotDatePeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             PilotDatePeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined PilotRequest rows
         $key2 = PilotRequestPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = PilotRequestPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = PilotRequestPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 PilotRequestPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (PilotDate) to the collection in $obj2 (PilotRequest)
             $obj2->addPilotDate($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }