File: /var/www/html/taxicamera/old/applicationold/views/admin/report/service_notification/list.php
<div class="main-content">
<div class="content-wrapper">
<div class="container-fluid">
<?php if ($this->session->flashdata('success_msg')) : ?>
<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
<?php echo $this->session->flashdata('success_msg') ?>
</div>
<?php endif ?>
<?php if ($this->session->flashdata('error_msg')) : ?>
<div class="alert alert-danger">
<a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
<?php echo $this->session->flashdata('error_msg') ?>
</div>
<?php endif ?>
<!-- Basic form layout section start -->
<section id="basic-form-layouts">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<div class="page-title-wrap">
<h4 class="card-title">Service Notification Report</h4>
</div>
<!--<p class="mb-0">This is the most basic and cost estimation form is the default position.</p>-->
</div>
<div class="card-body">
<div class="px-3">
<form class="form custom_form_style">
<div class="form-body">
<div class="user_permission_top">
</div>
</div>
<!--<div class="form-actions">
<button type="button" class="btn btn-danger mr-1">
<i class="fa fa-times" aria-hidden="true"></i> Cancel
</button>
<button type="button" class="btn btn-success">
<i class="fa fa-floppy-o" aria-hidden="true"></i> Save
</button>
</div>-->
</form>
<div class="row ">
<div class="table-responsive custom_table_area export_table_area">
<table id="income_table" class="table table-striped table-bordered export_btn_dt c_table_style">
<thead>
<tr>
<th>SL No.</th>
<th>Car No.</th>
<th>Date</th>
<th>Driver DC</th>
<th>Driver Name</th>
<th>Driver Phone Number</th>
<th>KM Reading ( Last entered)</th>
<th>Action</th>
</tr>
</thead>
<tbody id="tbody_income_table">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- // Basic form layout section end -->
</div>
</div>
</div>
<script>
$(document).ready(function() {
service_notification_list();
});
function service_notification_list() {
var resulthtml = '';
$.ajax({
url: "<?php echo base_url('admin/report/get_service_notification_report'); ?>",
type: "POST",
data: {},
dataType: "json",
encode: true,
//async: false
})
.done(function(data) {
if (data.status) {
if (data.service_notification_list) {
var i = 0;
$.each(data.service_notification_list, function(key, value) {
i++;
resulthtml += '<tr>';
resulthtml += '<td>' + i + '</td>';
resulthtml += '<td>' + value.registration_no + '</td>';
resulthtml += '<td>' + value.payin_date + '</td>';
resulthtml += '<td>' + value.dc_no + '</td>';
resulthtml += '<td>' + value.first_name.trim() +' '+value.middle_name.trim()+' '+value.last_name.trim()+'</td>';
resulthtml += '<td>' + value.mobile + '</td>';
resulthtml += '<td>' + value.total_km_end + '</td>';
if(value.service_status == 0){
resulthtml += '<td><a title="Pending" class="btn_action btn btn-warning settle_btn" href="<?= base_url();?>admin/report/service_booked/'+value.service_notification_id+'">Pending</a></td>';
}
else{
resulthtml += '<td><a title="Service Booked" class="btn_action btn btn-success" href="<?= base_url();?>admin/report/service_pending/'+value.service_notification_id+'">Service Booked</a></td>';
}
resulthtml += '</tr>';
})
//console.log(resulthtml);
var now = new Date();
var date = now.getFullYear() + ":" + now.getMonth() + ":" + now.getDate();
$("#income_table").dataTable().fnDestroy();
$("#tbody_income_table").html(resulthtml);
$('#income_table').DataTable({
pageLength: 100,
dom: 'Bfrtip',
buttons: [{
extend: 'excel',
text: 'Download Excel',
className: 'btn btn-outline-primary mr-1',
filename: 'service_notification_report' + date
}
//'copy', 'csv', 'excel', 'pdf', 'print'
]
});
}
} else {
$.alert({
type: 'red',
title: 'Alert!',
content: 'Oops!Something went wrong...',
});
}
})
.fail(function(result) {
$.alert({
type: 'red',
title: 'Alert!',
content: 'Oops!Something went wrong...',
});
})
}
$('a.settle_btn').confirm({
title: "confirm Activation",
content: "Do you want to change the status to service booked?",
buttons: {
Activate: {
btnClass: 'btn-green',
action: function(){
location.href = this.$target.attr('href');
}
},
Close: {
btnClass: 'btn-default',
action: function(){
}
},
}
});
</script>