Lager-v3/resources/views/products/show.blade.php

164 lines
6.2 KiB
PHP

@extends('Layouts.master')
@section('content')
<div class="main-container pb-4">
<div class="row">
<div class="col-auto">
<h1>
@if(!empty($data->deleted_at))
@lang('DELETED')
@endif
@lang('product')
</h1>
</div>
@can('product_edit')
<div class="col">
<a href="{{route('products.edit',['product' => $data])}}" target="_blank"
class="btn btn-outline-success ms-4 mt-2">
@lang('edit')
</a>
</div>
@endcan
</div>
<div class="row">
<table>
<tr>
<td class="col-2 fw-bold">
@if(config('app.barcode_mode') == 'static')
@lang('static')
@elseif(config('app.barcode_mode') == 'dynamic')
@lang('dynamic')
@endif
@lang('barcode') :
</td>
<td class="col-auto">
@if(config('app.barcode_mode') == 'static')
@if(!empty($data->barcode))
{{$data->barcode}}
@endif
@elseif(config('app.barcode_mode') == 'dynamic')
{{$data->category->name}}.@if(!empty($data->subcategory)){{$data->subcategory->name}}.@endif{{$data->brand->name}}.{{$data->model->name}}@if(!empty($data->name)).{{$data->name}}@endif
@endif
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('category') :
</td>
<td class="col-auto">
<a href="{{route('categories.show',['category' => $data->category])}}" class="btn btn-success" target="_blank">{{$data->category->name}}</a>
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('subcategory') :
</td>
<td class="col-auto">
@if(!empty($data->subcategory))
<a href="{{route('subcategories.show',['subcategory' => $data->subcategory])}}" class="btn btn-success" target="_blank">{{$data->subcategory->name}}</a>
@else
@lang('none')
@endif
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('brand') :
</td>
<td class="col-auto">
<a href="{{route('brands.show',['brand' => $data->brand])}}" class="btn btn-success" target="_blank">{{$data->brand->name}}</a>
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('model') :
</td>
<td class="col-auto">
<a href="{{route('models.show',['model' => $data->model])}}" class="btn btn-success" target="_blank">{{$data->model->name}}</a>
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('name') :
</td>
<td class="col-auto">
@if(!empty($data->name))
{{$data->name}}
@endif
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('created_at') :
</td>
<td class="col-auto">
{{date('d-m-Y H:i:s',strtotime($data->created_at))}}
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('updated_at') :
</td>
<td class="col-auto">
{{date('d-m-Y H:i:s',strtotime($data->updated_at))}}
</td>
</tr>
@if(!empty($data->deleted_at))
<tr>
<td class="col-1 fw-bold">
@lang('deleted_at') :
</td>
<td class="col-auto">
{{date('d-m-Y H:i:s',strtotime($data->deleted_at))}}
</td>
</tr>
@endif
<!-- Pool -->
<tr>
<td>
<h2 class="mt-4">@lang('pool')</h2>
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('available') :
</td>
<td class="col-auto">
{{$data->total - (count($data->loans) + count($data->reservations))}}
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('lent') :
</td>
<td class="col-auto">
{{count($data->loans)}}
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('reserved') :
</td>
<td class="col-auto">
{{count($data->reservations)}}
</td>
</tr>
<tr>
<td class="col-1 fw-bold">
@lang('total') :
</td>
<td class="col-auto">
{{$data->total}}
</td>
</tr>
</table>
</div>
<div class="row mt-4">
<h1></h1>
</div>
</div>
@endsection
@section('scripting')
@endsection