Made it so they can now make there own dynamic guide

This commit is contained in:
2020-08-04 15:29:08 +02:00
parent 210aa00fc6
commit 9dd09f2205
4 changed files with 46 additions and 7 deletions
@@ -2,7 +2,7 @@
@extends("admin.layout.header")
@section("title")
Events - Vis
Kontakt - Vis
@endsection
@section("path")
@@ -15,9 +15,18 @@
<form method="post" action="{{ route("users.store") }}">
@csrf
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg på Navn, Email, Telefon"></input>
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg på navn,titel,email,tf"></input>
</form>
<input class="checkbox-inline" type="checkbox" name="checkbox" id="navn" value="navn">
<label for="navn">Navn</label>
<input class="checkbox-inline" type="checkbox" name="checkbox" id="titel" value="titel">
<label for="efternavn">Titel</label>
<input class="checkbox-inline" type="checkbox" name="checkbox" id="email" value="email">
<label for="efternavn">Email</label>
<input class="checkbox-inline" type="checkbox" name="checkbox" id="tf" value="tf">
<label for="efternavn">Telefon</label>
<p></p>
</div>
@@ -51,11 +60,13 @@
<script>
$('#search').on('keyup', function () {
$value = $(this).val();
$checkboxValue = $( "input:checked" ).val();
$.ajax({
type: 'get',
url: '{{route('contacts.search')}}',
data: {'search':$value},
data: {'search':$value, 'isCheck': $checkboxValue},
success:function (data) {
console.log($checkboxValue);
$('tbody').html(data);
},
error:function (data) {
@@ -66,5 +77,22 @@
</script>
<script>
$(document).ready(function(){
$("input:checkbox").on('click', function() {
var $box = $(this);
if ($box.is(":checked")) {
var group = "input:checkbox[name='" + $box.attr("name") + "']";
$(group).prop("checked", false);
$box.prop("checked", true);
} else {
$box.prop("checked", false);
}
});
});
</script>
@endsection