File: //var/www/html/owlcrm/resources/views/users/invoice/index.blade.php
@extends('adminlte::page')
@section('title', 'OWL CRM Dashboard')
@section('content_header')
<h1>Invoice</h1>
<small>Manage Invoice</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('invoice.create') }}" class="btn btn-dark"><i class="fas fa-plus"></i> Add Invoice
</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 method="POST" 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>
<table class="table table-bordered yajra-datatable">
<thead>
<tr>
<th>Invoice Number</th>
<th>Invoice Date</th>
<th>Due Date</th>
<th>Payment Modes</th>
<th>Generated By</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</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('invoice.index') }}",
'data': function(data) {
// Read values
var search_keyword = $('#search_keyword').val();
var shop_filter = $('#shop_filter option:selected').val();
// Append to data
data.search_keyword = search_keyword;
data.shop_filter = shop_filter;
}
},
columns: [
/*{data: 'checkbox', name: 'checkbox', orderable: false, searchable: false},*/
/* {data: 'id', name: 'ID'}, */
{
data: 'subject',
name: 'Invoice Number'
},
{
data: 'proposal_date',
name: 'Invoice Date'
},
{
data: 'valid_till_date',
name: 'Due Date'
},
{
data: 'created_by',
name: 'Generated By'
},
{
data: 'status',
name: 'Status',
},
{
data: 'action',
name: 'Actions',
},
]
});
$('#search_keyword').keyup(function() {
dataTable.draw();
});
$('#shop_filter').on('change', function() {
dataTable.draw();
});
});
</script>
@stop