File: /var/www/html/owlcrm/resources/views/users/properties/index.blade.php
@extends('adminlte::page')
@section('title', 'OWL CRM Dashboard')
@section('content_header')
<h1>Properties</h1>
<small>Manage Properties</small>
@stop
@section('content')
<div class="card card-dark">
<div class="card-header">
<h3 class="card-title"></h3>
<div class="card-tools">
<a href="{{ route('properties.create') }}" class="btn btn-dark"><i class="fas fa-plus"></i> Add Properties</a>
</div>
</div>
<div class="card-body">
@if (session('success'))
<h6 class = 'alert alert-success'>
{{ Session('success') }}
</h6>
@endif
@if (session('error'))
<h6 class="alert alert-danger">
{{ session('error') }}
</h6>
@endif
<form id="search-form" role="form">
<div class="form-group">
<label for="search">Search</label>
<x-adminlte-input class="form-control" id="search_keyword" name="search_keyword"
placeholder="Enter Name" />
</div>
@php
$config = [
'showDropdowns' => true,
'cancelButtonClasses' => 'btn-danger',
'locale' => ['format' => 'YYYY/MM/DD'],
];
@endphp
</form>
<div class="table-responsive">
<table class="table table-bordered yajra-datatable">
<thead>
<tr>
<th>Name</th>
<th>Nature</th>
<th>Type</th>
<th>Description</th>
<th>Location</th>
<th>Project</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
@stop
@section('js')
<script type="text/javascript">
$(function() {
var dataTable = $('.yajra-datatable').DataTable({
processing: true,
serverSide: true,
pageLength: 10,
searching: false,
'ajax': {
'url': "{{ route('properties.index') }}",
'data': function(data) {
// Read values
var search_keyword = $('#search_keyword').val();
var shop_filter = $('#shop_filter option:selected').val();
var status_filter = $('#status_filter option:selected').val();
// Append to data
data.search_keyword = search_keyword;
data.shop_filter = shop_filter;
data.status_filter = status_filter;
}
},
columns: [
/*{data: 'checkbox', name: 'checkbox', orderable: false, searchable: false},*/
/* {data: 'id', name: 'ID'}, */
{
data: 'name',
name: 'Name'
},
{
data: 'nature',
name: 'Nature'
},
{
data: 'type',
name: 'Type'
},
{
data: 'description',
name: 'Description'
},
{
data: 'location',
name: 'Location'
},
{
data: 'project_id',
name: 'Project'
},
{
data: 'action',
name: 'Action',
},
]
});
$('#search_keyword').keyup(function() {
dataTable.draw();
});
$('#shop_filter').on('change', function() {
dataTable.draw();
});
});
</script>
@stop