Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp into master
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
<tr>
|
||||
<th class="text-white text-center" style="background-color: orange;">Nyeste brugere</th>
|
||||
</tr>
|
||||
@for($i = 0; $i < 5 && $i < count(\App\User::query()->orderByDesc("id")->get()); $i++)
|
||||
@for($i = 0; $i < 10 && $i < count(\App\User::query()->orderByDesc("id")->get()); $i++)
|
||||
<tr>
|
||||
<td>{{ ucfirst(strtolower(\App\User::query()->orderByDesc("id")->get()[$i]->name_first)) . ' ' . ucfirst(strtolower(\App\User::query()->orderByDesc("id")->get()[$i]->name_last)) }}</td>
|
||||
</tr>
|
||||
@@ -83,10 +83,21 @@
|
||||
@if(\App\Event::query()->orderByDesc("date")->first() !== null)
|
||||
<div class="event_card">
|
||||
@if(\App\Event::query()->orderByDesc("date")->first()->resource_id !== null)
|
||||
<div class="header" style="background-size: cover; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", \App\Event::query()->orderByDesc("date")->first()->resource_id)->first()->filename) }}');">
|
||||
<h3 style="text-shadow: 2px 2px 2px #00788A;" class="text-white text-center">{{ \App\Event::query()->orderByDesc("date")->first()->name }}</h3>
|
||||
<p style="text-shadow: 2px 2px 2px #00788A"; class="text-white text-center mt-0">{{__('msg.af')}}: {{ \App\Event::query()->orderByDesc("date")->first()->accountable }}</p>
|
||||
<p style="text-shadow: 2px 2px 2px #00788A"; class="text-white text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime(\App\Event::query()->orderByDesc("date")->first()->date))->format('d/m/Y \k\l\. H:i') }}</p>
|
||||
<div class="header" style="padding-top: 0">
|
||||
<table class="tbl mt-0">
|
||||
<tr>
|
||||
<td><label>Event navn</label></td>
|
||||
<td>{{ \App\Event::query()->orderByDesc("date")->first()->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>Event ansvarlig</label></td>
|
||||
<td>{{__('msg.af')}}: {{ \App\Event::query()->orderByDesc("date")->first()->accountable }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>Tidspunkt</label></td>
|
||||
<td>{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime(\App\Event::query()->orderByDesc("date")->first()->date))->format('d/m/Y \k\l\. H:i') }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="header">
|
||||
@@ -97,10 +108,14 @@
|
||||
@endif
|
||||
|
||||
<div class="container" style="margin-top: 8px;">
|
||||
{!! \App\Helpers::closetags(substr(\App\Event::query()->orderByDesc("date")->first()->description, 0, 300) )!!}
|
||||
<table style="border: 1px solid lightgrey; width: 100%;">
|
||||
<tr>
|
||||
<td> {!! \App\Helpers::closetags(substr(\App\Event::query()->orderByDesc("date")->first()->description, 0, 300) )!!}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="event_id" value="{{ \App\Event::query()->orderByDesc("date")->first()->id }}">
|
||||
<div class="row" style="justify-content: space-between; margin-top: 16px;">
|
||||
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.accountsignups", ["event" => \App\Event::query()->orderByDesc("date")->first()->id ])}}">{{__('msg.sedeltagere')}}</a>
|
||||
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.signups", ["event" => \App\Event::query()->orderByDesc("date")->first()->id ])}}">{{__('msg.sedeltagere')}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,7 +137,7 @@
|
||||
<th class="text-white text-center" style="background-color: deepskyblue;">Seneste Vejledninger</th>
|
||||
</tr>
|
||||
@if(count(\App\Guide::all()) > 0)
|
||||
@for($i = 0; $i < 5 && $i < count(\App\Guide::query()->orderByDesc("id")->get()); $i++)
|
||||
@for($i = 0; $i < 10 && $i < count(\App\Guide::query()->orderByDesc("id")->get()); $i++)
|
||||
<tr>
|
||||
<td>{{ ucfirst(strtolower(\App\Guide::query()->orderByDesc("id")->get()[$i]->name)) }}</td>
|
||||
</tr>
|
||||
@@ -145,14 +160,28 @@
|
||||
</div>
|
||||
<table class="tbl mt-1">
|
||||
<tr>
|
||||
<th class="text-white text-center" style="background-color: lightseagreen;">Ugens Menuplan</th>
|
||||
<th class="text-white text-center" style="background-color: lightseagreen; border-right: unset;">Ugens Menuplan</th>
|
||||
<th class="text-white text-center" style="background-color: lightseagreen; border-left: unset;"></th> <!--Maybe fix ?-->
|
||||
</tr>
|
||||
</table>
|
||||
@if(\App\MenuPlan::query()->where("week", "=", date('W'))->first() !== null)
|
||||
{!! \App\MenuPlan::query()->where("week", "=", date('W'))->first()->menu !!}
|
||||
{{-- \App\MenuPlan::query()->where("week", "=", date('W'))->first() --}}
|
||||
<tr>
|
||||
<td><label>Mandag </label></td>
|
||||
<td>{{ \App\MenuPlan::query()->where("week", "=", date('W'))->first()->monday }}</td>
|
||||
</tr>
|
||||
<td><label>Tirsdag</label></td>
|
||||
<td>{{ \App\MenuPlan::query()->where("week", "=", date('W'))->first()->tuesday }}</td>
|
||||
</tr>
|
||||
<td><label>Onsdag</label></td>
|
||||
<td>{{ \App\MenuPlan::query()->where("week", "=", date('W'))->first()->wednesday }}</td>
|
||||
</tr>
|
||||
<td><label>Torsdag</label></td>
|
||||
<td>{{ \App\MenuPlan::query()->where("week", "=", date('W'))->first()->thursday }}</td>
|
||||
</tr>
|
||||
@else
|
||||
</table>
|
||||
<p class="text-center">Der er ingen menuplan for denne uge</p>
|
||||
@endif
|
||||
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<h1>Opret Lokation</h1>
|
||||
<h1 id="errormesseages" >Opret Lokation</h1>
|
||||
<form method="post" action="{{ route("locations.store") }}">
|
||||
@csrf
|
||||
<label for="name">Lokationsnavn:</label>
|
||||
<label hidden id="error" for="errormesseages">Lokation findes allerede</label>
|
||||
<input type="text" name="name" id="name" placeholder="Bygning A" required>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Opret">
|
||||
</form>
|
||||
@endsection
|
||||
@section("scripts")
|
||||
@@ -28,5 +29,57 @@
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
//Dont delete me, if the user reloads the pages with text in the text-box this code runs.
|
||||
$(document).ready(function () {
|
||||
$value = $('#name').val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('locations.nameCheck')}}',
|
||||
data: {'nameCheck':$value},
|
||||
success:function (data) {
|
||||
console.log(data);
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#name').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('locations.nameCheck')}}',
|
||||
data: {'nameCheck':$value},
|
||||
success:function (data) {
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
@csrf
|
||||
@method("put")
|
||||
<label for="name">Lokationsnavn:</label>
|
||||
<label hidden id="error" for="errormesseages">Lokation findes allerede</label>
|
||||
<input type="text" name="name" id="name" value="{{ $location->name }}" required>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Rediger">
|
||||
</form>
|
||||
@endsection
|
||||
@section("scripts")
|
||||
@@ -29,5 +30,57 @@
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
//Dont delete me, if the user reloads the pages with text in the text-box this code runs.
|
||||
$(document).ready(function () {
|
||||
$value = $('#name').val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('locations.nameCheckUpdate')}}',
|
||||
data: {'nameCheck':$value, 'id':{{$location->id}}},
|
||||
success:function (data) {
|
||||
console.log(data);
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#name').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('locations.nameCheckUpdate')}}',
|
||||
data: {'nameCheck':$value, 'id':{{$location->id}}},
|
||||
success:function (data) {
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -29,20 +29,14 @@
|
||||
<label for="week">Uge nr.</label>
|
||||
<label hidden id="error" for="errormesseages">Menuplan findes allerede</label>
|
||||
<input type="number" name="week" id="week" min="1" max="53" placeholder="1" required>
|
||||
<div id="editor">
|
||||
<h2 class="ql-align-center"><strong>Mandag:</strong></h2>
|
||||
<p class="ql-align-center">{Mandag}</p>
|
||||
<p class="ql-align-center"><br></p>
|
||||
<h2 class="ql-align-center"><strong>Tirsdag:</strong></h2>
|
||||
<p class="ql-align-center">{Tirsdag}</p>
|
||||
<p class="ql-align-center"><br></p>
|
||||
<h2 class="ql-align-center"><strong>Onsdag:</strong></h2>
|
||||
<p class="ql-align-center">{Onsdag}</p>
|
||||
<p class="ql-align-center"><br></p>
|
||||
<h2 class="ql-align-center"><strong>Torsdag:</strong></h2>
|
||||
<p class="ql-align-center">{Torsdag}</p>
|
||||
</div>
|
||||
<textarea name="menu" class="d-none" id="hiddenArea"></textarea>
|
||||
<label for="monday">Mandag:</label>
|
||||
<input type="text" name="monday" id="monday" placeholder="Hawaii Pizza" required>
|
||||
<label for="tuesday">Tirsdag:</label>
|
||||
<input type="text" name="tuesday" id="tuesday" placeholder="Pasta Bolognese" required>
|
||||
<label for="wednesday">Onsdag:</label>
|
||||
<input type="text" name="wednesday" id="wednesday" placeholder="Pandekager" required>
|
||||
<label for="thursday">Torsdag:</label>
|
||||
<input type="text" name="thursday" id="thursday" placeholder="Bøf med løg" required>
|
||||
<label class="toggle">
|
||||
<input class="toggle__input" id="isNews" type="checkbox" name="newsoption" onclick="change()">
|
||||
<span class="toggle__label">
|
||||
@@ -56,34 +50,6 @@
|
||||
|
||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Opret Menuplan">
|
||||
</form>
|
||||
|
||||
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
|
||||
<script>
|
||||
var container = document.getElementById("editor");
|
||||
var fullEditor = new Quill(container, {
|
||||
modules: {
|
||||
'toolbar': [
|
||||
[ 'bold', 'italic', 'underline', 'strike' ],
|
||||
[{ 'color': [] }],
|
||||
[{ 'script': 'super' }, { 'script': 'sub' }],
|
||||
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
|
||||
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
||||
[ {'direction': 'rtl'}, { 'align': [] }],
|
||||
[ 'link' ],
|
||||
[ 'clean' ]
|
||||
],
|
||||
},
|
||||
theme: 'snow'
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var form = document.querySelector('form');
|
||||
form.onsubmit = function() {
|
||||
var myEditor = document.getElementById('editor');
|
||||
var html = myEditor.children[0].innerHTML;
|
||||
document.getElementById('hiddenArea').innerText = html;
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@section("scripts")
|
||||
<script>
|
||||
|
||||
@@ -30,8 +30,14 @@
|
||||
<label for="mandag">Uge:</label>
|
||||
<label hidden id="error" for="errormesseages">Menuplan findes allerede</label>
|
||||
<input type="number" name="week" id="week" min="1" max="53" value="{{ $menuplan->week }}" required>
|
||||
<div id="editor">{!! $menuplan->menu !!}</div>
|
||||
<textarea name="menu" class="d-none" id="hiddenArea"></textarea>
|
||||
<label for="monday">Mandag:</label>
|
||||
<input type="text" name="monday" id="monday" placeholder="Hawaii Pizza" required value="{{ $menuplan->monday }}">
|
||||
<label for="tuesday">Tirsdag:</label>
|
||||
<input type="text" name="tuesday" id="tuesday" placeholder="Pasta Bolognese" required value="{{ $menuplan->tuesday }}">
|
||||
<label for="wednesday">Onsdag:</label>
|
||||
<input type="text" name="wednesday" id="wednesday" placeholder="Pandekager" required value="{{ $menuplan->wednesday }}">
|
||||
<label for="thursday">Torsdag:</label>
|
||||
<input type="text" name="thursday" id="thursday" placeholder="Bøf med løg" required value="{{ $menuplan->thursday }}">
|
||||
<label class="toggle">
|
||||
<input class="toggle__input" type="checkbox" name="newsoption">
|
||||
<span class="toggle__label">
|
||||
@@ -40,34 +46,6 @@
|
||||
</label>
|
||||
<input id="disable" type="submit" class="btn btn-dark text-white" value="Rediger Menuplan">
|
||||
</form>
|
||||
|
||||
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
|
||||
<script>
|
||||
var container = document.getElementById("editor");
|
||||
var fullEditor = new Quill(container, {
|
||||
modules: {
|
||||
'toolbar': [
|
||||
[ 'bold', 'italic', 'underline', 'strike' ],
|
||||
[{ 'color': [] }],
|
||||
[{ 'script': 'super' }, { 'script': 'sub' }],
|
||||
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
|
||||
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
||||
[ {'direction': 'rtl'}, { 'align': [] }],
|
||||
[ 'link' ],
|
||||
[ 'clean' ]
|
||||
],
|
||||
},
|
||||
theme: 'snow'
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var form = document.querySelector('form');
|
||||
form.onsubmit = function() {
|
||||
var myEditor = document.getElementById('editor');
|
||||
var html = myEditor.children[0].innerHTML;
|
||||
document.getElementById('hiddenArea').innerText = html;
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@section("scripts")
|
||||
<script>
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<h1>Opret Vaskemaskine:</h1>
|
||||
<h1 id="errormesseages" >Opret Vaskemaskine:</h1>
|
||||
<form method="post" action="{{ route("washing-machines.store") }}">
|
||||
@csrf
|
||||
<label for="name_first">Vaskemaskine Navn:</label>
|
||||
<label hidden id="error" for="errormesseages">Vaskemaskinen med den lokation findes allerede</label>
|
||||
<input type="text" name="name" id="name" max="60" placeholder="Vaskemaskine nr. 1" required>
|
||||
<label for="location_id">Lokation:</label>
|
||||
<select name="location_id" id="location_id" class="mb-2" required>
|
||||
@@ -26,7 +27,7 @@
|
||||
<option disabled> Der er ingen lokationer oprettet!</option>
|
||||
@endif
|
||||
</select>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Opret">
|
||||
</form>
|
||||
@endsection
|
||||
@section("scripts")
|
||||
@@ -39,5 +40,82 @@
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
//Dont delete me, if the user reloads the pages with text in the text-box this code runs.
|
||||
$(document).ready(function () {
|
||||
$value = $('#name').val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('washing-machines.nameCheck')}}',
|
||||
data: {'nameCheck':$value, 'location': $('#location_id').val()},
|
||||
success:function (data) {
|
||||
console.log(data);
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#name').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('washing-machines.nameCheck')}}',
|
||||
data: {'nameCheck':$value, 'location': $('#location_id').val()},
|
||||
success:function (data) {
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('#location_id').on('change', function () {
|
||||
$value = $('#name').val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('washing-machines.nameCheck')}}',
|
||||
data: {'nameCheck':$value, 'location': $('#location_id').val()},
|
||||
success:function (data) {
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
@csrf
|
||||
@method("put")
|
||||
<label for="name_first">Vaskemaskine Navn:</label>
|
||||
<label hidden id="error" for="errormesseages">Vaskemaskinen med den lokation findes allerede</label>
|
||||
<input type="text" name="name" id="name" max="60" value="{{$machine->name}}" required>
|
||||
<select class="w-100" name="location_id" id="location_id" class="mb-2" required>
|
||||
<option disabled> -- Vælg Lokation -- </option>
|
||||
@@ -25,7 +26,7 @@
|
||||
<option {{ $selected }} value="{{ $location->id }}">{{ $location->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Rediger">
|
||||
</form>
|
||||
@endsection
|
||||
@section("scripts")
|
||||
@@ -38,5 +39,82 @@
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
//Dont delete me, if the user reloads the pages with text in the text-box this code runs.
|
||||
$(document).ready(function () {
|
||||
$value = $('#name').val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('washing-machines.nameCheckUpdate')}}',
|
||||
data: {'nameCheck':$value, 'location': $('#location_id').val(), 'id': {{$machine->id}}},
|
||||
success:function (data) {
|
||||
console.log(data);
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#name').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('washing-machines.nameCheckUpdate')}}',
|
||||
data: {'nameCheck':$value, 'location': $('#location_id').val(), 'id': {{$machine->id}}},
|
||||
success:function (data) {
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('#location_id').on('change', function () {
|
||||
$value = $('#name').val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('washing-machines.nameCheckUpdate')}}',
|
||||
data: {'nameCheck':$value, 'location': $('#location_id').val(), 'id': {{$machine->id}}},
|
||||
success:function (data) {
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<div class="row align-items-center">
|
||||
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('washing-machines.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Vaskemaskine</a>
|
||||
</div>
|
||||
{!! session()->get('WashingNameExists') !!}
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
<th>Navn</th>
|
||||
|
||||
@@ -18,7 +18,17 @@
|
||||
<span class="text-center text-white bold">{{ __('msg.ugestor') }}: {{$menuplan->week}}</span>
|
||||
@endif
|
||||
<div class="col w-100 mt-1">
|
||||
{!! $menuplan->menu !!}
|
||||
{!! '<h2 class="ql-align-center"><strong>Mandag:</strong></h2>'.
|
||||
'<p class="ql-align-center">'.$menuplan->monday.'</p><p class="ql-align-center"></p>'.
|
||||
|
||||
'<h2 class="ql-align-center"><strong>Tirsdag:</strong></h2>'.
|
||||
'<p class="ql-align-center">'.$menuplan->tuesday.'</p><p class="ql-align-center"></p>'.
|
||||
|
||||
'<h2 class="ql-align-center"><strong>Onsdag:</strong></h2>'.
|
||||
'<p class="ql-align-center">'.$menuplan->wednesday.'</p><p class="ql-align-center"></p>'.
|
||||
|
||||
'<h2 class="ql-align-center"><strong>Torsdag:</strong></h2>'.
|
||||
'<p class="ql-align-center">'.$menuplan->thursday.'</p>' !!}
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user