116 lines
5.1 KiB
PHP
Executable File
116 lines
5.1 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('Patients List')?></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_active_patients" cellspacing="0" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th><?=lang('No.')?></th>
|
|
<th><?=lang('Service Type')?></th>
|
|
<th><?=lang('Patient Name')?></th>
|
|
<th><?=lang('Email')?></th>
|
|
<th><?=lang('Phone')?></th>
|
|
<th><?=lang('Address (City, Zip)')?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<script src="<?=base_url()?>common/js/utils.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
var filter='<?=$filter?>';
|
|
var req={};
|
|
req.filter=['week','month','year'].includes(filter.trim())?filter.trim():'year';
|
|
if(req.filter=='week'){
|
|
req.periods=Samples.utils.weeksrange({count:1,direction:'backward',format:'yyyy-mm-dd',joiner:' ~ '});
|
|
}else if(req.filter=='month'){
|
|
req.periods=Samples.utils.monthsrange({count:1,direction:'backward',format:'yyyy-mm-dd',joiner:' ~ '});
|
|
}else if(req.filter=='year'){
|
|
req.periods=Samples.utils.yearsrange({count:1,direction:'backward',format:'yyyy-mm-dd',joiner:' ~ '});
|
|
}
|
|
ajax_get_active_patients_overview(req);
|
|
});
|
|
function ajax_get_active_patients_overview(req){
|
|
try{
|
|
var dataTable=$('#data_table_active_patients').DataTable();
|
|
dataTable.destroy();
|
|
|
|
var table=$('#data_table_active_patients').DataTable({
|
|
responsive: true,
|
|
"processing": true,
|
|
"serverSide": true,
|
|
"searchable": true,
|
|
"ajax": {
|
|
url: "patient/getActivePatientsList",
|
|
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_active_patients_overview(); - ${error}`);
|
|
}
|
|
}
|
|
</script>
|