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

85 lines
5.5 KiB
PHP

<button data-toggle="modal" data-target="#setupModal_{{$reservation->id}}" class="btn btn-outline-success">@lang('set up')</button>
<div class="product-edit-buttons">
<!-- Modal -->
<div class="modal" tabindex="-1" role="dialog" id="setupModal_{{$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('setup')</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">
<h1>
@lang('room') : {{$reservation->room->building->name}} - {{$reservation->room->name}}
</h1>
<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->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
@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">
<form action="{{route('reservations.setup',['reservation' => $loan->id])}}" method="post">
@csrf
<input type="submit" value="@lang('set up')" class="btn btn-success">
</form>
</div>
</div>
</div>
</div>
</div>