Lager-v3/resources/views/Partials/Pages/reservation_items.blade.php

81 lines
5.4 KiB
PHP

<button data-toggle="modal" data-target="#itemModal_{{$reservation->id}}" class="btn btn-info">@lang('items')</button>
<div class="product-edit-buttons">
<!-- Modal -->
<div class="modal" tabindex="-1" role="dialog" id="itemModal_{{$reservation->id}}">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="alert alert-danger" style="display:none"></div>
<div class="modal-header">
<h5 class="modal-title">@lang('reservation') @lang('items')</h5>
<button type="button" class="btn btn-secondary close fold" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<table class="table table-striped">
<thead>
<th>@lang('type')</th>
<th>@lang('item')</th>
<th class="text-center">@lang('amount')</th>
</thead>
<tbody>
@foreach($reservations as $loan)
@if($reservation->date_start == $loan->date_start)
@if($reservation->date_end == $loan->date_end)
@if($reservation->user->id == $loan->user->id)
@if($reservation->room->id == $loan->room->id)
<tr>
<td class="align-middle">
@switch($loan->loanable_type)
@case('App\Models\Product')
@lang('product')
@break
@case('App\Models\Cabel')
@lang('cabel')
@break
@endswitch
</td>
<td class="align-middle">
@switch($loan->loanable_type)
@case('App\Models\Product')
<a href="{{route('products.show',['product' => $loan->loanable->id])}}" target="_blank" class="btn btn-success">
@if(config('app.barcode_mode') == 'dynamic')
{{$loan->loanable->category->name}}.@if(!empty($loan->loanable->subcategory->name)){{$loan->loanable->subcategory->name}}.@endif{{$loan->loanable->brand->name}}.{{$loan->loanable->model->name}}@if(!empty($loan->loanable->name)).{{$loan->loanable->name}}@endif
@endif
@if(config('app.barcode_mode') == 'static')
{{$loan->loanable->barcode}}
@endif
</a>
@break
@case('App\Models\Cabel')
<a href="{{route('cabels.show',['cabel' => $loan->loanable->id])}}" target="_blank" class="btn btn-success">
{{$loan->loanable->category->name}}.{{$loan->loanable->name}}
</a>
@break
@endswitch
</td>
<td class="align-middle text-center">
{{$loan->amount}}
</td>
</tr>
@endif
@endif
@endif
@endif
@endforeach
<tr>
<td class="align-middle fw-bold">Total</td>
<td class="align-middle fw-bold">:</td>
<td class="align-middle text-center fw-bold">{{$reservation->amount}}</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">@lang('cancel')</button>
</div>
</div>
</div>
</div>
</div>