mein-sterntours/resources/views/settings/airport/index.blade.php
Kevin Adametz 881fc84207 08 2024
2024-08-05 11:58:09 +02:00

138 lines
No EOL
6.9 KiB
PHP
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-3 mb-1">
Airport
</h4>
<div class="card">
<div class="card-datatable table-responsive">
<table class="datatables-default table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Name')}}</th>
<th>{{__('Code')}}</th>
<th>{{__('Stadt')}}</th>
<th>{{__('Land')}}</th>
<th>{{__('sichtbar')}}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($airports as $value)
<tr>
<td>
<button type="button" class="btn icon-btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-default"
data-id="{{ $value->id }}"
data-name="{{ $value->name }}"
data-code="{{ $value->code }}"
data-city="{{ $value->city }}"
data-country="{{ $value->country }}"
data-active="{{ $value->active }}">
<span class="fa fa-edit"></span>
</button>
</td>
<td data-sort="{{ $value->id }}">{{ $value->name }}</td>
<td data-sort="{{ $value->code }}">{{ $value->code }}</td>
<td data-sort="{{ $value->city }}">{{ $value->city }}</td>
<td data-sort="{{ $value->country }}">{{ $value->country }}</td>
<td data-sort="{{ $value->active }}">{!! \App\Helper\HTMLHelper::getActiveIcon($value->active) !!}</td>
<td><a class="text-danger" href="{{ route('admin_settings_airport_delete', [$value->id]) }}" onclick="return confirm('{{__('Wirklich löschen?')}}');"><i class="fa fa-trash-alt"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 col">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-default"
data-id="new"
data-name=""
data-code=""
data-city=""
data-country=""
data-active="1"
>Neuen Airport anlegen</button>
</div>
</div>
<!-- Modal template -->
<div class="modal fade" id="modals-default">
<div class="modal-dialog">
{!! Form::open([ 'url' => route('admin_settings_airport_update'), 'method' => 'post', 'class' => 'modal-content' ]) !!}
{{ Form::hidden('id', '') }}
<input type="hidden" class="form-control" name="id">
<div class="modal-header">
<h5 class="modal-title">Airport <span class="font-weight-light">anlegen/bearbeiten</span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
<div class="form-row">
<div class="form-group col">
<label for="name" class="form-label">Name*</label>
{{ Form::text('name', '', array('placeholder'=>__('Name'), 'class'=>'form-control', 'required'=>true)) }}
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="code" class="form-label">Code*</label>
{{ Form::text('code', '', array('placeholder'=>__('Code'), 'class'=>'form-control', 'required'=>true)) }}
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="city" class="form-label">Stadt</label>
{{ Form::text('city', '', array('placeholder'=>__('Stadt'), 'class'=>'form-control', 'required'=>false)) }}
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label for="country" class="form-label">Land</label>
{{ Form::text('country', '', array('placeholder'=>__('Land'), 'class'=>'form-control', 'required'=>false)) }}
</div>
</div>
<div class="form-group">
<label class="custom-control custom-checkbox m-0">
{{ Form::checkbox('active', 1, '', array('class'=>'custom-control-input')) }}
<span class="custom-control-label">{{__('sichtbar')}}</span>
</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
<button type="submit" class="btn btn-primary">{{__('save')}}</button>
</div>
{!! Form::close() !!}
</div>
</div>
<script>
$( document ).ready(function() {
$('#modals-default').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
$(this).find(".modal-content input[name='id']").val(button.data('id'));
$(this).find(".modal-body input[name='name']").val(button.data('name'));
$(this).find(".modal-body input[name='code']").val(button.data('code'));
$(this).find(".modal-body input[name='city']").val(button.data('city'));
$(this).find(".modal-body input[name='country']").val(button.data('country'));
$(this).find(".modal-body input[name='active']").prop( "checked", button.data('active'));
});
$('.datatables-default').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"order": [[ 1, "asc" ]],
"language": {
"url": "/js/German.json"
}
});
});
</script>
</div>
@endsection