209 lines
7.9 KiB
PHP
Executable File

<!--sidebar end-->
<!--main content start-->
<?php if($this->session->flashdata('feedback_error')){ ?>
<script>
Swal.fire({
position: 'center',
icon: 'error',
title: '<?php echo $this->session->flashdata('feedback_error'); ?>',
showConfirmButton: false,
timer: 3500
})
</script>
<?php } ?>
<?php if($this->session->flashdata('feedback_success')){ ?>
<script>
Swal.fire({
position: 'center',
icon: 'success',
title: '<?php echo $this->session->flashdata('feedback_success'); ?>',
showConfirmButton: false,
timer: 3500
})
</script>
<?php } ?>
<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-6">
<h3 class="font-weight-bold"><?php echo lang('Caregiver 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="editable-sample" cellspacing="0" width="100%">
<thead>
<tr>
<!-- <th><?php echo lang('id'); ?></th> -->
<th class="w-10"><?php echo lang('Sl.No'); ?></th>
<th class="w-10"><?php echo lang('Type'); ?></th>
<th class="w-10"><?php echo lang('name'); ?></th>
<th class="w-10"><?php echo lang('email'); ?></th>
<th class="w-10"><?php echo lang('phone'); ?></th>
<th class="w-10"><?php echo lang('options'); ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<!--main content end-->
<!--footer start-->
<script type="text/javascript">
function sendMail(_this)
{
var tomail = $(_this).attr("to_mail");
var cg_id = $(_this).attr("cg_id");
$.ajax('caregivers/smail', {
type: 'POST', // http method
data: { tomail: tomail,cg_id: cg_id,<?php echo $this->security->get_csrf_token_name(); ?>:'<?php echo $this->security->get_csrf_hash(); ?>' }, // data to submit
async: false,
success: function (data, status, xhr) {
$(_this).html("Mail sent successfully<i class='la la-check'></i>");
$(_this).removeClass("btn-warning");
$(_this).addClass("btn-success");
},
error: function (jqXhr, textStatus, errorMessage) {
// $('p').append('Error' + errorMessage);
alert("error duc");
}
});
}
</script>
<script>
$(document).ready(function () {
var table = $('#editable-sample').DataTable({
responsive: true,
"processing": true,
"serverSide": true,
"searchable": true,
"ajax": {
url: "caregivers/getCaregiverList",
type: 'POST',
data: {
'<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>'
},
},
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/<?php echo $this->language; ?>.json"
}
});
table.buttons().container().appendTo('.custom_buttons');
});
function sendForbackgroundCheck(_this)
{
let userEmail = $(_this).attr('to_mail');
let userId = $(_this).attr('cg_id');
$(_this).html("Sending...");
$.ajax('caregivers/clearchecks', {
type: 'POST', // http method
data: { userEmail: userEmail,userId: userId,<?php echo $this->security->get_csrf_token_name(); ?>:'<?php echo $this->security->get_csrf_hash(); ?>' }, // data to submit
async: false,
success: function (data, status, xhr) {
// $(_this).html('Pending');
location.reload()
},
error: function (jqXhr, textStatus, errorMessage) {
// $('p').append('Error' + errorMessage);
alert("error duc");
}
});
}
function checkBackgoundStatus(_this)
{
$(_this).html('Please wait . . .');
let cid = $(_this).attr('attr_cid');
let rowId = $(_this).attr('attr_rowId');
$.ajax('<?php echo base_url(); ?>caregivers/background_corn/'+cid+'/'+rowId, {
type: 'GET', // http method
//data: { userEmail: userEmail,userId: userId,<?php echo $this->security->get_csrf_token_name(); ?>:'<?php echo $this->security->get_csrf_hash(); ?>' }, // data to submit
async: false,
success: function (data, status, xhr) {
// $(_this).html('Pending');
// location.reload()
let reportData = JSON.parse(data);
console.log(reportData);
$("#stat"+rowId).html(reportData.report_status);
$(_this).html('check status');
},
error: function (jqXhr, textStatus, errorMessage) {
// $('p').append('Error' + errorMessage);
alert("error duc");
}
});
}
</script>