139 lines
5.9 KiB
PHP
139 lines
5.9 KiB
PHP
@extends('Layouts.master')
|
|
|
|
@section('content')
|
|
<div class="main-container pb-4">
|
|
@include('Partials.Pages.index_top')
|
|
<table class="table table-striped">
|
|
<thead>
|
|
@if(config('app.barcode_mode') == 'static')
|
|
<th>@lang('barcode')</th>
|
|
@endif
|
|
<th>@lang('category')</th>
|
|
<th class="text-center">@lang('subcategory')</th>
|
|
<th>@lang('brand')</th>
|
|
<th>@lang('model')</th>
|
|
<th>@lang('name')</th>
|
|
<th>@lang('description')</th>
|
|
|
|
<th>@lang('available')</th>
|
|
<th>@lang('lent')</th>
|
|
<th>@lang('reserved')</th>
|
|
<th>@lang('total')</th>
|
|
<th>@lang('action')</th>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($data as $product)
|
|
<tr>
|
|
@if(config('app.barcode_mode') == 'static')
|
|
<td class="align-middle">
|
|
@if(!empty($product->barcode))
|
|
{{$product->barcode}}
|
|
@else
|
|
@lang('none')
|
|
@endif
|
|
</td>
|
|
@endif
|
|
<td class="align-middle">
|
|
@can('categories_view')
|
|
<a href="{{route('categories.show',['category' => $product->category])}}"
|
|
class="btn btn-success">
|
|
{{$product->category->name}}
|
|
</a>
|
|
@else
|
|
{{$product->category->name}}
|
|
@endcan
|
|
</td>
|
|
<td class="align-middle text-center">
|
|
@can('subcategories_view')
|
|
@if(!empty($product->subcategory))
|
|
<a href="{{route('subcategories.show',['subcategory' => $product->subcategory])}}"
|
|
class="btn btn-success">
|
|
{{$product->subcategory->name}}
|
|
</a>
|
|
@else
|
|
@lang('none')
|
|
@endif
|
|
@else
|
|
{{$product->subcategory->name}}
|
|
@endcan
|
|
</td>
|
|
<td class="align-middle">
|
|
@can('brands_view')
|
|
<a href="{{route('brands.show',['brand' => $product->brand])}}" class="btn btn-success">
|
|
{{$product->brand->name}}
|
|
</a>
|
|
@else
|
|
{{$product->brand->name}}
|
|
@endcan
|
|
</td>
|
|
<td class="align-middle">
|
|
@can('models_view')
|
|
<a href="{{route('models.show',['model' => $product->model])}}" class="btn btn-success">
|
|
{{$product->model->name}}
|
|
</a>
|
|
@else
|
|
{{$product->model->name}}
|
|
@endcan
|
|
</td>
|
|
<td class="align-middle">
|
|
@can('products_view')
|
|
@if(!empty($product->name))
|
|
<a href="{{route('products.show',['product' => $product])}}"
|
|
class="btn btn-success me-2">
|
|
{{$product->name}}
|
|
</a>
|
|
@else
|
|
<a href="{{route('products.show',['product' => $product])}}"
|
|
class="btn btn-outline-success me-2">
|
|
@lang('show')
|
|
</a>
|
|
@endif
|
|
@else
|
|
{{$product->name}}
|
|
@endcan
|
|
|
|
</td>
|
|
<td class="align-middle">
|
|
{{$product->description}}
|
|
</td>
|
|
<td class="align-middle text-center">
|
|
{{$product->total - (count($product->loans) + count($product->reservations))}}
|
|
</td>
|
|
<td class="align-middle text-center">
|
|
{{count($product->loans)}}
|
|
</td>
|
|
<td class="align-middle text-center">
|
|
{{count($product->reservations)}}
|
|
</td>
|
|
<td class="align-middle text-center">
|
|
{{$product->total}}
|
|
</td>
|
|
<td>
|
|
@can('brand_edit')
|
|
<a href="{{route('brands.edit',['brand' => $brand])}}" class="btn btn-outline-success">
|
|
@lang('edit')
|
|
</a>
|
|
@endcan
|
|
@can('brand_restore')
|
|
<a href="{{route('brands.restore',['brand' => $brand])}}" class="btn btn-outline-success">
|
|
@lang('restore')
|
|
</a>
|
|
@endcan
|
|
@can('brand_delete_force')
|
|
<a href="{{route('productss.forceDelete',['brand' => $brand])}}"
|
|
class="btn btn-outline-danger">
|
|
@lang('delete_force')
|
|
</a>
|
|
@endcan
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@include('Partials.Pages.display')
|
|
</div>
|
|
@endsection
|
|
|
|
@section('scripting')
|
|
@endsection
|