ajax attempt
This commit is contained in:
65
resources/views/ajax/b4.blade.php
Normal file
65
resources/views/ajax/b4.blade.php
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-140677389-1"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', 'UA-140677389-1');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<title>{{ config('app.name', 'W4RP Services') }}</title>
|
||||||
|
<!-- Required meta tags -->
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
|
||||||
|
<!-- CSRF Token -->
|
||||||
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
|
||||||
|
<!-- Bootstrap CSS
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
|
||||||
|
-->
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
|
||||||
|
<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
@include('layouts.navbar')
|
||||||
|
<div class="container">
|
||||||
|
@include('inc.messages')
|
||||||
|
</div>
|
||||||
|
@yield('content')
|
||||||
|
<!-- Optional JavaScript -->
|
||||||
|
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
function fetch_user_data(query = '') {
|
||||||
|
$.ajax({
|
||||||
|
url:"{{ route('live_search.action') }}",
|
||||||
|
method:'GET',
|
||||||
|
data:{query:query},
|
||||||
|
dataType:'json',
|
||||||
|
success:function(data) {
|
||||||
|
$('tbody').html(data.table_data);
|
||||||
|
$('#total_records').text(data.total_data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch_user_data();
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on('keyup', '#search', function() {
|
||||||
|
var query = $(this).val();
|
||||||
|
fetch_user_data(query);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@extends('layouts.b4')
|
@extends('ajax.b4')
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<input type="text" name="search" id="search" class="form-control" placeholder="Search Users" />
|
<input type="text" name="search" id="search" class="form-control" placeholder="Search Users" />
|
||||||
@@ -17,29 +17,4 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<script>
|
|
||||||
$(document).ready(function() {
|
|
||||||
function fetch_user_data(query = '') {
|
|
||||||
$.ajax({
|
|
||||||
url:"{{ route('live_search.action') }}",
|
|
||||||
method:'GET',
|
|
||||||
data:{query:query},
|
|
||||||
dataType:'json',
|
|
||||||
success:function(data) {
|
|
||||||
$('tbody').html(data.table_data);
|
|
||||||
$('#total_records').text(data.total_data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch_user_data();
|
|
||||||
})
|
|
||||||
|
|
||||||
$(document).on('keyup', '#search', function() {
|
|
||||||
var query = $(this).val();
|
|
||||||
fetch_user_data(query);
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
Reference in New Issue
Block a user