2019-07-11 23:55:51 +02:00
|
|
|
@extends('layout.app')
|
|
|
|
|
2020-01-24 23:05:55 +01:00
|
|
|
|
2019-12-07 16:50:36 +01:00
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
|
2019-07-11 23:55:51 +02:00
|
|
|
@section('left-menu')
|
2020-02-01 01:01:26 +01:00
|
|
|
@parent
|
|
|
|
@if( auth()->check() )
|
|
|
|
@if( auth()->user()->fireStationID != NULL)
|
2020-02-01 01:18:26 +01:00
|
|
|
@if(auth()->user()->accessLevel() == 50)
|
2020-02-01 01:01:26 +01:00
|
|
|
<ul>
|
2020-01-22 00:54:08 +01:00
|
|
|
<a href="/wyjazdy/add"><li>Dodaj<img src="/img/left_menu_icon/add.png"></li></a>
|
2019-07-11 23:55:51 +02:00
|
|
|
</ul>
|
2020-02-01 01:01:26 +01:00
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
@endif
|
2019-07-11 23:55:51 +02:00
|
|
|
@stop
|
|
|
|
|
|
|
|
@section('center-area')
|
2020-01-24 23:05:55 +01:00
|
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
2019-07-11 23:55:51 +02:00
|
|
|
@parent
|
2019-12-07 14:44:28 +01:00
|
|
|
@if( auth()->check())
|
|
|
|
@if( auth()->user()->fireStationID == NULL)
|
|
|
|
Jednostka nie istnieje
|
|
|
|
@else
|
2020-02-01 01:03:57 +01:00
|
|
|
|
2020-02-01 02:33:06 +01:00
|
|
|
<form action="{{ route('operations.allPDF') }}" method="post" style="display:inline;">
|
2020-02-01 01:03:57 +01:00
|
|
|
{{ csrf_field() }}
|
|
|
|
<input type="hidden" class="form-control" name="fireStationID" value="{{auth()->user()->fireStationID}}">
|
|
|
|
<button class="btn btn-dark" type="submit">Drukuj wszystkie</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
2020-01-22 00:54:08 +01:00
|
|
|
<table class='table'>
|
|
|
|
<thead>
|
2019-12-07 14:44:28 +01:00
|
|
|
<tr>
|
2020-01-22 00:54:08 +01:00
|
|
|
<th>#</th>
|
|
|
|
<th>Data</th>
|
|
|
|
<th>Miejsce</th>
|
|
|
|
<th>Cel</th>
|
|
|
|
<th>Rodzaj zagrożenia</th>
|
|
|
|
<th>Dowódca</th>
|
2020-02-01 01:01:26 +01:00
|
|
|
@if(auth()->user()->accessLevel() == 50)
|
2020-01-22 00:54:08 +01:00
|
|
|
<th>Operacja</th>
|
2020-02-01 01:03:57 +01:00
|
|
|
<th>Szczegóły</th>
|
2020-02-01 01:01:26 +01:00
|
|
|
@endif
|
2020-02-01 01:18:26 +01:00
|
|
|
<th>Szczegóły</th>
|
|
|
|
|
2020-01-29 01:57:19 +01:00
|
|
|
|
|
|
|
</tr>
|
2020-01-22 00:54:08 +01:00
|
|
|
</thead>
|
|
|
|
|
|
|
|
@php
|
|
|
|
$i=1;
|
|
|
|
@endphp
|
|
|
|
@foreach($operations as $operation)
|
|
|
|
<tr>
|
|
|
|
<th>{{$i}}</th>
|
|
|
|
<td id="operationDate{{ $operation->id }}">{{ $operation->operationDate }}</td>
|
|
|
|
<td id="operationLocation{{ $operation->id }}">{{ $operation->location }}</td>
|
|
|
|
<td id="operationTarget{{ $operation->id }}">{{ $operation->target }}</td>
|
|
|
|
<td id="operationDangerType{{ $operation->id }}">{{ $operation->dangerType }}</td>
|
|
|
|
<td id="operationCommander{{ $operation->id }}">{{$operation->name}} {{$operation->surname}}</td>
|
2020-02-01 01:18:26 +01:00
|
|
|
@if(auth()->user()->accessLevel() == 50)
|
2020-01-24 23:05:55 +01:00
|
|
|
<td>
|
2020-01-29 01:57:19 +01:00
|
|
|
<a href="{{ URL::asset('wyjazdy/edit/'.$operation->id) }}" class="btn btn-secondary" role="button">Edytuj</a>
|
|
|
|
<button class="btn btn-danger" type="submit" id="{{$operation->id}}" onclick="deleteButton('{{$operation->id}}')">Usuń</button>
|
2020-02-01 02:33:06 +01:00
|
|
|
<form action="{{ route('operations.singlePDF') }}" method="post" style="display:inline;">
|
2020-02-01 01:03:57 +01:00
|
|
|
{{ csrf_field() }}
|
|
|
|
<input type="hidden" class="form-control" name="operationID" value="{{$operation->id}}">
|
|
|
|
<button class="btn btn-dark" type="submit">Drukuj</button>
|
|
|
|
</form>
|
2020-01-24 23:05:55 +01:00
|
|
|
</td>
|
2020-02-01 01:01:26 +01:00
|
|
|
@endif
|
2020-01-24 23:05:55 +01:00
|
|
|
<td>
|
2020-01-29 01:57:19 +01:00
|
|
|
<button class="btn btn-info" type="button" id="more{{$operation->id}}" onclick="showMoreInformation('{{$operation->id}}')">Więcej</button>
|
2020-01-24 23:05:55 +01:00
|
|
|
</td>
|
2020-01-22 00:54:08 +01:00
|
|
|
</tr>
|
|
|
|
<tr id="moreInformation{{$operation->id}}" style="visibility:collapse;">
|
|
|
|
{{-- bgcolor="#C0C0C0"--}}
|
|
|
|
<td colspan="8">
|
|
|
|
<center>
|
|
|
|
<table class="table table-dark">
|
|
|
|
<thead>
|
2019-12-11 20:28:53 +01:00
|
|
|
<tr>
|
2020-01-22 00:54:08 +01:00
|
|
|
<th colspan="8"><center>Opis Akcji</center></th>
|
2019-12-11 20:28:53 +01:00
|
|
|
</tr>
|
2020-01-22 00:54:08 +01:00
|
|
|
</thead>
|
2019-12-11 20:28:53 +01:00
|
|
|
|
2020-01-22 00:54:08 +01:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td colspan="8">{{$operation->description}}</td>
|
|
|
|
</tr>
|
2019-12-11 20:28:53 +01:00
|
|
|
|
|
|
|
<tr>
|
2020-01-22 00:54:08 +01:00
|
|
|
<td></td>
|
2019-12-11 20:28:53 +01:00
|
|
|
</tr>
|
|
|
|
|
2020-01-22 00:54:08 +01:00
|
|
|
<tr>
|
|
|
|
<th><center>Pojazdy</center></th>
|
|
|
|
<th><center>Kierowcy</center></th>
|
|
|
|
</tr>
|
|
|
|
@foreach($trucks[$operation->id] as $truck)
|
|
|
|
@if($truck->truckID != null)
|
|
|
|
<tr>
|
|
|
|
<td>{{$truck->name}} {{$truck->codename }} {{$truck->brand}} {{$truck->registrationNumber}}</td>
|
|
|
|
<td colspan="8">{{$truck->driverName }} {{ $truck->driverSurname}}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<th><center>Członkowie Akcji</center></th>
|
|
|
|
<th><center>Transport Własny</center></th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
@foreach($fireFighters[$operation->id] as $fireFighter)
|
|
|
|
@if($fireFighter->memberID != null)
|
|
|
|
<tr>
|
|
|
|
<td>{{$fireFighter->name}} {{$fireFighter->surname }}</td>
|
|
|
|
<td>{{($fireFighter->privateTransport == 1) ? "Tak" : "Nie"}}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</center>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
@php
|
|
|
|
$i++;
|
|
|
|
@endphp
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
2019-12-11 20:28:53 +01:00
|
|
|
</table>
|
2020-01-24 23:05:55 +01:00
|
|
|
{{ $operations->links() }}
|
2019-12-07 14:44:28 +01:00
|
|
|
@endif
|
|
|
|
@else
|
|
|
|
Brak autoryzacji
|
|
|
|
@endif
|
2019-07-11 23:55:51 +02:00
|
|
|
|
2019-11-23 15:01:59 +01:00
|
|
|
@stop
|
2019-12-07 16:50:36 +01:00
|
|
|
|
|
|
|
<script>
|
|
|
|
function showMoreInformation(operationID){
|
|
|
|
if( $('#more'+operationID).val() == "Więcej"){
|
|
|
|
$('#more'+operationID).val("Ukryj");
|
2019-12-11 20:28:53 +01:00
|
|
|
$("#moreInformation"+operationID).css('visibility', 'visible');
|
2019-12-07 16:50:36 +01:00
|
|
|
} else{
|
|
|
|
$('#more'+operationID).val("Więcej");
|
2019-12-11 20:28:53 +01:00
|
|
|
$("#moreInformation"+operationID).css('visibility', 'collapse');
|
2019-12-07 16:50:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-01-24 23:05:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
function deleteButton(operationID){
|
|
|
|
swal.fire({
|
|
|
|
title: "Czy chcesz usunąć wyjazd?",
|
|
|
|
width: 'auto',
|
|
|
|
confirmButtonText: 'Tak',
|
|
|
|
cancelButtonText: 'Nie',
|
|
|
|
showCancelButton: true,
|
|
|
|
}).then((result) => {
|
|
|
|
if(result.value){
|
|
|
|
|
|
|
|
$.ajaxSetup({
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
url: "wyjazdy/"+operationID,
|
|
|
|
type: 'DELETE',
|
|
|
|
data: {
|
|
|
|
"id": operationID,
|
|
|
|
},
|
|
|
|
success: function (){
|
|
|
|
console.log("it Works");
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
2019-12-07 16:50:36 +01:00
|
|
|
</script>
|
2020-01-22 00:54:08 +01:00
|
|
|
|
|
|
|
|