Initial Commit

This commit is contained in:
dann4624
2022-09-28 09:38:08 +02:00
parent cac476f80f
commit 2d04a269e6
355 changed files with 52166 additions and 25 deletions
@@ -0,0 +1,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>