106 lines
4.5 KiB
PHP
Executable File

<div class="app-content content">
<section class="content-wrapper">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-md-12">
<h3 class="font-weight-bold"><?=lang('Recent Visits')?></h3>
</div>
</div>
</div>
<hr class="mt-0 mb-0" />
<div class="card-content collapse show">
<div class="card-body card-dashboard">
<div class="panel-body">
<div class="adv-table editable-table ">
<div class="space15"></div>
<table class="table table-striped table-bordered dom-jQuery-events" id="data_table_recent_visits" cellspacing="0" width="100%">
<thead>
<tr>
<th><?=lang('No.')?></th>
<th><?=lang('Service Type')?></th>
<th><?=lang('Patient Name')?></th>
<th><?=lang('Clock In')?></th>
<th><?=lang('Clock Out')?></th>
<th><?=lang('Status')?></th>
<th><?=lang('Action')?></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<script type="text/javascript">
$(document).ready(function(){
ajax_get_recent_visits_overview({'filter':'month'});
});
function ajax_get_recent_visits_overview(req){
try{
var dataTable=$('#data_table_recent_visits').DataTable();
dataTable.destroy();
var table=$('#data_table_recent_visits').DataTable({
responsive: true,
"processing": true,
"serverSide": true,
"searchable": true,
"ajax": {
url: "CaregiversDashboard/hms_get_recent_visits_list",
type: 'POST',
data: {
'<?=$this->security->get_csrf_token_name()?>' : '<?=$this->security->get_csrf_hash()?>',
body:req
},
},
scroller: {
loadingIndicator: true
},
dom: "<'row'<'col-sm-5 data-table-pagelimit'l><'col-sm-6 data-table-search'f><'col-sm-1 text-center data-table-button-collection'B>>" +
"<'row'<'col-sm-12 data-table-body'tr>>" +
"<'row'<'col-sm-5 data-table-pagecountsummary'i><'col-sm-7 data-table-pagination'p>>",
buttons: [
{
extend: 'collection',
text: '...',
buttons: [
'copyHtml5',
'excelHtml5',
'csvHtml5',
'pdfHtml5',
{
extend: 'print',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6],
}
}
]
},
],
aLengthMenu: [
[10, 25, 50, 100,],
[10, 25, 50, 100]
],
iDisplayLength: 100,
"order": [[0, "desc"]],
"language": {
"lengthMenu": "_MENU_",
search: "_INPUT_",
"url": "common/assets/DataTables/languages/<?=$this->language?>.json"
}
});
table.buttons().container().appendTo('.custom_buttons');
}catch(error){
console.error(`Error occured in function ajax_get_recent_visits_overview(); - ${error}`);
}
}
</script>