eOSP2/resources/views/vehicles.blade.php

75 lines
3.4 KiB
PHP

@extends('layout.app')
@section('left-menu')
@parent
<ul>
<a href="/pojazdy/add"><li>Dodaj<img src="img/left_menu_icon/add.png"></li></a>
</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>LP</td>
<td>Typ Pojazdu</td>
<td>Marka</td>
<td>Nr rej.</td>
<td>Kryptonim</td>
<td>Rok Produkcji</td>
<td>Rodzaj napędu</td>
<td>Przegląd</td>
<td>OC</td>
@php
$lp=0 // liczba porządkowa
@endphp
@foreach($vehicles as $vehicle)
@php
$lp = $lp + 1
@endphp
<tr>
<form action="{{ route('vehicles.destroy', $vehicle->id)}}" method="post">
<td>{{ $lp }}</td>
<td id="name{{ $vehicle->id }}">{{ $vehicle->name }}</td>
<td id="brand{{ $vehicle->id }}">{{ $vehicle->brand }}</td>
<td id="registrationNumber{{ $vehicle->id }}">{{ $vehicle->registrationNumber }}</td>
<td id="codename{{ $vehicle->id }}">{{ $vehicle->codename }}</td>
<td id="productionYear{{ $vehicle->id }}">{{ $vehicle->productionYear }}</td>
<td id="driveType{{ $vehicle->id }}">{{ $vehicle->driveType }}</td>
<td id="examExpirationDate{{ $vehicle->id }}">{{ $vehicle->examExpirationDate }}</td>
<td id="insuranceExpirationDate{{ $vehicle->id }}">{{ $vehicle->insuranceExpirationDate }}</td>
<td><a href="{{ URL::asset('pojazdy/edit/'.$vehicle->id) }}"><input type="button" onclick="" value="Edytuj"> </a></td>
{{ csrf_field() }}
@method('DELETE')
<td><button class="btn btn-danger" type="submit">Usuń</button></td>
</form>
@if ($vehicle->status == 1)
<form method="POST" action="/pojazdy/deactivate">
{{ csrf_field() }}
<input type="hidden" class="form-control" name="vehicleID" value="{{ $vehicle->id }}">
<td><button style="cursor:pointer" type="submit" class="btn btn-primary">Zawieś</button></td>
</form>
@elseif ($vehicle->status == 0)
<form method="POST" action="/pojazdy/activate">
{{ csrf_field() }}
<input type="hidden" class="form-control" name="vehicleID" value="{{ $vehicle->id }}">
<td><button style="cursor:pointer" type="submit" class="btn btn-primary">Przywróć do służby</button></td>
</form>
@endif
</tr>
@endforeach
</table>
@endif
@else
Brak autoryzacji
@endif
@stop