360 lines
14 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 } ?>
<?php
if($this->session->flashdata('feedback_greeting_by_system_admin')){
?>
<script>
Swal.fire({
position: 'center',
icon: 'success',
title: '<?php echo $this->session->flashdata('feedback_greeting_by_system_admin'); ?>',
showConfirmButton: false,
timer: 3500
})
</script>
<?php
unset($_SESSION['feedback_greeting_by_system_admin']);
}
?>
<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 Pending Acceptance'); ?></h3>
</div>
<div class="col-md-6 no-print pull-right">
<a class='btn btn-warning white onboardMail repo_stat pull-right' href="<?php base_url()."caregivers/clearchecks_corn"; ?>"><?php echo lang('Update report Status'); ?></a>
</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>
<?php
if(isset($dlGvdftsdr) && $dlGvdftsdr==202){
?>
<button onclick="deleteCaregiverAllInfoAtOnce()">Delete</button>
<button onclick="checkAllMyGtfgsdvhjgsdjfj()">Check All</button>
<?php
}
?>
<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-15"><?php echo lang('percentage'); ?></th> -->
<th class="no-print"><?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/getApprovalList",
type: 'POST',
data: {
'<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',dlGvdftsdr:<?=isset($dlGvdftsdr)?intval($dlGvdftsdr):0?>
},
},
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>
<script type="text/javascript">
if(typeof swalAlert==="undefined"){
function swalAlert(icon,msg){
Swal.fire({
position: 'center',
icon: icon,
title: msg,
showConfirmButton: false,
timer: 1500
});
}
}
if(typeof checkAllMyGtfgsdvhjgsdjfj==="undefined"){
function checkAllMyGtfgsdvhjgsdjfj(){
$('input.twrdtssgdctsr5tfddt[type="checkbox"]').prop('checked', true);
}
}
if(typeof deleteCaregiverAllInfoAtOnce==="undefined"){
function deleteCaregiverAllInfoAtOnce(){
if(!window.confirm("Do you want to delete?")){
return false;
}
var checkedValues=[];
$('input.twrdtssgdctsr5tfddt[type="checkbox"]').each(function() {
if ($(this).is(':checked')) {
checkedValues.push($(this).val());
}
});
var checkedValues_str='';
if(checkedValues.length>0){
checkedValues_str=checkedValues.join(',');
}
if(checkedValues_str!=""){
var request={
'caregiver_ids':checkedValues_str,
'type':'bulk'
};
var url="<?=base_url()?>dbclean/hms_delete_all_caregiver_info";
$.ajax({
type: 'POST',
url: url,
data: {
<?=$this->security->get_csrf_token_name()?>:'<?=$this->security->get_csrf_hash()?>',
body: request
},
beforeSend: function(){
// console.log("Deleting Caregiver...");
callLoader_hgy44vg(true,'Deleteing Caregiver...');
},
success: function(response) {
var data=$.parseJSON(response);
swalAlert(data.status==200?'success':'error',data.msg);
callLoader_hgy44vg(false);
$('input.twrdtssgdctsr5tfddt[type="checkbox"]').each(function() {
if ($(this).is(':checked')) {
$(this).closest('tr[role="row"]').remove();
}
});
// location.reload();
},
error: function(){
callLoader_hgy44vg(false);
console.error("something bad happened while calling ajax-dbclean/hms_delete_all_caregiver_info");
},
complete: function(){
// console.log("Completed Caregiver Deletion...");
}
});
}
}
}
if(typeof deleteCaregiverAllInfo==="undefined"){
function deleteCaregiverAllInfo(ths,caregiver_id){
try{
var caregiver_name=$(ths).find('span').text();
if(!window.confirm("Do you want to delete '"+caregiver_name+"'?")){
return false;
}
var request={
'caregiver_id':caregiver_id
};
var url="<?=base_url()?>dbclean/hms_delete_all_caregiver_info";
$.ajax({
type: 'POST',
url: url,
data: {
<?=$this->security->get_csrf_token_name()?>:'<?=$this->security->get_csrf_hash()?>',
body: request
},
beforeSend: function(){
// console.log("Deleting Caregiver...");
callLoader_hgy44vg(true,'Deleteing Caregiver...');
},
success: function(response) {
var data=$.parseJSON(response);
swalAlert(data.status==200?'success':'error',data.msg);
callLoader_hgy44vg(false);
$(ths).closest('tr[role="row"]').remove();
// location.reload();
},
error: function(){
callLoader_hgy44vg(false);
console.error("something bad happened while calling ajax-dbclean/hms_delete_all_caregiver_info");
},
complete: function(){
// console.log("Completed Caregiver Deletion...");
}
});
}
catch(error){
console.error("Error occured in function deleteCaregiverAllInfo();");
}
}
}
</script>