2018-02-04 08:18:09 +08:00
|
|
|
@extends("layouts.${SKIN_NAME}.app")
|
2017-12-20 10:19:36 +08:00
|
|
|
@section('title', 'flights')
|
2018-02-04 08:18:09 +08:00
|
|
|
|
2017-08-03 04:12:26 +08:00
|
|
|
@section('content')
|
|
|
|
<div class="row">
|
|
|
|
@include('flash::message')
|
2017-12-05 04:21:46 +08:00
|
|
|
<div class="col-md-9">
|
2017-08-03 04:12:26 +08:00
|
|
|
<h2 class="description">flights</h2>
|
2018-02-04 08:18:09 +08:00
|
|
|
@include("layouts.${SKIN_NAME}.flights.table")
|
2017-08-03 04:12:26 +08:00
|
|
|
</div>
|
2017-12-05 04:21:46 +08:00
|
|
|
<div class="col-md-3">
|
2018-02-04 08:18:09 +08:00
|
|
|
@include("layouts.${SKIN_NAME}.flights.search")
|
2017-08-03 04:29:04 +08:00
|
|
|
</div>
|
2017-08-03 04:12:26 +08:00
|
|
|
</div>
|
2017-12-05 00:34:01 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-12 text-center">
|
2018-02-04 08:18:09 +08:00
|
|
|
{{ $flights->links("layouts.${SKIN_NAME}.pagination.default") }}
|
2017-12-05 00:34:01 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-08-03 04:12:26 +08:00
|
|
|
@endsection
|
2018-02-04 08:18:09 +08:00
|
|
|
|
2017-08-04 10:02:02 +08:00
|
|
|
@section('scripts')
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$("button.save_flight").click(function(e) {
|
|
|
|
var btn = $(this);
|
|
|
|
var flight_id = btn.attr('x-id');
|
|
|
|
|
|
|
|
var params = {
|
|
|
|
method: 'POST',
|
|
|
|
data: {'flight_id': flight_id, _token: "{{ csrf_token() }}"},
|
|
|
|
//headers: { 'X-CSRF-Token': "{{ csrf_token() }}" }
|
|
|
|
};
|
|
|
|
|
|
|
|
if(btn.hasClass('btn-danger')) {
|
|
|
|
params.data.action = 'remove';
|
|
|
|
params.success = function() {
|
|
|
|
console.log('successfully removed flight');
|
|
|
|
btn.removeClass('btn-danger');
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
params.data.action = 'save';
|
|
|
|
params.success = function() {
|
|
|
|
console.log('successfully saved flight');
|
|
|
|
btn.addClass('btn-danger');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$.ajax("/flights/save", params);
|
|
|
|
e.preventDefault();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endsection
|
2017-08-03 04:12:26 +08:00
|
|
|
|