File: //var/www/html/owlcrm/resources/views/users/lead_proposal/index.blade.php
@extends('adminlte::page')
@section('title', 'OWL CRM Dashboard')
@section('content_header')
<h1>Lead Proposal</h1>
<small>Manage Lead Proposal</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('lead_proposal.create') }}" class="btn btn-dark"><i class="fas fa-plus"></i> Add Lead
Proposal</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 Subject" />
</div>
@php
$config = [
'showDropdowns' => true,
'cancelButtonClasses' => 'btn-danger',
'locale' => ['format' => 'YYYY/MM/DD'],
];
@endphp
</form>
<div class="table-responsive w-100">
<table class="table table-bordered w-100 yajra-datatable">
<thead>
<tr>
<th>Subject</th>
<th>Proposal Date</th>
<th>Valid Till Date</th>
<th>Created By</th>
<th>Address</th>
<th>Email Address</th>
<th>Phone</th>
<th>Status</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('lead_proposal.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: 'subject',
name: 'Subject'
},
{
data: 'proposal_date',
name: 'Proposal Date'
},
{
data: 'valid_till_date',
name: 'Valid Till Date'
},
{
data: 'created_by',
name: 'Created By'
},
{
data: 'address',
name: 'Address',
},
{
data: 'email_address',
name: 'Email Address',
},
{
data: 'phone',
name: 'Phone',
},
{
data: 'status',
name: 'Status',
},
{
data: 'action',
name: 'Actions',
},
]
});
$('#search_keyword').keyup(function() {
dataTable.draw();
});
$('#shop_filter').on('change', function() {
dataTable.draw();
});
});
</script>
@stop