1
0
forked from s421507/eOSP2
eOSP2/resources/views/operation.blade.php
2019-12-11 20:28:53 +01:00

107 lines
4.5 KiB
PHP

@extends('layout.app')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
@section('left-menu')
@parent<ul>
<a href="wyjazdy/add"><li>Dodaj<img src="img/left_menu_icon/add.png"></li></a>
<li>Edytuj<img src="img/left_menu_icon/edit.png"></li>
<li>Usuń<img src="img/left_menu_icon/delete.png"></li>
</ul>
@stop
@section('center-area')
@parent
@if( auth()->check())
@if( auth()->user()->fireStationID == NULL)
Jednostka nie istnieje
@else
<table class='firefighterViewTable'>
<tr class='table-header'>
<td>Data</td>
<td>Miejsce</td>
<td>Cel</td>
<td>Rodzaj zagrożenia</td>
<td>Dowódca</td>
</tr>
@foreach($operations as $operation)
<tr>
<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>
<td><a href="{{ URL::asset('wyjazdy/edit/'.$operation->id) }}"><input type="button" onclick="" value="Edytuj"> </a></td>
<td><input type="button" onclick="showMoreInformation('{{$operation->id}}')" id="more{{$operation->id}}" value="Więcej"></td>
</tr>
<tr id="moreInformation{{$operation->id}}" style="visibility:collapse;" bgcolor="#C0C0C0">
<td colspan="5">
<center>
<table>
<tr class='table-header'>
<td colspan="8">Opis Akcji</td>
</tr>
<tr>
<td>{{$operation->description}}</td>
</tr>
<tr><td></td></tr>
<tr class="table-header">
<td>Pojazdy</td>
<td>Kierowcy</td>
</tr>
@foreach($trucks[$operation->id] as $truck)
@if($truck->truckID != null)
<tr>
<td>{{$truck->name}} {{$truck->codename }} {{$truck->brand}} {{$truck->registrationNumber}}</td>
<td>{{$truck->driverName }} {{ $truck->driverSurname}}</td>
</tr>
@endif
@endforeach
<tr><td></td></tr>
<tr class='table-header' colspan="5">
<td>Członkowie Akcji</td>
<td>Transport Własny</td>
</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
</table>
</center>
</td>
</tr>
@endforeach
</table>
@endif
@else
Brak autoryzacji
@endif
@stop
<script>
function showMoreInformation(operationID){
if( $('#more'+operationID).val() == "Więcej"){
$('#more'+operationID).val("Ukryj");
$("#moreInformation"+operationID).css('visibility', 'visible');
} else{
$('#more'+operationID).val("Więcej");
$("#moreInformation"+operationID).css('visibility', 'collapse');
}
}
</script>