Lager-v3/resources/views/contracts/index.blade.php

65 lines
2.6 KiB
PHP

@extends('Layouts.master')
@section('content')
<div class="main-container pb-4">
<div class="head-section mb-2">
@include('Partials.Pages.Search.search_bar')
</div>
<table class="table table-striped">
<thead>
<th>@lang('user')</th>
<th>@lang('date')</th>
<th>@lang('type')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $contract)
<tr>
<td>
@can('users_view')
<a href="{{route('users.show',['user' => $contract->user->id])}}" target="_blank"
class="btn btn-success">
{{ $contract->user->username }}
</a>
@else
{{ $contract->user->username }}
@endcan
</td>
<td>
{{ date('d.m.Y H:i:s', $contract->timestamp) }}
</td>
<td>
@if($contract->type == 'contracts')
@lang('loan')
@elseif($contract->type == 'laptops')
@lang('laptop')
@elseif($contract->type == 'reservations')
@lang('reservation')
@endif
</td>
<td>
@can('pdf_view')
<a href="{{ route('pdf.show',['user' => $contract->user->username,'timestamp' => $contract->timestamp,'type' => $contract->type]) }}" target="_BLANK" class="btn btn-xs btn-outline-info pull-right">
@lang('show')
</a>
@endcan
@can('delete', App\Models\PDF::class)
<form method="post" action="{{ route('pdf.delete',['user' => $contract->user->username,'timestamp' => $contract->timestamp,'type' => $contract->type]) }}" class="d-inline">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-outline-danger btn-xs pull-right">@lang('delete')</button>
</form>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
@include('Partials.Pages.display')
</div>
@endsection
@section('scripting')
@endsection