Initial Commit

This commit is contained in:
dann4624
2022-09-28 09:38:08 +02:00
parent cac476f80f
commit 2d04a269e6
355 changed files with 52166 additions and 25 deletions
@@ -0,0 +1,6 @@
<select id="pagnation" class="form-select form-control" name="p" onchange="$('#searchPagnation').submit()">
<option value="10"<?= @$_GET["p"] == 10 ? 'selected' : '' ?>>10</option>
<option value="25"<?= @$_GET["p"] == 25 ? 'selected' : '' ?>>25</option>
<option value="50" <?= @$_GET["p"] == 50 ? 'selected' : '' ?>>50</option>
<option value="100" <?= @$_GET["p"] == 100 ? 'selected' : ''?>>100</option>
</select>
@@ -0,0 +1,8 @@
<form id="searchPagnation" style="width:30%;">
<div class="search-form-group">
@include('Partials.Pages.Search.pagination')
@include('Partials.Pages.Search.search_type')
@include('Partials.Pages.Search.search_compare')
@include('Partials.Pages.Search.search_field')
</div>
</form>
@@ -0,0 +1,6 @@
<select name="search_compare" id="search_compare" class="form-select" required>
<option value="like" @if(isset($_GET['search_compare']) && $_GET['search_compare'] == 'like') selected @endif>~</option>
<option value="=" @if(isset($_GET['search_compare']) && $_GET['search_compare'] == '=') selected @endif>=</option>
<option value=">=" @if(isset($_GET['search_compare']) && $_GET['search_compare'] == '>=') selected @endif>>=</option>
<option value="<=" @if(isset($_GET['search_compare']) && $_GET['search_compare'] == '<=') selected @endif><=</option>
</select>
@@ -0,0 +1,4 @@
<input type="text" name="search_term" placeholder="@lang('search')" class="form-control" value="<?= @$_GET["search_term"] ?? ''?>">
<button type="submit" class="btn btn-primary" value="Search">
<i class="fa fa-search"></i>
</button>
@@ -0,0 +1,10 @@
<select name="search_type" id="search_type" class="form-select" style="width:100%" required>
@foreach($search_types as $search_type)
<option
value="{{$search_type['value']}}"
@if(isset($_GET['search_type']) && $_GET['search_type'] == $search_type['value']) selected @endif
>
@lang($search_type['name'])
</option>
@endforeach
</select>
@@ -0,0 +1,7 @@
<div>
@can(Request::segment(1)."_create")
<a href="{{Route(Request::segment(1).".create")}}" class="btn btn-outline-success">
<i class="fa fa-plus"></i>
</a>
@endcan
</div>
@@ -0,0 +1,6 @@
<div class="main-container pb-4">
<form method="post" action="{{route(Request::segment(1).'.store')}}">
@include(Request::segment(1).'.form_input')
@include('Partials.Form.Input.Submit.submit_create')
</form>
</div>
@@ -0,0 +1,43 @@
<div class="main-container pb-4">
@include('Partials.Pages.index_top')
<table class="table table-striped">
<thead>
<th>@lang('name')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $object)
<tr>
<td class="align-middle">
@can(Request::segment(1).'_view')
<a href="{{route(Request::segment(1).'.show',[$data_name => $object])}}"
class="btn btn-success">
{{$object->name}}
</a>
@else
{{$object->name}}
@endcan
</td>
<td>
@can(Request::segment(1).'_edit')
<a href="{{route(Request::segment(1).'.edit',[$data_name => $object])}}"
class="btn btn-outline-success">
@lang('edit')
</a>
@endcan
@can(Request::segment(1).'_restore')
<a href="{{route(Request::segment(1).'.restore',[$data_name => $object])}}"
class="btn btn-outline-success">
@lang('restore')
</a>
@endcan
@can(Request::segment(1).'_delete_force')
@include('Partials.Form.Input.Modal.delete_force')
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
@include('Partials.Pages.display')
</div>
@@ -0,0 +1,15 @@
<div class="dropdown flex-right mt-2">
<button class="btn btn-secondary dropdown-toggle" type="button" id="Showdropdown" data-bs-toggle="dropdown" aria-expanded="false">
@lang('select')
</button>
<ul class="dropdown-menu" aria-labelledby="Showdropdown">
@if(Request::is(Request::segment(1)))
@can(Request::segment(1)."_viewAny_deleted")
<li><a class="dropdown-item" href="{{Request::segment(1)}}/deleted">@lang('deleted')</a></li>
@endcan
@else
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".index")}}">@lang('active')</a></li>
@endif
</ul>
</div>
@@ -0,0 +1,4 @@
{{$data->appends($_GET)->links()}}
<p>
@lang('displaying') {{$data->count()}} @lang('of'){{ $data->total() }} @lang($data_names).
</p>
@@ -0,0 +1,9 @@
<div class="main-container pb-4">
<form method="post" action="{{route(Request::segment(1).'.update',[$data_name => $data])}}">
@include(Request::segment(1).'.form_input')
@include('Partials.Form.Input.Submit.submit_edit')
</form>
@can(Request::segment(1).'_delete')
@include('Partials.Form.Input.Modal.delete')
@endcan
</div>
@@ -0,0 +1,17 @@
<div class="head-section">
@include('Partials.Pages.Search.search_bar')
@if(Request::segment(2) == null)
@can(Request::segment(1)."_create")
@if(!isset($without_create))
@include('Partials.Pages.create_button')
@endif
@endcan
@endif
</div>
@if(!isset($no_deleted))
<div>
@include('Partials.Pages.deleted_selector')
</div>
@else
<div class="mt-2"></div>
@endif
@@ -0,0 +1,78 @@
<button data-toggle="modal" data-target="#itemModal_{{$loan->id}}" class="btn btn-info">@lang('items')</button>
<div class="product-edit-buttons">
<!-- Modal -->
<div class="modal" tabindex="-1" role="dialog" id="itemModal_{{$loan->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('loan') @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($loans as $tracked)
@if($loan->date_start == $tracked->date_start)
@if($loan->date_end == $tracked->date_end)
@if($loan->user->id == $tracked->user->id)
<tr>
<td class="align-middle">
@switch($tracked->loanable_type)
@case('App\Models\Product')
@lang('product')
@break
@case('App\Models\Cabel')
@lang('cabel')
@break
@endswitch
</td>
<td class="align-middle">
@switch($tracked->loanable_type)
@case('App\Models\Product')
<a href="{{route('products.show',['product' => $tracked->loanable->id])}}" target="_blank" class="btn btn-success">
@if(config('app.barcode_mode') == 'dynamic')
{{$tracked->loanable->category->name}}.@if(!empty($tracked->loanable->subcategory->name)){{$tracked->loanable->subcategory->name}}.@endif{{$tracked->loanable->brand->name}}.{{$tracked->loanable->model->name}}@if(!empty($tracked->loanable->name)).{{$tracked->loanable->name}}@endif
@endif
@if(config('app.barcode_mode') == 'static')
{{$tracked->loanable->barcode}}
@endif
</a>
@break
@case('App\Models\Cabel')
<a href="{{route('cabels.show',['cabel' => $tracked->loanable->id])}}" target="_blank" class="btn btn-success">
{{$tracked->loanable->category->name}}.{{$tracked->loanable->name}}
</a>
@break
@endswitch
</td>
<td class="align-middle text-center">
{{$tracked->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">{{$loan->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>
@@ -0,0 +1,80 @@
<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>
@@ -0,0 +1,84 @@
<button data-toggle="modal" data-target="#pickupModal_{{$reservation->id}}" class="btn btn-outline-success">@lang('picked up')</button>
<div class="product-edit-buttons">
<!-- Modal -->
<div class="modal" tabindex="-1" role="dialog" id="pickupModal_{{$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('pickup')</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.pickup',['reservation' => $reservation->id])}}" method="post">
@csrf
<input type="submit" value="@lang('picked up')" class="btn btn-success">
</form>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,46 @@
<div class="dropdown flex-right mt-2">
<button class="btn btn-secondary dropdown-toggle" type="button" id="Showdropdown" data-bs-toggle="dropdown" aria-expanded="false">
@lang('select')
</button>
<ul class="dropdown-menu" aria-labelledby="Showdropdown">
@if(Request::is(Request::segment(1)))
@can(Request::segment(1)."_validate")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".validations")}}">@lang('validations')</a></li>
@endcan
@can(Request::segment(1)."_setup")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".setups")}}">@lang('setups')</a></li>
@endcan
@can(Request::segment(1)."_pickup")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".pickups")}}">@lang('pickups')</a></li>
@endcan
@elseif(Request::is(Request::segment(1)."/pickups"))
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".index")}}">@lang('all')</a></li>
@can(Request::segment(1)."_validate")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".validations")}}">@lang('validations')</a></li>
@endcan
@can(Request::segment(1)."_setup")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".setups")}}">@lang('setups')</a></li>
@endcan
@elseif(Request::is(Request::segment(1)."/setups"))
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".index")}}">@lang('all')</a></li>
@can(Request::segment(1)."_validate")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".validations")}}">@lang('validations')</a></li>
@endcan
@can(Request::segment(1)."_pickup")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".pickups")}}">@lang('pickups')</a></li>
@endcan
@elseif(Request::is(Request::segment(1)."/validations"))
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".index")}}">@lang('all')</a></li>
@can(Request::segment(1)."_setup")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".setups")}}">@lang('setups')</a></li>
@endcan
@can(Request::segment(1)."_pickup")
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".pickups")}}">@lang('pickups')</a></li>
@endcan
@else
<li><a class="dropdown-item" href="{{Route(Request::segment(1).".index")}}">@lang('all')</a></li>
@endif
</ul>
</div>
@@ -0,0 +1,84 @@
<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>
@@ -0,0 +1,4 @@
<div class="main-container pb-4">
@include('Partials.Pages.show_top')
@include(Request::segment(1).'.show_data')
</div>
@@ -0,0 +1,15 @@
<div class="row">
<div class="col-auto">
<h1>
@lang($data_name) : @if(!empty($data->name)){{$data->name}}@endif
</h1>
</div>
@can(Request::segment(1).'_edit')
<div class="col">
<a href="{{route(Request::segment(1).'.edit',[$data_name => $data])}}"
class="btn btn-outline-success ms-4 mt-2">
@lang('edit')
</a>
</div>
@endcan
</div>