Made it so they can now make there own dynamic guide
This commit is contained in:
parent
210aa00fc6
commit
9dd09f2205
|
@ -146,6 +146,18 @@ class ContactController extends Controller
|
||||||
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
|
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
|
||||||
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
|
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
|
||||||
"</tr>";
|
"</tr>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if($request->isCheck === "navn")
|
||||||
|
$users = Contact::query()->where('contactname', 'LIKE',$request->search.'%')->get();
|
||||||
|
elseif ($request->isCheck === "titel")
|
||||||
|
$users = Contact::query()->where('title', 'LIKE',$request->search.'%')->get();
|
||||||
|
elseif ($request->isCheck === "email")
|
||||||
|
$users = Contact::query()->where('email', 'LIKE',$request->search.'%')->get();
|
||||||
|
elseif ($request->isCheck === "tf")
|
||||||
|
$users = Contact::query()->where('phone', 'LIKE',$request->search.'%')->get();
|
||||||
|
else
|
||||||
$users = DB::table('contacts')->where('contactname', 'LIKE',$request->search.'%')
|
$users = DB::table('contacts')->where('contactname', 'LIKE',$request->search.'%')
|
||||||
->orWhere('title','LIKE', $request->search.'%')
|
->orWhere('title','LIKE', $request->search.'%')
|
||||||
->orWhere('phone','LIKE', $request->search.'%')
|
->orWhere('phone','LIKE', $request->search.'%')
|
||||||
|
@ -170,7 +182,7 @@ class ContactController extends Controller
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$output.='<tr>'.
|
$output.='<tr>'.
|
||||||
'<td>Din søgning matchede ikke nogen personer</td>'.
|
'<td>Intet match</td>'.
|
||||||
'<td></td>'.
|
'<td></td>'.
|
||||||
'<td></td>'.
|
'<td></td>'.
|
||||||
'<td></td>'.
|
'<td></td>'.
|
||||||
|
|
|
@ -231,7 +231,6 @@ class WashingReservationController extends Controller
|
||||||
'<td></td>'.
|
'<td></td>'.
|
||||||
'<td></td>'.
|
'<td></td>'.
|
||||||
'<td></td>'.
|
'<td></td>'.
|
||||||
'<td></td>'.
|
|
||||||
'</tr>';
|
'</tr>';
|
||||||
}
|
}
|
||||||
return Response($output);
|
return Response($output);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
@extends("admin.layout.header")
|
@extends("admin.layout.header")
|
||||||
|
|
||||||
@section("title")
|
@section("title")
|
||||||
Events - Vis
|
Kontakt - Vis
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("path")
|
@section("path")
|
||||||
|
@ -15,9 +15,18 @@
|
||||||
|
|
||||||
<form method="post" action="{{ route("users.store") }}">
|
<form method="post" action="{{ route("users.store") }}">
|
||||||
@csrf
|
@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>
|
</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>
|
<p></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,11 +60,13 @@
|
||||||
<script>
|
<script>
|
||||||
$('#search').on('keyup', function () {
|
$('#search').on('keyup', function () {
|
||||||
$value = $(this).val();
|
$value = $(this).val();
|
||||||
|
$checkboxValue = $( "input:checked" ).val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'get',
|
type: 'get',
|
||||||
url: '{{route('contacts.search')}}',
|
url: '{{route('contacts.search')}}',
|
||||||
data: {'search':$value},
|
data: {'search':$value, 'isCheck': $checkboxValue},
|
||||||
success:function (data) {
|
success:function (data) {
|
||||||
|
console.log($checkboxValue);
|
||||||
$('tbody').html(data);
|
$('tbody').html(data);
|
||||||
},
|
},
|
||||||
error:function (data) {
|
error:function (data) {
|
||||||
|
@ -66,5 +77,22 @@
|
||||||
</script>
|
</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
|
@endsection
|
||||||
|
|
|
@ -15,14 +15,14 @@
|
||||||
|
|
||||||
<form method="post" action="{{ route("washing-reservations.store") }}">
|
<form method="post" action="{{ route("washing-reservations.store") }}">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg på Navn, Telefon"></input>
|
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg på vaskemaskine, tid"></input>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
<input class="checkbox-inline" type="checkbox" name="checkbox" id="vaskemaskine" value="vaskemaskine">
|
<input class="checkbox-inline" type="checkbox" name="checkbox" id="vaskemaskine" value="vaskemaskine">
|
||||||
<label for="navn">Vaskemaskine</label>
|
<label for="navn">Vaskemaskine</label>
|
||||||
<input class="checkbox-inline" type="checkbox" name="checkbox" id="tidspunkt" value="tidspunkt">
|
<input class="checkbox-inline" type="checkbox" name="checkbox" id="tidspunkt" value="tidspunkt">
|
||||||
<label for="efternavn">Tispunkt</label>
|
<label for="efternavn">Tidspunkt</label>
|
||||||
<input class="checkbox-inline" type="checkbox" name="checkbox" id="bruger" value="bruger">
|
<input class="checkbox-inline" type="checkbox" name="checkbox" id="bruger" value="bruger">
|
||||||
<label for="email">Bruger</label>
|
<label for="email">Bruger</label>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue