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
+32
View File
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="da">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{ $title ?? 'login'}}</title>
<link rel="icon" type="image/png" href="SKPFullLogo.png">
<link rel="stylesheet" href={{ asset('css/app.css') }}>
<style>
body {
margin: 0;
padding-top: 90px;
}
</style>
</head>
<body class="">
<div class="container-fluid">
@if($errors->any())
@foreach($errors->all() as $error)
<div class="alert alert-danger" role="alert">
"{{$error}}"
</div>
@endforeach
@endif
@yield('content')
</div>
@include('Partials.footer')
</body>
</html>
+51
View File
@@ -0,0 +1,51 @@
<!doctype html>
<html lang="da">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="csrf-token" content="{{csrf_token()}}">
<!-- things with curly brackets and having dollar sign is something that comes from Controller -->
<title>{{ $title ?? 'Lagersystem' }}</title>
<link rel="icon" type="image/png" href="{{asset('SKPFullLogo.png')}}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.0/css/all.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<link rel="stylesheet" href={{ asset('css/app.css') }}>
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
</head>
<body>
@include('Partials.Navbar')
@if($errors->any())
@foreach($errors->all() as $error)
<div class="alert alert-danger" role="alert">
"{{$error}}"
</div>
@endforeach
@endif
<div class="container-fluid">
<div class="col 12 pt-4 pb-4 ">
<div class="row pe-3 ps-3 ">
<div class="col-6 ps-2" style="background-color: white">
<h5 class="text-capitalize">@lang(request()->segment(1))</h5>
</div>
<div class="col-6 text-end pe-2" style="background-color: white">
<h5 class="text-capitalize">@lang(request()->segment(1)) / @lang(request()->segment(2))</h5>
</div>
</div>
</div>
@yield('content')
</div>
@include('partials.footer')
<script src="https://code.jquery.com/jquery-1.12.0.min.js" ></script>
<script src="https://code.jquery.com/jquery-migrate-1.2.1.min.js" ></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
crossorigin="anonymous"></script>
@yield('scripting')
</body>
</html>
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.show_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,38 @@
<div class="row mt-2" >
<div class="col-2"></div>
<div class="col-1">
<button data-toggle="modal" data-target="#deleteModal_{{$data->id}}" class="btn btn-danger">@lang('delete')</button>
</div>
</div>
<div class="product-edit-buttons">
<!-- Modal -->
<div class="modal" tabindex="-1" role="dialog" id="deleteModal_{{$data->id}}">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="alert alert-danger" style="display:none"></div>
<div class="modal-header">
<h5 class="modal-title">@lang('delete') @lang($data_name)</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">
@lang($data_name) {{$data->name}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">@lang('cancel')</button>
<form method="post" action="{{route(Request::segment(1).'.destroy', [$data_name => $data])}}" id="deleteForm" class="form-inline">
@method('delete')
@csrf
<button class="btn btn-danger" id="ajaxSubmit">@lang('delete')</button>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
crossorigin="anonymous"></script>
@@ -0,0 +1,33 @@
<button data-toggle="modal" data-target="#deleteModal_{{$object->id}}" class="btn btn-outline-danger">@lang('delete_force')</button>
<div class="product-edit-buttons">
<!-- Modal -->
<div class="modal" tabindex="-1" role="dialog" id="deleteModal_{{$object->id}}">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="alert alert-danger" style="display:none"></div>
<div class="modal-header">
<h5 class="modal-title">@lang('deletion_force') @lang('of') @lang($data_name)</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">
@lang($data_name) {{$object->name}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">@lang('cancel')</button>
<form method="get" action="{{route(Request::segment(1).".forceDelete", [$data_name => $object])}}" id="deleteForm" class="form-inline">
@method('delete')
@csrf
<button class="btn btn-danger" id="ajaxSubmit">@lang('delete_force')</button>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
crossorigin="anonymous"></script>
@@ -0,0 +1,7 @@
<div class="mt-3 row">
@csrf
<div class="col-2"></div>
<div class="col-1">
<input type="submit" class="btn btn-success" value="@lang('create')">
</div>
</div>
@@ -0,0 +1,8 @@
<div class="row mt-3" >
@method('delete')
@csrf
<div class="col-2"></div>
<div class="col-1">
<input type="submit" class="btn btn-danger " value="@lang('delete')">
</div>
</div>
@@ -0,0 +1,8 @@
<div class="mt-3 row">
@method('put')
@csrf
<div class="col-2"></div>
<div class="col-1">
<input type="submit" class="btn btn-success" value="@lang('edit')">
</div>
</div>
@@ -0,0 +1,8 @@
<div class="mt-3 row">
@method('put')
@csrf
<div class="col-2"></div>
<div class="col-1">
<input type="submit" class="btn btn-success" value="@lang('update')">
</div>
</div>
@@ -0,0 +1,17 @@
<div class="mb-3 row">
<label for="amount_input" class="col-2 col-form-label fw-bold">@lang('amount') : </label>
<div class="col-10">
<input
type="number"
class="form-control"
name="amount"
id="amount_input"
placeholder="@lang('amount')"
@if(old('amount') !== null)
value="{{old('amount')}}"
@else
value="1"
@endif
>
</div>
</div>
@@ -0,0 +1,19 @@
<div class="mb-3 row">
<label for="barcode_input" class="col-2 col-form-label fw-bold">@lang('barcode') : </label>
<div class="col-10">
<input
type="text"
class="form-control"
name="barcode"
id="barcode_input"
placeholder="@lang('barcode')"
@if(old('barcode') !== null)
value="{{old('barcode')}}"
@else
@if(isset($data->barcode))
value="{{$data->barcode}}"
@endif
@endif
>
</div>
</div>
@@ -0,0 +1,31 @@
<div class="mb-3 row">
<label for="building_input" class="col-2 col-form-label fw-bold">@lang('brand') : </label>
<div class="col-10">
<select name="brand_id" id="brand_input" class="form-select" required>
<option value="" @if(old('brand_id') !== null) selected @endif>@lang('please_select')</option>
@foreach($brands as $brand)
<option
value="{{$brand->id}}"
@if(old('brand_id') !== null)
@if($brand->id == old('brand_id'))
selected
@endif
@else
@if(isset($data))
@if($brand->id == $data->brand->id)
selected
@endif
@endif
@endif
>
{{$brand->name}}
</option>
@endforeach
</select>
</div>
</div>
<script>
$("#brand_input").on( "input",function() {
$("#brand_input option:contains('Vælg...')").remove();
});
</script>
@@ -0,0 +1,27 @@
<div class="mb-3 row">
<label for="building_input" class="col-2 col-form-label fw-bold">@lang('building') : </label>
<div class="col-10">
<select name="building_id" id="building_input" class="form-select">
@foreach($buildings as $building)
<option
value="{{$building->id}}"
@if(old('building_id') !== null)
@if($building->id == old('building_id'))
selected
@endif
@else
@if(isset($data))
@if($building->id == $data->building->id)
selected
@endif
@endif
@endif
>
{{$building->name}}
</option>
@endforeach
</select>
</div>
</div>
@@ -0,0 +1,67 @@
<div class="mb-3 row">
<label class="col-2 col-form-label fw-bold">@lang('cabels') : </label>
<div class="col-10">
<table class="table table-striped">
<thead>
<th>@lang('barcode')</th>
<th class="text-center">@lang('available')</th>
<th class="text-center">@lang('amount')</th>
<th class="text-center">@lang('action')</th>
</thead>
<tbody id="cabel_input_container">
<datalist id="cabels">
@foreach($cabels as $cabel)
<option data-available="{{$cabel->total - (count($cabel->loans) + count($cabel->reservations))}}" data-cabel-id="{{$cabel->id}}">{{$cabel->category->name}}.{{$cabel->name}}</option>
@endforeach
</datalist>
<tr>
<button type="button" id="cabel_add_button" class="btn btn-outline-success mb-4">@lang('add') @lang('cabel')</button>
</tr>
</tbody>
</table>
</div>
</div>
<script>
var cabel_count = 0;
$("#cabel_add_button").click(function(){
let cabel_table = $("#cabel_input_container");
cabel_table.append('<tr><td class="col align-middle"><div class="input-group"><input type="text" name="cabels[' + cabel_count + ']" id="cabel_' + cabel_count + '_input" class="form-control" placeholder="Barcode" list="cabels" data-cabel-index="' + cabel_count + '" oninput="cabel_barcode_change(this)" required></div></td><td id="cabel_' + cabel_count + '_available" class="col-1 text-center align-middle">0</td><td class="col-1 text-center align-middle"><input type="number" id="cabel_' + cabel_count + '_amount" name="cabel_amount[' + cabel_count + ']" class="form-control text-center" step="1" min="0" max="0" @if(old("cabel_' + cabel_count + '_amount"))value="old("cabel_' + cabel_count + '_amount")"@else value="0" @endif required disabled><input type="hidden" name="cabel_id[' + cabel_count + ']" id="cabel_' + cabel_count + '_id" value="0"></td><td class="col-2 text-center align-middle"><button type="button" onclick="cabel_barcode_remove(this)" class="btn btn-outline-danger">@lang('remove') @lang('cabel')</button></td></tr>');
cabel_count += 1;
});
function cabel_barcode_remove(elem) {
let this_row = $(elem).parent().parent().remove();
}
function cabel_barcode_change(elem){
let cabel_index = $(elem).data('cabel-index');
let cabel_input = $("#cabel_" + cabel_index + "_input");
var available = $('#cabels option').filter(function() {
return this.value == cabel_input.val();
}).data('available');
var cabel_id = $('#cabels option').filter(function() {
return this.value == cabel_input.val();
}).data('cabel-id');
if(available == null || typeof available === "undefined"){
$("#cabel_" + cabel_index + "_available").html(0);
$("#cabel_" + cabel_index + "_amount").prop('min',0);
$("#cabel_" + cabel_index + "_amount").prop('max',0);
$("#cabel_" + cabel_index + "_amount").val(0);
$("#cabel_" + cabel_index + "_amount").prop('disabled',true);
$("#cabel_" + cabel_index + "_id").val(0);
}
else{
$("#cabel_" + cabel_index + "_available").html(available);
$("#cabel_" + cabel_index + "_amount").prop('min',1);
$("#cabel_" + cabel_index + "_amount").prop('max',available);
$("#cabel_" + cabel_index + "_amount").val(1);
$("#cabel_" + cabel_index + "_amount").prop('disabled',false);
$("#cabel_" + cabel_index + "_id").val(cabel_id);
}
}
</script>
@@ -0,0 +1,89 @@
<div class="mb-3 row">
<label class="col-2 col-form-label fw-bold">@lang('cabels') : </label>
<div class="col-10">
<table class="table table-striped">
<thead>
<th>@lang('barcode')</th>
<th class="text-center">@lang('lent')</th>
<th class="text-center">@lang('amount')</th>
<th class="text-center">@lang('action')</th>
</thead>
<tbody id="cabel_input_container">
<datalist id="cabels">
@foreach($cabels as $cabel)
<option data-lent="{{count($cabel->loans)}}" data-cabel-id="{{$cabel->id}}">{{$cabel->category->name}}.{{$cabel->name}}</option>
@endforeach
</datalist>
<tr>
<button type="button" id="cabel_add_button" class="btn btn-outline-success mb-4">@lang('add') @lang('cabel')</button>
</tr>
</tbody>
</table>
</div>
</div>
<script>
var cabel_count = 0;
$("#cabel_add_button").click(function(){
let cabel_table = $("#cabel_input_container");
cabel_table.append('<tr><td class="col align-middle"><div class="input-group"><input type="text" name="cabels[' + cabel_count + ']" id="cabel_' + cabel_count + '_input" class="form-control" placeholder="@lang("barcode")" list="cabels" data-cabel-index="' + cabel_count + '" oninput="cabel_barcode_change(this)" required></div></td><td id="cabel_' + cabel_count + '_lent" class="col-1 text-center align-middle">0</td><td class="col-1 text-center align-middle" id="cabel_' + cabel_count + '_actions"><input type="number" id="cabel_' + cabel_count + '_amount" name="cabel_amount[' + cabel_count + ']" class="form-control text-center" step="1" min="0" max="0" @if(old("cabel_' + product_count + '_amount"))value="old("cabel_' + cabel_count + '_amount")"@else value="0" @endif required disabled><input type="hidden" name="cabel_id[' + cabel_count + ']" id="cabel_' + cabel_count + '_id" value="0"></td><td class="col-2 text-center align-middle"><button type="button" onclick="cabel_barcode_remove(this)" class="btn btn-outline-danger me-2">@lang('remove') @lang('product')</button></td><td id="cabel_'+ cabel_count + '_note_container" class="align-middle"></td></tr>');
cabel_count += 1;
});
function cabel_barcode_remove(elem) {
let this_row = $(elem).parent().parent().remove();
}
function cabel_barcode_change(elem){
let cabel_index = $(elem).data('cabel-index');
let cabel_input = $("#cabel_" + cabel_index + "_input");
let note_container = $('#cabel_'+ cabel_index + '_note_container');
var lent = $('#cabels option').filter(function() {
return this.value == cabel_input.val();
}).data('lent');
var cabel_id = $('#cabels option').filter(function() {
return this.value == cabel_input.val();
}).data('cabel-id');
if(lent == null || typeof lent === "undefined"){
$("#cabel_" + cabel_index + "_lent").html(0);
$("#cabel_" + cabel_index + "_amount").prop('min',0);
$("#cabel_" + cabel_index + "_amount").prop('max',0);
$("#cabel_" + cabel_index + "_amount").val(0);
$("#cabel_" + cabel_index + "_amount").prop('disabled',true);
$("#cabel_" + cabel_index + "_id").val(0);
note_container.empty();
}
else{
$("#cabel_" + cabel_index + "_lent").html(lent);
$("#cabel_" + cabel_index + "_amount").prop('min',1);
$("#cabel_" + cabel_index + "_amount").prop('max',lent);
$("#cabel_" + cabel_index + "_amount").val(1);
$("#cabel_" + cabel_index + "_amount").prop('disabled',false);
$("#cabel_" + cabel_index + "_id").val(cabel_id);
note_container.append('<button type="button" onclick="cabel_note_add(this)" class="btn btn-outline-danger" data-cabel-index="' + cabel_index +'" data-cabel-id="' + cabel_id +'">@lang('add') @lang('note')</button>');
}
}
function cabel_note_add(elem) {
$(elem).hide();
let index = $(elem).data('cabel-index');
let cabel_id = $(elem).data('cabel-id');
let note_container = $('#cabel_'+ index + '_note_container');
note_container.append('<select name="cabel_note_type[' + index + ']" id="cabel_' + index + '_note_type" class="form-select w-25 d-inline me-2 align-middle">');
let note_selector = $("#cabel_" + index + "_note_type");
let note_types = {!! json_encode($note_types) !!};
note_types.forEach(function(item){
note_selector.append("<option value=" + item['id'] + ">" + item['name'] + "</option>");
})
note_container.append('</select>');
note_container.append('<textarea rows=1 placeholder="@lang("note")" class="form-control d-inline w-50 align-middle" name="cabel_note_text[' + index + ']" required></textarea>');
note_container.append('<input type="checkbox" name="cabel_note_remove['+ index +']" id="cabel_' + index + '_note_remove" class="align-top ms-2 mt-4" checked>');
note_container.append('<label for="cabel_' + index + '_note_remove" class="align-top mt-3 ms-2 fw-bold">@lang("amount_remove") </label');
note_container.append('<input type="hidden" name="cabel_note_id[' + index +']" value="' + cabel_id + '">');
}
</script>
@@ -0,0 +1,31 @@
<div class="mb-3 row">
<label for="product_category" class="col-2 col-form-label fw-bold">@lang('category') : </label>
<div class="col-10">
<select name="category_id" id="category_input" class="form-select" required>
<option value="" @if(old('category_id') !== null) selected @endif>@lang('please_select')</option>
@foreach($categories as $category)
<option
value="{{$category->id}}"
@if(old('category_id') !== null)
@if($building->id == old('category_id'))
selected
@endif
@else
@if(isset($data))
@if($category->id == $data->category->id)
selected
@endif
@endif
@endif
>
{{$category->name}}
</option>
@endforeach
</select>
</div>
</div>
<script>
$("#category_input").on( "input",function() {
$("#category_input option:contains('Vælg...')").remove();
});
</script>
@@ -0,0 +1,29 @@
<div class="mb-3 row">
<label for="name_input" class="col-2 col-form-label fw-bold">@lang('city') : </label>
<div class="col-2 pe-2">
<input
type="number"
class="form-control"
name="zip"
id="zip_input"
placeholder="@lang('zip') @lang('number')"
@if(old('zip') !== null)
value="{{old('zip')}}"
@endif
required
>
</div>
<div class="col-8">
<input
type="text"
class="form-control"
name="city"
id="city_input"
placeholder="@lang('name')"
@if(old('city') !== null)
value="{{old('city')}}"
@endif
required
>
</div>
</div>
@@ -0,0 +1,42 @@
<div class="mb-3 row">
<label for="date_end_input" class="col-2 col-form-label fw-bold">@lang('date_end') : </label>
@if(isset($date_end_permanent))
<div class="col-1 align-middle pt-2">
<input type="checkbox" id="permanent_input" name="permanent" class="form-check-input" oninput="permanent_change(this)">
<label for="permanent_input" class="form-check-label fw-bold">@lang('permanent')</label>
</div>
@endif
<div
@if(isset($date_end_permanent))
class="col-9 align-middle"
@else
class="col-10"
@endif
>
<input
type="date"
class="form-control"
name="date_end"
id="date_end_input"
placeholder="@lang('date_end')"
min="{{date('Y-m-d',strtotime(now()))}}"
@if(old('date_end') !== null)
value="{{old('date_end')}}"
@elseif(isset($data->date_end))
value="{{date('Y-m-d',strtotime($data->date_end))}}"
@else
value="{{date('Y-m-d',strtotime(now()))}}"
@endif
required
>
</div>
</div>
<script>
function permanent_change(elem){
if ($(elem).is(':checked')) {
$('#date_end_input').prop('disabled', true);
} else {
$('#date_end_input').prop('disabled', false);
}
}
</script>
@@ -0,0 +1,24 @@
<div class="mb-3 row">
<label for="date_start_input" class="col-2 col-form-label fw-bold">@lang('date_start') : </label>
<div class="col-10">
<input
type="date"
class="form-control"
name="date_start"
id="date_start_input"
placeholder="@lang('date_start')"
min="{{date('Y-m-d',strtotime(now()))}}"
@if(old('date_start') !== null)
value="{{old('date_start')}}"
@elseif(isset($data->date_start))
value="{{$data->date_start}}"
@else
value="{{date('Y-m-d',strtotime(now()))}}"
@endif
required
@if(isset($date_start_locked))
disabled
@endif
>
</div>
</div>
@@ -0,0 +1,6 @@
<div class="mb-3 row">
<label for="description_input" class="col-2 col-form-label fw-bold">@lang('description') : </label>
<div class="col-10">
<textarea name="description" id="description_input" class="form-control form-textarea" placeholder="@lang('description')">@if(old('description')){{old('description')}}@elseif(isset($data->description)){{$data->description}}@endif</textarea>
</div>
</div>
@@ -0,0 +1,15 @@
<div class="mb-3 row">
<label for="email_input" class="col-2 col-form-label fw-bold">@lang('email') : </label>
<div class="col-10">
<input
type="email"
class="form-control"
name="email"
id="email_input"
placeholder="@lang('email')"
@if(old('email') !== null)
value="{{old('email')}}"
@endif
>
</div>
</div>
@@ -0,0 +1,33 @@
<div class="mb-3 row">
<label class="col-2 col-form-label fw-bold">@lang('laptop') : </label>
<div class="col-10">
<datalist id="laptops">
@foreach($laptops as $laptop)
@if(config('app.barcode_mode') == 'dynamic')
<option data-laptop-id="{{$laptop->id}}">{{$laptop->category->name}}.@if(!empty($laptop->subcategory->name)){{$laptop->subcategory->name}}.@endif{{$laptop->brand->name}}.{{$laptop->model->name}}@if(!empty($laptop->name)).{{$laptop->name}}@endif</option>
@elseif(config('app.barcode_mode') == 'static')
<option data-laptop-id="{{$laptop->id}}">{{$laptop->barcode}}</option>
@endif
@endforeach
</datalist>
<input type="text" name="laptop" id="laptop_input" class="form-control" placeholder="@lang('barcode')" list="laptops" oninput="laptop_barcode_change(this)" required>
<input type="hidden" name="laptop_id" id="laptop_id" value=""></td>
</tr>
</div>
</div>
<script>
function laptop_barcode_change(elem){
let laptop_input = $("#laptop_input");
var laptop_id = $('#laptops option').filter(function() {
return this.value == laptop_input.val();
}).data('laptop-id');
if(laptop_id == null || typeof laptop_id === "undefined"){
$("#laptop_id").val();
}
else{
$("#laptop_id").val(laptop_id);
}
}
</script>
@@ -0,0 +1,11 @@
<div class="mb-3 row">
<label for="name_input" class="col-2 col-form-label fw-bold">@lang('accessories') : </label>
<div class="col-1 pe-2">
<input type="checkbox" name="bag" id="bag_input" class="form-check-input">
<label for="bag_input" class="form-check-label fw-bold">@lang('bag')</label>
</div>
<div class="col-1 pe-2">
<input type="checkbox" name="lock" id="lock_input" class="form-check-input">
<label for="lock_input" class="form-check-label fw-bold">@lang('lock')</label>
</div>
</div>
@@ -0,0 +1,46 @@
<div class="mb-3 row">
<label for="model_input" class="col-2 col-form-label fw-bold">@lang('model') : </label>
<div class="col-10">
<select name="model_id" id="model_input" class="form-select" disabled required>
<option value="" @if(old('model_id') !== null) selected @endif>@lang('please_select')</option>
@foreach($models as $model)
<option
value="{{$model->id}}"
@if(old('model_id') !== null)
@if($model->id == old('model_id'))
selected
@endif
@else
@if(isset($data))
@if(!empty($data->model))
@if($model->id == $data->model->id)
selected
@endif
@endif
@endif
@endif
>
{{$model->name}}
</option>
@endforeach
</select>
</div>
</div>
<script>
$("#brand_input").on( "input",function() {
$('#model_input').prop("disabled", false);
$('#model_input').children().remove().end();
$('#model_input').append(`<option disabled selected value="">@lang('please_select')</option>`);
let models = {!! json_encode($models) !!};
models.forEach(function(item){
if(item['brand_id'] == $('#brand_input').val()){
$('#model_input').append(`<option value="` + item['id'] +`">` + item['name'] + `</option>`);
}
})
});
$("#model_input").on( "input",function() {
$("#model_input option:contains('Vælg...')").remove();
});
</script>
@@ -0,0 +1,19 @@
<div class="mb-3 row">
<label for="name_input" class="col-2 col-form-label fw-bold">@lang('name') : </label>
<div class="col-10">
<input
type="text"
class="form-control"
name="name"
id="name_input"
placeholder="@lang('name')"
@if(old('name') !== null)
value="{{old('name')}}"
@else
@if(isset($data->name))
value="{{$data->name}}"
@endif
@endif
>
</div>
</div>
@@ -0,0 +1,30 @@
<div class="mb-3 row">
<label for="password_input" class="col-2 col-form-label fw-bold">@lang('password') : </label>
<div class="col-10">
<input
type="password"
class="form-control"
name="password"
id="password_input"
pattern="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-.]).{8,}$"
placeholder="@lang('password')"
value="{{old('password')}}"
>
</div>
</div>
@if(isset($password_input_repeat))
<div class="mb-3 row">
<label for="password_input_repeat" class="col-2 col-form-label fw-bold">@lang('password_repeat') : </label>
<div class="col-10">
<input
type="password"
class="form-control"
name="password_repeat"
id="password_input_repeat"
pattern="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-.]).{8,}$"
placeholder="@lang('password_repeat')"
value="{{old('password_repeat')}}"
>
</div>
</div>
@endif
@@ -0,0 +1,720 @@
<div class="mb-3 row">
<span class="col-2 col-form-label fw-bold">@lang('permissions') : </span>
<div class="col-10">
<ul class="ulBorder">
<li>
<input type="checkbox" class="all-rights-checkbox" name="allPermission" id="allPermission">
<label class="form-check-label all-rights-label" for="allPermission">@lang('all') @lang('permissions')</label>
<ul>
<!-- Homepage -->
<li class="current sub_cat_box top-border ">
<input type="checkbox" name="home_page" id="home_page" {{ in_array('home_page', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="home_page">@lang('homepage')</label>
</li>
<!-- brands -->
<li class="current sub_cat_box">
<input type="checkbox">
<label class="form-check-label">@lang('brand') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="brands_viewAny" id="brands_viewAny" {{ in_array('brands_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="brands_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="brands_viewAny_deleted" id="brands_viewAny_deleted" {{ in_array('brands_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="brand_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="brands_view" id="brands_view" {{ in_array('brands_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="brands_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="brands_create" id="brands_create" {{ in_array('brands_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="brands_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="brands_edit" id="brands_edit" {{ in_array('brands_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="brands_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="brands_delete" id="brands_delete" {{ in_array('brands_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="brands_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="brands_delete_force" id="brands_delete_force" {{ in_array('brands_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="brands_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="brands_restore" id="brands_restore" {{ in_array('brands_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="brands_restore">@lang('restore')</label>
</li>
</ul>
</li>
<!-- models -->
<li class="current sub_cat_box">
<input type="checkbox">
<label class="form-check-label">@lang('model') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="models_viewAny" id="models_viewAny" {{ in_array('models_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="models_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="models_viewAny_deleted" id="models_viewAny_deleted" {{ in_array('models_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="models_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="models_view" id="models_view" {{ in_array('models_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="models_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="models_create" id="models_create" {{ in_array('models_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="models_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="models_edit" id="models_edit" {{ in_array('models_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="models_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="models_delete" id="models_delete" {{ in_array('models_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="models_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="models_delete_force" id="models_delete_force" {{ in_array('models_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="models_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="models_restore" id="models_restore" {{ in_array('models_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="models_restore">@lang('restore')</label>
</li>
</ul>
</li>
<!-- products -->
<li class="current sub_cat_box">
<input type="checkbox">
<label class="form-check-label">@lang('product') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="products_viewAny" id="products_viewAny" {{ in_array('products_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="products_viewAny_deleted" id="products_viewAny_delete" {{ in_array('products_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="products_view" id="products_view" {{ in_array('products_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="products_create" id="products_create" {{ in_array('products_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="products_edit" id="products_edit" {{ in_array('products_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="products_delete" id="products_delete" {{ in_array('products_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="products_delete_force" id="products_delete_force" {{ in_array('products_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="products_restore" id="products_restore" {{ in_array('products_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_restore">@lang('restore')</label>
</li>
<li>
<input type="checkbox" name="products_amount_add" id="products_amount_add" {{ in_array('products_amount_add', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_amount_add">@lang('amount_add')</label>
</li>
<li>
<input type="checkbox" name="products_amount_remove" id="products_amount_remove" {{ in_array('products_amount_remove', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="products_amount_remove">@lang('amount_remove')</label>
</li>
</ul>
</li>
<!-- products categories -->
<li class="current sub_cat_box">
<input type="checkbox" name="">
<label class="form-check-label" for="category">@lang('product') @lang('category') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="categories_viewAny" id="categories_viewAny" {{ in_array('categories_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="categories_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="categories_viewAny_deleted" id="categories_viewAny_deleted" {{ in_array('categories_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="categories_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="categories_view" id="categories_view" {{ in_array('categories_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="categories_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="categories_create" id="categories_create" {{ in_array('categories_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="categories_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="categories_edit" id="categories_edit" {{ in_array('categories_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="categories_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="categories_delete" id="categories_delete" {{ in_array('categories_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="categories_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="categories_delete_force" id="categories_delete_force" {{ in_array('categories_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="categories_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="categories_restore" id="categories_restore" {{ in_array('categories_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="categories_restore">@lang('restore')</label>
</li>
</ul>
</li>
<!-- products subcategories -->
<li class="current sub_cat_box">
<input type="checkbox" name="">
<label class="form-check-label" for="subcategory">@lang('product') @lang('subcategory') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="subcategories_viewAny" id="subcategories_viewAny" {{ in_array('subcategories_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="subcategories_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="subcategories_viewAny_deleted" id="subcategories_viewAny_deleted" {{ in_array('subcategories_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="subcategories_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="subcategories_view" id="subcategories_view" {{ in_array('subcategories_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="subcategories_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="subcategories_create" id="subcategories_create" {{ in_array('subcategories_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="subcategories_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="subcategories_edit" id="subcategories_edit" {{ in_array('subcategories_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="subcategories_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="subcategories_delete" id="subcategories_delete" {{ in_array('subcategories_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="subcategories_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="subcategories_delete_force" id="subcategories_delete_force" {{ in_array('subcategories_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="subcategories_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="subcategories_restore" id="subcategories_restore" {{ in_array('subcategories_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="subcategories_restore">@lang('restore')</label>
</li>
</ul>
</li>
<!-- users -->
<li class="current sub_cat_box">
<input type="checkbox">
<label class="form-check-label">@lang('user') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="users_viewAny" id="users_viewAny" {{ in_array('users_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="users_viewAny_deleted" id="users_viewAny_deleted" {{ in_array('users_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="users_view" id="users_view" {{ in_array('users_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="users_create" id="users_create" {{ in_array('users_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="users_edit" id="users_edit" {{ in_array('users_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="users_edit_role" id="users_edit_role" {{ in_array('users_edit_role', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_edit_role">@lang('update') @lang('role')</label>
</li>
<li>
<input type="checkbox" name="users_edit_username" id="users_edit_username" {{ in_array('users_edit_username', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_edit_username">@lang('update') @lang('username')</label>
</li>
<li>
<input type="checkbox" name="users_delete" id="users_delete" {{ in_array('users_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="users_delete_force" id="users_delete_force" {{ in_array('users_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="users_restore" id="users_restore" {{ in_array('users_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="users_restore">@lang('restore')</label>
</li>
</ul>
</li>
<!-- PDF -->
<li class="current sub_cat_box">
<input type="checkbox" >
<label class="form-check-label">PDF @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="pdf_viewAny" id="pdf_viewAny" {{ in_array('pdf_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="pdf_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="pdf_view" id="pdf_view" {{ in_array('pdf_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="pdf_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="pdf_delete" id="pdf_delete" {{ in_array('pdf_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="pdf_delete">@lang('delete')</label>
</li>
</ul>
</li>
<!-- buildings -->
<li class="current sub_cat_box">
<input type="checkbox">
<label class="form-check-label">@lang('building') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="buildings_viewAny" id="buildings_viewAny" {{ in_array('buildings_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="buildings_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="buildings_viewAny_deleted" id="buildings_viewAny_deleted" {{ in_array('buildings_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="buildings_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="buildings_view" id="buildings_view" {{ in_array('buildings_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="buildings_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="buildings_create" id="buildings_create" {{ in_array('buildings_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="buildings_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="buildings_edit" id="buildings_edit" {{ in_array('buildings_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="buildings_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="buildings_delete" id="buildings_delete" {{ in_array('buildings_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="buildings_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="buildings_delete_force" id="buildings_delete_force" {{ in_array('buildings_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="buildings_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="buildings_restore" id="buildings_restore" {{ in_array('buildings_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="buildings_restore">@lang('restore')</label>
</li>
</ul>
</li>
<!-- rooms -->
<li class="current sub_cat_box">
<input type="checkbox">
<label class="form-check-label">@lang('room') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="rooms_viewAny" id="rooms_viewAny" {{ in_array('rooms_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="rooms_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="rooms_viewAny_deleted" id="rooms_viewAny_deleted" {{ in_array('rooms_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="rooms_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="rooms_view" id="rooms_view" {{ in_array('rooms_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="rooms_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="rooms_create" id="rooms_create" {{ in_array('rooms_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="rooms_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="rooms_edit" id="rooms_edit" {{ in_array('rooms_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="rooms_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="rooms_delete" id="rooms_delete" {{ in_array('rooms_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="rooms_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="rooms_delete_force" id="rooms_delete_force" {{ in_array('rooms_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="rooms_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="rooms_restore" id="rooms_restore" {{ in_array('rooms_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="rooms_restore">@lang('restore')</label>
</li>
</ul>
</li>
<li class="current sub_cat_box">
<input type="checkbox" >
<label class="form-check-label">@lang('cabel') @lang('category') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="cabelCategories_viewAny" id="cabelCategories_viewAny" {{ in_array('cabelCategories_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabelCategories_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="cabelCategories_viewAny_deleted" id="cabelCategories_viewAny_deleted" {{ in_array('cabelCategories_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabelCategories_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="cabelCategories_view" id="cabelCategories_view" {{ in_array('cabelCategories_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabelCategories_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="cabelCategories_create" id="cabelCategories_create" {{ in_array('cabelCategories_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabelCategories_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="cabelCategories_edit" id="cabelCategories_edit" {{ in_array('cabelCategories_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabelCategories_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="cabelCategories_delete" id="cabelCategories_delete" {{ in_array('cabelCategories_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabelCategories_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="cabelCategories_delete_force" id="cabelCategories_delete_force" {{ in_array('cabelCategories_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabelCategories_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="cabelCategories_restore" id="cabelCategories_restore" {{ in_array('cabelCategories_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabelCategories_restore">@lang('restore')</label>
</li>
</ul>
</li>
<li class="current sub_cat_box">
<input type="checkbox" >
<label class="form-check-label">@lang('cabel') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="cabels_viewAny" id="cabels_viewAny" {{ in_array('cabels_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="cabels_viewAny_deleted" id="cabels_viewAny_deleted" {{ in_array('cabels_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="cabels_view" id="cabels_view" {{ in_array('cabels_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="cabels_create" id="cabels_create" {{ in_array('cabels_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="cabels_edit" id="cabels_edit" {{ in_array('cabels_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="cabels_delete" id="cabels_delete" {{ in_array('cabels_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="cabels_delete_force" id="cabels_delete_force" {{ in_array('cabels_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="cabels_amount_add" id="cabels_amount_add" {{ in_array('cabels_amount_add', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_amount_add">@lang('amount_add')</label>
</li>
<li>
<input type="checkbox" name="cabels_amount_remove" id="cabels_amount_remove" {{ in_array('cabels_amount_remove', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="cabels_amount_remove">@lang('amount_remove')</label>
</li>
</ul>
</li>
<li class="current sub_cat_box">
<input type="checkbox" >
<label class="form-check-label">@lang('role') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="roles_viewAny" id="roles_viewAny" {{ in_array('roles_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="roles_viewAny_deleted" id="roles_viewAny_deleted" {{ in_array('roles_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="roles_view" id="roles_view" {{ in_array('roles_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="roles_create" id="roles_create" {{ in_array('roles_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="roles_edit" id="roles_edit" {{ in_array('roles_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="roles_edit_permissions" id="roles_edit_permissions" {{ in_array('roles_edit_permissions', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_edit_permissions">@lang('give') @lang('permissions')</label>
</li>
<li>
<input type="checkbox" name="roles_delete" id="roles_delete" {{ in_array('roles_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="roles_delete_force" id="roles_delete_force" {{ in_array('roles_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="roles_restore" id="roles_restore" {{ in_array('roles_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="roles_restore">@lang('restore')</label>
</li>
</ul>
</li>
<li class="current sub_cat_box">
<input type="checkbox" >
<label class="form-check-label">@lang('loan') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="loans_viewAny" id="loans_viewAny" {{ in_array('loans_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="loans_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="loans_create_user" id="loans_create_user" {{ in_array('loans_create_user', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="loans_create_user">@lang('create') @lang('user') @lang('loan')</label>
</li>
<li>
<input type="checkbox" name="loans_create_laptop" id="loans_create_laptop" {{ in_array('loans_create_laptop', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="loans_create_laptop">@lang('create') @lang('laptop') @lang('loan')</label>
</li>
<li>
<input type="checkbox" name="loans_return" id="loans_return" {{ in_array('loans_return', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="loans_return">@lang('return')</label>
</li>
<li>
<input type="checkbox" name="loans_adjust" id="loans_adjust" {{ in_array('loans_adjust', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="loans_adjust">@lang('adjust') @lang('date_end')</label>
</li>
</ul>
</li>
<li class="current sub_cat_box">
<input type="checkbox" >
<label class="form-check-label">@lang('reservation') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="reservations_viewAny" id="reservations_viewAny" {{ in_array('reservations_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="reservations_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="reservations_create" id="reservations_create" {{ in_array('reservations_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="reservations_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="reservations_cancel" id="reservations_cancel" {{ in_array('reservations_cancel', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="reservations_cancel">@lang('cancel')</label>
</li>
<li>
<input type="checkbox" name="reservations_validate" id="reservations_validate" {{ in_array('reservations_validate', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="reservations_validate">@lang('validate')</label>
</li>
<li>
<input type="checkbox" name="reservations_setup" id="reservations_setup" {{ in_array('reservations_setup', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="reservations_setup">@lang('setup')</label>
</li>
<li>
<input type="checkbox" name="reservations_pickup" id="reservations_pickup" {{ in_array('reservations_pickup', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="reservations_pickup">@lang('pickup')</label>
</li>
<li>
<input type="checkbox" name="reservations_return" id="reservations_return" {{ in_array('reservations_return', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="reservations_return">@lang('return')</label>
</li>
<li>
<input type="checkbox" name="reservations_adjust" id="reservations_adjust" {{ in_array('reservations_adjust', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="reservations_adjust">@lang('adjust') @lang('date_end')</label>
</li>
</ul>
</li>
<li class="current sub_cat_box">
<input type="checkbox" >
<label class="form-check-label">@lang('note') @lang('permissions')</label>
<ul>
<li>
<input type="checkbox" name="notes_viewAny" id="notes_viewAny" {{ in_array('notes_viewAny', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="notes_viewAny">@lang('viewAny')</label>
</li>
<li>
<input type="checkbox" name="notes_viewAny_deleted" id="notes_viewAny_deleted" {{ in_array('notes_viewAny_deleted', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="notes_viewAny_deleted">@lang('viewAny_deleted')</label>
</li>
<li>
<input type="checkbox" name="notes_view" id="notes_view" {{ in_array('notes_view', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="notes_view">@lang('view')</label>
</li>
<li>
<input type="checkbox" name="notes_create" id="notes_create" {{ in_array('notes_create', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="notes_create">@lang('create')</label>
</li>
<li>
<input type="checkbox" name="notes_edit" id="notes_edit" {{ in_array('notes_edit', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="notes_edit">@lang('edit')</label>
</li>
<li>
<input type="checkbox" name="notes_delete" id="notes_delete" {{ in_array('notes_delete', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="notes_delete">@lang('delete')</label>
</li>
<li>
<input type="checkbox" name="notes_delete_force" id="notes_delete_force" {{ in_array('notes_delete_force', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="notes_delete_force">@lang('delete_force')</label>
</li>
<li>
<input type="checkbox" name="notes_restore" id="notes_restore" {{ in_array('notes_restore', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="notes_restore">@lang('restore')</label>
</li>
</ul>
</li>
<li class="current sub_cat_box">
<input type="checkbox" name="logs_viewAny" id="logs_viewAny" {{ in_array('logs_viewAny', $permissions) ? 'checked' : null }}>
<label for="logs_viewAny" class="form-check-label">@lang('log') @lang('permissions')</label>
</li>
<li class="current sub_cat_box">
<input type="checkbox" name="statistics" id="statistics" {{ in_array('statistics', $permissions) ? 'checked' : null }}>
<label class="form-check-label" for="statistics">@lang('stat') @lang('permissions')</label>
</li>
</ul>
</li>
</ul>
</div>
</div>
@section('scripting')
<script>
// in any of the input fields with the type checkbox change the function is run
$('input[type="checkbox"]').change(function(e) {
let checked = $(this).prop("checked"),
container = $(this).parent(),
siblings = container.siblings();
// goes through the parent to find its children and checks them
container.find('input[type="checkbox"]').prop({
indeterminate: false,
checked: checked
});
function checkSiblings(el) {
let parent = el.parent().parent(),
all = true;
el.siblings().each(function() {
let returnValue = all = ($(this).children('input[type="checkbox"]').prop("checked") === checked);
return returnValue;
});
if (all && checked) {
parent.children('input[type="checkbox"]').prop({
indeterminate: false,
checked: checked
});
checkSiblings(parent);
} else if (all && !checked) {
parent.children('input[type="checkbox"]').prop("checked", checked);
parent.children('input[type="checkbox"]').prop("indeterminate", (parent.find('input[type="checkbox"]:checked').length > 0));
checkSiblings(parent);
} else {
el.parents("li").children('input[type="checkbox"]').prop({
indeterminate: true,
checked: false
});
}
}
checkSiblings(container);
// Get current permissions groups checkbox
let containerCheckBox = container.parent().parent().children('input[type="checkbox"]');
// Check if checkbox is all permissions
if(container.children().hasClass('all-rights-checkbox')){
if (checked)
container.children().find('ul').show();
else
container.children().find('ul').hide();
}else {
// Check if permission checkbox is group parent
if (container.hasClass('sub_cat_box')) {
if (checked)
container.find('ul').show();
else
container.find('ul').hide();
// Check if checkbox is a sub permission
} else {
if (checked)
container.parent().parent().find('ul').show();
else {
if (containerCheckBox.prop('indeterminate'))
container.parent().parent().find('ul').show();
}
}
}
});
$(".current").click(function(e){
$(this).find('ul').toggle();
})
$(() => {
let checkBoxes = $('.ulBorder').find('.sub_cat_box > input[type="checkbox"]');
$.each(checkBoxes, (index, checkBox) => {
let totalCheckBoxCount = $(checkBox).parent().children().find('input[type="checkbox"]').length,
checkedCheckBoxCount = $(checkBox).parent().children().find('input[type="checkbox"]:checked').length;
if(checkedCheckBoxCount > 0)
$(checkBox).parent().children('ul').show();
if(totalCheckBoxCount > 0) {
if (totalCheckBoxCount == checkedCheckBoxCount)
$(checkBox).prop('checked', true);
else if (checkedCheckBoxCount > 0 && checkedCheckBoxCount != totalCheckBoxCount)
$(checkBox).prop('indeterminate', true);
}
});
})
</script>
@endsection
<style>
li{
list-style-type: none;
}
</style>
@@ -0,0 +1,15 @@
<div class="mb-3 row">
<label for="telephone_input" class="col-2 col-form-label fw-bold">@lang('telephone') @lang('number'): </label>
<div class="col-10">
<input
type="tel"
class="form-control"
name="telephone"
id="telephone_input"
placeholder="@lang('telephone') @lang('number')"
@if(old('telephone') !== null)
value="{{old('telephone')}}"
@endif
>
</div>
</div>
@@ -0,0 +1,71 @@
<div class="mb-3 row">
<label class="col-2 col-form-label fw-bold">@lang('products') : </label>
<div class="col-10">
<table class="table table-striped">
<thead>
<th>@lang('barcode')</th>
<th class="text-center">@lang('available')</th>
<th class="text-center">@lang('amount')</th>
<th class="text-center">@lang('action')</th>
</thead>
<tbody id="product_input_container">
<datalist id="products">
@foreach($products as $product)
@if(config('app.barcode_mode') == 'dynamic')
<option data-available="{{$product->total - (count($product->loans) + count($product->reservations))}}" data-product-id="{{$product->id}}">{{$product->category->name}}.@if(!empty($product->subcategory->name)){{$product->subcategory->name}}.@endif{{$product->brand->name}}.{{$product->model->name}}@if(!empty($product->name)).{{$product->name}}@endif</option>
@elseif(config('app.barcode_mode') == 'static')
<option data-available="{{$product->total - (count($product->loans) + count($product->reservations))}}" data-product-id="{{$product->id}}">{{$product->barcode}}</option>
@endif
@endforeach
</datalist>
<tr>
<button type="button" id="product_add_button" class="btn btn-outline-success mb-4">@lang('add') @lang('product')</button>
</tr>
</tbody>
</table>
</div>
</div>
<script>
var product_count = 0;
$("#product_add_button").click(function(){
let product_table = $("#product_input_container");
product_table.append('<tr><td class="col align-middle"><div class="input-group"><input type="text" name="products[' + product_count + ']" id="product_' + product_count + '_input" class="form-control" placeholder="Barcode" list="products" data-product-index="' + product_count + '" oninput="product_barcode_change(this)" required></div></td><td id="product_' + product_count + '_available" class="col-1 text-center align-middle">0</td><td class="col-1 text-center align-middle"><input type="number" id="product_' + product_count + '_amount" name="product_amount[' + product_count + ']" class="form-control text-center" step="1" min="0" max="0" @if(old("product_' + product_count + '_amount"))value="old("product_' + product_count + '_amount")"@else value="0" @endif required disabled><input type="hidden" name="product_id[' + product_count + ']" id="product_' + product_count + '_id" value="0"></td><td class="col-2 text-center align-middle"><button type="button" onclick="product_barcode_remove(this)" class="btn btn-outline-danger">@lang('remove') @lang('product')</button></td></tr>');
product_count += 1;
});
function product_barcode_remove(elem) {
let this_row = $(elem).parent().parent().remove();
}
function product_barcode_change(elem){
let product_index = $(elem).data('product-index');
let product_input = $("#product_" + product_index + "_input");
var available = $('#products option').filter(function() {
return this.value == product_input.val();
}).data('available');
var product_id = $('#products option').filter(function() {
return this.value == product_input.val();
}).data('product-id');
if(available == null || typeof available === "undefined"){
$("#product_" + product_index + "_available").html(0);
$("#product_" + product_index + "_amount").prop('min',0);
$("#product_" + product_index + "_amount").prop('max',0);
$("#product_" + product_index + "_amount").val(0);
$("#product_" + product_index + "_amount").prop('disabled',true);
$("#product_" + product_index + "_id").val(0);
}
else{
$("#product_" + product_index + "_available").html(available);
$("#product_" + product_index + "_amount").prop('min',1);
$("#product_" + product_index + "_amount").prop('max',available);
$("#product_" + product_index + "_amount").val(1);
$("#product_" + product_index + "_amount").prop('disabled',false);
$("#product_" + product_index + "_id").val(product_id);
}
}
</script>
@@ -0,0 +1,94 @@
<div class="mb-3 row">
<label class="col-2 col-form-label fw-bold">@lang('products') : </label>
<div class="col-10">
<table class="table table-striped">
<thead>
<th>@lang('barcode')</th>
<th class="text-center">@lang('lent')</th>
<th class="text-center">@lang('amount')</th>
<th class="text-center">@lang('action')</th>
<th class="">@lang('note')</th>
<th></th>
</thead>
<tbody id="product_input_container">
<datalist id="products">
@foreach($products as $product)
@if(config('app.barcode_mode') == 'dynamic')
<option data-lent="{{count($product->loans)}}" data-product-id="{{$product->id}}">{{$product->category->name}}.@if(!empty($product->subcategory->name)){{$product->subcategory->name}}.@endif{{$product->brand->name}}.{{$product->model->name}}@if(!empty($product->name)).{{$product->name}}@endif</option>
@elseif(config('app.barcode_mode') == 'static')
<option data-lent="{{count($product->loans)}}" data-product-id="{{$product->id}}">{{$product->barcode}}</option>
@endif
@endforeach
</datalist>
<tr>
<button type="button" id="product_add_button" class="btn btn-outline-success mb-4">@lang('add') @lang('product')</button>
</tr>
</tbody>
</table>
</div>
</div>
<script>
var product_count = 0;
$("#product_add_button").click(function(){
let product_table = $("#product_input_container");
product_table.append('<tr><td class="col align-middle"><div class="input-group"><input type="text" name="products[' + product_count + ']" id="product_' + product_count + '_input" class="form-control" placeholder="@lang("barcode")" list="products" data-product-index="' + product_count + '" oninput="product_barcode_change(this)" required></div></td><td id="product_' + product_count + '_lent" class="col-1 text-center align-middle">0</td><td class="col-1 text-center align-middle" id="product_' + product_count + '_actions"><input type="number" id="product_' + product_count + '_amount" name="product_amount[' + product_count + ']" class="form-control text-center" step="1" min="0" max="0" @if(old("product_' + product_count + '_amount"))value="old("product_' + product_count + '_amount")"@else value="0" @endif required disabled><input type="hidden" name="product_id[' + product_count + ']" id="product_' + product_count + '_id" value="0"></td><td class="col-2 text-center align-middle"><button type="button" onclick="product_barcode_remove(this)" class="btn btn-outline-danger me-2">@lang('remove') @lang('product')</button></td><td id="product_'+ product_count + '_note_container" class="align-middle"></td></tr>');
product_count += 1;
});
function product_barcode_remove(elem) {
let this_row = $(elem).parent().parent().remove();
}
function product_barcode_change(elem){
let product_index = $(elem).data('product-index');
let product_input = $("#product_" + product_index + "_input");
let note_container = $('#product_'+ product_index + '_note_container');
var lent = $('#products option').filter(function() {
return this.value == product_input.val();
}).data('lent');
var product_id = $('#products option').filter(function() {
return this.value == product_input.val();
}).data('product-id');
if(lent == null || typeof lent === "undefined"){
$("#product_" + product_index + "_lent").html(0);
$("#product_" + product_index + "_amount").prop('min',0);
$("#product_" + product_index + "_amount").prop('max',0);
$("#product_" + product_index + "_amount").val(0);
$("#product_" + product_index + "_amount").prop('disabled',true);
$("#product_" + product_index + "_id").val(0);
note_container.empty();
}
else{
$("#product_" + product_index + "_lent").html(lent);
$("#product_" + product_index + "_amount").prop('min',1);
$("#product_" + product_index + "_amount").prop('max',lent);
$("#product_" + product_index + "_amount").val(1);
$("#product_" + product_index + "_amount").prop('disabled',false);
$("#product_" + product_index + "_id").val(product_id);
note_container.append('<button type="button" onclick="product_note_add(this)" class="btn btn-outline-danger" data-product-index="' + product_index +'" data-product-id="' + product_id +'">@lang('add') @lang('note')</button>');
}
}
function product_note_add(elem) {
$(elem).hide();
let index = $(elem).data('product-index');
let product_id = $(elem).data('product-id');
let note_container = $('#product_'+ index + '_note_container');
note_container.append('<select name="product_note_type[' + index + ']" id="product_' + index + '_note_type" class="form-select w-25 d-inline me-2 align-middle">');
let note_selector = $("#product_" + index + "_note_type");
let note_types = {!! json_encode($note_types) !!};
note_types.forEach(function(item){
note_selector.append("<option value=" + item['id'] + ">" + item['name'] + "</option>");
})
note_container.append('</select>');
note_container.append('<textarea rows=1 placeholder="@lang("note")" class="form-control d-inline w-50 align-middle" name="product_note_text[' + index + ']" required></textarea>');
note_container.append('<input type="checkbox" name="product_note_remove['+ index +']" id="product_' + index + '_note_remove" class="align-top ms-2 mt-4" checked>');
note_container.append('<label for="product_' + index + '_note_remove" class="align-top mt-3 ms-2 fw-bold">@lang("amount_remove") </label');
note_container.append('<input type="hidden" name="product_note_id[' + index +']" value="' + product_id + '">');
}
</script>
@@ -0,0 +1,10 @@
<div class="mb-3 row">
<label for="role_input" class="col-2 col-form-label fw-bold">@lang('role') : </label>
<div class="col-10">
<select name="role_id" id="role_input" class="form-select">
@foreach($roles as $role)
<option value="{{$role->id}}">{{$role->name}}</option>
@endforeach
</select>
</div>
</div>
@@ -0,0 +1,39 @@
<div class="mb-3 row">
<label for="room_input" class="col-2 col-form-label fw-bold">@lang('room') : </label>
<datalist id="rooms">
@foreach($rooms as $room)
<option data-room-id="{{$room->id}}">{{$room->building->name}} - {{$room->name}}</option>
@endforeach
</datalist>
<div class="col-10">
<input
type="text"
class="form-control"
name="room"
id="room_input"
list="rooms"
placeholder="@lang('room')"
value="{{old('room')}}"
required
oninput="room_change(this)"
>
</div>
<input type="hidden" name="room_id" id="room_id_input">
</div>
<script>
function room_change(elem){
let room_input = $("#room_input");
let room_id = $('#rooms option').filter(function() {
return this.value == room_input.val();
}).data('room-id');
if(room_id == null || typeof room_id === "undefined"){
$("#room_id_input").val(0);
}
else{
$("#room_id_input").val(room_id);
}
}
</script>
@@ -0,0 +1,41 @@
<div class="mb-3 row">
<label for="name_input" class="col-2 col-form-label fw-bold">@lang('street') : </label>
<div class="col-6 pe-2">
<input
type="text"
class="form-control"
name="street_name"
id="street_name_input"
placeholder="@lang('name')"
@if(old('street_name') !== null)
value="{{old('street_name')}}"
@endif
required
>
</div>
<div class="col-2 pe-2">
<input
type="text"
class="form-control"
name="street_number"
id="street_number_input"
placeholder="@lang('street') @lang('number')"
@if(old('street_number') !== null)
value="{{old('street_number')}}"
@endif
required
>
</div>
<div class="col-2">
<input
type="text"
class="form-control"
name="street_direction"
id="street_direction_input"
placeholder="@lang('instructions')"
@if(old('street_direction') !== null)
value="{{old('street_direction')}}"
@endif
>
</div>
</div>
@@ -0,0 +1,46 @@
<div class="mb-3 row">
<label for="subcategory_input" class="col-2 col-form-label fw-bold">@lang('subcategory') : </label>
<div class="col-10">
<select name="subcategory_id" id="subcategory_input" class="form-select" disabled required>
<option value="" @if(old('subcategory_id') !== null) selected @endif>@lang('please_select')</option>
<option value="">@lang('none')</option>
@foreach($subcategories as $subcategory)
<option
value="{{$subcategory->id}}"
@if(old('subcategory_id') !== null)
@if($subcategory->id == old('subcategory_id'))
selected
@endif
@else
@if(isset($data))
@if(!empty($data->subcategory))
@if($subcategory->id == $data->subcategory->id)
selected
@endif
@endif
@endif
@endif
>
{{$subcategory->name}}
</option>
@endforeach
</select>
</div>
</div>
<script>
$("#category_input").on( "input",function() {
$('#subcategory_input').prop("disabled", false);
$('#subcategory_input').children().remove().end();
$('#subcategory_input').append(`<option disabled selected value="">@lang('please_select')</option>`);
$('#subcategory_input').append(`<option value="">@lang('none')</option>`);
let subcategories = {!! json_encode($subcategories) !!};
subcategories.forEach(function(item){
if(item['product_category_id'] == $('#category_input').val()){
$('#subcategory_input').append(`<option value="` + item['id'] +`">` + item['name'] + `</option>`);
}
})
});
$("#subcategory_input").on( "input",function() {
$("#subcategory_input option:contains('Vælg...')").remove();
});
</script>
@@ -0,0 +1,26 @@
<div class="mb-3 row">
<label for="username_input" class="col-2 col-form-label fw-bold">@lang('username') : </label>
<datalist id="users">
@foreach($users as $user)
<option>{{$user->username}}</option>
@endforeach
</datalist>
<div class="col-10">
<input
type="text"
class="form-control"
name="user"
id="user_input"
list="users"
placeholder="@lang('username')"
@if(old('username') !== null)
value="{{old('username')}}"
@else
@if(isset($data->username))
value="{{$data->username}}"
@endif
@endif
required
>
</div>
</div>
@@ -0,0 +1,26 @@
<div class="mb-3 row">
<label for="username_input" class="col-2 col-form-label fw-bold">@lang('username') : </label>
<datalist id="users">
@foreach($users as $user)
<option>{{$user->username}}</option>
@endforeach
</datalist>
<div class="col-10">
<input
type="text"
class="form-control"
name="username"
id="username_input"
list="users"
placeholder="@lang('username')"
@if(old('username') !== null)
value="{{old('username')}}"
@else
@if(isset($data->username))
value="{{$data->username}}"
@endif
@endif
required
>
</div>
</div>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,120 @@
<script type="text/javascript">
// Initialize the image variables
var imgWidth;
var imgHeight;
// The Signature Pad Functions
function LenderStartSign()
{
// Check if the Browser Extension is Installed
var isInstalled = document.documentElement.getAttribute('SigPlusExtLiteExtension-installed');
if (!isInstalled) {
alert("SigPlusExtLite extension is either not installed or disabled. Please install or enable extension.");
return;
}
// Get the Signature Canvas Object
var canvasObj = document.getElementById('lenderCanvas');
// Clear the Signature Canvas Object
canvasObj.getContext('2d').clearRect(0, 0, canvasObj.width, canvasObj.height);
// Reset the Data Containers
document.getElementById("lenderSigStringData").value = "";
document.getElementById("lenderSigRawData").value = "";
// Set the Signature Image dimensions
imgWidth = canvasObj.width;
imgHeight = canvasObj.height;
// Set the Data to be sent to the Signature Pad
var message = { "firstName": "", "lastName": "", "eMail": "", "location": "", "imageFormat": 1, "imageX": imgWidth, "imageY": imgHeight, "imageTransparency": false, "imageScaling": false, "maxUpScalePercent": 0.0, "rawDataFormat": "ENC", "minSigPoints": 25 };
// Add Event Listener
top.document.addEventListener('SignResponse', LenderSignResponse, false);
// Prepare Data to be Sent
var messageData = JSON.stringify(message);
var element = document.createElement("MyLenderExtensionDataElement");
element.setAttribute("messageAttribute", messageData);
document.documentElement.appendChild(element);
var evt = document.createEvent("Events");
//Send the Data to the Signature Pad
evt.initEvent("SignStartEvent", true, false);
element.dispatchEvent(evt);
}
// Get Response from the Signature Pad
function LenderSignResponse(event)
{
var str = event.target.getAttribute("msgAttribute");
var obj = JSON.parse(str);
LenderSetValues(obj, imgWidth, imgHeight);
}
// Set the Input from the Signature Pad into the Data Containers and the Canvas
function LenderSetValues(objResponse, imageWidth, imageHeight)
{
var obj = null;
if(typeof(objResponse) === 'string'){
obj = JSON.parse(objResponse);
} else{
obj = JSON.parse(JSON.stringify(objResponse));
}
// Get the Canvas
var ctx = document.getElementById('lenderCanvas').getContext('2d');
// Check for Errors from the Signature Pad
if (obj.errorMsg != null && obj.errorMsg!="" && obj.errorMsg!="undefined")
{
// Display the Error Message
alert(obj.errorMsg);
}
// If No Errors
else
{
if (obj.isSigned)
{
// Put the Data into the Data Containers
document.getElementById("lenderSigRawData").value += obj.imageData;
document.getElementById("lenderSigStringData").value += obj.sigString;
// Draw the Image on the Canvas
var img = new Image();
img.onload = function ()
{
ctx.drawImage(img, 0, 0, imageWidth, imageHeight);
}
img.src = "data:image/png;base64," + obj.imageData;
// Disable the 'Sign' Button
var sign_button = document.getElementById('lenderSignButton');
sign_button.style.display = "none";
var lender_confirm_field = document.getElementById('lender_confirm');
lender_confirm_field.innerHTML = '<i class="fas fa-check"></i> Underskrift modtaget';
}
}
}
</script>
<!-- Hide Data Containers -->
<style>
#lenderSigStringData, #lenderSigRawData,#lenderCanvas{
display:none;
}
</style>
<!-- The Lender Signature Form -->
<div class="mb-3 row">
<div class="col-2 fw-bold">
@lang('lender') :
</div>
<div class="col">
<canvas id="lenderCanvas" name="lenderCanvas" width="300" height="80"></canvas>
<button id="lenderSignButton" class="btn btn-secondary" onclick="LenderStartSign()" @if(old('lenderSigRawData')) style="display:none;" @endif type="button">@lang('sign')</button>
<span id="lender_confirm">@if(old('lenderSigRawData'))<i class="fas fa-check"></i> Underskrift modtaget @endif</span>
<!-- Data Containers -->
<textarea id="lenderSigStringData" name="lenderSigStringData" rows="20" cols="50">@if(old('lenderSigStringData')){{old('lenderSigStringData')}}@endif</textarea>
<textarea id="lenderSigRawData" name="lenderSigRawData" rows="20" cols="50" required>@if(old('lenderSigRawData')){{old('lenderSigRawData')}}@endif</textarea>
</div>
</div>
@@ -0,0 +1,120 @@
<script type="text/javascript">
// Initialize the image variables
var imgWidth;
var imgHeight;
// The Signature Pad Functions
function LoanerStartSign()
{
// Check if the Browser Extension is Installed
var isInstalled = document.documentElement.getAttribute('SigPlusExtLiteExtension-installed');
if (!isInstalled) {
alert("SigPlusExtLite extension is either not installed or disabled. Please install or enable extension.");
return;
}
// Get the Signature Canvas Object
var canvasObj = document.getElementById('loanerCanvas');
// Clear the Signature Canvas Object
canvasObj.getContext('2d').clearRect(0, 0, canvasObj.width, canvasObj.height);
// Reset the Data Containers
document.getElementById("loanerSigStringData").value = "";
document.getElementById("loanerSigRawData").value = "";
// Set the Signature Image dimensions
imgWidth = canvasObj.width;
imgHeight = canvasObj.height;
// Set the Data to be sent to the Signature Pad
var message = { "firstName": "", "lastName": "", "eMail": "", "location": "", "imageFormat": 1, "imageX": imgWidth, "imageY": imgHeight, "imageTransparency": false, "imageScaling": false, "maxUpScalePercent": 0.0, "rawDataFormat": "ENC", "minSigPoints": 25 };
// Add Event Listener
top.document.addEventListener('SignResponse', LoanerSignResponse, false);
// Prepare Data to be Sent
var messageData = JSON.stringify(message);
var element = document.createElement("MyLoanerExtensionDataElement");
element.setAttribute("messageAttribute", messageData);
document.documentElement.appendChild(element);
var evt = document.createEvent("Events");
//Send the Data to the Signature Pad
evt.initEvent("SignStartEvent", true, false);
element.dispatchEvent(evt);
}
// Get Response from the Signature Pad
function LoanerSignResponse(event)
{
var str = event.target.getAttribute("msgAttribute");
var obj = JSON.parse(str);
LoanerSetValues(obj, imgWidth, imgHeight);
}
// Set the Input from the Signature Pad into the Data Containers and the Canvas
function LoanerSetValues(objResponse, imageWidth, imageHeight)
{
var obj = null;
if(typeof(objResponse) === 'string'){
obj = JSON.parse(objResponse);
} else{
obj = JSON.parse(JSON.stringify(objResponse));
}
// Get the Canvas
var ctx = document.getElementById('loanerCanvas').getContext('2d');
// Check for Errors from the Signature Pad
if (obj.errorMsg != null && obj.errorMsg!="" && obj.errorMsg!="undefined")
{
// Display the Error Message
alert(obj.errorMsg);
}
// If No Errors
else
{
if (obj.isSigned)
{
// Put the Data into the Data Containers
document.getElementById("loanerSigRawData").value += obj.imageData;
document.getElementById("loanerSigStringData").value += obj.sigString;
// Draw the Image on the Canvas
var img = new Image();
img.onload = function ()
{
ctx.drawImage(img, 0, 0, imageWidth, imageHeight);
}
img.src = "data:image/png;base64," + obj.imageData;
// Disable the 'Sign' Button
var sign_button = document.getElementById('loanerSignButton');
sign_button.style.display = "none";
var loaner_confirm_field = document.getElementById('loaner_confirm');
loaner_confirm_field.innerHTML = '<i class="fas fa-check"></i> Underskrift modtaget';
}
}
}
</script>
<!-- Hide Data Containers -->
<style>
#loanerSigStringData, #loanerSigRawData,#loanerCanvas{
display:none;
}
</style>
<!-- The Loaner Signature Form -->
<div class="mb-3 row">
<div class="col-2 fw-bold">
@lang('loaner') :
</div>
<div class="col">
<canvas id="loanerCanvas" name="loanerCanvas" width="300" height="80"></canvas>
<button id="loanerSignButton" class="btn btn-secondary" onclick="LoanerStartSign()" @if(old('loanerSigRawData')) style="display:none;" @endif type="button">@lang('sign')</button>
<span id="loaner_confirm">@if(old('loanerSigRawData'))<i class="fas fa-check"></i> Underskrift modtaget @endif</span>
<!-- Data Containers -->
<textarea id="loanerSigStringData" name="loanerSigStringData" rows="20" cols="50">@if(old('loanerSigStringData')){{old('loanerSigStringData')}}@endif</textarea>
<textarea id="loanerSigRawData" name="loanerSigRawData" rows="20" cols="50" required>@if(old('loanerSigRawData')){{old('loanerSigRawData')}}@endif</textarea>
</div>
</div>
@@ -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>
+30
View File
@@ -0,0 +1,30 @@
<footer class="text-center p-1 footer-styling">
<div class="row">
<div class="col-md-6">
<p class="fw-bold">
<b class="">@lang('footer.created')</b> :
@lang('author') @lang('footer.help') @lang('footer.group')
</p>
</div>
<div class="col-md-4">
</div>
<div class="col-md-2">
<p class="fw-bold">
&copy; <?php
$fromYear = 2022;
$thisYear = (int)date('Y');
echo $fromYear . (($fromYear != $thisYear) ? '-' . $thisYear : '');?>
</p>
</div>
</div>
</footer>
<style>
.footer-styling {
background-color: darkgray;
margin: auto 0 0;
width: 100%;
position: sticky;
top: 100%;
}
</style>
+302
View File
@@ -0,0 +1,302 @@
<nav class="navbar navbar-expand-md navbar-dark fixed-top" id="sidebar">
<a class="navbar-brand align-self-center">SKP Lagersystem</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsDefault"
aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button >
<div class="collapse navbar-collapse" id="navbarsDefault">
<ul class="navbar-nav nav-pills active">
<!-- loan create -->
@canany(['loans_create_user', 'loans_create_laptop'])
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbaLoansCreateDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa fa-arrow-circle-right"></i>
@lang('create') @lang('loan')
</a>
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbaLoansCreateDropdownMenuLink">
@can('loans_create_user')
<li>
<a href="{{ route('loans.create') }}" class="dropdown-item align-middle {{Request::routeIs('loans.create') ? 'active' : '' }}">
<span class="ms-1 d-sm-inline">
<i class="fa fa-user"></i>
@lang('to') @lang('user')
</span>
</a>
</li>
@endcan
@can('loans_create_laptop')
<li>
<a href="{{ route('loans.laptop.create') }}" class="dropdown-item align-middle {{Request::routeIs('loans.laptop.create') ? 'active' : '' }}">
<span class="ms-1 d-sm-inline">
<i class="fa fa-laptop"></i>
@lang('laptop')
</span>
</a>
</li>
@endcan
</ul>
</li>
@endcan
<!-- loan return -->
@can('loans_return')
<li class="nav-item">
<a href="{{ route('loans.return.page') }}" class="nav-link align-middle {{Request::routeIs('loans.return.page') ? 'active' : '' }}">
<i class="fa fa-arrow-circle-left"></i>
<span class="ms-1 d-sm-inline">
@lang('return')
</span>
</a>
</li>
@endcan
<!-- loan list -->
@can('loans_viewAny')
<li class="nav-item">
<a href="{{ route('loans.index') }}" class="nav-link align-middle {{Request::routeIs('loans.index') ? 'active' : '' }}">
<i class="fa fa-list"></i>
<span class="ms-1 d-sm-inline">
@lang('see') @lang('loans')
</span>
</a>
</li>
@endcan
<!-- reservation create -->
@can('reservations_create')
<li class="nav-item">
<a href="{{ route('reservations.create') }}" class="nav-link align-middle {{Request::routeIs('reservations.create') ? 'active' : '' }}">
<i class="fa fa-calendar-plus"></i>
<span class="ms-1 d-sm-inline">
@lang('create') @lang('reservation')
</span>
</a>
</li>
@endcan
<!-- reservation list -->
@can('reservations_viewAny')
<li class="nav-item">
<a href="{{ route('reservations.index') }}" class="nav-link align-middle {{Request::routeIs('reservations.index') ? 'active' : '' }}">
<i class="fa fa-calendar-day"></i>
<span class="ms-1 d-sm-inline">
@lang('see') @lang('reservations')
</span>
</a>
</li>
@endcan
<!-- products -->
@can('viewAny', App\Models\Product::class)
<li class="nav-item">
<a href="{{ route('products.index') }}" class="nav-link align-middle {{Request::routeIs('products.index') ? 'active' : '' }}">
<i class="fa fa-laptop"></i>
<span class="ms-1 d-sm-inline">
@lang('products')
</span>
</a>
</li>
<!-- products related -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarProductRelatedDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa fa-th"></i>
@lang('product') @lang('related')
</a>
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarProductRelatedDropdownMenuLink">
@can('viewAny', App\Models\ProductCategory::class)
<li>
<a href="{{ route('categories.index') }}" class="dropdown-item align-middle {{Request::routeIs('categories.index') ? 'active' : '' }}">
<span class="ms-1 d-sm-inline">
<i class="fa fa-list"></i>
@lang('categories')
</span>
</a>
</li>
@endcan
@can('viewAny', App\Models\ProductSubcategory::class)
<li>
<a href="{{ route('subcategories.index') }}" class="dropdown-item align-middle {{Request::routeIs('subcategories.index') ? 'active' : '' }}">
<span class="ms-1 d-sm-inline">
<i class="fa fa-list"></i>
@lang('subcategories')
</span>
</a>
</li>
@endcan
@can('viewAny', App\Models\Brand::class)
<li>
<a href="{{ route('brands.index') }}" class="dropdown-item align-middle {{Request::routeIs('brands.index') ? 'active' : '' }}">
<span class="ms-1 d-sm-inline">
<i class="fa fa-desktop"></i>
@lang('brands')
</span>
</a>
</li>
@endcan
@can('viewAny', App\Models\ProductModel::class)
<li>
<a href="{{route('models.index')}}" class="dropdown-item align-middle {{Request::routeIs('models.index') ? 'active' : ''}}">
<span class="ms-1 d-sm-inline">
<i class="fa fa-desktop"></i>
@lang('models')
</span>
</a>
</li>
@endcan
</ul>
</li>
@endcan
<!-- cabels -->
@can('viewAny', App\Models\Cabel::class)
<li class="nav-item">
<a href="{{ route('cabels.index') }}" class="nav-link align-middle {{Request::routeIs('cabels.index') ? 'active' : '' }}">
<i class="fa fa-network-wired"></i>
<span class="ms-1 d-sm-inline">
@lang('cabels')
</span>
</a>
</li>
@endcan
<!-- cabel categories -->
@can('cabelCategories_viewAny')
<li class="nav-item">
<a href="{{ route('cabelCategories.index') }}" class="nav-link align-middle {{Request::routeIs('cabelCategories.index') ? 'active' : '' }}">
<i class="fa fa-network-wired"></i>
<span class="ms-1 d-sm-inline">
@lang('cabel') @lang('categories')
</span>
</a>
</li>
@endcan
<!-- notes -->
@can('notes_viewAny')
<li class="nav-item">
<a href="{{ route('notes.index') }}" class="nav-link align-middle {{Request::routeIs('notes.index') ? 'active' : '' }}">
<i class="fa fa-file-excel"></i>
<span class="ms-1 d-sm-inline">
@lang('notes')
</span>
</a>
</li>
@endcan
<!-- pdf -->
@can('pdf_viewAny')
<li class="nav-item">
<a href="{{ route('contracts.index') }}" class="nav-link align-middle {{Request::routeIs('contracts.index') ? 'active' : '' }}">
<i class="fa fa-file-contract"></i>
<span class="ms-1 d-sm-inline">
@lang('contracts')
</span>
</a>
</li>
@endcan
<!-- users -->
@can('viewAny', App\Models\User::class)
<li class="nav-item">
<a href="{{ route('users.index') }}" class="nav-link align-middle {{Request::routeIs('users.index') ? 'active' : '' }}">
<i class="fa fa-users"></i>
<span class="ms-1 d-sm-inline">
@lang('users')
</span>
</a>
</li>
@endcan
<!-- roles -->
@can('roles_viewAny')
<li class="nav-item">
<a href="{{ route('roles.index') }}" class="nav-link align-middle {{Request::routeIs('roles.index') ? 'active' : '' }}">
<i class="fa fa-user-tag"></i>
<span class="ms-1 d-sm-inline">
@lang('roles')
</span>
</a>
</li>
@endcan
<!-- buildings -->
@can('buildings_viewAny')
<li class="nav-item">
<a href="{{ route('buildings.index') }}" class="nav-link align-middle {{Request::routeIs('buildings.index') ? 'active' : ''}}">
<i class="fa fa-home"></i>
<span class="ms-1 d-sm-inline">
@lang('buildings')
</span>
</a>
</li>
@endcan
<!-- rooms -->
@can('rooms_viewAny')
<li class="nav-item">
<a href="{{ route('rooms.index') }}" class="nav-link align-middle {{Request::routeIs('rooms.index') ? 'active' : ''}}">
<i class="fa fa-door-open"></i>
<span class="ms-1 d-sm-inline">
@lang('rooms')
</span>
</a>
</li>
@endcan
@can('logs_viewAny')
<li class="nav-item">
<a href="{{ route('logs') }}" class="nav-link align-middle {{Request::routeIs('logs') ? 'active' : ''}}">
<i class="fa fa-list"></i>
<span class="ms-1 d-sm-inline">
@lang('logs')
</span>
</a>
</li>
@endcan
@can('statistics')
<li class="nav-item">
<a href="{{ route('statistics') }}" class="nav-link align-middle {{Request::routeIs('statistics') ? 'active' : ''}}">
<i class="fa fa-list"></i>
<span class="ms-1 d-sm-inline">
@lang('statistics')
</span>
</a>
</li>
@endcan
<!-- Profile -->
<li class="nav-item">
<a href="{{ route('users.show',auth()->user()->id) }}" class="nav-link align-middle {{Request::routeIs('users.show*') ? 'active' : '' }}">
<i class="fa fa-user-cog"></i>
<span class="ms-1 d-sm-inline">
@lang('profile')
</span>
</a>
</li>
<!--logout-->
<li class="nav-item">
<a href="{{route('logout')}}" class="nav-link align-middle {{Request::is('logout') ? 'active' : '' }}">
<i class="fas fa-sign-out-alt"></i>
<span class="ms-1 d-sm-inline">
@lang('logout')
</span>
</a>
</li>
<!-- Permissions -->
<!--
<div style="height:5em;overflow:auto;">
@foreach(Auth::user()->role->permissions as $permission)
{{$permission->name}}<br>
@endforeach
</div>
-->
</ul>
<div class="logged-in-user" >
<a class="nav-item text-decoration-none" style="color: white" href="{{route('users.show',auth()->user()->id)}}">{{auth()->user()->name}}</a>
</div>
</div>
</nav>
+8
View File
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.create_page')
@endsection
@section('scripting')
@endsection
+8
View File
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.deleted_page')
@endsection
@section('scripting')
@endsection
+8
View File
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.edit_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1 @@
@include('Partials.Form.Input.name')
+39
View File
@@ -0,0 +1,39 @@
@extends('Layouts.master')
@section('content')
<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 $brand)
<tr>
<td class="align-middle">
@can('brands_view')
<a href="{{route('brands.show',['brand' => $brand])}}" class="btn btn-success">
{{$brand->name}}
</a>
@else
{{$brand->name}}
@endcan
</td>
<td>
@can('brands_edit')
<a href="{{route('brands.edit',['brand' => $brand])}}" class="btn btn-outline-success">
@lang('edit')
</a>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
@include('Partials.Pages.display')
</div>
@endsection
@section('scripting')
@endsection
+8
View File
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.show_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,41 @@
<h2>@lang('models')</h2>
@if(count($data->models) >= 1)
<table>
@foreach($data->models as $model)
<tr>
<td>
@can('models_view')
<a href="{{route('models.show',['model' => $model])}}" class="btn btn-success" target="_blankd">{{$model->name}}</a>
@else
{{$model->name}}
@endcan
</td>
</tr>
@endforeach
</table>
@else
@lang('no_amount') @lang('models')
@endif
<hr>
<h2>@lang('products')</h2>
@if(count($data->products) >= 1)
<table>
@foreach($data->products as $product)
<tr>
<td>
<a href="{{route('products.show',['product' => $product])}}" class="btn btn-success" target="_blank">
@if(config('app.barcode_mode') == 'dynamic')
{{$product->category->name}}.@if(!empty($product->subcategory->name)){{$product->subcategory->name}}.@endif{{$product->brand->name}}.{{$product->model->name}}@if(!empty($product->name)).{{$product->name}}@endif
@endif
@if(config('app.barcode_mode') == 'static')
{{$product->barcode}}
@endif
</a> </td>
</tr>
@endforeach
</table>
@else
@lang('no_amount') @lang('products')
@endif
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.create_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,48 @@
@extends('Layouts.master')
@section('content')
<div class="main-container pb-4" id="tables">
@include('Partials.Pages.index_top')
<table class="table table-striped">
<thead>
<th>@lang('name')</th>
<th>@lang('rooms')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $object)
<tr>
<td class="align-middle">
<a href="{{route('buildings.show',['building' => $object])}}" target="_blank"
class="btn btn-success">{{$object->name}}</a>
</td>
<td>
<a href="{{route('rooms.index',['p' => '100','search_type' => 'building','search_term' => $object->name])}}"
target="_blank" class="btn btn-success">@lang('rooms')</a>
</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>
@endsection
@section('scripting')
@endsection
+8
View File
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.edit_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1 @@
@include('Partials.Form.Input.name')
+35
View File
@@ -0,0 +1,35 @@
@extends('Layouts.master')
@section('content')
<div class="main-container pb-4" id="tables">
@include('Partials.Pages.index_top')
<table class="table table-striped">
<thead>
<th>@lang('name')</th>
<th>@lang('rooms')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $building)
<tr>
<td class="align-middle">
<a href="{{route('buildings.show',['building' => $building])}}" target="_blank"
class="btn btn-success">{{$building->name}}</a>
</td>
<td>
<a href="{{route('rooms.index',['p' => '100','search_type' => 'building','search_term' => $building->name])}}"
target="_blank" class="btn btn-success">@lang('rooms')</a>
</td>
<td>
<a href="{{route('buildings.edit',['building' => $building])}}"
target="_blank" class="btn btn-outline-success">@lang('edit')</a>
</td>
</tr>
@endforeach
</tbody>
</table>
@include('Partials.Pages.display')
</div>
@endsection
@section('scripting')
@endsection
+8
View File
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.show_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,18 @@
<h2>@lang('rooms')</h2>
@if(count($data->rooms) >= 1)
<table class="">
@foreach($data->rooms as $room)
<tr>
<td>
<a href="{{route('rooms.show',['room' => $room])}}" target="_blank"
class="btn btn-success">
{{$room->name}}
</a>
</td>
</tr>
@endforeach
</table>
@else
@lang('no_amount') @lang('rooms')
@endif
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.create_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,47 @@
@extends('Layouts.master')
@section('content')
<div class="main-container pb-4">
@include('Partials.Pages.index_top')
<table class="table table-striped table-hover mt-4">
<thead>
<th>@lang('name')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $object)
<tr>
<td>
@can('cabelCategories_view')
<a href="{{route('cabelCategories.show',['cabelCategory' => $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>
</div>
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.edit_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1 @@
@include('Partials.Form.Input.name')
@@ -0,0 +1,38 @@
@extends('Layouts.master')
@section('content')
<div class="main-container pb-4">
@include('Partials.Pages.index_top')
<table class="table table-striped table-hover mt-4">
<thead>
<th>@lang('name')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $object)
<tr>
<td>
@can('cabelCategories_view')
<a href="{{route('cabelCategories.show',['cabelCategory' => $object])}}" class="btn btn-success">
{{$object->name}}
</a>
@else
{{$role->name}}
@endcan
</td>
<td>
@can('cabelCategories_edit')
<a href="{{route('cabelCategories.edit',['cabelCategory' => $object])}}"
class="btn btn-outline-success">@lang('edit')</a>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.show_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,20 @@
<h2>@lang('cabels')</h2>
@if(count($data->cabels) >= 1)
<table>
@foreach($data->cabels as $cabel)
<tr>
<td>
@can('cabels_view')
<a href="{{route('cabels.show',['cabel' => $cabel])}}" class="btn btn-success" target="_blank">
{{$cabel->category->name}}.{{$cabel->name}}
</a>
@else
{{$cabel->category->name}}.{{$cabel->name}}
@endcan
</td>
</tr>
@endforeach
</table>
@else
@lang('no_amount') @lang('products')
@endif
+8
View File
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.create_page')
@endsection
@section('scripting')
@endsection
+68
View File
@@ -0,0 +1,68 @@
@extends('Layouts.master')
@section('content')
<div class="main-container pb-4" id="tables">
@include('Partials.Pages.index_top')
<table class="table table-striped">
<thead>
<th>@lang('category')</th>
<th>@lang('name')</th>
<th class="text-center">@lang('available')</th>
<th class="text-center">@lang('lent')</th>
<th class="text-center">@lang('reserved')</th>
<th class="text-center">@lang('total')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $cabel)
<tr>
<td class="align-middle">
<a href="{{route('cabelCategories.show',['cabelCategory' => $cabel->category])}}"
target="_blank"
class="btn btn-success">{{$cabel->category->name}}
</a>
</td>
<td class="align-middle">
<a href="{{route('cabels.show',[$data_name => $cabel])}}" target="_blank"
class="btn btn-success">{{$cabel->name}}
</a>
</td>
<td class="align-middle text-center">
{{$cabel->total - (count($cabel->loans) + count($cabel->reservations))}}
</td>
<td class="align-middle text-center">
{{count($cabel->loans)}}
</td>
<td class="align-middle text-center">
{{count($cabel->reservations)}}
</td>
<td class="align-middle text-center">
{{$cabel->total}}
</td>
<td>
@can('cabels_edit')
<a href="{{route('cabels.edit',['cabel' => $cabel])}}" class="btn btn-outline-success">
@lang('edit')
</a>
@endcan
@can('cabels_restore')
<a href="{{route('cabels.restore',['cabel' => $cabel])}}" class="btn btn-outline-success">
@lang('restore')
</a>
@endcan
@can('cabels_delete_force')
<a href="{{route('cabels.forceDelete',['cabel' => $cabel])}}"
class="btn btn-outline-danger">
@lang('delete_force')
</a>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
@include('Partials.Pages.display')
</div>
@endsection
@section('scripting')
@endsection
+50
View File
@@ -0,0 +1,50 @@
@extends('Layouts.master')
@section('content')
<div class="main-container pb-4">
<form method="post" action="{{route('cabels.update',['cabel' => $data])}}">
@include('cabels.form_input')
@include('Partials.Form.Input.Submit.submit_edit')
</form>
@can('cabels_delete')
@include('Partials.Form.Input.Modal.delete')
@endcan
@can('cabels_amount_add')
<hr>
<form method="post">
@method('put')
@csrf
<div class="mb-3 row">
<label for="amount_input" class="col-2 col-form-label fw-bold">@lang('amount') : </label>
<div class="col-8">
<input
type="number"
class="form-control me-2"
name="amount"
id="amount_input"
placeholder="@lang('amount')"
@if(old('amount') !== null)
value="{{old('amount')}}"
@else
value="1"
@endif
>
</div>
<div class="col-2">
@can('cabels_amount_add')
<input type="submit" class="btn btn-success ms-2" value="@lang('amount_add')"
formaction="{{route('cabels.amount.add',['cabel' => $data])}}">
@endcan
@can('cabels_amount_remove')
<input type="submit" class="btn btn-danger ms-2" value="@lang('amount_remove')"
formaction="{{route('cabels.amount.remove',['cabel' => $data])}}">
@endcan
</div>
</div>
</form>
@endcan
</div>
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,2 @@
@include('Partials.Form.Input.category')
@include('Partials.Form.Input.name')
+67
View File
@@ -0,0 +1,67 @@
@extends('Layouts.master')
@section('content')
<div class="main-container pb-4" id="tables">
@include('Partials.Pages.index_top')
<table class="table table-striped">
<thead>
<th>@lang('category')</th>
<th>@lang('name')</th>
<th class="text-center">@lang('available')</th>
<th class="text-center">@lang('lent')</th>
<th class="text-center">@lang('reserved')</th>
<th class="text-center">@lang('total')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $cabel)
<tr>
<td class="align-middle">
@can('cabelCategories_view')
<a href="{{route('cabelCategories.show',['cabelCategory' => $cabel->category])}}"
target="_blank"
class="btn btn-success">
{{$cabel->category->name}}
</a>
@else
{{$cabel->category->name}}
@endcan
</td>
<td class="align-middle">
@can('cabels_view')
<a href="{{route('cabels.show',[$data_name => $cabel])}}" target="_blank"
class="btn btn-success">
{{$cabel->name}}
</a>
@else
{{$cabel->name}}
@endcan
</td>
<td class="align-middle text-center">
{{$cabel->total - (count($cabel->loans) + count($cabel->reservations))}}
</td>
<td class="align-middle text-center">
{{count($cabel->loans)}}
</td>
<td class="align-middle text-center">
{{count($cabel->reservations)}}
</td>
<td class="align-middle text-center">
{{$cabel->total}}
</td>
<td>
@can('cabels_edit')
<a href="{{route('cabels.edit',[$data_name => $cabel])}}"
class="btn btn-outline-success">@lang('edit')
</a>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
@include('Partials.Pages.display')
</div>
@endsection
@section('scripting')
@endsection
+8
View File
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.show_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,10 @@
<h1>
@lang('category') :
@can('cabelCategories_view')
<a href="{{route('cabelCategories.show',['cabelCategory' => $data->category->id])}}" class="btn btn-success" target="_blank">
{{$data->category->name}}
</a>
@else
{{$data->category->name}}
@endcan
</h1>
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.create_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.deleted_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.edit_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1 @@
@include('Partials.Form.Input.name')
@@ -0,0 +1,41 @@
@extends('Layouts.master')
@section('content')
<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 $category)
<tr>
<td class="align-middle">
@can('categories_view')
<a href="{{route('categories.show',['category' => $category])}}" class="btn btn-success">
{{$category->name}}
</a>
@else
{{$category->name}}
@endcan
</td>
<td>
@can('categories_edit')
<a href="{{route('categories.edit',['category' => $category])}}"
class="btn btn-outline-success">
@lang('edit')
</a>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
@include('Partials.Pages.display')
</div>
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,8 @@
@extends('Layouts.master')
@section('content')
@include('Partials.Pages.show_page')
@endsection
@section('scripting')
@endsection
@@ -0,0 +1,37 @@
<h2>@lang('subcategories')</h2>
@if(count($data->subcategories) >= 1)
<table>
@foreach($data->subcategories as $subcategory)
<tr>
<td>
<a href="{{route('subcategories.show',['subcategory' => $subcategory])}}" class="btn btn-success" target="_blankd">{{$subcategory->name}}</a>
</td>
</tr>
@endforeach
</table>
@else
@lang('no_amount') @lang('subcategories')
@endif
<hr>
<h2>@lang('products')</h2>
@if(count($data->products) >= 1)
<table>
@foreach($data->products as $product)
<tr>
<td>
<a href="{{route('products.show',['product' => $product])}}" class="btn btn-success" target="_blank">
@if(config('app.barcode_mode') == 'dynamic')
{{$product->category->name}}.@if(!empty($product->subcategory->name)){{$product->subcategory->name}}.@endif{{$product->brand->name}}.{{$product->model->name}}@if(!empty($product->name)).{{$product->name}}@endif
@endif
@if(config('app.barcode_mode') == 'static')
{{$tracked->loanable->barcode}}
@endif
</a> </td>
</tr>
@endforeach
</table>
@else
@lang('no_amount') @lang('products')
@endif
+64
View File
@@ -0,0 +1,64 @@
@extends('Layouts.master')
@section('content')
<div class="main-container pb-4">
<div class="head-section mb-2">
@include('Partials.Pages.Search.search_bar')
</div>
<table class="table table-striped">
<thead>
<th>@lang('user')</th>
<th>@lang('date')</th>
<th>@lang('type')</th>
<th>@lang('action')</th>
</thead>
<tbody>
@foreach($data as $contract)
<tr>
<td>
@can('users_view')
<a href="{{route('users.show',['user' => $contract->user->id])}}" target="_blank"
class="btn btn-success">
{{ $contract->user->username }}
</a>
@else
{{ $contract->user->username }}
@endcan
</td>
<td>
{{ date('d.m.Y H:i:s', $contract->timestamp) }}
</td>
<td>
@if($contract->type == 'contracts')
@lang('loan')
@elseif($contract->type == 'laptops')
@lang('laptop')
@elseif($contract->type == 'reservations')
@lang('reservation')
@endif
</td>
<td>
@can('pdf_view')
<a href="{{ route('pdf.show',['user' => $contract->user->username,'timestamp' => $contract->timestamp,'type' => $contract->type]) }}" target="_BLANK" class="btn btn-xs btn-outline-info pull-right">
@lang('show')
</a>
@endcan
@can('delete', App\Models\PDF::class)
<form method="post" action="{{ route('pdf.delete',['user' => $contract->user->username,'timestamp' => $contract->timestamp,'type' => $contract->type]) }}" class="d-inline">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-outline-danger btn-xs pull-right">@lang('delete')</button>
</form>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
@include('Partials.Pages.display')
</div>
@endsection
@section('scripting')
@endsection
+8
View File
@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

Some files were not shown because too many files have changed in this diff Show More