Edit user PIREP
This commit is contained in:
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="UtilsTest" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" singleton="true">
|
<configuration default="false" name="UtilsTest" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" singleton="true">
|
||||||
<TestRunner class="PIREPTest" configuration_file="$PROJECT_DIR$/phpunit.xml" file="$PROJECT_DIR$/tests/UtilsTest.php" scope="Class" use_alternative_configuration_file="true" />
|
<TestRunner class="UtilsTest" configuration_file="$PROJECT_DIR$/phpunit.xml" file="$PROJECT_DIR$/tests/UtilsTest.php" scope="Class" use_alternative_configuration_file="true" />
|
||||||
<method />
|
<method />
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
@@ -5,6 +5,8 @@ namespace App\Http\Controllers\Admin;
|
|||||||
use App\Http\Requests\CreatePirepRequest;
|
use App\Http\Requests\CreatePirepRequest;
|
||||||
use App\Http\Requests\UpdatePirepRequest;
|
use App\Http\Requests\UpdatePirepRequest;
|
||||||
use App\Repositories\AircraftRepository;
|
use App\Repositories\AircraftRepository;
|
||||||
|
use App\Repositories\AirlineRepository;
|
||||||
|
use App\Repositories\AirportRepository;
|
||||||
use App\Repositories\PirepRepository;
|
use App\Repositories\PirepRepository;
|
||||||
use App\Services\PIREPService;
|
use App\Services\PIREPService;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -12,16 +14,26 @@ use Flash;
|
|||||||
use Log;
|
use Log;
|
||||||
use Prettus\Repository\Criteria\RequestCriteria;
|
use Prettus\Repository\Criteria\RequestCriteria;
|
||||||
use Response;
|
use Response;
|
||||||
|
use App\Facades\Utils;
|
||||||
|
|
||||||
|
|
||||||
class PirepController extends BaseController
|
class PirepController extends BaseController
|
||||||
{
|
{
|
||||||
private $pirepRepo, $aircraftRepo, $pirepSvc;
|
private $airportRepo,
|
||||||
|
$airlineRepo,
|
||||||
|
$pirepRepo,
|
||||||
|
$aircraftRepo,
|
||||||
|
$pirepSvc;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
AirportRepository $airportRepo,
|
||||||
|
AirlineRepository $airlineRepo,
|
||||||
AircraftRepository $aircraftRepo,
|
AircraftRepository $aircraftRepo,
|
||||||
PirepRepository $pirepRepo,
|
PirepRepository $pirepRepo,
|
||||||
PIREPService $pirepSvc
|
PIREPService $pirepSvc
|
||||||
) {
|
) {
|
||||||
|
$this->airportRepo = $airportRepo;
|
||||||
|
$this->airlineRepo = $airlineRepo;
|
||||||
$this->aircraftRepo = $aircraftRepo;
|
$this->aircraftRepo = $aircraftRepo;
|
||||||
$this->pirepRepo = $pirepRepo;
|
$this->pirepRepo = $pirepRepo;
|
||||||
$this->pirepSvc = $pirepSvc;
|
$this->pirepSvc = $pirepSvc;
|
||||||
@@ -128,15 +140,20 @@ class PirepController extends BaseController
|
|||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$pirep = $this->pirepRepo->findWithoutFail($id);
|
$pirep = $this->pirepRepo->findWithoutFail($id);
|
||||||
|
|
||||||
if (empty($pirep)) {
|
if (empty($pirep)) {
|
||||||
Flash::error('Pirep not found');
|
Flash::error('Pirep not found');
|
||||||
return redirect(route('admin.pireps.index'));
|
return redirect(route('admin.pireps.index'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hms = Utils::secondsToTimeParts($pirep->flight_time);
|
||||||
|
$pirep->hours = $hms['h'];
|
||||||
|
$pirep->minutes = $hms['m'];
|
||||||
|
|
||||||
return view('admin.pireps.edit', [
|
return view('admin.pireps.edit', [
|
||||||
'pirep' => $pirep,
|
'pirep' => $pirep,
|
||||||
'aircraft' => $this->aircraftList(),
|
'airports' => $this->airportRepo->selectBoxList(),
|
||||||
|
'airlines' => $this->airlineRepo->selectBoxList(),
|
||||||
|
'aircraft' => $this->aircraftRepo->selectBoxList(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +167,9 @@ class PirepController extends BaseController
|
|||||||
{
|
{
|
||||||
$pirep = $this->pirepRepo->findWithoutFail($id);
|
$pirep = $this->pirepRepo->findWithoutFail($id);
|
||||||
|
|
||||||
|
$pirep->flight_time = ((int)$request['hours'] * 60 * 60)
|
||||||
|
+ ((int)$request['minutes'] * 60);
|
||||||
|
|
||||||
if (empty($pirep)) {
|
if (empty($pirep)) {
|
||||||
Flash::error('Pirep not found');
|
Flash::error('Pirep not found');
|
||||||
return redirect(route('admin.pireps.index'));
|
return redirect(route('admin.pireps.index'));
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Frontend;
|
namespace App\Http\Controllers\Frontend;
|
||||||
|
|
||||||
|
use App\Services\PIREPService;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
@@ -22,29 +23,31 @@ class PirepController extends Controller
|
|||||||
$aircraftRepo,
|
$aircraftRepo,
|
||||||
$pirepRepo,
|
$pirepRepo,
|
||||||
$airportRepo,
|
$airportRepo,
|
||||||
$pirepFieldRepo;
|
$pirepFieldRepo,
|
||||||
|
$pirepSvc;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AirlineRepository $airlineRepo,
|
AirlineRepository $airlineRepo,
|
||||||
PirepRepository $pirepRepo,
|
PirepRepository $pirepRepo,
|
||||||
AircraftRepository $aircraftRepo,
|
AircraftRepository $aircraftRepo,
|
||||||
AirportRepository $airportRepo,
|
AirportRepository $airportRepo,
|
||||||
PirepFieldRepository $pirepFieldRepo
|
PirepFieldRepository $pirepFieldRepo,
|
||||||
|
PIREPService $pirepSvc
|
||||||
) {
|
) {
|
||||||
$this->airlineRepo = $airlineRepo;
|
$this->airlineRepo = $airlineRepo;
|
||||||
$this->aircraftRepo = $aircraftRepo;
|
$this->aircraftRepo = $aircraftRepo;
|
||||||
$this->pirepRepo = $pirepRepo;
|
$this->pirepRepo = $pirepRepo;
|
||||||
$this->airportRepo = $airportRepo;
|
$this->airportRepo = $airportRepo;
|
||||||
$this->pirepFieldRepo = $pirepFieldRepo;
|
$this->pirepFieldRepo = $pirepFieldRepo;
|
||||||
|
$this->pirepSvc = $pirepSvc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$pireps = $this->pirepRepo
|
$pireps = Pirep::where('user_id', $user->id)
|
||||||
->where('user_id', $user->id)
|
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('created_at', 'desc')
|
||||||
->get();
|
->paginate();
|
||||||
|
|
||||||
return $this->view('pireps.index', [
|
return $this->view('pireps.index', [
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
@@ -54,11 +57,9 @@ class PirepController extends Controller
|
|||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$aircraft = $this->aircraftList();
|
|
||||||
|
|
||||||
return $this->view('pireps.create', [
|
return $this->view('pireps.create', [
|
||||||
'airports' => $this->airportRepo->selectBoxList(),
|
'airports' => $this->airportRepo->selectBoxList(),
|
||||||
'airlines' => $this->airlineRepo->all()->pluck('name', 'id'),
|
'airlines' => $this->airlineRepo->selectBoxList(),
|
||||||
'aircraft' => $this->aircraftRepo->selectBoxList(),
|
'aircraft' => $this->aircraftRepo->selectBoxList(),
|
||||||
'pirepfields' => $this->pirepFieldRepo->all(),
|
'pirepfields' => $this->pirepFieldRepo->all(),
|
||||||
'fieldvalues' => [],
|
'fieldvalues' => [],
|
||||||
@@ -95,8 +96,7 @@ class PirepController extends Controller
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$pirepSvc = app('\App\Services\PIREPService');
|
$pirep = $this->pirepSvc->create($pirep, $custom_fields);
|
||||||
$pirep = $pirepSvc->create($pirep, $custom_fields);
|
|
||||||
|
|
||||||
//Flash::success('PIREP submitted successfully!');
|
//Flash::success('PIREP submitted successfully!');
|
||||||
return redirect(route('frontend.pireps.index'));
|
return redirect(route('frontend.pireps.index'));
|
||||||
|
|||||||
@@ -67,6 +67,21 @@ class Pirep extends Model
|
|||||||
'arr_airport_id' => 'required',
|
'arr_airport_id' => 'required',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getFlightId()
|
||||||
|
{
|
||||||
|
$flight_id = $this->airline->code;
|
||||||
|
if($this->flight_id) {
|
||||||
|
$flight_id .= $this->flight->flight_number;
|
||||||
|
} else {
|
||||||
|
$flight_id .= $this->flight_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $flight_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Foreign Keys
|
* Foreign Keys
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -169,7 +169,9 @@ input[type="file"] > input[type="button"]::-moz-focus-inner {
|
|||||||
.navbar-toggle,
|
.navbar-toggle,
|
||||||
input:focus,
|
input:focus,
|
||||||
button:focus {
|
button:focus {
|
||||||
outline: 0 !important; }
|
outline: 0 !important;
|
||||||
|
-webkit-box-shadow: inset 0 -2px 0 #2196f3;
|
||||||
|
box-shadow: inset 0 -2px 0 #2196f3; }
|
||||||
|
|
||||||
/* Animations */
|
/* Animations */
|
||||||
.form-control,
|
.form-control,
|
||||||
@@ -816,6 +818,10 @@ hr {
|
|||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
right: 8px; }
|
right: 8px; }
|
||||||
|
|
||||||
|
input {
|
||||||
|
margin-top: 5px;
|
||||||
|
border: none; }
|
||||||
|
|
||||||
.form-control::-moz-placeholder {
|
.form-control::-moz-placeholder {
|
||||||
color: #DDDDDD;
|
color: #DDDDDD;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@@ -837,21 +843,34 @@ hr {
|
|||||||
filter: alpha(opacity=100); }
|
filter: alpha(opacity=100); }
|
||||||
|
|
||||||
.form-control {
|
.form-control {
|
||||||
background-color: #fffcf5;
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.846;
|
||||||
|
color: #666666;
|
||||||
border: medium none;
|
border: medium none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: #66615b;
|
/*-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||||
font-size: 14px;
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);*/
|
||||||
transition: background-color 0.3s ease 0s;
|
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
|
||||||
|
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||||
|
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||||
padding: 7px 18px;
|
padding: 7px 18px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
-webkit-box-shadow: none;
|
/*background-color: $gray-input-bg;
|
||||||
box-shadow: none; }
|
border: medium none;
|
||||||
|
border-radius: $border-radius-base;
|
||||||
|
color: $font-color;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
transition: background-color 0.3s ease 0s;
|
||||||
|
@include input-size($padding-base-vertical, $padding-base-horizontal, $height-base);
|
||||||
|
@include box-shadow(none);*/ }
|
||||||
.form-control:focus {
|
.form-control:focus {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
-webkit-box-shadow: none;
|
outline: 0 !important;
|
||||||
box-shadow: none;
|
border-bottom: 2px solid #2196f3;
|
||||||
outline: 0 !important; }
|
/*-webkit-box-shadow: inset 0 -2px 0 #2196f3;
|
||||||
|
box-shadow: inset 0 -2px 0 #2196f3;*/ }
|
||||||
.has-success .form-control, .has-error .form-control, .has-success .form-control:focus, .has-error .form-control:focus {
|
.has-success .form-control, .has-error .form-control, .has-success .form-control:focus, .has-error .form-control:focus {
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
box-shadow: none; }
|
box-shadow: none; }
|
||||||
@@ -884,7 +903,10 @@ hr {
|
|||||||
|
|
||||||
.input-lg {
|
.input-lg {
|
||||||
height: 55px;
|
height: 55px;
|
||||||
padding: 11px 30px; }
|
padding: 11px 30px;
|
||||||
|
font-size: 17px;
|
||||||
|
line-height: 1.3333333;
|
||||||
|
border-radius: 3px; }
|
||||||
|
|
||||||
.has-error .form-control-feedback, .has-error .control-label {
|
.has-error .form-control-feedback, .has-error .control-label {
|
||||||
color: #EB5E28; }
|
color: #EB5E28; }
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,3 +1,8 @@
|
|||||||
|
input {
|
||||||
|
margin-top: 5px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
.form-control::-moz-placeholder{
|
.form-control::-moz-placeholder{
|
||||||
@include placeholder($medium-gray,1);
|
@include placeholder($medium-gray,1);
|
||||||
}
|
}
|
||||||
@@ -12,19 +17,36 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.form-control {
|
.form-control {
|
||||||
background-color: $gray-input-bg;
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
line-height: 1.846;
|
||||||
|
color: #666666;
|
||||||
|
border: medium none;
|
||||||
|
border-radius: $border-radius-base;
|
||||||
|
/*-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);*/
|
||||||
|
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
|
||||||
|
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||||
|
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||||
|
@include input-size($padding-base-vertical, $padding-base-horizontal, $height-base);
|
||||||
|
|
||||||
|
/*background-color: $gray-input-bg;
|
||||||
border: medium none;
|
border: medium none;
|
||||||
border-radius: $border-radius-base;
|
border-radius: $border-radius-base;
|
||||||
color: $font-color;
|
color: $font-color;
|
||||||
font-size: $font-size-base;
|
font-size: $font-size-base;
|
||||||
transition: background-color 0.3s ease 0s;
|
transition: background-color 0.3s ease 0s;
|
||||||
@include input-size($padding-base-vertical, $padding-base-horizontal, $height-base);
|
@include input-size($padding-base-vertical, $padding-base-horizontal, $height-base);
|
||||||
@include box-shadow(none);
|
@include box-shadow(none);*/
|
||||||
|
|
||||||
&:focus{
|
&:focus{
|
||||||
background-color: $white-bg;
|
background-color: $white-bg;
|
||||||
@include box-shadow(none);
|
//@include box-shadow(none);
|
||||||
outline: 0 !important;
|
outline: 0 !important;
|
||||||
|
border-bottom: 2px solid #2196f3;
|
||||||
|
/*-webkit-box-shadow: inset 0 -2px 0 #2196f3;
|
||||||
|
box-shadow: inset 0 -2px 0 #2196f3;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-success &,
|
.has-success &,
|
||||||
@@ -75,6 +97,9 @@
|
|||||||
.input-lg{
|
.input-lg{
|
||||||
height: 55px;
|
height: 55px;
|
||||||
padding: $padding-large-vertical $padding-large-horizontal;
|
padding: $padding-large-vertical $padding-large-horizontal;
|
||||||
|
font-size: 17px;
|
||||||
|
line-height: 1.3333333;
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-error{
|
.has-error{
|
||||||
@@ -94,7 +119,6 @@
|
|||||||
border: medium none;
|
border: medium none;
|
||||||
border-radius: $border-radius-base;
|
border-radius: $border-radius-base;
|
||||||
|
|
||||||
|
|
||||||
.has-success &,
|
.has-success &,
|
||||||
.has-error &{
|
.has-error &{
|
||||||
background-color: $white-color;
|
background-color: $white-color;
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ input[type="file"] > input[type="button"]::-moz-focus-inner{
|
|||||||
input:focus,
|
input:focus,
|
||||||
button:focus {
|
button:focus {
|
||||||
outline : 0 !important;
|
outline : 0 !important;
|
||||||
|
-webkit-box-shadow: inset 0 -2px 0 #2196f3;
|
||||||
|
box-shadow: inset 0 -2px 0 #2196f3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Animations */
|
/* Animations */
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<link href="/assets/admin/css/bootstrap.min.css" rel="stylesheet" />
|
<link href="/assets/admin/css/bootstrap.min.css" rel="stylesheet" />
|
||||||
<link href="/assets/admin/css/animate.min.css" rel="stylesheet"/>
|
<link href="/assets/admin/css/animate.min.css" rel="stylesheet"/>
|
||||||
<link href="/assets/admin/css/paper-dashboard.css" rel="stylesheet"/>
|
<link href="/assets/admin/css/paper-dashboard.css" rel="stylesheet"/>
|
||||||
|
|
||||||
<link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css"
|
<link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css"
|
||||||
rel="stylesheet"/>
|
rel="stylesheet"/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="card">
|
<div class="card border-blue-bottom">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-5">
|
<div class="col-xs-5">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="card">
|
<div class="card border-blue-bottom">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h4 class="title">Announcements</h4>
|
<h4 class="title">Announcements</h4>
|
||||||
<p class="category">just updated</p>
|
<p class="category">just updated</p>
|
||||||
|
|||||||
@@ -5,21 +5,44 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@component('admin.components.infobox')
|
<div class="row">
|
||||||
@slot('icon', 'pe-7s-users')
|
<div class="col-md-6">
|
||||||
@slot('type', 'Pilots')
|
@component('admin.components.infobox')
|
||||||
@slot('pending', 5)
|
@slot('icon', 'pe-7s-users')
|
||||||
@slot('total', 60)
|
@slot('type', 'Pilots')
|
||||||
@endcomponent
|
@slot('pending', 5)
|
||||||
|
@slot('total', 60)
|
||||||
|
@endcomponent
|
||||||
|
|
||||||
|
@component('admin.components.infobox')
|
||||||
|
@slot('icon', 'pe-7s-cloud-upload')
|
||||||
|
@slot('type', 'PIREPs')
|
||||||
|
@slot('pending', $pending_pireps)
|
||||||
|
@slot('link', route('admin.pireps.index').'?search=status:0')
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
@component('admin.components.infobox')
|
||||||
|
@slot('icon', 'pe-7s-users')
|
||||||
|
@slot('type', 'Pilots')
|
||||||
|
@slot('pending', 5)
|
||||||
|
@slot('total', 60)
|
||||||
|
@endcomponent
|
||||||
|
|
||||||
|
@component('admin.components.infobox')
|
||||||
|
@slot('icon', 'pe-7s-cloud-upload')
|
||||||
|
@slot('type', 'PIREPs')
|
||||||
|
@slot('pending', $pending_pireps)
|
||||||
|
@slot('link', route('admin.pireps.index').'?search=status:0')
|
||||||
|
@endcomponent
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@include('admin.dashboard.announcements')
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@component('admin.components.infobox')
|
@include('admin.dashboard.pirep_chart')
|
||||||
@slot('icon', 'pe-7s-cloud-upload')
|
|
||||||
@slot('type', 'PIREPs')
|
|
||||||
@slot('pending', $pending_pireps)
|
|
||||||
@slot('link', route('admin.pireps.index').'?search=status:0')
|
|
||||||
@endcomponent
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{--<div class="col-md-3 col-sm-6 col-xs-12">
|
{{--<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
@@ -44,10 +67,10 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@include('admin.dashboard.announcements')
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@include('admin.dashboard.pirep_chart')
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
@extends('admin.app')
|
@extends('admin.app')
|
||||||
|
|
||||||
|
@section('title', 'Edit ' . $pirep->getFlightId() )
|
||||||
@section('content')
|
@section('content')
|
||||||
<section class="content-header">
|
<div class="content">
|
||||||
<h1>
|
@include('adminlte-templates::common.errors')
|
||||||
$MODEL_NAME_HUMAN$
|
<div class="card border-blue-bottom">
|
||||||
</h1>
|
<div class="content">
|
||||||
</section>
|
{!! Form::model($pirep, ['route' => ['admin.pireps.update', $pirep->id], 'method' => 'patch']) !!}
|
||||||
<div class="content">
|
@include('admin.pireps.fields')
|
||||||
@include('adminlte-templates::common.errors')
|
{!! Form::close() !!}
|
||||||
<div class="box box-primary">
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="row">
|
|
||||||
{!! Form::model($pirep, ['route' => ['admin.pireps.update', $pirep->id], 'method' => 'patch']) !!}
|
|
||||||
|
|
||||||
@include('admin.pireps.fields')
|
|
||||||
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="card border-blue-bottom">
|
||||||
|
<div class="content">
|
||||||
|
@include('admin.pireps.field_values')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
@include('admin.pireps.script')
|
||||||
|
|||||||
@@ -1,47 +1,80 @@
|
|||||||
<!-- Flight Id Field -->
|
<div class="row">
|
||||||
{{--<div class="form-group col-sm-6">
|
<div class="form-group col-sm-12">
|
||||||
{!! Form::label('flight_id', 'Flight ID:') !!}
|
{{--<div class="avatar">
|
||||||
{!! Form::text('flight_id', null, ['class' => 'form-control']) !!}
|
<img src="{!! $pirep->pilot->gravatar() !!}" />
|
||||||
</div>--}}
|
</div>--}}
|
||||||
|
Filed By: <a href="{!! route('admin.users.edit', [$pirep->pilot->id]) !!}" target="_blank">
|
||||||
|
{!! $pirep->pilot->pilot_id() !!} {!! $pirep->pilot->name !!}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Aircraft Id Field -->
|
<div class="form-group col-sm-6">
|
||||||
<div class="form-group col-sm-6">
|
<div>
|
||||||
{!! Form::label('aircraft_id', 'Aircraft ID:') !!}
|
{!! Form::label('airline_id', 'Airline') !!}
|
||||||
{!! Form::select('aircraft_id', $aircraft, null, ['class' => 'form-control']) !!}
|
{!! Form::select('airline_id', $airlines, null, ['class' => 'form-control select2']) !!}
|
||||||
</div>
|
</div>
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
{!! Form::label('aircraft_id', 'Aircraft:') !!}
|
||||||
|
{!! Form::select('aircraft_id', $aircraft, null, ['class' => 'form-control select2']) !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Flight Time Field -->
|
<div class="form-group col-sm-6">
|
||||||
<div class="form-group col-sm-6">
|
{!! Form::label('flight_number', 'Flight Number/Route Code/Leg') !!}
|
||||||
{!! Form::label('flight_time', 'Flight Time:') !!}
|
{!! Form::text('flight_number', null, ['placeholder' => 'Flight Number', 'class' => 'form-control']) !!}
|
||||||
{!! Form::text('flight_time', null, ['class' => 'form-control']) !!}
|
{!! Form::text('route_code', null, ['placeholder' => 'Code (optional)', 'class' => 'form-control']) !!}
|
||||||
</div>
|
{!! Form::text('route_leg', null, ['placeholder' => 'Leg (optional)', 'class' => 'form-control']) !!}
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Level Field -->
|
<div class="form-group col-sm-6">
|
||||||
<div class="form-group col-sm-6">
|
{!! Form::label('dpt_airport_id', 'Departure Airport:') !!}
|
||||||
{!! Form::label('level', 'Flight Level:') !!}
|
{!! Form::select('dpt_airport_id', $airports, null, ['class' => 'form-control select2']) !!}
|
||||||
{!! Form::text('level', null, ['class' => 'form-control']) !!}
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Route Field -->
|
<div class="form-group col-sm-6">
|
||||||
<div class="form-group col-sm-6">
|
{!! Form::label('arr_airport_id', 'Arrival Airport:') !!}
|
||||||
{!! Form::label('route', 'Route:') !!}
|
{!! Form::select('arr_airport_id', $airports, null, ['class' => 'form-control select2']) !!}
|
||||||
{!! Form::text('route', null, ['class' => 'form-control']) !!}
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Notes Field -->
|
<!-- Flight Time Field -->
|
||||||
<div class="form-group col-sm-6">
|
<div class="form-group col-sm-6">
|
||||||
{!! Form::label('notes', 'Notes:') !!}
|
{!! Form::label('flight_time', 'Flight Time (hours & minutes):') !!}
|
||||||
{!! Form::text('notes', null, ['class' => 'form-control']) !!}
|
<div class="">
|
||||||
</div>
|
{!! Form::number('hours', null, ['class' => 'form-control', 'placeholder' => 'hours']) !!}
|
||||||
|
{!! Form::number('minutes', null, ['class' => 'form-control', 'placeholder' => 'minutes']) !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Raw Data Field -->
|
<!-- Level Field -->
|
||||||
<div class="form-group col-sm-6">
|
<div class="form-group col-sm-6">
|
||||||
{!! Form::label('raw_data', 'Raw Data:') !!}
|
{!! Form::label('level', 'Flight Level:') !!}
|
||||||
{!! Form::text('raw_data', null, ['class' => 'form-control']) !!}
|
{!! Form::text('level', null, ['class' => 'form-control']) !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Route Field -->
|
||||||
|
<div class="form-group col-sm-6">
|
||||||
|
{!! Form::label('route', 'Route:') !!}
|
||||||
|
{!! Form::text('route', null, ['class' => 'form-control']) !!}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Notes Field -->
|
||||||
|
<div class="form-group col-sm-6">
|
||||||
|
{!! Form::label('notes', 'Notes:') !!}
|
||||||
|
{!! Form::textarea('notes', null, ['class' => 'form-control']) !!}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Raw Data Field -->
|
||||||
|
<div class="form-group col-sm-6">
|
||||||
|
{!! Form::label('raw_data', 'Raw Data:') !!}
|
||||||
|
{!! Form::textarea('raw_data', null, ['class' => 'form-control', 'disabled']) !!}
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Submit Field -->
|
<!-- Submit Field -->
|
||||||
<div class="form-group col-sm-12">
|
<div class="form-group col-sm-12">
|
||||||
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
|
<div class="pull-right">
|
||||||
<a href="{!! route('admin.pireps.index') !!}" class="btn btn-default">Cancel</a>
|
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
|
||||||
|
<a href="{!! route('admin.pireps.index') !!}" class="btn btn-default">Cancel</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,12 +6,7 @@
|
|||||||
<h5>
|
<h5>
|
||||||
<a class="text-c"
|
<a class="text-c"
|
||||||
href="{!! route('admin.pireps.show', [$pirep->id]) !!}">
|
href="{!! route('admin.pireps.show', [$pirep->id]) !!}">
|
||||||
{!! $pirep->airline->code !!}
|
{!! $pirep->getFlightId() !!}
|
||||||
@if($pirep->flight_id)
|
|
||||||
{!! $pirep->flight->flight_number !!}
|
|
||||||
@else
|
|
||||||
{!! $pirep->flight_number !!}
|
|
||||||
@endif
|
|
||||||
</a>
|
</a>
|
||||||
</h5>
|
</h5>
|
||||||
<div>
|
<div>
|
||||||
@@ -61,31 +56,41 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 ">
|
<div class="col-lg-12 ">
|
||||||
<table class="pull-right">
|
<table class="pull-right">
|
||||||
<tr><td>
|
<tr>
|
||||||
@if($pirep->status == config('enums.pirep_status.PENDING')
|
<td>
|
||||||
|| $pirep->status == config('enums.pirep_status.REJECTED'))
|
@if($pirep->status == config('enums.pirep_status.PENDING')
|
||||||
{!! Form::open(['url' => '/admin/pireps/'.$pirep->id.'/status', 'method' => 'post',
|
|| $pirep->status == config('enums.pirep_status.REJECTED'))
|
||||||
'name' => 'accept_'.$pirep->id,
|
{!! Form::open(['url' => '/admin/pireps/'.$pirep->id.'/status', 'method' => 'post',
|
||||||
'id' => $pirep->id.'_accept',
|
'name' => 'accept_'.$pirep->id,
|
||||||
'pirep_id' => $pirep->id,
|
'id' => $pirep->id.'_accept',
|
||||||
'new_status' => config('enums.pirep_status.ACCEPTED'),
|
'pirep_id' => $pirep->id,
|
||||||
'class' => 'pirep_submit_status']) !!}
|
'new_status' => config('enums.pirep_status.ACCEPTED'),
|
||||||
{!! Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-info']) !!}
|
'class' => 'pirep_submit_status']) !!}
|
||||||
{!! Form::close() !!}
|
{!! Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-info']) !!}
|
||||||
@endif
|
{!! Form::close() !!}
|
||||||
</td><td> </td><td>
|
@endif
|
||||||
@if($pirep->status == config('enums.pirep_status.PENDING')
|
</td>
|
||||||
|| $pirep->status == config('enums.pirep_status.ACCEPTED'))
|
<td> </td>
|
||||||
{!! Form::open(['url' => '/admin/pireps/'.$pirep->id.'/status', 'method' => 'post',
|
<td>
|
||||||
'name' => 'reject_'.$pirep->id,
|
@if($pirep->status == config('enums.pirep_status.PENDING')
|
||||||
'id' => $pirep->id.'_reject',
|
|| $pirep->status == config('enums.pirep_status.ACCEPTED'))
|
||||||
'pirep_id' => $pirep->id,
|
{!! Form::open(['url' => '/admin/pireps/'.$pirep->id.'/status', 'method' => 'post',
|
||||||
'new_status' => config('enums.pirep_status.REJECTED'),
|
'name' => 'reject_'.$pirep->id,
|
||||||
'class' => 'pirep_submit_status']) !!}
|
'id' => $pirep->id.'_reject',
|
||||||
{!! Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-danger']) !!}
|
'pirep_id' => $pirep->id,
|
||||||
{!! Form::close() !!}
|
'new_status' => config('enums.pirep_status.REJECTED'),
|
||||||
@endif
|
'class' => 'pirep_submit_status']) !!}
|
||||||
</td></tr>
|
{!! Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-danger']) !!}
|
||||||
|
{!! Form::close() !!}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td> </td>
|
||||||
|
<td>
|
||||||
|
<a href="{!! route('admin.pireps.edit', [$pirep->id]) !!}"
|
||||||
|
class='btn btn-sm btn-success btn-icon'>
|
||||||
|
<i class="fa fa-pencil-square-o"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user