/**
  *     Order
  *     @param  integer $id
  */
 function showOrder($id = 0)
 {
     $item = new AdFlightAdvertiserManagerModel();
     $data = $item->where('flight_id', $id)->orderby('order', 'ASC')->get();
     $this->data['data'] = $data;
     $this->data['assetURL'] = $this->assetURL;
     $this->layout->content = View::make('showOrder', $this->data);
 }
 /**
  *     Load Modal Add/Edit Flight
  *     @param  integer  $id
  *     @return Response
  */
 public function loadModal()
 {
     if (Request::ajax()) {
         $id = Input::get('id');
         $flightId = Input::get('flightId');
         $flightName = Input::get('flightName');
         $adId = Input::get('adId');
         $status = TRUE;
         $view = NULL;
         $this->data['flightId'] = $flightId;
         $this->data['flightName'] = $flightName;
         $this->data['adId'] = $adId;
         $this->data['id'] = $id;
         // check if flightPublisher exist
         $flightAd = AdFlightAdvertiserManagerModel::where('ad_id', $adId)->where('flight_id', $flightId)->first();
         if ($id != 0 && $flightAd) {
             $this->data['data'] = $flightAd;
         }
         $view = View::make('flightModal', $this->data)->render();
         return Response::json(array('status' => $status, 'view' => $view));
     }
 }