Simple PIREP overview page (map not working atm)
This commit is contained in:
4
Makefile
4
Makefile
@@ -53,6 +53,10 @@ update: build
|
||||
.PHONY: reset
|
||||
reset: clean
|
||||
@php composer.phar dump-autoload
|
||||
@make reload-db
|
||||
|
||||
.PHONY: reload-db
|
||||
reload-db:
|
||||
@php artisan database:create --reset
|
||||
@php artisan migrate:refresh --seed
|
||||
|
||||
|
||||
@@ -335,8 +335,9 @@ pireps:
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: KAUS
|
||||
arr_airport_id: KJFK
|
||||
flight_time: 21600 # 6 hours
|
||||
flight_time: 180 # 6 hours
|
||||
status: 0
|
||||
route: PLMMR2 SPA Q22 BEARI FAK PHLBO3
|
||||
notes: just a pilot report
|
||||
- id: pirepid_2
|
||||
user_id: 1
|
||||
@@ -345,8 +346,9 @@ pireps:
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
flight_time: 21600 # 6 hours
|
||||
flight_time: 180 # 6 hours
|
||||
status: 0
|
||||
route: PLMMR2 SPA Q22 BEARI FAK PHLBO3
|
||||
notes: just a pilot report
|
||||
- id: pirepid_3
|
||||
user_id: 1
|
||||
@@ -355,8 +357,9 @@ pireps:
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
flight_time: 21600 # 6 hours
|
||||
flight_time: 180 # 6 hours
|
||||
status: 0
|
||||
route: PLMMR2 SPA Q22 BEARI FAK PHLBO3
|
||||
notes: just a pilot report
|
||||
|
||||
pirep_fields:
|
||||
|
||||
@@ -107,7 +107,8 @@ class PirepController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$pirep = Pirep::where('id', $id);
|
||||
#$pirep = Pirep::where('id', $id);
|
||||
$pirep = $this->pirepRepo->find($id);
|
||||
return $this->view('pireps.show', [
|
||||
'pirep' => $pirep,
|
||||
]);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
return [
|
||||
|
||||
'name' => 'phpvms',
|
||||
'name' => env('PHPVMS_VA_NAME', 'phpvms'),
|
||||
'env' => env('APP_ENV', 'dev'),
|
||||
'debug' => env('APP_DEBUG', true),
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
@@ -11,6 +11,7 @@ APP_DEBUG=true
|
||||
APP_LOCALE=en
|
||||
|
||||
PHPVMS_INSTALLED=true
|
||||
PHPVMS_VA_NAME="phpvms"
|
||||
VACENTRAL_API_KEY=
|
||||
|
||||
APP_LOG=daily
|
||||
|
||||
@@ -80,6 +80,30 @@ class EnvironmentService
|
||||
return $opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a key/value pair in the env file
|
||||
* @param $key
|
||||
* @param $value
|
||||
*/
|
||||
public static function changeEnvironmentVariable($key, $value, $quoted=false)
|
||||
{
|
||||
$env_file = \App::environmentFilePath();
|
||||
|
||||
if (\is_bool(env($key))) {
|
||||
$old = env($key) ? 'true' : 'false';
|
||||
}
|
||||
|
||||
if($quoted) {
|
||||
$value = '"'.$value.'"';
|
||||
}
|
||||
|
||||
if (file_exists($env_file)) {
|
||||
file_put_contents($env_file, str_replace(
|
||||
"$key=" . $old, "$key=" . $value, file_get_contents($env_file)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the template file name and write it out
|
||||
* @param $opts
|
||||
|
||||
@@ -11,81 +11,3 @@ function phpvms_vacentral_airport_lookup(icao, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function phpvms_render_airspace_map(opts) {
|
||||
opts = __parse_opts(opts);
|
||||
var map = __draw_base_map(opts);
|
||||
if (opts.set_marker == true) {
|
||||
L.marker(coords).addTo(map);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
function __parse_opts(opts) {
|
||||
_.defaults(opts, {
|
||||
render_elem: 'map',
|
||||
overlay_elem: '',
|
||||
lat: 0,
|
||||
lon: 0,
|
||||
zoom: 12,
|
||||
layers: [],
|
||||
set_marker: false,
|
||||
});
|
||||
|
||||
return opts;
|
||||
}
|
||||
|
||||
function __draw_base_map(opts) {
|
||||
|
||||
var coords = [opts.lat, opts.lon];
|
||||
|
||||
/*var openaip_airspace_labels = new L.TileLayer.WMS(
|
||||
"http://{s}.tile.maps.openaip.net/geowebcache/service/wms", {
|
||||
maxZoom: 14,
|
||||
minZoom: 12,
|
||||
layers: 'openaip_approved_airspaces_labels',
|
||||
tileSize: 1024,
|
||||
detectRetina: true,
|
||||
subdomains: '12',
|
||||
format: 'image/png',
|
||||
transparent: true
|
||||
});
|
||||
|
||||
openaip_airspace_labels.addTo(map);*/
|
||||
|
||||
var opencyclemap_phys_osm = new L.TileLayer(
|
||||
'http://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=f09a38fa87514de4890fc96e7fe8ecb1', {
|
||||
maxZoom: 14,
|
||||
minZoom: 4,
|
||||
format: 'image/png',
|
||||
transparent: true
|
||||
});
|
||||
|
||||
var openaip_cached_basemap = new L.TileLayer("http://{s}.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/{z}/{x}/{y}.png", {
|
||||
maxZoom: 14,
|
||||
minZoom: 4,
|
||||
tms: true,
|
||||
detectRetina: false,
|
||||
subdomains: '12',
|
||||
format: 'image/png',
|
||||
transparent: true
|
||||
});
|
||||
|
||||
var openaip_basemap_phys_osm = L.featureGroup([opencyclemap_phys_osm, openaip_cached_basemap]);
|
||||
|
||||
var map = L.map('map', {
|
||||
layers: [openaip_basemap_phys_osm],
|
||||
center: coords,
|
||||
zoom: opts.zoom,
|
||||
scrollWheelZoom: false,
|
||||
}).setView(coords, opts.zoom);
|
||||
|
||||
var attrib = L.control.attribution({position: 'bottomleft'});
|
||||
attrib.addAttribution("<a href=\"https://www.thunderforest.com\" target=\"_blank\" style=\"\">Thunderforest</a>");
|
||||
attrib.addAttribution("<a href=\"https://www.openaip.net\" target=\"_blank\" style=\"\">openAIP</a>");
|
||||
attrib.addAttribution("<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\" style=\"\">OpenStreetMap</a> contributors");
|
||||
attrib.addAttribution("<a href=\"https://www.openweathermap.org\" target=\"_blank\" style=\"\">OpenWeatherMap</a>");
|
||||
|
||||
attrib.addTo(map);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
78
public/assets/system/js/system.js
Normal file
78
public/assets/system/js/system.js
Normal file
@@ -0,0 +1,78 @@
|
||||
function phpvms_render_airspace_map(opts) {
|
||||
opts = __parse_opts(opts);
|
||||
var map = __draw_base_map(opts);
|
||||
if (opts.set_marker == true) {
|
||||
L.marker(coords).addTo(map);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
function __parse_opts(opts) {
|
||||
_.defaults(opts, {
|
||||
render_elem: 'map',
|
||||
overlay_elem: '',
|
||||
lat: 0,
|
||||
lon: 0,
|
||||
zoom: 12,
|
||||
layers: [],
|
||||
set_marker: false,
|
||||
});
|
||||
|
||||
return opts;
|
||||
}
|
||||
|
||||
function __draw_base_map(opts) {
|
||||
|
||||
var coords = [opts.lat, opts.lon];
|
||||
|
||||
/*var openaip_airspace_labels = new L.TileLayer.WMS(
|
||||
"http://{s}.tile.maps.openaip.net/geowebcache/service/wms", {
|
||||
maxZoom: 14,
|
||||
minZoom: 12,
|
||||
layers: 'openaip_approved_airspaces_labels',
|
||||
tileSize: 1024,
|
||||
detectRetina: true,
|
||||
subdomains: '12',
|
||||
format: 'image/png',
|
||||
transparent: true
|
||||
});
|
||||
|
||||
openaip_airspace_labels.addTo(map);*/
|
||||
|
||||
var opencyclemap_phys_osm = new L.TileLayer(
|
||||
'http://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=f09a38fa87514de4890fc96e7fe8ecb1', {
|
||||
maxZoom: 14,
|
||||
minZoom: 4,
|
||||
format: 'image/png',
|
||||
transparent: true
|
||||
});
|
||||
|
||||
var openaip_cached_basemap = new L.TileLayer("http://{s}.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/{z}/{x}/{y}.png", {
|
||||
maxZoom: 14,
|
||||
minZoom: 4,
|
||||
tms: true,
|
||||
detectRetina: false,
|
||||
subdomains: '12',
|
||||
format: 'image/png',
|
||||
transparent: true
|
||||
});
|
||||
|
||||
var openaip_basemap_phys_osm = L.featureGroup([opencyclemap_phys_osm, openaip_cached_basemap]);
|
||||
|
||||
var map = L.map('map', {
|
||||
layers: [openaip_basemap_phys_osm],
|
||||
center: coords,
|
||||
zoom: opts.zoom,
|
||||
scrollWheelZoom: false,
|
||||
}).setView(coords, opts.zoom);
|
||||
|
||||
var attrib = L.control.attribution({position: 'bottomleft'});
|
||||
attrib.addAttribution("<a href=\"https://www.thunderforest.com\" target=\"_blank\" style=\"\">Thunderforest</a>");
|
||||
attrib.addAttribution("<a href=\"https://www.openaip.net\" target=\"_blank\" style=\"\">openAIP</a>");
|
||||
attrib.addAttribution("<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\" style=\"\">OpenStreetMap</a> contributors");
|
||||
attrib.addAttribution("<a href=\"https://www.openweathermap.org\" target=\"_blank\" style=\"\">OpenWeatherMap</a>");
|
||||
|
||||
attrib.addTo(map);
|
||||
|
||||
return map;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>@yield('title') - phpvms admin</title>
|
||||
<title>@yield('title') - {!! config('app.name') !!} admin</title>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
@@ -88,6 +88,7 @@
|
||||
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
|
||||
|
||||
<script src="{!! public_asset('/assets/admin/js/admin.js') !!}"></script>
|
||||
<script src="{!! public_asset('/assets/system/js/system.js') !!}"></script>
|
||||
|
||||
<script>
|
||||
rivets.configure({
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>phpvms4 admin</title>
|
||||
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
|
||||
name='viewport'>
|
||||
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/img/admin/favicon.ico"/>
|
||||
<link rel="stylesheet"
|
||||
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2/css/select2.min.css">
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/2.3.3/css/AdminLTE.min.css">
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/2.3.3/css/skins/_all-skins.min.css">
|
||||
{{-- <link rel="stylesheet" href="/vendor/openlayers/ol.css" type="text/css"> --}}
|
||||
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css"/>
|
||||
|
||||
<!-- Ionicons -->
|
||||
{{--<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">--}}
|
||||
|
||||
<style>
|
||||
section.content-header h1 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
</style>
|
||||
@yield('css')
|
||||
</head>
|
||||
|
||||
<body class="skin-blue sidebar-mini">
|
||||
@if (!Auth::guest())
|
||||
<div class="wrapper">
|
||||
<!-- Main Header -->
|
||||
<header class="main-header">
|
||||
|
||||
<!-- Logo -->
|
||||
<a href="#" class="logo">
|
||||
<b>phpvms<sup>7</sup></b>
|
||||
</a>
|
||||
|
||||
<!-- Header Navbar -->
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
<!-- Navbar Right Menu -->
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<!-- Tasks: style can be found in dropdown.less -->
|
||||
<li class="dropdown tasks-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-flag-o"></i>
|
||||
<span class="label label-danger">10</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header">10 PIREPs to approve</li>
|
||||
<li>
|
||||
<!-- inner menu: contains the actual data -->
|
||||
<ul class="menu">
|
||||
<li><!-- Task item -->
|
||||
<a href="#">
|
||||
<h3>
|
||||
Design some buttons
|
||||
<small class="pull-right">20%</small>
|
||||
</h3>
|
||||
<div class="progress xs">
|
||||
<div class="progress-bar progress-bar-aqua"
|
||||
style="width: 20%" role="progressbar"
|
||||
aria-valuenow="20" aria-valuemin="0"
|
||||
aria-valuemax="100">
|
||||
<span class="sr-only">20% Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li><!-- end task item -->
|
||||
...
|
||||
</ul>
|
||||
</li>
|
||||
<li class="footer">
|
||||
<a href="#">View all tasks</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- User Account Menu -->
|
||||
<li class="dropdown user user-menu">
|
||||
<!-- Menu Toggle Button -->
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<!-- The user image in the navbar-->
|
||||
<img src="http://infyom.com/images/logo/blue_logo_150x150.jpg"
|
||||
class="user-image" alt="User Image"/>
|
||||
<!-- hidden-xs hides the username on small devices so only the image appears. -->
|
||||
<span class="hidden-xs">{!! Auth::user()->name !!}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- The user image in the menu -->
|
||||
<li class="user-header">
|
||||
<img src="http://infyom.com/images/logo/blue_logo_150x150.jpg"
|
||||
class="img-circle" alt="User Image"/>
|
||||
<p>
|
||||
{!! Auth::user()->name !!}
|
||||
<small>Member
|
||||
since {!! Auth::user()->created_at->format('M. Y') !!}</small>
|
||||
</p>
|
||||
</li>
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
<a href="#" class="btn btn-default btn-flat">Profile</a>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="{!! url('/logout') !!}"
|
||||
class="btn btn-default btn-flat">Sign out</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
@include('admin.sidebar')
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
<!-- Main Footer -->
|
||||
{{--<footer class="main-footer" style="max-height: 100px;text-align: center">
|
||||
<strong>Copyright © 2017 <a href="#">phpvms</a>.</strong> All rights reserved.
|
||||
</footer>--}}
|
||||
|
||||
</div>
|
||||
@else
|
||||
<nav class="navbar navbar-default navbar-static-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
|
||||
<!-- Collapsed Hamburger -->
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
|
||||
data-target="#app-navbar-collapse">
|
||||
<span class="sr-only">Toggle Navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
<!-- Branding Image -->
|
||||
<a class="navbar-brand" href="{!! url('/') !!}">
|
||||
phpVMS
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="app-navbar-collapse">
|
||||
<!-- Left Side Of Navbar -->
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="{!! url('/home') !!}">Home</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<!-- Authentication Links -->
|
||||
<li><a href="{!! url('/login') !!}">Login</a></li>
|
||||
<li><a href="{!! url('/register') !!}">Register</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div id="page-content-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2/js/select2.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/iCheck/1.0.2/icheck.min.js"></script>
|
||||
<script src="/vendor/pjax/jquery.pjax.js"></script>
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css"
|
||||
rel="stylesheet"/>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/js/bootstrap-editable.min.js"></script>
|
||||
|
||||
<!-- AdminLTE App -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/2.3.3/js/app.min.js"></script>
|
||||
|
||||
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
|
||||
|
||||
{{-- <script src="/vendor/openlayers/ol.js"></script> --}}
|
||||
<script src="/js/admin/admin.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".select2").select2();
|
||||
});
|
||||
</script>
|
||||
@yield('scripts')
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,7 +7,7 @@
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/assets/frontend/img/apple-icon.png">
|
||||
<link rel="icon" type="image/png" href="/assets/frontend/img/favicon.png">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<title>phpvms</title>
|
||||
<title>@yield('title') - {!! config('app.name') !!}</title>
|
||||
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
|
||||
name='viewport'/>
|
||||
<!-- Fonts and icons -->
|
||||
@@ -18,8 +18,19 @@
|
||||
<link href="{!! public_asset('/assets/frontend/css/bootstrap.min.css') !!}" rel="stylesheet"/>
|
||||
<link href="{!! public_asset('/assets/vendor/select2/dist/css/select2.min.css') !!}" rel="stylesheet"/>
|
||||
<link href="{!! public_asset('/assets/frontend/css/now-ui-kit.css') !!}" rel="stylesheet"/>
|
||||
<link href="{!! public_asset('/assets/admin/vendor/leaflet.css') !!}" rel="stylesheet"/>
|
||||
<link href="{!! public_asset('/assets/frontend/css/styles.css') !!}" rel="stylesheet"/>
|
||||
|
||||
<style>
|
||||
.font-large {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.font-medium {
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@yield('css')
|
||||
|
||||
</head>
|
||||
@@ -137,6 +148,7 @@
|
||||
<div class="clearfix" style="height: 200px;"></div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>
|
||||
<script src="{!! public_asset('/assets/frontend/js/core/jquery.3.2.1.min.js') !!}" type="text/javascript"></script>
|
||||
<script src="{!! public_asset('/assets/frontend/js/core/tether.min.js') !!}" type="text/javascript"></script>
|
||||
<script src="{!! public_asset('/assets/frontend/js/core/bootstrap.min.js') !!}" type="text/javascript"></script>
|
||||
@@ -145,6 +157,10 @@
|
||||
<script src="{!! public_asset('/assets/frontend/js/plugins/bootstrap-datepicker.js') !!}" type="text/javascript"></script>
|
||||
<script src="{!! public_asset('/assets/frontend/js/now-ui-kit.js') !!}" type="text/javascript"></script>
|
||||
<script src="{!! public_asset('/assets/vendor/select2/dist/js/select2.js') !!}"></script>
|
||||
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
|
||||
|
||||
<script src="{!! public_asset('/assets/system/js/system.js') !!}"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".select2").select2();
|
||||
|
||||
@@ -1,31 +1,9 @@
|
||||
@extends('admin.app')
|
||||
@extends('layouts.default.app')
|
||||
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1 class="pull-left">{!! $flight->airline->code !!}{!! $flight->flight_number !!}</h1>
|
||||
<h1 class="pull-right">
|
||||
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px"
|
||||
href="{!! route('flights.edit', $flight->id) !!}">Edit</a>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
@include('admin.flights.show_fields')
|
||||
</div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h3>assigned subfleets</h3>
|
||||
<div class="box-body">
|
||||
@include('admin.flights.subfleets')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="row">
|
||||
@include('layouts.default.flights.show_fields')
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
|
||||
36
resources/views/layouts/default/pireps/script.blade.php
Normal file
36
resources/views/layouts/default/pireps/script.blade.php
Normal file
@@ -0,0 +1,36 @@
|
||||
@section('scripts')
|
||||
<script>
|
||||
function changeStatus(values) {
|
||||
var destContainer = '#pirep_' + values.pirep_id + '_container';
|
||||
$.ajax({
|
||||
url: '/admin/pireps/' + values.pirep_id + '/status',
|
||||
data: values,
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
// console.log(data);
|
||||
$(destContainer).replaceWith(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//$(document).ready(function() {
|
||||
$(document).on('submit', 'form.pirep_submit_status', function (event) {
|
||||
console.log(event);
|
||||
|
||||
event.preventDefault();
|
||||
var values = {
|
||||
pirep_id: $(this).attr('pirep_id'),
|
||||
new_status: $(this).attr('new_status')
|
||||
};
|
||||
|
||||
console.log(values);
|
||||
console.log('Changing PIREP ' + values.pirep_id + ' to state ' + values.new_status);
|
||||
|
||||
//var destContainer = '#pirep_' + pirep_id + '_container';
|
||||
//$.pjax.submit(event, destContainer, { push: false, maxCacheLength: 0 });
|
||||
|
||||
changeStatus(values);
|
||||
});
|
||||
//});
|
||||
</script>
|
||||
@endsection
|
||||
97
resources/views/layouts/default/pireps/show.blade.php
Normal file
97
resources/views/layouts/default/pireps/show.blade.php
Normal file
@@ -0,0 +1,97 @@
|
||||
@extends('layouts.default.app')
|
||||
|
||||
@section('title', 'PIREP '.$pirep->getFlightId())
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h2 class="description">{!! $pirep->getFlightId() !!}</h2>
|
||||
</div>
|
||||
<div class="col-md-4 align-right">
|
||||
@if($pirep->status == config('enums.pirep_status.PENDING'))
|
||||
<div class="badge badge-warning "><span class="font-large">Pending</span></div>
|
||||
@elseif($pirep->status === config('enums.pirep_status.ACCEPTED'))
|
||||
<div class="badge badge-success">Accepted</div>
|
||||
@else
|
||||
<div class="badge badge-danger">Rejected</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>Departure/Arrival</td>
|
||||
<td>
|
||||
{!! $pirep->dpt_airport->icao !!} - {!! $pirep->dpt_airport->name !!}
|
||||
<span class="description">to</span>
|
||||
{!! $pirep->arr_airport->icao !!} - {!! $pirep->arr_airport->name !!}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Flight Time</td>
|
||||
<td>
|
||||
{!! Utils::minutesToTimeString($pirep->flight_time) !!}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Route</td>
|
||||
<td>
|
||||
{!! $pirep->route !!}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Notes</td>
|
||||
<td>
|
||||
{!! $pirep->notes !!}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3 class="description">fields</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
<th>Source</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($pirep->fields as $field)
|
||||
<tr>
|
||||
<td>{!! $field->name !!}</td>
|
||||
<td>{!! $field->value !!}</td>
|
||||
<td>{!! $field->source !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3 class="description">map</h3>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="box-body">
|
||||
<div id="map" style="width: 100%; height: 800px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
phpvms_render_airspace_map({
|
||||
lat: {!! $pirep->arr_airport->lat !!},
|
||||
lon: {!! $pirep->dpt_airport->lon !!},
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user