예제 #1
0
 public function flightdata(Request $request)
 {
     $flight = $request->DATA2;
     if (strtolower($flight) == 'bid') {
         // Bids are not supported just yet so lets error out
         return '0|Bids Not Supported In VAOS Yet';
     } else {
         if (is_numeric($flight)) {
             return '0|No Airline Code';
         }
         $flightinfo = $this->getProperFlightNum($flight);
         $route = Schedule::where('code', $flightinfo['code'])->where('flightnum', $flightinfo['flightnum'])->first();
         // lets separate the eloquent array into a single thing to send to the view
         $rte;
         /*
         foreach ($route as $r)
         {
         	$rte->depicao = $r->depicao;
         	$rte->arricao = $r->arricao;
         	$rte->route = $r->route;
         	$rte->registration = $r->registration;
         	$rte->flightlevel = $r->flightlevel;
         }
         */
         $status = '1|flightplan';
         return view('ACARS.xacars')->with(['status' => '1|flightplan', 'routedata' => $route]);
         //"1|flightplan $route->depicao $route->arricao $route->arricao $route->route 180 30 IFR $route->registration $route->flightlevel";
     }
 }
예제 #2
0
 /**
  * @param Request $request
  */
 public function get(Request $request)
 {
     // find out if this is calling the ID or the airport identifier
     if ($request->has('depicao')) {
         $route = Schedule::where('depicao', $request->depicao)->get();
     }
     if ($request->has('arricao')) {
         $route = Schedule::where('arricao', $request->arricao)->get();
     }
     if ($request->has('id')) {
         $route = Schedule::find($request->id);
     }
     return $route;
 }
 protected function getInput()
 {
     $type = ['getup' => 'warning', 'work' => 'primary', 'learning' => 'success', 'exercise' => 'info', 'waste' => 'danger', 'finish' => 'default'];
     $date = date('Y-m-d');
     $check = Input::get('data.s_slug');
     if ($check == 'getfin') {
         $g = Schedule::where('s_slug', 'getup')->where('created_at', 'like', '%' . $date . '%')->first();
         $f = Schedule::where('s_slug', 'finish')->where('created_at', 'like', '%' . $date . '%')->first();
         if ($g && $f) {
             return false;
         } elseif ($g) {
             $slug = 'finish';
         } else {
             $slug = 'getup';
         }
     } else {
         $slug = Input::get('data.s_slug');
     }
     return ['s_name' => Input::get('data.s_name'), 's_slug' => $slug, 's_type' => $type[$slug]];
 }