Files
w4rpservices/resources/views/ajax/live_search.blade.php
2019-07-13 02:50:07 -05:00

40 lines
979 B
PHP

@extends('layouts.b4')
@section('content')
<div class="container">
<input type="text" name="search" id="search" class="form-control" placeholder="search Users" />
</div>
<div class="table-responsive">
<h3 align="center"> Total Data : <span id="total_records"></span></h3>
</div>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>User</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script>
$(document).ready(function() {
fetch_user_data();
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);
}
});
}
})
</script>
@endsection