Ejemplo n.º 1
0
 public function executeForm(sfWebRequest $request)
 {
     $this->processFilterForm($request);
     //check if personal flight is checked
     //if checked then fetch missions matches
     //if no then normal filter
     $this->pager = null;
     if ($this->match_p_f != null and $this->match_p_f != '') {
         $this->pager = MissionLegPeer::getByFilterPF($this->match_p_f, sfConfig::get('app_max_missiion_available_per_page', 10));
     } else {
         //if not available then return null
         if ($this->not_available == 1) {
             $this->getUser()->setFlash('warning', 'You have checked "Not Available" in Availablity form!');
         } else {
             $this->pager = MissionLegPeer::getByFilter($this->max = 10, $this->page = 1, $this->sort_by, $this->availability, $this->first_date, $this->last_date, $this->types, $this->no_weekday, $this->no_weekend, $this->as_ma, $this->orgin, $this->dest, $this->airport_id, $this->date_range1, $this->date_range2, $this->filled, $this->open, $this->pilot, $this->mission_assistant, $this->ifr_backup, $this->wing, $this->ident, $this->city, $this->state, $this->zip, $this->day_1, $this->day_2, $this->day_3, $this->day_4, $this->day_5, $this->day_6, $this->day_7, $this->all_type, $this->max_pass, $this->max_wei, $this->max_dist, $this->max_eff, $this->home_base);
         }
     }
     if ($this->pager != null) {
         $this->mission_legs = $this->pager->getResults();
     } else {
         $this->mission_legs = null;
     }
     $this->missions = MissionPeer::getByMayInterested();
     $this->miss_pre = array();
     $this->miss_array = array();
     $this->miss_ids = array();
     foreach ($this->mission_legs as $leg) {
         $this->miss_ids[$leg->getMissionId()] = $leg->getMissionId();
     }
     foreach ($this->mission_legs as $leg) {
         if ($this->miss_ids[$leg->getMissionId()] == $leg->getMissionId()) {
             $this->miss_array[$leg->getMissionId()] = $leg->getMissionId();
         }
     }
 }