5286 lines
305 KiB
PHP
Executable File

<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class CaregiversDashboard extends MX_Controller {
function __construct() {
parent::__construct();
$this->load->model('caregivers/Caregiver_model');
$this->load->model('mail_settings/Mail_model');
$this->load->model('CaregiverDashboard_model');
$this->load->model('referral/Referral_model');
$this->load->model('master_cg_service/Master_cg_service_model');
$this->load->model('master_caregiver_skills/Test_model','cg_skill');
$this->load->model('home/Home_model');
$this->load->helper('generatepdf_helper');
$this->load->helper('docexpiredate_helper');
$this->load->helper('mail_frequency_helper');
// if (!$this->ion_auth->in_group(array('Caregiver','admin'))) {
// if(!$this->ion_auth->coordinator_permission('caregiver_menu')){
// redirect('home/permission');
// }
// }
}
public function index() {
$id = $this->session->userdata('user_id');
// by naran on 16-09-2021
$data['onboardQuiz']=$this->Caregiver_model->getOnboardQuizStatus($id);
// end by naran on 16-09-2021
$data['nurse']=$this->Caregiver_model->getNurseByIonId($id);
$caregiver_id=$data['nurse']->id;
$data['progress']=$data['nurse']->progress;
//$data['patient']=$this->Caregiver_model->getCaregiverPatient($data['nurse']->id);
//$data['master_schdule']=$this->Caregiver_model->masterScheduleList();
$data['previuos_schedules']=$this->CaregiverDashboard_model->getCaregiverPreviousSchedule($caregiver_id);
$data['upcomming_schedules']=$this->CaregiverDashboard_model->getCaregiverUpcommingSchedule($caregiver_id);
//echo '<pre>';print_r($data['upcomming_schedule']);die;
$caregiverSchedule=$this->Caregiver_model->getCaregiverSchedule($caregiver_id);
foreach($caregiverSchedule as $schedule){
$data['caregiverScheduleid'][]=$schedule->schedule_master_id;
}
$nurse_data=$this->Caregiver_model->getNurseByIonId($id);
$progressData = json_decode($nurse_data->from_tab_status_pctg);
$progress = $progressData->form1+$progressData->form2+$progressData->form3+$progressData->form4+$progressData->form5+$progressData->form6+$progressData->form7+$progressData->form8+$progressData->form9+$progressData->form10+$progressData->form11;
if($progress < 100)
{
redirect(base_url()."CaregiversDashboard/profile");
}
// pre($data);die;
$this->load->view('home/dashboard',$data); // just the header file
$this->load->view('dashboard',$data);
$this->load->view('home/footer',$data);
}
public function load_progress(){
$id = $this->input->get('id');
$nurse_data=$this->Caregiver_model->getNurseByIonId($id);
$cg_id=$nurse_data->id;
$progressData = json_decode($nurse_data->from_tab_status_pctg);
$progress = $progressData->form1+$progressData->form2+$progressData->form3+$progressData->form4+$progressData->form5+$progressData->form6+$progressData->form7+$progressData->form8+$progressData->form9+$progressData->form10+$progressData->form11;
//$progress=$nurse_data->progress;
$data['progress']=$progress;
$doc_exsist=$this->Caregiver_model->CargiverDocumentsUploaded($id);
$data['upload']=$doc_exsist;
$basic_completed=[];
$medic_completed=[];
$lic_completed=[];
$other_completed=[];
$basic_completed[]=_DOC_PHOTOCODE_ ;
$basic_completed[]=_DOC_CTZCODE_;
$basic_completed[]=_DOC_CTZBACK_;
$basic_completed[]=_DOC_SSCCODE_;
$basic_completed[]=_DOC_SSCBACK_;
$basic_completed[]=_DOC_SIDCODE_;
$basic_completed[]=_DOC_SIDBACK_;
$basic_completed[]=_DOC_RESUMECODE_;
$basic_completed[]=_DOC_REFCODE_;
$basic_completed[]=_DOC_PROFETIONAL_REFERENCE;
$medic_completed[]=_DOC_EHA_CODE_;
$medic_completed[]=_DOC_HBV_CODE_;
// $medic_completed[]=PPD_Quantiferonon_status;
$medic_completed[]=_DOC_RBL_CODE_;
$medic_completed[]=_DOC_RBO_CODE_;
$medic_completed[]=_DOC_CHICKENPOXCODE_;
$medic_completed[]=_DOC_DIPHTHERIA_CODE_;
$medic_completed[]=_DOC_TETANUS_CODE_;
$medic_completed[]=_DOC_MUMPS_CODE_;
$medic_completed[]=_DOC_VAR_CODE_;
$medic_completed[]=_DOC_DRUG_SCREENINGCODE_;
$medic_completed[]=_DOC_FLU_VACCINECODE_;
$medic_completed[]=_DOC_COVID_;
$other_completed[]=_DOC_OTHERCODE_;
$emp_health_assesment=json_decode($nurse_data->emp_health_assesment);
$cxrData=$this->Caregiver_model->checkCXRStatus($cg_id);
if($emp_health_assesment->positive_ppd==1){
if($cxrData->CXR==""){
$medic_completed[]="CXR";
}
}
$getlicencse=$this->Caregiver_model->getNurseLicenseInfoByDocType($cg_id,_ADDL_CERTIFICATE_);
foreach($getlicencse as $lc){
if($lc->documents_type==""){
$lic_completed[]="LICENSE";
break;
}
}
// $otherReferences=$this->Caregiver_model->getOtherReferences($cg_id);
// $oth_nme=$otherReferences->additional_professional_references_name;
// $oth_ads=$otherReferences->additional_professional_references_address;
// $oth_phn=$otherReferences->additional_professional_references_telephone;
// if($oth_nme=="" && $oth_ads=="" && $oth_phn==""){
// }else{
// $basic_completed[]=_OTHER_REFERENCE_CODE;
// }
$cg_type=$nurse_data->qualification_type;
if($cg_type==4){
$basic_completed[]=_DOC_MICCODE_;
$basic_completed[]=_DOC_NPICODE_;
$lic_completed[]=_DOC_CPR_;
}if($cg_type==5){
$basic_completed[]=_DOC_MICCODE_;
$basic_completed[]=_DOC_NPICODE_;
}if($cg_type==6){
$basic_completed[]=_DOC_CHRC102_;
$basic_completed[]=_DOC_CHRC103_;
$basic_completed[]=_DOC_RRFCODE_;
$basic_completed[]=_DOC_PCACODE_;
}if($cg_type==7){
$basic_completed[]=_DOC_CHRC102_;
$basic_completed[]=_DOC_CHRC103_;
$basic_completed[]=_DOC_RRFCODE_;
$basic_completed[]=_DOC_PCACODE_;
}
$basic_status="";
foreach($basic_completed as $basic){
if(!in_array($basic,$data['upload'])){
$basic_status="false";
}
}
if($basic_status!="false"){
$basic_status="true";
}
$medic_status="";
foreach($medic_completed as $medic){
if(!in_array($medic,$data['upload'])){
$medic_status="false";
}
}
if($medic_status!="false"){
$medic_status="true";
}
$lic_status="";
foreach($lic_completed as $lic){
if(!in_array($lic,$data['upload'])){
$lic_status="false";
}
}
if($lic_status!="false"){
$lic_status="true";
}
$oth_status="";
foreach($other_completed as $other){
if(!in_array($other,$data['upload'])){
$oth_status="false";
}
}
if($oth_status!="false"){
$oth_status="true";
}
$data['doc_status']=[
"basic_doc"=>$basic_status,
"med_doc"=>$medic_status,
"lic_doc"=>$lic_status,
"oth_doc"=>$oth_status
];
// pre($data);
echo json_encode($data);
}
public function updatedata(){
// echo '<pre>'; print_r($_POST); echo '</pre>';
// die;
$id=$_POST['id'];
$ionid=$_POST['Ion_id'];
$doc_type=$_POST['doc_type'];
$folder_name='USER_'.str_pad($ionid, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
$uploadto="uploads/Documents/".$folder_name."/";
if($_FILES[$doc_type]['name'] || $_POST['image']){
if($_POST['image']){
$img = $_POST['image'];
$image_parts = explode(";base64,", $img);
$image_type_aux = explode("image/", $image_parts[0]);
$image_type = $image_type_aux[1];
$image_base64 = base64_decode($image_parts[1]);
$file_name_pieces = uniqid() . '.'.$image_type;
$new_file_name = $doc_type.'_'.str_pad($ionid, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces;
$file = $uploadto . $new_file_name;
file_put_contents($file, $image_base64);
// pre($file);die;
}
if($_FILES[$doc_type]['name']){
$file_name = $_FILES[$doc_type]['name'];
$file_name_pieces = explode('.', $file_name);
$count=count($file_name_pieces);
$new_file_name = $doc_type.'_'.str_pad($ionid, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces[$count-1];
$config = array(
'file_name' => $new_file_name,
'upload_path' => "./".$uploadto,
'allowed_types' => "gif|jpg|png|jpeg|pdf",
'overwrite' => False,
'max_size' => "20480000",
//'max_height' => "1768",
//'max_width' => "2024"
);
$this->load->library('Upload', $config);
$this->upload->initialize($config);
if ($this->upload->do_upload($doc_type)) {
$path = $this->upload->data();
//$photo = $path['file_name'];
}
}
if($path['file_name']!="" || $image_base64!="" ){
if($path['file_name']!="" ){
$_POST[$doc_type]=$uploadto.''.$path['file_name'];
}else if($image_base64!=""){
$_POST[$doc_type]=$uploadto.''.$new_file_name;
}
}
}
$caregiver_data=$this->Caregiver_model->getNurseByIonId($ionid);
if(isset($_POST['drive_info'])){
if($caregiver_data->drive_info!=""){
unset($_POST['progress']);
}else{
$_POST['progress']=$caregiver_data->progress + $_POST['progress'];
}
}else if(isset($_POST['PPD_Quantiferonon'])){
if($caregiver_data->PPD_Quantiferonon!=""){
unset($_POST['progress']);
}else{
$_POST['progress']=$caregiver_data->progress + $_POST['progress'];
}
}else{
unset($_POST['progress']);
}
$id=$_POST['id'];
// $caregiver_data=$caregiver_details=$this->Caregiver_model->getNurseById($id);
// echo '<pre>'; print_r($caregiver_data); echo '</pre>';
//echo '<pre>'; print_r($caregiver_details); echo '</pre>';
//die;
unset($_POST['Ion_id']);
unset($_POST['doc_type']);
unset($_POST['id']);
unset($_POST['form_status']);
unset($_POST['data_type']);
unset($_POST['drive_info']);
unset($_POST['Automobile_Policy_Holder_Name']);
unset($_POST['Automobile_Policy_Number']);
unset($_POST['Automobile_Policy_Expiration_Date']);
// echo '<pre>'; print_r($_POST); echo '</pre>';die;
if(isset($_POST['PPD_Quantiferonon'])){
$data3['PPD_Quantiferonon'] = $_POST['PPD_Quantiferonon'];
}
if(isset($_POST['PPD_Quantiferonon_status'])){
$data3['PPD_Quantiferonon_status'] = $_POST['PPD_Quantiferonon_status'];
$caregiver_data=$this->Caregiver_model->getNurseById($id);
if($caregiver_data->PPD_Quantiferonon_status==""){
$caregiverPer = json_decode($caregiver_data->from_tab_status_pctg);
$caregiverPer->form11 = $caregiverPer->form11 + 1;
$process= json_encode($caregiverPer);
$caregiverUpdate=array(
'from_tab_status_pctg' => $process,
);
$this->Caregiver_model->updateNurse($id,$caregiverUpdate);
}
}
if(isset($_POST['CXR'])){
$data3['CXR'] = $_POST['CXR'];
}
if(isset($_POST['drive_info'])){
$data3['drive_info'] = $_POST['drive_info'];
}
if(isset($_POST['Automobile_Policy_Holder_Name'])){
$data3['Automobile_Policy_Holder_Name'] = $_POST['Automobile_Policy_Holder_Name'];
}
if(isset($_POST['Automobile_Policy_Number'])){
$data3['Automobile_Policy_Number'] = $_POST['Automobile_Policy_Number'];
}
if(isset($_POST['Automobile_Policy_Expiration_Date'])){
$data3['Automobile_Policy_Expiration_Date'] = $_POST['Automobile_Policy_Expiration_Date'];
}
if(isset($_POST['PPD_Quantiferonon_date'])){
$data3['PPD_Quantiferonon_date'] = $_POST['PPD_Quantiferonon_date'];
docExpireDate($id,'PPD',$data3['PPD_Quantiferonon_date'],null);
}
// echo 'post';
// pre($_POST);
// echo 'data3';
// pre($data3);
// echo 'data2';
// pre($data2);
// die;
$nurse_data=$this->Caregiver_model->updateNurse($id,$_POST,$data2,$data3);
if($nurse_data>0){
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
);
echo json_encode($output);
}else{
$output=array(
'upload'=>'failed',
'msg'=>'No Updation.',
);
echo json_encode($output);
}
}
public function profile() {
$data = array();
$eml = $_SESSION['email'];
$data['userType']=$this->Caregiver_model->get_user_type($eml);
// _die($_SESSION);
//unset($_SESSION['form_tab_status']);
$form_tab_status = $_SESSION['form_tab_status'];
unset($_SESSION['form_tab_status']);
$_SESSION['form_tab_status'] == '';
//unset($_SESSION['form_tab_status']);
$id = $this->session->userdata('user_id');
$data['nurse']=$this->Caregiver_model->getNurseByIonId($id);
//pr($data);die;
$caregiverId = $data['nurse']->caregiver_table_id;
#for showing start_Application pdf files
$data['ion_id']=$id;
$data['startAppPath']="systemfiles/pdf/primary/start_application/";
$data['endAppPath']="systemfiles/pdf/primary/end_application/";
$data['pathDir']="uploads/Documents/";
$data['folder_name']='USER_'.str_pad($id, 6, "0", STR_PAD_LEFT);
$data['user_folder']=$data['pathDir'].$data['folder_name'];
#for showing pdf files
$data['state_list']=$this->Caregiver_model->get_state_list();
$data['city_list']=$this->Caregiver_model->get_city_list();
$data['school_list']=$this->Caregiver_model->get_SchoolList();
$data['ethnicity_list']=$this->Caregiver_model->get_ethnicity_list();
$data['eyeColors']=$this->Caregiver_model->get_eyeColors();
$data['hairColors']=$this->Caregiver_model->get_hairColors();
$data['skills']=$this->Caregiver_model->caregiver_skill_list();
$data['language']=$this->Caregiver_model->get_language_list();
$data['country']=$this->Caregiver_model->get_country_list();
$data['relation']=$this->Caregiver_model->get_relation();
$data['time_slot']=$this->Caregiver_model->get_time_slot_list();
$data['ref_src_list']=$this->Caregiver_model->get_ref_src_list();
$data['services']=$this->Caregiver_model->get_service_list($caregiverId);
$data['religious_preferences']=$this->Caregiver_model->religious_preferences();
$data['reason_for_leaving']=$this->Caregiver_model->get_reason_for_leaving();
//echo '<pre>'; print_r($data['services']); echo '</pre>';die;
$data['exp_by_condition']=$this->Caregiver_model->exp_by_condition();
$data['exp_by_demographics']=$this->Caregiver_model->exp_by_demographics();
$data['rn_exp']=$this->Caregiver_model->rn_exp();
$data['experience']=$this->Caregiver_model->get_caregiver_experience($caregiverId);
$data['getNurseSkill']=$this->Caregiver_model->getNurseSkill($caregiverId);
$data['cg_services']=$this->Caregiver_model->get_cg_service_list();
$data['getPrefShift']=$this->Caregiver_model->getShiftPref($caregiverId);
$data['homecareRegitryRelease']=$this->HOME_CARE_REGISTRY_RELEASE_FORM($caregiverId);
$data['homecareHealthAid']=$this->Application_For_Home_Health_Aides($caregiverId);
$data['Professional_Profile']=$this->Professional_Profile($caregiverId);
$data['annual_physical_exam_form']=$this->ANNUAL_PHYSICAL_EXAMINATION_FORM($caregiverId);
$data['Employee_Health']=$this->Employee_Health($caregiverId);
$data['referral_source']=$this->Caregiver_model->get_referral_source();
// $data['employeeVaccineWaiver']=$this->EMPLOYEE_HEP_B_VACCINE_WAIVER($caregiverId);
// echo $data['phyExamForm'];
// die();
if($id!=""){
$data['cargiverService']=$this->Caregiver_model->get_CaregiverService_listById($caregiverId);
}else{
$data['cargiverService']="";
}
//echo '<pre>'; print_r($data['cargiverService']); echo '</pre>';die;
$data['documents']=$this->Caregiver_model->getNurseDocuments($id);
$data['certificates'] = $this->Caregiver_model->getCertificatesById($caregiverId);
$data['certificateDoc'] = $this->Caregiver_model->getCertificatesByStatus($caregiverId);
if($id){
$data['nurse']=$this->Caregiver_model->getNurseByIonId($id);
$data['nurse']->emp_health_assessment=$this->Caregiver_model->get_health_assessmentById($id);
$data['other_reference'] = $this->Caregiver_model->getOtherReferenceByIonId($id);
$data['licenses'] = $this->Caregiver_model->getLicensesByIonId($id);
$progress = json_decode($data['nurse']->from_tab_status_pctg);
$progressData = $progress->form1+$progress->form2+$progress->form3+$progress->form4+$progress->form5+$progress->form6+$progress->form7+$progress->form8+$progress->form9+$progress->form10+$progress->form11;
$data['tabstatus']=$this->getTabStatus($caregiverId);
//pr("form_tab_status".$form_tab_status);
if($form_tab_status==='0')
$data['tab']='0';
else if($form_tab_status==1)
$data['tab']=1;
else if($form_tab_status==2)
$data['tab']=3;
else if($form_tab_status==3)
$data['tab']=3;
else if($form_tab_status==4)
$data['tab']=4;
else if($form_tab_status==5)
$data['tab']=10;
else if($form_tab_status== 12 && $progress >= 100)
$data['tab']=12;
else
$data['tab']='';
}
if($this->ion_auth->in_group(array('Caregiver'))){
$data['group_name']="caregiver";
}
$data['progress']=$data['nurse']->progress;
$data['q_e_type'] = $this->Caregiver_model->getQualificationEmployeeType($caregiverId); // qualification type and employee type
$data['signature'] = $this->CaregiverDashboard_model->getSignatureInfo($caregiverId);
$data['signature_type']=[];
foreach($data['signature'] as $sig){
$data['signature_type'][] = $sig->document_details;
}
$cg_typeData=$this->Caregiver_model->getQualificationEmployeeType($caregiverId);
$data['caregiver_type']=$this->typeOfCaregiver($cg_typeData);
$extraPdfInfoData=$this->Caregiver_model->getExtraInfoOfPdf($caregiverId,$document_details="");
foreach($extraPdfInfoData as $exp){
$d_type=$exp->document_type;
$data['extraPdfInfo'][$d_type]=$exp->info;
}
// pre($data['extraPdfInfo']);die;
$this->load->view('home/dashboard',$data); // just the header file
$this->load->view('profile',$data);
$this->load->view('home/footer',$data); // just the header file
}
#==============================================================
#adding extra info in pdf
public function ExtraPdfInfo()
{
$post=$this->input->post();
// pre($post);die();
$data1['caregiver_id']=$post['caregiverId'];
$data1['document_type']=$post['documentType'];
unset($post['caregiverId']);
unset($post['documentType']);
$data1['info']=json_encode($post);
$response=$this->Caregiver_model->insertExtraPdfInfo($data1);
if($response){
$data=array();
$data['document_details']=$data1['document_type'];
$data['document_html']="";
$data['caregiver_id']=$data1['caregiver_id'];
$data['signature']="";
$data['signature_date']="";
$data['signature_type']="";
$data['status']="0";
$this->pdfGeneration($data,$concentStatus="0");
}
echo $response;
}
#adding extra info in pdf
#==============================================================
#==============================================================
#calling the Ajax from disclosure
public function disclosureAjax()
{
// $cg_id=$_GET['cg_id'];
$ion_id=$this->session->userdata('user_id');
$data['nurse']=$this->Caregiver_model->getNurseByIonId($ion_id);
$cg_id=$data['nurse']->caregiver_table_id;
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
/*
#checking whether the files are already existed or not
$filePath="uploads/Documents/".$folder_name."/";
$fileName=str_pad($ion_id, 6,"0",STR_PAD_LEFT).".pdf";
$slugs=[
"APPLECATION_EMPLOYMENT_",
"DOH_CHRC102_",
"DOH_CHRC103_",
"REGISTRY_RELEASE_"
];
foreach($slugs as $slug){
$file=$filePath.$slug.$fileName;
if(file_exists($file)){
$file_exist[]="true";
}if(!file_exists($file)){
$file_exist[]="false";
}
}
if(in_array("true",$file_exist)){
echo "1";
}else{
#Getting All datas for Generating pdfs
$pdfdata=$this->getRequireDataForPdfFillUp($cg_id);
#Getting All datas for Generating pdfs
// pre($pdfdata);die;
#function for Generating pdfs
$res=$this->Application_of_employment($ion_id,$cg_id,$pdfdata);
#function for Generating pdfs
echo "1";
}
#checking whether the files are already existed or not
*/
#Getting All datas for Generating pdfs
$pdfdata=$this->getRequireDataForPdfFillUp($cg_id);
#Getting All datas for Generating pdfs
// pre($pdfdata);die();
#function for Generating pdfs
$res=$this->Application_of_employment($ion_id,$cg_id,$pdfdata);
$res2=$this->updateEditablePdfs($cg_id,$extract="");
#function for Generating pdfs
echo "1";
}
#calling the Ajax from disclosure
#calling ajax from Auth Release
public function authreleaseAjax()
{
$cg_id=$this->input->get("cg_id");
$res2=$this->updateEditablePdfs($cg_id,$extract="AuthRelease");
echo "1";
}
#calling ajax from Auth Release
#updateDompdfPdfs its called at the time of saving savesignature
public function updateDompdfPdfs()
{
$ion_id = $this->session->userdata('user_id');
$data['nurse']=$this->Caregiver_model->getNurseByIonId($ion_id);
$cg_id = $data['nurse']->caregiver_table_id;
$pdfdata=$this->getRequireDataForPdfFillUp($cg_id);
$res=$this->Application_of_employment($ion_id,$cg_id,$pdfdata);
echo "1";
}
#updateDompdfPdfs its called at the time of saving savesignature
#create pdfs(from editable pdfs using pdftk)for the very first time and
#also updation with every click on the disclosure&signature tab
public function updateEditablePdfs($cg_id,$extract)
{
// $cg_id=427;
$cg_typeData=$this->Caregiver_model->getQualificationEmployeeType($cg_id);
$type=$this->typeOfCaregiver($cg_typeData);
$sigDatas=$this->CaregiverDashboard_model->getDocumentSignatureByCgId($cg_id);
if($extract=="AuthRelease"){
$doc=[
"AuthRelease"
];
}
if($extract==""){
if($type=="A"){
$doc=[
// "AuthRelease",
"ContractorAgreement",
"BackgroundCheck",
"iNineForm",
"wNineForm",
"DirectDiposit"
];
}if($type=="B"){
$doc=[
// "AuthRelease",
"ContractorAgreement",
"BackgroundCheck",
"iNineForm",
"wNineForm",
"DirectDiposit"
];
}if($type=="C"){
$doc=[
// "AuthRelease",
// "ContractorAgreement",
"BackgroundCheck",
"iNineForm",
// "wNineForm",
"DirectDiposit"
];
}if($type=="D"){
$doc=[
// "AuthRelease",
// "ContractorAgreement",
"BackgroundCheck",
"iNineForm",
// "wNineForm",
"DirectDiposit",
"Doh102",
"Doh103",
"RegistryRelease"
];
}
}
$doc2=[];
$len=count($doc);
for($i=0;$i<10;$i++){
$data=array();
if(in_array($sigDatas[$i]->document_details,$doc)){
$data=array();
$data['document_details']=$sigDatas[$i]->document_details;
$data['document_html']=$sigDatas[$i]->document_html;
$data['caregiver_id']=$sigDatas[$i]->caregiver_id;
$data['signature']=$sigDatas[$i]->signature;
$data['signature_date']=$sigDatas[$i]->signature_date;
$data['signature_type']=$sigDatas[$i]->signature_type;
if($type=="D"){
$data['status']="0";
}else{
$data['status']="1";
}
$doc2[]=$data['document_details'];
// pre($data);
$response=$this->pdfGeneration($data,$concentStatus="0");
}
}
$doc3=array_diff($doc,$doc2);
foreach($doc3 as $d){
$data=array();
$data['document_details']=$d;
$data['document_html']="";
$data['caregiver_id']=$cg_id;
$data['signature']="";
$data['signature_date']="";
$data['signature_type']="";
if($type=="D"){
$data['status']="0";
}else{
$data['status']="1";
}
// pre($data);
$response=$this->pdfGeneration($data,$concentStatus="0");
}
// die();
return $response;
}
#create pdfs(from editable pdfs using pdftk)for the very first time and
#also updation with every click on the disclosure&signature tab
#type of caregiver
public function typeOfCaregiver($cg_typeData)
{
$q=$cg_typeData->qualification_type;
$e=$cg_typeData->employee_type;
if(($q=="4" || $q=="5") && $e=="contrator"){
$type="A";
}
if(($q=="6" || $q=="7") && $e=="contrator"){
$type="B";
}
if(($q=="4" || $q=="5") && $e=="inhouse"){
$type="C";
}
if(($q=="6" || $q=="7") && $e=="inhouse"){
$type="D";
}
return $type;
}
#type of caregiver
#Getting All datas for Generating pdfs (html dompdfs)
public function getRequireDataForPdfFillUp($id)
{
// $this->load->model('caregivers/Caregiver_model');
// $id=425;
if($id != '')
{
$datas = $this->Caregiver_model->getNurseById($id);
$data['cg'] = $datas;
$data['eha'] = json_decode($datas->emp_health_assesment);
$data['school'] = json_decode($datas->educationBackground);
$data['emp'] = json_decode($datas->employementHistory);
$caregiver_type=$data['cg']->qualification_type;
$caregiverId=$id;
$YearExperience=$data['cg']->years_of_exp;
$data['expTab'] = $this->getExperienceDetailsForPdf($caregiver_type,$caregiverId,$YearExperience);
// $data['expTab'] = $this->Caregiver_model->getCgExperienceInfo($caregiverId);
// pre($data['expTab']);die;
$data['emg_contact'] = json_decode($datas->Emergency_Contact_Address);
$emg_relation_id = $datas->Emergency_Contact_Relationship;
$data['referral_source_name'] = $this->Caregiver_model->getReferralSourceName($data['cg']->referral_source);
$data['emg_relation_name'] = $this->Caregiver_model->getRelationshipName($emg_relation_id);
$data['employementHistory2'] = json_decode($datas->employementHistory2);
$data['demographics_exp'] = $this->getDemographicExp(json_decode($datas->demographics_exp));
$data['website_setting'] = $this->Caregiver_model->get_website_setting();
// _die($data['expTab']);
}
$data['tick'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAaQAAAGkBcaGY2AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNzdCxDYJgEAbQxwK6g2ED7QyTWFKxhQPQso4tIzAAG0AN2GhiYfLjmaDXv+++O3492Rf2hGMUFxjRRfAZA3rk/4EbXBL4efPbzTdMKCMYdmgxo1pbe03Ixw/bP0Im1KnaqSZLBL82ueIQwdvPHdIVIU3fgaM4AAAAAElFTkSuQmCC';
$data['blackSqr'] = 'data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gc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g5aBV9SW8Jvjzfj1PNdTmW1W6jo5v8pqHtGYgKU+zfDcaC9or2CY+e9jtlw5uYRQ4pS/LduOOcoZaRFmYGsNGkzU2rwlVZds3pKrDR00VSQANavS4TfGNTZpFB3jAG2LAJTItauNI8bdR7YBsxvu9wicPJvc8Ro/8OSKYwhqIiO3DTOoMoZn3oh7MQY1k4tctBlrMW4dgJZBSx01qt7mGoX8y8Xx/O5p2KFEq1bTmt8HcxlslE0PmCh6BMy4W2q9fcycK84xTrfAGgTddFcMkPBb5Skvpd/GPYeK9GaYNj22+EibdbW23HxWX/m2rd83hhXGd92oUei9SiWNDTv2wHJfd0XjLRKoDCqrqRxtf9dUkjbebPS5pO1Gs5v1UP5u8ZYy6hpIHbfiW88WGXdXG99lT+42sq2S1rFhdjXwtiuvYgRZa/V28KpaNs3x76xuMH/9roQeADfzsfSA2d1jd4W/J46NTHja49H52fbx/9hl0cBfdJL2wgEz6tFxM4StePwnUgeW2WWePwovlIK66kj8bcfqC1ywWV9o+1jsUaJanuKqI3DJVWN+x/StifG7sw799rF3HW3JnBpdZZp/7FgFyX678iC2j619tKDAYH9dYseq3XJek6Aa19g+tg9HuUgFI1ftmB0rxToARX4HQ2eRK0lvH8t/NBhKFUlSNyb3fwDasbJqyOwrFG7wrFW5jZFsH1v3gAfEYSwsLEQiKzt37jztqKOOesWqcbP/qlo674wzzjjoyCOPPGe72bbusWrHnn/66acfcuCBB559+OGHM1vOZ7ocdthhp/yPAAMAqavxaXdmcGgAAAAASUVORK5CYII=';
$signData=$this->CaregiverDashboard_model->getAllSignatureDetails($id);
foreach($signData as $sign)
{
$type=$sign->document_details;
$signature_date=date("m-d-Y h:i A",strtotime($sign->signature_date));
$sData=[
"sig"=>$sign->signature,
'date'=>$signature_date
];
$data[$type]=(object)$sData;
}
return $data;
}
public function getExperienceDetailsForPdf($type,$id,$year_experience)
{
$caregiver_type = $type;
$caregiverId=$id;
$YearExperience=$year_experience;
$exprience_head=$this->Caregiver_model->getServiceHeadByType2($caregiver_type);
foreach($exprience_head as $key=>$exp_head){
$service_head_id = $exp_head->service_head_id;
$getCareExp = $this->Caregiver_model->getCareExp($caregiver_type,$service_head_id,$caregiverId);
if(!empty($getCareExp)){
$exprience_head[$key]->caregiver_experience=$getCareExp;
}else{
unset($exprience_head[$key]);
}
}
// return $exprience_head;
return array_values($exprience_head); //re-indexing array
}
public function getDemographicExp($demographics_exp)
{
$demographics=[];
$b=[];
foreach($demographics_exp as $key=>$val){
$exp_id = $key;
$exp_value = $val;
$service_name = $this->Caregiver_model->demographics_exp_byId($exp_id);
$b['experience_id']=$exp_id;
$b['service_name']=$service_name->experience_label;
$b['experience_value']=$exp_value;
array_push($demographics,$b);
}
return $demographics;
}
#Getting All datas for Generating pdfs (html dompdfs)
#function for Generating pdfs
public function Application_of_employment($ion_id,$cg_id,$data)
{
$experience=$data['cg']->years_of_exp;
$cg_typeData=$this->Caregiver_model->getQualificationEmployeeType($cg_id);
$type=$this->typeOfCaregiver($cg_typeData);
if($type=="D"){
if($experience>0){
$perPage=$this->experiencePageSize($cg_id);
if($perPage>0 && $perPage<=1){
$end=5;
}if($perPage>1 && $perPage<=2){
$end=6;
}if($perPage>2 && $perPage<=3){
$end=7;
}if($perPage>3 && $perPage<=4){
$end=8;
}if($perPage>4 && $perPage<=5){
$end=9;
}if($perPage>5 && $perPage<=6){
$end=10;
}
$end2=($end+1);
$end3=($end2+1);
$end4=($end3+1);
$end5=($end4+1);
$pdf1=[
"slug"=>"APPLICATION_EMPLOYMENT_",
// "start"=>1,
// "end"=>6
"start"=>1,
"end"=>$end
];
$pdf2=[
"slug"=>"DOH_CHRC102_",
// "start"=>7,
// "end"=>null
"start"=>$end2,
"end"=>null
];
$pdf3=[
"slug"=>"DOH_CHRC103_",
// "start"=>8,
// "end"=>9
"start"=>$end3,
"end"=>$end4
];
$pdf4=[
"slug"=>"REGISTRY_RELEASE_",
// "start"=>10,
// "end"=>null
"start"=>$end5,
"end"=>null
];
#declaring files as pages for creating those into a single pdf
$data['pages']=[
'WECURO_HHA_APPLICATION_1st_Disclosure_Page',
'WECURO_HHA_APPLICATION_1st_Disclosure_Page2',
'WECURO_HHA_APPLICATION_4pg',
'WECURO_HHA_APPLICATION_3pg',
'Employee_Health_2.php',
// 'WECURO_HHA_APPLICATION_6pg',
'NYDOH_CHRC_102_FORM2_2',
'NYDOH_103_FORM','NYDOH_103_FORM_2nd',
'HOME_CARE_REGISTRY_RELEASE_FORM'
];
#declaring files as pages for creating those into a single pdf
}else{
$pdf1=[
"slug"=>"APPLICATION_EMPLOYMENT_",
"start"=>1,
"end"=>4
];
$pdf2=[
"slug"=>"DOH_CHRC102_",
"start"=>5,
"end"=>null
];
$pdf3=[
"slug"=>"DOH_CHRC103_",
"start"=>6,
"end"=>7
];
$pdf4=[
"slug"=>"REGISTRY_RELEASE_",
"start"=>8,
"end"=>null
];
#declaring files as pages for creating those into a single pdf
$data['pages']=[
'WECURO_HHA_APPLICATION_1st_Disclosure_Page',
'WECURO_HHA_APPLICATION_1st_Disclosure_Page2',
// 'WECURO_HHA_APPLICATION_4pg',
'WECURO_HHA_APPLICATION_3pg',
'Employee_Health_2.php',
// 'WECURO_HHA_APPLICATION_6pg',
'NYDOH_CHRC_102_FORM2_2',
'NYDOH_103_FORM','NYDOH_103_FORM_2nd',
'HOME_CARE_REGISTRY_RELEASE_FORM'
];
#declaring files as pages for creating those into a single pdf
}
$cred=[$pdf1,$pdf2,$pdf3,$pdf4];
}else{
if($experience>0){
$pdf1=[
"slug"=>"APPLICATION_EMPLOYMENT_",
"start"=>1,
"end"=>end
];
$data['pages']=[
'WECURO_HHA_APPLICATION_1st_Disclosure_Page',
'WECURO_HHA_APPLICATION_1st_Disclosure_Page2',
'WECURO_HHA_APPLICATION_4pg',
'WECURO_HHA_APPLICATION_3pg',
'Employee_Health_2.php',
// 'WECURO_HHA_APPLICATION_6pg',
];
}else{
$pdf1=[
"slug"=>"APPLICATION_EMPLOYMENT_",
"start"=>1,
"end"=>end
];
$data['pages']=[
'WECURO_HHA_APPLICATION_1st_Disclosure_Page',
'WECURO_HHA_APPLICATION_1st_Disclosure_Page2',
// 'WECURO_HHA_APPLICATION_4pg',
'WECURO_HHA_APPLICATION_3pg',
'Employee_Health_2.php',
// 'WECURO_HHA_APPLICATION_6pg',
];
}
$cred=[$pdf1];
}
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$path['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#filename
$path['fileName']=str_pad($ion_id, 6,"0",STR_PAD_LEFT).".pdf";
#filename
$response=generate_pdf_and_save(array("forms_pdf/generate_pdf_for_save"),$data,$path,$cred);
return $response;
}
#function for Generating pdfs
#finding per page calculation for type D caregiver
public function experiencePageSize($id)
{
// $id=427;
$datas=$this->Caregiver_model->getNurseById($id);
$data['cg'] = $datas;
$caregiver_type=$data['cg']->qualification_type;
$caregiverId=$id;
$YearExperience=$data['cg']->years_of_exp;
$data['expTab'] = $this->getExperienceDetailsForPdf($caregiver_type,$caregiverId,$YearExperience);
$data['demographics_exp'] = $this->getDemographicExp(json_decode($datas->demographics_exp));
$i=0;
foreach($data['expTab'] as $expTab){
$i++;
foreach($expTab->caregiver_experience as $exp){
$i++;
}
}
foreach($data['demographics_exp'] as $dmg){
$i++;
}
$rows=($i+1);
$perPage=($rows/25);
return $perPage;
// pre($perPage);
}
#finding per page calculation for type D caregiver
#==============================================================
#==============================================================
#Adverse Incident Addendum pdf
public function createAddendumPdfFile()
{
$cg_id=$this->input->get($id)['id'];
$authSig=$this->CaregiverDashboard_model->getAuthReleaseSignature($cg_id);
$data=array();
$data['document_details']="Addendum";
$data['document_html']="";
$data['caregiver_id']=$cg_id;
$data['signature']=$authSig->signature;
$data['signature_date']=$authSig->signature_date;
$data['signature_type']="";
$data['status']="0";
$response=$response=$this->pdfGeneration($data,$concentStatus="0");
header("location: ".base_url().$response);
}
#Adverse Incident Addendum pdf
#Editable Pdf form fill up
public function saveDocumentSignature()
{
$data = array();
$data['document_details'] = $this->input->post("documentType");
$data['document_html'] = $this->input->post("rawForm");
$data['caregiver_id'] = $this->input->post("id");
$data['signature'] = $this->input->post("signature");
// $data['signature_date'] = $this->input->post("date");
$data['signature_date'] = date('Y-m-d H:i:s');
if(!isset($_POST['signature_type'])){
$data['signature_type']='draw';
}else{
$data['signature_type']=$this->input->post("signature_type");
}
// pre($data);die();
$resp = $this->CaregiverDashboard_model->saveDislosureSignature($data);
#pdf generate
$data['status'] = "1";
$response=$this->pdfGeneration($data,$concentStatus="1");
#pdf generate
echo $resp;
// echo "1";
}
public function pdfGeneration($data,$concentStatus)
{
$this->load->helper('generatePdf_helper');
$id=$data['caregiver_id'];
$cgData=$this->CaregiverDashboard_model->getCgDetails($id);
$q_e_type = $this->Caregiver_model->getQualificationEmployeeType($id);
$ion_id=$cgData->ion_user_id;
// pre($data['signature_date']);
// pre(strtotime($data['signature_date']));
$dob_m_d_y=date("m-d-Y",strtotime($cgData->dob));
if($data['signature_date']!="" && $data['signature']!=""){
$td=$data['signature_date'];
$sig=date("Y-m-d",strtotime($data['signature_date']));
$data['signature_date']=date("m-d-Y h:i A",strtotime($data['signature_date']));
}else{
$data['signature']="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAADICAYAAADGFbfiAAAAAXNSR0IArs4c6QAAByFJREFUeF7t1bEJACAQBEGtXOzcxAo2EIMxP5DhYefwCBAgQIBAEJhhY0KAAAECBIaAOAICBAgQSAICktiMCBAgQEBA3AABAgQIJAEBSWxGBAgQICAgboAAAQIEkoCAJDYjAgQIEBAQN0CAAAECSUBAEpsRAQIECAiIGyBAgACBJCAgic2IAAECBATEDRAgQIBAEhCQxGZEgAABAgLiBggQIEAgCQhIYjMiQIAAAQFxAwQIECCQBAQksRkRIECAgIC4AQIECBBIAgKS2IwIECBAQEDc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IECBBIAgKS2IwIECBAQEDcAAECBAgkAQFJbEYECBAgICBugAABAgSSgIAkNiMCBAgQEBA3QIAAAQJJQEASmxEBAgQICIgbIECAAIEkICCJzYgAAQIEBMQNECBAgEASEJDEZkSAAAECAuIGCBAgQCAJCEhiMyJAgAABAXEDBAgQIJAEBCSxGREgQICAgLgBAgQIEEgCApLYjAgQIEBAQNwAAQIECCQBAUlsRgQIECAgIG6AAAECBJKAgCQ2IwIECBAQEDdAgAABAklAQBKbEQECBAgIiBsgQIAAgSQgIInNiAABAgQExA0QIECAQBIQkMRmRIAAAQIC4gYIECBAIAkISGIzIkCAAAEBcQMECBAgkAQEJLEZESBAgICAuAECBAgQSAICktiMCBAgQEBA3AABAgQIJAEBSWxGBAgQICAgboAAAQIEkoCAJDYjAgQIEBAQN0CAAAECSUBAEpsRAQIECAiIGyBAgACBJCAgic2IAAECBATEDRAgQIBAEhCQxGZEgAABAgLiBggQIEAgCQhIYjMiQIAAAQFxAwQIECCQBAQksRkRIECAgIC4AQIECBBIAgKS2IwIECBAQEDcAAECBAgkAQFJbEYECBAgICBugAABAgSSgIAkNiMCBAgQEBA3QIAAAQJJQEASmxEBAgQICIgbIECAAIEkICCJzYgAAQIEBMQNECBAgEASEJDEZkSAAAECAuIGCBAgQCAJCEhiMyJAgAABAXEDBAgQIJAEBCSxGREgQICAgLgBAgQIEEgCApLYjAgQIEBAQNwAAQIECCQBAUlsRgQIECAgIG6AAAECBJKAgCQ2IwIECBAQEDdAgAABAklAQBKbEQECBAgIiBsgQIAAgSQgIInNiAABAgQExA0QIECAQBIQkMRmRIAAAQIC4gYIECBAIAkISGIzIkCAAAEBcQMECBAgkAQEJLEZESBAgICAuAECBAgQSAICktiMCBAgQEBA3AABAgQIJAEBSWxGBAgQICAgboAAAQIEksCLgKz7s51+aESAAAECXwoc4J8ByWeJY6EAAAAASUVORK5CYII=";
$td="";
$sig="";
$data['signature_date']="";
}
// pre($data['signature_date']);
$soc_no=$cgData->soc_sec;
$soc_no_="";
$len=strlen($soc_no);
if($len==11){
for($i=0;$i<$len;$i++){
if($i==0){$soc1=$soc_no[$i];}if($i==1){$soc2=$soc_no[$i];}if($i==2){$soc3=$soc_no[$i];}if($i==4){$soc4=$soc_no[$i];}if($i==5){$soc5=$soc_no[$i];}if($i==7){$soc6=$soc_no[$i];}if($i==8){$soc7=$soc_no[$i];}if($i==9){$soc8=$soc_no[$i];}if($i==10){$soc9=$soc_no[$i];}
if($i<=2){$soc_no_.="X";}if($i==3 || $i==6){$soc_no_.="-";}if($i==4 || $i==5){$soc_no_.="X";}if($i>6){$soc_no_.=$soc_no[$i];}
}
}else{$soc6=$soc7=$soc8=$soc9="";}
$address=$cgData->address1;
$apartment=$cgData->apartment1;
$state=$cgData->state1;
$city=$cgData->city1;
$county=$cgData->county1;
$zipcode=$cgData->zipcode1;
$dob=$cgData->dob;
// pre($cgData);
// pre($data);die();
/*
| start of the application
*/
#this is single tab auth release
if($data['document_details']=="AuthRelease")
{
// pre($data);die();
if($concentStatus=="1"){
$sigData['concent_signature']=$data['signature'];
$sigData['concent_date']=$td;
$this->Caregiver_model->updateForConcentSignature($sigData,$id);
}
$datas=array();
#info release
$data1['pdfFile']="systemfiles/pdf/secondary/start_application/information_release.pdf";
$data1['pages']=1;
$data1['break_page']=1;
$data1['slug']="INFO_RELEASE_";
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/'.$folder_name, 0777, TRUE);
}
$data1['filePath']="uploads/Documents/".$folder_name."/";
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
$data1['x']=46;
$data1['y']=175;
$data1['w']=50;
$data1['h']=35;
$data1['dataInfo']=[
'name'=>"( ".$cgData->fname." ".$cgData->lname." )",
'date'=>$data['signature_date']
];
$datas[]=$data1;
#info release
#general disclosure
$data2['pdfFile']="systemfiles/pdf/secondary/start_application/general_disclosure.pdf";
$data2['pages']=1;
$data2['break_page']=1;
$data2['slug']="GENERAL_DISCLOSURE_";
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/'.$folder_name, 0777, TRUE);
}
$data2['filePath']="uploads/Documents/".$folder_name."/";
$data2['imagePath']="uploads\Documents\\".$folder_name."\\";
$url=$data['signature'];
$img=$data2['filePath'].$data2['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data2['imageFile']=$data2['imagePath'].$data2['slug']."img_".$id.".png";
$data2['x']=43;
$data2['y']=237;
$data2['w']=55;
$data2['h']=40;
$data2['dataInfo']=[
'name'=>$cgData->fname." ".$cgData->lname,
'date'=>$data['signature_date']
];
$datas[]=$data2;
#general disclosure
#privacy policy
$data3['pdfFile']="systemfiles/pdf/secondary/start_application/privacy_policy.pdf";
$data3['pages']=19;
$data3['break_page']=19;
$data3['slug']="PRIVACY_POLICY_";
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/'.$folder_name, 0777, TRUE);
}
$data3['filePath']="uploads/Documents/".$folder_name."/";
$data3['imagePath']="uploads\Documents\\".$folder_name."\\";
$url=$data['signature'];
$img=$data3['filePath'].$data3['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data3['imageFile']=$data3['imagePath'].$data3['slug']."img_".$id.".png";
$data3['x']=45;
$data3['y']=42;
$data3['w']=35;
$data3['h']=35;
$data3['dataInfo']=[
'name'=>$cgData->fname." ".$cgData->lname,
'date'=>$data['signature_date']
];
$datas[]=$data3;
#privacy policy
#terms of use
$data4['pdfFile']="systemfiles/pdf/secondary/start_application/terms_of_use.pdf";
$data4['pages']=13;
$data4['break_page']=13;
$data4['slug']="TERMS_USE_";
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/'.$folder_name, 0777, TRUE);
}
$data4['filePath']="uploads/Documents/".$folder_name."/";
$data4['imagePath']="uploads\Documents\\".$folder_name."\\";
$url=$data['signature'];
$img=$data1['filePath'].$data4['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data4['imageFile']=$data4['imagePath'].$data4['slug']."img_".$id.".png";
$data4['x']=45;
$data4['y']=240;
$data4['w']=35;
$data4['h']=35;
$data4['dataInfo']=[
'name'=>$cgData->fname." ".$cgData->lname,
'date'=>$data['signature_date']
];
$datas[]=$data4;
#terms of use
#arbitration agreement
$data5['pdfFile']="systemfiles/pdf/secondary/start_application/arbitration_agreement.pdf";
$data5['pages']=5;
$data5['break_page']=5;
$data5['slug']="ARBITRATION_AGREEMENT_";
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/'.$folder_name, 0777, TRUE);
}
$data5['filePath']="uploads/Documents/".$folder_name."/";
$data5['imagePath']="uploads\Documents\\".$folder_name."\\";
$url=$data['signature'];
$img=$data5['filePath'].$data5['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data5['imageFile']=$data5['imagePath'].$data5['slug']."img_".$id.".png";
$data5['x']=45;
$data5['y']=110;
$data5['w']=40;
$data5['h']=30;
$data5['dataInfo']=[
'name'=>$cgData->fname." ".$cgData->lname,
'date'=>$data['signature_date']
];
$datas[]=$data5;
#arbitration agreement
#e-signature
$data6['pdfFile']="systemfiles/pdf/secondary/start_application/e_signature.pdf";
$data6['pages']=3;
$data6['break_page']=3;
$data6['slug']="E_SIGNATURE_";
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/'.$folder_name, 0777, TRUE);
}
$data6['filePath']="uploads/Documents/".$folder_name."/";
$data6['imagePath']="uploads\Documents\\".$folder_name."\\";
$url=$data['signature'];
$img=$data6['filePath'].$data6['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data6['imageFile']=$data6['imagePath'].$data6['slug']."img_".$id.".png";
$data6['x']=45;
$data6['y']=180;
$data6['w']=40;
$data6['h']=30;
$data6['dataInfo']=[
'name'=>$cgData->fname." ".$cgData->lname,
'date'=>$data['signature_date']
];
#e-signature
#sending data to generate pdfs
$datas[]=$data6;
$mainslug="AUTH_RELEASE_";
// pre($datas);die();
$response=mypdf($datas,$ion_id,$mainslug);
return $response;
}
#this is single tab auth release
/*
| End of the application
*/
if($q_e_type->employee_type=="inhouse")
{
#to get the editable pdf form
$data1['pdfFile']="systemfiles/pdf/secondary/end_application/w_four.pdf";
#to get the editable pdf form
#some credentials about the editable pdf form
$data1['pages']=1;
$data1['break_page']=1;
$data1['slug']="W_FOUR_";
#some credentials about the editable pdf form
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$data1['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#file path for creating temp files and original files
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
#file path for creating temp files and original files
#signature save as image
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
#signature save as image
#image placing coordinates & height, width
$data1['x']=40;
$data1['y']=229;
$data1['w']=25;
$data1['h']=20;
#image placing coordinates & height, width
#data info for filling up the editable form
$address_=$address.", ".$apartment;
$city_state_zip_=$city.", ".$state.", ".$zipcode;
if($cgData->marital_status=="Single"){$status="single";}
$data1['dataInfo']=[
"first_name_middle_initial"=>$cgData->fname." ".$cgData->mid_name,
"last_name"=>$cgData->lname,
"address"=>$address_.", ".$ci9y_state_zip_,
"status"=>$status,
"date"=>$data['signature_date'],
"name_address"=>$cgData->fname." ".$cgData->lname.", ".$address_.", ".$city_state_zip_,
"first_date"=>"",
"ein_no"=>"",
];
#data for filling up the editable form
//sending data to generate pdfs
$datas=array();
$datas[]=$data1;
$response=mypdf($datas,$ion_id,$mainslug="");
// return $response;
}
if($q_e_type->employee_type=="inhouse")
{
#to get the editable pdf form
$data1['pdfFile']="systemfiles/pdf/secondary/end_application/withholding_allowance.pdf";
#to get the editable pdf form
#some credentials about the editable pdf form
$data1['pages']=8;
$data1['break_page']=1;
$data1['slug']="WITHHOLDING_ALLOWANCE_";
#some credentials about the editable pdf form
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$data1['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#file path for creating temp files and original files
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
#file path for creating temp files and original files
#signature save as image
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
#signature save as image
#image placing coordinates & height, width
$data1['x']=40;
$data1['y']=107;
$data1['w']=25;
$data1['h']=20;
#image placing coordinates & height, width
#data info for filling up the editable form
$address_=$address.", ".$apartment;
$city_state_zip_=$city.", ".$state.", ".$zipcode;
if($cgData->marital_status=="Single"){$status="single";}
$data1['dataInfo']=[
"first_name_middle_initial"=>$cgData->fname." ".$cgData->mid_name,
"last_name"=>$cgData->lname,
"address"=>$address,
"apartment_no"=>$apartment,
"city_village_po"=>$city,
"state"=>$state,
"zip_code"=>$zipcode,
"social_security_no"=>$soc_no_,
"status"=>"",
"resident_newyork"=>"",
"resident_yonkers"=>"",
"date"=>$data['signature_date'],
"name_address"=>"",
"identification_no"=>""
];
#data for filling up the editable form
//sending data to generate pdfs
$datas=array();
$datas[]=$data1;
$response=mypdf($datas,$ion_id,$mainslug="");
// return $response;
}
if($data['document_details']=="ApplicationEmployment")
{
if($data['status']=="1"){
$this->updateDompdfPdfs();
}
return 1;
}
if($data['document_details']=="ContractorAgreement")
{
#to get the editable pdf form
$data1['pdfFile']="systemfiles/pdf/secondary/end_application/contractor_agreement.pdf";
#to get the editable pdf form
#some credentials about the editable pdf form
$data1['pages']=9;
$data1['break_page']=4;
$data1['slug']="CONTRACTOR_AGREEMENT_";
#some credentials about the editable pdf form
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$data1['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#file path for creating temp files and original files
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
#file path for creating temp files and original files
#signature save as image
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
#signature save as image
#image placing coordinates & height, width
$data1['x']=38;
$data1['y']=235;
$data1['w']=30;
$data1['h']=25;
#image placing coordinates & height, width
#data getting from extra_editable_pdf_info table
$ContractorAgreement=$this->Caregiver_model->getExtraInfoOfPdf($id,$data['document_details']);
$ConAgreeinfo=json_decode($ContractorAgreement->info);
#data getting from extra_editable_pdf_info table
#data info for filling up the editable form
$data1['dataInfo']=[
'agreement_date'=>$data['signature_date'],
'nurse_name'=>$cgData->fname." ".$cgData->lname,
'checkbox_agree'=>$ConAgreeinfo->checkbox_agree,
'printed_name'=>$cgData->fname." ".$cgData->lname,
'wecuro_printed_name'=>"",
'title'=>$ConAgreeinfo->title,
'wecuro_title'=>"",
'federal_id'=>$ConAgreeinfo->federal_id
];
#data for filling up the editable form
//sending data to generate pdfs
$datas=array();
$datas[]=$data1;
$response=mypdf($datas,$ion_id,$mainslug="");
return $response;
}
if($data['document_details']=="BackgroundCheck")
{
#to get the editable pdf form
$data1['pdfFile']="systemfiles/pdf/secondary/end_application/background_check.pdf";
#to get the editable pdf form
#some credentials about the editable pdf form
$data1['pages']=7;
$data1['break_page']=2;
$data1['slug']="BACKGROUND_CHECK_";
#some credentials about the editable pdf form
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$data1['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#file path for creating temp files and original files
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
#file path for creating temp files and original files
#signature save as image
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
#signature save as image
#image placing coordinates & height, width
$data1['x']=38;
$data1['y']=165;
$data1['w']=30;
$data1['h']=25;
#image placing coordinates & height, width
#data getting from extra_editable_pdf_info table
$BackgroundCheck=$this->Caregiver_model->getExtraInfoOfPdf($id,$data['document_details']);
$BackCheckinfo=json_decode($BackgroundCheck->info);
$from_date1=date("m-d-Y",strtotime($BackCheckinfo->from_date1));
$to_date1=date("m-d-Y",strtotime($BackCheckinfo->to_date1));
$from_date2=date("m-d-Y",strtotime($BackCheckinfo->from_date2));
$to_date2=date("m-d-Y",strtotime($BackCheckinfo->to_date2));
for($i=0;$i<10;$i++){
if($BackCheckinfo->from_date1){
$f_d1[]=$from_date1[$i];
}else{
$f_d1[]="";
}if($BackCheckinfo->to_date1){
$t_d1[]=$to_date1[$i];
}else{
$t_d1[]="";
}if($BackCheckinfo->from_date2){
$f_d2[]=$from_date2[$i];
}else{
$f_d2[]="";
}if($BackCheckinfo->to_date2){
$t_d2[]=$to_date2[$i];
}else{
$t_d2[]="";
}
}
#data getting from extra_editable_pdf_info table
#data info for filling up the editable form
$address_=$address.", ".$apartment;
$city_state_zip_=$city.", ".$state.", ".$zipcode;
$data1['dataInfo']=[
'auth_check_last_name'=>$cgData->lname,
'auth_check_first_name'=>$cgData->fname,
'auth_check_middle_name'=>$cgData->mid_name,
'auth_check_other_name'=>$BackCheckinfo->auth_check_other_name,
'auth_check_years_used'=>$BackCheckinfo->auth_check_years_used,
'background_check_report'=>$BackCheckinfo->background_check_report,
'sig_date_mm'=>$sig[5].$sig[6],
'sig_date_dd'=>$sig[8].$sig[9],
'sig_date_yyyy'=>$sig[0].$sig[1].$sig[2].$sig[3],
'back_check_first_name'=>$cgData->fname,
'back_check_middle_name'=>$cgData->mid_name,
'back_check_last_name'=>$cgData->lname,
'dob_mm'=>$dob[5].$dob[6],
'dob_dd'=>$dob[8].$dob[9],
'dob_yyyy'=>$dob[0].$dob[1].$dob[2].$dob[3],
'social_security_number'=>$soc_no,
'driver_license'=>$BackCheckinfo->driver_license,
'state_issuing_license'=>$BackCheckinfo->state_issuing_license,
'other_first_name1'=>$BackCheckinfo->other_first_name1,
'other_middle_name1'=>$BackCheckinfo->other_middle_name1,
'other_last_name1'=>$BackCheckinfo->other_last_name1,
'other_first_name2'=>$BackCheckinfo->other_first_name2,
'other_middle_name2'=>$BackCheckinfo->other_middle_name2,
'other_last_name2'=>$BackCheckinfo->other_last_name2,
'other_first_name3'=>$BackCheckinfo->other_first_name3,
'other_middle_name3'=>$BackCheckinfo->other_middle_name3,
'other_last_name3'=>$BackCheckinfo->other_last_name3,
'present_street_address'=>$address_,
'city_state_zip1'=>$city_state_zip_,
'prior_street_address1'=>$BackCheckinfo->prior_street_address1,
'from_date_mm1'=>$f_d1[0].$f_d1[1],
'from_date_dd1'=>$f_d1[3].$f_d1[4],
'from_date_yyyy1'=>$f_d1[6].$f_d1[7].$f_d1[8].$f_d1[9],
'to_date_mm1'=>$t_d1[0].$t_d1[1],
'to_date_dd1'=>$t_d1[3].$t_d1[4],
'to_date_yyyy1'=>$t_d1[6].$t_d1[7].$t_d1[8].$t_d1[9],
'city_state_zip2'=>$BackCheckinfo->city_state_zip2,
'prior_street_address2'=>$BackCheckinfo->prior_street_address2,
'from_date_mm2'=>$f_d2[0].$f_d2[1],
'from_date_dd2'=>$f_d2[3].$f_d2[4],
'from_date_yyyy2'=>$f_d2[6].$f_d2[7].$f_d2[8].$f_d2[9],
'to_date_mm2'=>$t_d2[0].$t_d2[1],
'to_date_dd2'=>$t_d2[3].$t_d2[4],
'to_date_yyyy2'=>$t_d2[6].$t_d2[7].$t_d2[8].$t_d2[9],
'city_state_zip3'=>$BackCheckinfo->city_state_zip3
];
#data for filling up the editable form
//sending data to generate pdfs
$datas=array();
$datas[]=$data1;
$response=mypdf($datas,$ion_id,$mainslug="");
return $response;
}
if($data['document_details']=="iNineForm")
{
#to get the editable pdf form
$data1['pdfFile']="systemfiles/pdf/secondary/end_application/i_nine.pdf";
#to get the editable pdf form
#some credentials about the editable pdf form
$data1['pages']=3;
$data1['break_page']=1;
$data1['slug']="I_NINE_";
#some credentials about the editable pdf form
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$data1['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#file path for creating temp files and original files
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
#file path for creating temp files and original files
#signature save as image
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
#signature save as image
#image placing coordinates & height, width
$data1['x']=40;
$data1['y']=186;
$data1['w']=25;
$data1['h']=20;
#image placing coordinates & height, width
#data getting from extra_editable_pdf_info table
$iNineForm=$this->Caregiver_model->getExtraInfoOfPdf($id,$data['document_details']);
$iNineForminfo=json_decode($iNineForm->info);
if($iNineForminfo->alien_authorized_expire_date){
$exp_date=date("m-d-Y",strtotime($iNineForminfo->alien_authorized_expire_date));
}else{
$exp_date="";
}
#data getting from extra_editable_pdf_info table
#data info for filling up the editable form
$data1['dataInfo']=[
"last_name"=>$cgData->lname,
"first_name"=>$cgData->fname,
"middle_initial"=>$cgData->mid_name,
"other_last_name"=>$iNineForminfo->other_last_name,
"address_street_no_name"=>$address,
"apt_no"=>$apartment,
"city_town"=>$city,
"state"=>$state,
"zip_code"=>$zipcode,
"dob"=>$dob_m_d_y,
"soc_no1"=>$soc1,
"soc_no2"=>$soc2,
"soc_no3"=>$soc3,
"soc_no4"=>$soc4,
"soc_no5"=>$soc5,
"soc_no6"=>$soc6,
"soc_no7"=>$soc7,
"soc_no8"=>$soc8,
"soc_no9"=>$soc9,
"email"=>$cgData->email,
"telephone_no"=>$cgData->phone,
"country_citizen"=>$iNineForminfo->country_citizen,
"uscis_no"=>$iNineForminfo->uscis_no,
"alien_authorized_expire_date"=>$exp_date,
"alien_uscis_no"=>$iNineForminfo->alien_uscis_no,
"form_I_94_no"=>$iNineForminfo->form_I_94_no,
"foreign_passport_no"=>$iNineForminfo->foreign_passport_no,
"county_issuance"=>$iNineForminfo->county_issuance,
"sig_date"=>$data['signature_date'],
'translator_use'=>$iNineForminfo->translator_use,
'translator_last_name'=>$iNineForminfo->translator_last_name,
'translator_first_name'=>$iNineForminfo->translator_first_name,
'translator_street'=>$iNineForminfo->translator_street,
'translator_city'=>$iNineForminfo->translator_city,
'translator_state'=>$iNineForminfo->translator_state,
'translator_zip'=>$iNineForminfo->translator_zip,
"review_last_name"=>$cgData->lname,
"review_first_name"=>$cgData->fname,
"review_middle_initial"=>$cgData->mid_name,
"review_immigration_status"=>$iNineForminfo->review_immigration_status
];
#data for filling up the editable form
//sending data to generate pdfs
$datas=array();
$datas[]=$data1;
$response=mypdf($datas,$ion_id,$mainslug="");
return $response;
}
if($data['document_details']=="wNineForm")
{
#to get the editable pdf form
$data1['pdfFile']="systemfiles/pdf/secondary/end_application/w_nine.pdf";
#to get the editable pdf form
#some credentials about the editable pdf form
$data1['pages']=6;
$data1['break_page']=1;
$data1['slug']="W_NINE_";
#some credentials about the editable pdf form
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$data1['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#file path for creating temp files and original files
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
#file path for creating temp files and original files
#signature save as image
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
#signature save as image
#image placing coordinates & height, width
$data1['x']=40;
$data1['y']=197;
$data1['w']=25;
$data1['h']=20;
#image placing coordinates & height, width
#data getting from extra_editable_pdf_info table
$wNineForm=$this->Caregiver_model->getExtraInfoOfPdf($id,$data['document_details']);
$wNineForminfo=json_decode($wNineForm->info);
$emp_id=$wNineForminfo->emp_id;
$j=1;
for($i=0;$i<9;$i++){
if($emp_id[$i]){
$emp[]=$emp_id[$i];
}else{
$emp[]="";
}
$j++;
}
#data getting from extra_editable_pdf_info table
$address_=$address.", ".$apartment;
$city_state_zip_=$city.", ".$state.", ".$zipcode;
$data1['dataInfo']=[
'name'=>$cgData->fname." ".$cgData->lname,
'business_name'=>$wNineForminfo->businessName,
'tax_classification'=>$wNineForminfo->tax_classification,
'exempt_payee_code'=>$wNineForminfo->exempt_payee_code,
'exempt_reporting_code'=>$wNineForminfo->exempt_reporting_code,
'address'=>$address_,
'city_state_zip'=>$city_state_zip_,
'list_account_no'=>$wNineForminfo->list_account_no,
'requester_optional_name_address'=>$wNineForminfo->requester_optional_name_address,
'soc_no1'=>$soc1,
'soc_no2'=>$soc2,
'soc_no3'=>$soc3,
'soc_no4'=>$soc4,
'soc_no5'=>$soc5,
'soc_no6'=>$soc6,
'soc_no7'=>$soc7,
'soc_no8'=>$soc8,
'soc_no9'=>$soc9,
'emp_id1'=>$emp[0],
'emp_id2'=>$emp[1],
'emp_id3'=>$emp[2],
'emp_id4'=>$emp[3],
'emp_id5'=>$emp[4],
'emp_id6'=>$emp[5],
'emp_id7'=>$emp[6],
'emp_id8'=>$emp[7],
'emp_id9'=>$emp[8],
'signature_date'=>$data['signature_date'],
];
#data for filling up the editable form
//sending data to generate pdfs
$datas=array();
$datas[]=$data1;
$response=mypdf($datas,$ion_id,$mainslug="");
return $response;
}
if($data['document_details']=="DirectDiposit")
{
#to get the editable pdf form
$data1['pdfFile']="systemfiles/pdf/secondary/end_application/direct_deposit.pdf";
#to get the editable pdf form
#some credentials about the editable pdf form
$data1['pages']=1;
$data1['break_page']=1;
$data1['slug']="DIRECT_DEPOSIT_";
#some credentials about the editable pdf form
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$data1['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#file path for creating temp files and original files
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
#file path for creating temp files and original files
#signature save as image
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
#signature save as image
#image placing coordinates & height, width
$data1['x']=117;
$data1['y']=160;
$data1['w']=25;
$data1['h']=20;
#image placing coordinates & height, width
#data getting from extra_editable_pdf_info table
$DirectDiposit=$this->Caregiver_model->getExtraInfoOfPdf($id,$data['document_details']);
$DirDepoinfo=json_decode($DirectDiposit->info);
#data getting from extra_editable_pdf_info table
#data info for filling up the editable form
$data1['dataInfo']=[
'account1_type'=>$DirDepoinfo->account1_type,
'account1_employee_bank_name'=>$DirDepoinfo->account1_employee_bank_name,
'account1_bank_routing_account'=>$DirDepoinfo->account1_bank_routing_account,
'account2_type'=>$DirDepoinfo->account2_type,
'account2_employee_bank_name'=>$DirDepoinfo->account2_employee_bank_name,
'account2_bank_routing_account'=>$DirDepoinfo->account2_bank_routing_account,
'printed_name'=>$cgData->fname." ".$cgData->lname,
'date'=>$data['signature_date']
];
#data for filling up the editable form
//sending data to generate pdfs
$datas=array();
$datas[]=$data1;
$response=mypdf($datas,$ion_id,$mainslug="");
return $response;
}
if($data['document_details']=="Doh102")
{
if($data['status']=="1"){
$this->updateDompdfPdfs();
}
return 1;
}
if($data['document_details']=="Doh103")
{
if($data['status']=="1"){
$this->updateDompdfPdfs();
}
return 1;
}
if($data['document_details']=="RegistryRelease")
{
if($data['status']=="1"){
$this->updateDompdfPdfs();
}
return 1;
}
if($data['document_details']=="Addendum")
{
#to get the editable pdf form
$data1['pdfFile']="systemfiles/pdf/secondary/end_application/incident_addendum.pdf";
#to get the editable pdf form
#some credentials about the editable pdf form
$data1['pages']=1;
$data1['break_page']=1;
$data1['slug']="INCIDENT_ADDENDUM_";
#some credentials about the editable pdf form
#creating specific folder
$folder_name='USER_'.str_pad($ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
#creating specific folder
#file path for creating temp files and original files
$data1['filePath']="uploads/Documents/".$folder_name."/";
#file path for creating temp files and original files
#file path for creating temp files and original files
$data1['imagePath']="uploads\Documents\\".$folder_name."\\";
#file path for creating temp files and original files
#signature save as image
$url=$data['signature'];
$img=$data1['filePath'].$data1['slug']."img_".$id.".png";
file_put_contents($img, file_get_contents($url));
$data1['imageFile']=$data1['imagePath'].$data1['slug']."img_".$id.".png";
#signature save as image
#image placing coordinates & height, width
$data1['x']=46;
$data1['y']=260;
$data1['w']=25;
$data1['h']=20;
#image placing coordinates & height, width
$sigDate=date("m-d-Y h:i A");
$data1['dataInfo']=[
'name'=>$cgData->fname." ".$cgData->lname,
'date'=>$sigDate
];
#data for filling up the editable form
//sending data to generate pdfs
$datas=array();
$datas[]=$data1;
$response=mypdf($datas,$ion_id,$mainslug="");
$str_pad=str_pad($ion_id, 6,"0",STR_PAD_LEFT);
$location="uploads/Documents/USER_".$str_pad."/";
return $location.$response;
}
}
#Editable Pdf form fill up
#==============================================================
#==============================================================
#create final pdf from disclosure
public function final_pdf()
{
// echo "final pdf";die;
$this->load->helper('generatePdf_helper');
$document_details=$this->input->post("documentType");
$cg_id=$this->input->post("id");
$cg_type=$this->input->post("cg_type");
if($cg_type==""){
$cg_typeData=$this->Caregiver_model->getQualificationEmployeeType($cg_id);
$cg_type=$this->typeOfCaregiver($cg_typeData);
}
// pre($cg_type);die();
$cgData=$this->CaregiverDashboard_model->getCgDetails($cg_id);
$ion_id=$cgData->ion_user_id;
$str_pad=str_pad($ion_id, 6,"0",STR_PAD_LEFT);
$location="uploads/Documents/USER_".$str_pad."/";
if($cg_type=="A"){
$files=[
$location."AUTH_RELEASE_".$str_pad.".pdf",
$location."APPLICATION_EMPLOYMENT_".$str_pad.".pdf",
$location."CONTRACTOR_AGREEMENT_".$str_pad.".pdf",
$location."BACKGROUND_CHECK_".$str_pad.".pdf",
$location."I_NINE_".$str_pad.".pdf",
$location."W_NINE_".$str_pad.".pdf",
$location."DIRECT_DEPOSIT_".$str_pad.".pdf"
];
}if($cg_type=="B"){
$files=[
$location."AUTH_RELEASE_".$str_pad.".pdf",
$location."APPLICATION_EMPLOYMENT_".$str_pad.".pdf",
$location."CONTRACTOR_AGREEMENT_".$str_pad.".pdf",
$location."BACKGROUND_CHECK_".$str_pad.".pdf",
$location."I_NINE_".$str_pad.".pdf",
$location."W_NINE_".$str_pad.".pdf",
$location."DIRECT_DEPOSIT_".$str_pad.".pdf"
];
}if($cg_type=="C"){
$files=[
$location."AUTH_RELEASE_".$str_pad.".pdf",
$location."APPLICATION_EMPLOYMENT_".$str_pad.".pdf",
$location."BACKGROUND_CHECK_".$str_pad.".pdf",
$location."I_NINE_".$str_pad.".pdf",
$location."DIRECT_DEPOSIT_".$str_pad.".pdf"
];
}if($cg_type=="D"){
$files=[
$location."AUTH_RELEASE_".$str_pad.".pdf",
$location."APPLICATION_EMPLOYMENT_".$str_pad.".pdf",
$location."BACKGROUND_CHECK_".$str_pad.".pdf",
$location."I_NINE_".$str_pad.".pdf",
$location."DIRECT_DEPOSIT_".$str_pad.".pdf",
$location."DOH_CHRC102_".$str_pad.".pdf",
$location."DOH_CHRC103_".$str_pad.".pdf",
$location."REGISTRY_RELEASE_".$str_pad.".pdf",
];
}
$slug="FINAL_";
// pre($files);die;
$response=merge_pdfs($files,$slug,$ion_id,$location);
header("location: ".base_url().$response);
}
#create final pdf from disclosure
#send approval request from disclosure
public function send_approval()
{
// echo "approval";die;
$ionid=$this->input->post('ion_id');
$verification_submitted_by=$this->session->userdata('user_id');
$savetime=date('Y-m-d H:i:s', now());
$caregiverData=$this->Caregiver_model->getNurseByIonId($ionid);
$data=array(
'submited_for_verification'=>'yes',
'submission_date'=>$savetime,
'verification_submitted_by'=>$verification_submitted_by
);
// pre($caregiverData);die;
$this->Caregiver_model->updateNurse($caregiverData->caregiver_table_id,$data);
$name=$caregiverData->fname." ".$caregiverData->lname;
$from=array(
'name' => 'HMS Admin',
'email' => 'admin@hms.com'
);
$subject ='Successfully send for approval';
$emaildata['emaildata']=array(
'name' =>$name
);
$to=$caregiverData->email;
$message=$this->load->view('email_template_management/cararegiver_send_approval',$emaildata,TRUE);
send_email($from,$to,$subject,$message);
if($ionid == $verification_submitted_by){
redirect('CaregiversDashboard');
}else{
redirect('caregivers/pendingAcceptance');
}
}
#send approval request from disclosure
#==============================================================
#==============================================================
#Update acceptence & create Html view in modal body from dashboard calender
public function getScheduleDetailsByScheduleId()
{
$cg_id=$this->input->get('cg_id');
$pt_id=$this->input->get('pt_id');
$sch_id=$this->input->get('sch_id');
// $sch_id=106;
// $sch_id=108;
$scheduleDetails=$this->CaregiverDashboard_model->getScheduleDetailsByScheduleId($sch_id);
$clockInOutDetails=$this->CaregiverDashboard_model->getClockInOutDetailsByScheduleId($sch_id);
// pre($clockInOutDetails);die();
// echo json_encode($scheduleDetails);
$sch_start=date("m-d-Y h:i A",strtotime($scheduleDetails->start));
$sch_end=date("m-d-Y h:i A",strtotime($scheduleDetails->end));
$clock_in=date("m-d-Y h:i A",strtotime($clockInOutDetails->clock_in_time));
$clock_out=date("m-d-Y h:i A",strtotime($clockInOutDetails->clock_out_time));
$html='';
#logo and title (compulsary)
$headHtml='<input type="hidden" class="caregiver-id" value="'.$cg_id.'"><input type="hidden" class="patient-id" value="'.$pt_id.'"><input type="hidden" class="schedule-id" value="'.$sch_id.'"><div class="row"><div class="form-group col-12"><div class="w-100 center"><img src="https://openclipart.org/image/800px/216807" style="height:100px;width:100px;"></div></div><div class="form-group col-12"><h4 class="text-center text-capitalize" style="font-weight: bold;">'.$scheduleDetails->title.'</h4></div></div>';
$html.=$headHtml;
#logo and title (compulsary)
#schedule start and end time
$scheduleTimeHtml='<div class="row"><div class="form-group col-12 p-0 m-0" ><h4 class="text-center">Status : '.$scheduleDetails->acceptance_status.'</h4></div><div class="form-group col-12 p-0 m-0" ><h4 class="text-center">Schedule Start : '.$sch_start.'</h4></div><div class="form-group col-12 p-0 m-0"><h4 class="text-center">Schedule End : '.$sch_end.'</h4></div></div>';
$html.=$scheduleTimeHtml;
#schedule start and end time
#accept or decline schedule
if($scheduleDetails->acceptance_status=="Unconfirmed"){
$accpetDeclineButtonHtml='<div class="row pt-2"><div class="form-group col-5"><button class="btn btn-lg btn-danger decline-button pull-right">Decline</button></div><div class="form-group col-2 center"><span class="text-info">OR</span></div><div class="form-group col-5"><button class="btn btn-lg btn-info accept-button">Accept</button></div><div class="form-group col-12 decline-reason-container pt-2"><div class="row"><div class="form-group col-10 center rejection-reason-container"><textarea class="rejection-reason" style="height:100px;width:90%;" placeholder="Write here the reason"></textarea></div><div class="form-group col-2 center"><button class="btn btn-lg btn-info decline-save-button">Save</button></div></div></div></div>';
$html.=$accpetDeclineButtonHtml;
}
#accept or decline schedule
#clock in and out time
if($scheduleDetails->acceptance_status=="Accepted"){
if($clockInOutDetails!=""){
if($clockInOutDetails->clock_status==0){
if($clockInOutDetails->clock_in_time!=""){
$clockInTimeHtml='<div class="row"><div class="form-group col-12 p-0 m-0 center"><span class="text-center">......................................</span></div><div class="form-group col-12 p-0 m-0"><h4 class="text-center text-info">Clocked In : '.$clock_in.'</h4></div></div>';
$clockOutReportButtonHtml='<div class="row pt-2"><div class="form-group col-6"><button class="btn btn-warning pull-right clock-out-button">Clock Out</button></div> <div class="form-group col-6"><a type="button" href="'.base_url().'assessment?id='.$pt_id.'&scheduleId='.$sch_id.'" class="btn btn-danger">Report</a></div></div>';
$html.=$clockInTimeHtml.$clockOutReportButtonHtml;
}
}
if($clockInOutDetails->clock_status==1){
if($clockInOutDetails->clock_out_time!=""){
$clockInTimeHtml='<div class="row"><div class="form-group col-12 p-0 m-0 center"><span class="text-center">......................................</span></div><div class="form-group col-12 p-0 m-0"><h4 class="text-center text-info">Clocked In : '.$clock_in.'</h4></div></div>';
$clockOutTimeHtml='<div class="row"><div class="form-group col-12 p-0 m-0"><h4 class="text-center text-info">Clocked Out : '.$clock_out.'</h4></div></div>';
$reportButtonHtml='<div class="row pt-2"><div class="form-group col-12 center"><a type="button" href="'.base_url().'assessment?id='.$pt_id.'&scheduleId='.$sch_id.'" class="btn btn-danger">Report</a></div></div>';
$html.=$clockInTimeHtml.$clockOutTimeHtml.$reportButtonHtml;
}
}
}
else{
$clockInButtonHtml='<div class="row pt-2"><div class="form-group col-12 center"><button class="btn btn-success pull-right clock-in-button">Clock In</button></div></div>';
$html.=$clockInButtonHtml;
}
}
#clock in and out time
echo $html;
}
public function updateAcceptanceFromDasboard()
{
$data['acceptance_status']=$this->input->get("acceptance_status");
$data['rejection_reason']=$this->input->get("rejection_reason");
$sch_id=$this->input->get("sch_id");
// echo json_encode($data);
if($data['acceptance_status']=='Accepted'){
$success=$this->CaregiverDashboard_model->updateAcceptance($data,$sch_id);
}
if($data['acceptance_status']=='Declined'){
if($data['rejection_reason']==""){
echo "0";
}
if($data['rejection_reason']!=""){
$success=$this->CaregiverDashboard_model->updateAcceptance($data,$sch_id);
}
}
}
#Update acceptence & create Html view in modal body from dashboard calender
#==============================================================
public function getServices(){
$services=$this->Caregiver_model->getServices($_GET);
echo $services;
}
public function checkaddress(){
$this->load->helper('map_helper');
$address=$_GET['address'].'+'.$_GET['zipcode'];
//$response=address_info($_GET['address'],$_GET['zipcode']);
// $response=map_address($address);
$response=mapquest_address($_GET['address'],$_GET['zipcode']);
//print_r($response);die;
if($response){
$response['status_code']=200;
}else{
$response['status_code']=404;
}
echo json_encode($response);
}
public function documentsSave()
{
pre($_POST);pre($_FILES);die;
$ionid=$this->input->post('Ion_id');
$id=$this->input->post('id');
$caregiver_data=$this->Caregiver_model->getNurseByIonId($ionid);
$savetime=date ('Y-m-d H:i:s', now());
$doc_type=$this->input->post('doc_type');
$documentId=$this->input->post('doc_id');
$progress=$this->input->post('progress');
$usertype='Caregiver';
$folder_name='USER_'.str_pad($ionid, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
$uploadto="uploads/Documents/".$folder_name."/";
// pre($_FILES);
if($_FILES[$doc_type]['name'] || $_POST['image']){
if($_POST['image']){
$img = $_POST['image'];
$image_parts = explode(";base64,", $img);
$image_type_aux = explode("image/", $image_parts[0]);
$image_type = $image_type_aux[1];
$image_base64 = base64_decode($image_parts[1]);
$file_name_pieces = uniqid() . '.'.$image_type;
$new_file_name = $doc_type.'_'.str_pad($ionid, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces;
$file = $uploadto . $new_file_name;
file_put_contents($file, $image_base64);
// pre($file);die;
}
if($_FILES[$doc_type]['name']){
//echo '<pre>'; print_r($this->input->post()); echo '</pre>';die;
$file_name = $_FILES[$doc_type]['name'];
$file_name_pieces = explode('.', $file_name);
// pre($file_name_pieces);die;
$count=count($file_name_pieces);
$new_file_name = $doc_type.'_'.str_pad($ionid, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces[$count-1];
if($doc_type==_DOC_PHOTOCODE_){
$config = array(
'file_name' => $new_file_name,
'upload_path' => "./".$uploadto,
'allowed_types' => "gif|jpg|png|jpeg",
'overwrite' => False,
'max_size' => "20480000",
//'max_height' => "1768",
//'max_width' => "2024"
);
}else{
$config = array(
'file_name' => $new_file_name,
'upload_path' => "./".$uploadto,
'allowed_types' => "gif|jpg|png|jpeg|pdf",
'overwrite' => False,
'max_size' => "20480000",
//'max_height' => "1768",
//'max_width' => "2024"
);
}
$this->load->library('Upload', $config);
$this->upload->initialize($config);
if ($this->upload->do_upload($doc_type)) {
$path = $this->upload->data();
//$photo = $path['file_name'];
}
}
if($path['file_name']!="" || $image_base64!=""){
if($path['file_name']!=""){
$data = array(
'ion_user_id' => $ionid,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $path['file_name'],
'originalfilename' => $_FILES[$doc_type]['name'],
'documents_type' => $doc_type
);
}else if($image_base64!=""){
$data = array(
'ion_user_id' => $ionid,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $new_file_name,
'originalfilename' => $file_name_pieces,
'documents_type' => $doc_type
);
}
// pre($data);die;
$caregiverPer = json_decode($caregiver_data->from_tab_status_pctg);
$check_doc_exsist=$this->Caregiver_model->checkDocumentsExsist($ionid,$doc_type);
if($check_doc_exsist==0){
$caregiver_details=$this->Caregiver_model->getNurseById($id);
$caregiverPer = json_decode($caregiver_details->from_tab_status_pctg);
if($doc_type==_DOC_PCACODE_){
$caregiverPer->form11 = $caregiverPer->form11 + 2;
}else if($doc_type==_DOC_OTHERCODE_){
$caregiverPer->form11 = $caregiverPer->form11;
}else if($doc_type==_DOC_SIDCODE_){
$caregiverPer->form11 = $caregiverPer->form11;
}else if($doc_type==_DOC_SIDBACK_){
$caregiverPer->form11 = $caregiverPer->form11;
}else if($doc_type==_DOC_PROFETIONAL_REFERENCE || $doc_type==_DOC_REFCODE_){
// $doc1=$this->Caregiver_model->checkDocumentsExsist($ionid, _DOC_PROFETIONAL_REFERENCE);
if($doc_type==_DOC_PROFETIONAL_REFERENCE){
$doc=$this->Caregiver_model->checkDocumentsExsist($ionid,_DOC_REFCODE_);
}else{
$doc=$this->Caregiver_model->checkDocumentsExsist($ionid,_DOC_PROFETIONAL_REFERENCE);
}
if($doc==1){
$caregiverPer->form11 = $caregiverPer->form11 + 1;
}else{
$caregiverPer->form11 = $caregiverPer->form11;
}
}
else{
$caregiverPer->form11 = $caregiverPer->form11 + 1;
}
//pr($caregiverPer);die;
$caregiver_data=$this->Caregiver_model->getNurseByIonId($ionid);
$process= json_encode($caregiverPer);
if($caregiver_data->form_status<11)
$form_status=11;
else
$form_status=$caregiver_data->form_status;
$caregiverUpdate=array(
'from_tab_status_pctg' => $process,
'form_status' => $form_status,
);
// pr($caregiverUpdate);die;
$this->Caregiver_model->updateNurse($id,$caregiverUpdate);
}
// $doc1=$this->Caregiver_model->checkDocumentsExsist($ionid, _DOC_PROFETIONAL_REFERENCE);
// $doc2=$this->Caregiver_model->checkDocumentsExsist($ionid,_DOC_REFCODE_);
$this->Caregiver_model->deleteNursePreDocuments($documentId);
$documentId = $this->Caregiver_model->addNurseDocuments($data);
if($path['file_name']!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $path['file_name'],
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}else if($image_base64!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $new_file_name,
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}
$this->Home_model->activity_log($activitydata);
}
}else{
if($doc_type==_DOC_COVID_ || $doc_type==_DOC_DIPHTHERIA_CODE_ || $doc_type==_DOC_TETANUS_CODE_ || $doc_type==_DOC_MUMPS_CODE_ || $doc_type==_DOC_VAR_CODE_){
$check_doc_exsist=$this->Caregiver_model->checkDocumentsExsist($ionid,$doc_type);
if($check_doc_exsist==0){
$caregiver_details=$this->Caregiver_model->getNurseById($id);
$caregiverPer = json_decode($caregiver_details->from_tab_status_pctg);
$caregiverPer->form11 = $caregiverPer->form11 + 1;
$caregiver_data=$this->Caregiver_model->getNurseByIonId($ionid);
$process= json_encode($caregiverPer);
if($caregiver_data->form_status<11)
$form_status=11;
else
$form_status=$caregiver_data->form_status;
$caregiverUpdate=array(
'from_tab_status_pctg' => $process,
'form_status' => $form_status,
);
$this->Caregiver_model->updateNurse($id,$caregiverUpdate);
}
$this->Caregiver_model->deleteNursePreDocuments($documentId);
$data = array(
'ion_user_id' => $ionid,
'userid' => $id,
'user_type' => $usertype,
'documents_type' => $doc_type
);
$documentId = $this->Caregiver_model->addNurseDocuments($data);
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => '',
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
}
}
if($documentId){
$remarks=$this->input->post($doc_type.'_remarks');
$documents_no=$this->input->post($doc_type.'_documents_no');
$date_completed=$this->input->post($doc_type.'_date_completed');
$data = array(
'remarks' => $remarks,
'documents_no'=>$documents_no,
'date_completed'=>$date_completed
);
$this->Caregiver_model->updateNurseDocuments($data,$documentId);
$haveExpireDoc=array("SFI","MIC","CPR");
if(in_array($doc_type, $haveExpireDoc)){
docExpireDate($id,$doc_type,null,$remarks);
}
$haveCompletedDoc=array("EHA","HBV","DSC");
if(in_array($doc_type, $haveCompletedDoc)){
docExpireDate($id,$doc_type,$remarks,null);
}
$activitydata = array(
'activity_description' => $doc_type .' Remarks Update',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
'file_url'=>$uploadto.$path['file_name'],
);
echo json_encode($output);
}else{
$output=array(
'upload'=>'failed',
'msg'=>'Check File Type.',
'file_url'=>$uploadto.$path['file_name'],
);
echo json_encode($output);
}
}
public function ProfileUpdate()
{
//pre($_FILES['malpractice_document']);die;
// _die($_POST);
$form_tab = $this->input->post('form_tab_status');
$_SESSION['form_tab_status']=$form_tab;
$id = $this->input->post('id');
$form_status = $this->input->post('form_status');
$form_mode = $this->input->post('form_mode');
$fname = $this->input->post('fname');
$lname = $this->input->post('lname');
$phone = $this->input->post('phone');
$qualification_type = $this->input->post('qualification_type');
$service = $this->input->post('service');
$gender = $this->input->post('gender');
$marital_status = $this->input->post('marital_status');
$dependents = $this->input->post('dependents');
$dob = $this->input->post('dob');
$soc_sec = $this->input->post('soc_sec');
$country_of_birth = $this->input->post('country_of_birth');
$ethnicity = $this->input->post('ethnicity');
$height = $this->input->post('height_feet').'/'.$this->input->post('height_inches');
$weight = $this->input->post('weight');
$eye_color = $this->input->post('eye_color');
$hair_color = $this->input->post('hair_color');
$primary_language = $this->input->post('primary_langualge');
if(($primary_language)!=""){
$primary_language=implode("/",$primary_language);
}
$availability_borough = $this->input->post('availability_borough');
if($availability_borough!=""){
$availability_borough=implode("/",$availability_borough);
}
$availability = $this->input->post('availability');
if($this->input->post('availability')!=""){
$availability=implode("/",$availability);
}
$address1 = $this->input->post('address1');
$apt1 = $this->input->post('apt1');
$direction1 = $this->input->post('direction1');
$state1 = $this->input->post('state1');
$county1 = $this->input->post('county1');
$zipcode1 = $this->input->post('zipcode1');
$lang1 = $this->input->post('lang1');
$long1 = $this->input->post('long1');
$city1 = $this->input->post('city1');
$address2 = $this->input->post('address2');
$apt2 = $this->input->post('apt2');
$direction2 = $this->input->post('direction2');
$state2 = $this->input->post('state2');
$county2 = $this->input->post('county2');
$zipcode2 = $this->input->post('zipcode2');
$lang2 = $this->input->post('lang2');
$long2 = $this->input->post('long2');
$city2 = $this->input->post('city2');
$phone2 = $this->input->post('phone2');
$other_contact = $this->input->post('other_contact');
$alternative_email = $this->input->post('alternative_email');
$preferred_contact = $this->input->post('preferred_contact');
$years_of_exp = $this->input->post('years_of_exp');
$caregiver = $this->Caregiver_model->getNurseById($id);
if (!empty($id))
{
$data = array();
$data['nurse'] = $this->Caregiver_model->getNurseById($id);
$data['state_list']=$this->Caregiver_model->get_state_list();
$data['skills']=$this->Caregiver_model->caregiver_skill_list();
$data['tab']=$form_status;
// pre($data);die();
// $this->load->view('home/dashboard'); // just the header file
// $this->load->view('profile', $data);
// $this->load->view('home/footer'); // just the footer file
}
$data = array();
if(empty($id))
{
//die;
$this->session->set_flashdata('feedback_error', 'Data Saving Error.');
redirect('CaregiversDashboard');
}
else
{
//Cargiver IONID,NAME,ID
$CData=$this->Caregiver_model->getNameIdById($id);
//pre($CData);
$folder_name='uploads/Documents/USER_'.str_pad($CData['ion_user_id'], 6, "0", STR_PAD_LEFT).'/';
$uploadData['folder_name']=$folder_name;
$uploadData['CONFIG']['allowed_types']='gif|jpg|png|jpeg|pdf';
$uploadData['CONFIG']['max_size']='20480000';
$citizen = array(
'citizen'=>$this->input->post('citizen'),
'remain_permanently'=>$this->input->post('remain_permanently'),
'authorization_to_work'=>$this->input->post('authorization_to_work'),
'involved_as_defendant'=>$this->input->post('involved_as_defendant'),
'involved_as_defendant_explain'=>$this->input->post('involved_as_defendant_explain'),
'convicted'=>$this->input->post('convicted'),
'convicted_crime_explain'=>$this->input->post('convicted_crime_explain'),
'convicted_for_negligence'=>$this->input->post('convicted_for_negligence'),
'negligence_explain'=>$this->input->post('negligence_explain'),
'criminal_convictions'=>$this->input->post('criminal_convictions'),
'criminal_convictions_details'=>$this->input->post('criminal_convictions_details'));
$citizenJson = json_encode($citizen);
$physicalExamForm = array();
if($this->input->post('height_feet')!=""){ $physicalExamForm['height_feet'] = $this->input->post('height_feet'); }
if($this->input->post('height_inches')!=""){ $physicalExamForm['height_inches'] = $this->input->post('height_inches'); }
if($this->input->post('weight')!=""){ $physicalExamForm['weight'] = $this->input->post('weight'); }
if($this->input->post('blood_pressure')!=""){ $physicalExamForm['blood_pressure'] = $this->input->post('blood_pressure'); }
if($this->input->post('pulse')!=""){ $physicalExamForm['pulse'] = $this->input->post('pulse'); }
if($this->input->post('respiration')!=""){ $physicalExamForm['respiration'] = $this->input->post('respiration'); }
if($this->input->post('heart')!=""){ $physicalExamForm['heart'] = $this->input->post('heart'); }
if($this->input->post('lungs')!=""){ $physicalExamForm['lungs'] = $this->input->post('lungs'); }
if($this->input->post('muscular_skeleta')!=""){ $physicalExamForm['muscular_skeleta'] = $this->input->post('muscular_skeleta'); }
if($this->input->post('gu')!=""){ $physicalExamForm['gu'] = $this->input->post('gu'); }
if($this->input->post('gi')!=""){ $physicalExamForm['gi'] = $this->input->post('gi'); }
if($this->input->post('ppd1_testDate')!=""){ $physicalExamForm['ppd1_testDate'] = $this->input->post('ppd1_testDate'); }
if($this->input->post('ppd1_result')!=""){ $physicalExamForm['ppd1_result'] = $this->input->post('ppd1_result'); }
if($this->input->post('ppd1_resultDate')!=""){ $physicalExamForm['ppd1_resultDate'] = $this->input->post('ppd1_resultDate'); }
if($this->input->post('ppd2_testDate')!=""){ $physicalExamForm['ppd2_testDate'] = $this->input->post('gi'); }
if($this->input->post('ppd2_result')!=""){ $physicalExamForm['ppd2_result'] = $this->input->post('ppd2_result'); }
if($this->input->post('ppd2_resultDate')!=""){ $physicalExamForm['ppd2_resultDate'] = $this->input->post('ppd2_resultDate'); }
if($this->input->post('xray_testDate')!=""){ $physicalExamForm['xray_testDate'] = $this->input->post('xray_testDate'); }
if($this->input->post('xray_result')!=""){ $physicalExamForm['xray_result'] = $this->input->post('xray_result'); }
if($this->input->post('xray_resultDate')!=""){ $physicalExamForm['xray_resultDate'] = $this->input->post('xray_resultDate'); }
if($this->input->post('rubella_testDate')!=""){ $physicalExamForm['rubella_testDate'] = $this->input->post('rubella_testDate'); }
if($this->input->post('rubella_result')!=""){ $physicalExamForm['rubella_result'] = $this->input->post('rubella_result'); }
if($this->input->post('rubella_resultDate')!=""){ $physicalExamForm['rubella_resultDate'] = $this->input->post('rubella_resultDate'); }
if($this->input->post('rubeola_testDate')!=""){ $physicalExamForm['rubeola_testDate'] = $this->input->post('rubeola_testDate'); }
if($this->input->post('rubeola_result')!=""){ $physicalExamForm['rubeola_result'] = $this->input->post('rubeola_result'); }
if($this->input->post('rubeola_resultDate')!=""){ $physicalExamForm['rubeola_resultDate'] = $this->input->post('rubeola_resultDate'); }
if($this->input->post('rubeola_details')!=""){ $physicalExamForm['rubeola_details'] = $this->input->post('rubeola_details'); }
if($this->input->post('influenza_testDate')!=""){ $physicalExamForm['influenza_testDate'] = $this->input->post('influenza_testDate'); }
if($this->input->post('influenza_resultDate')!=""){ $physicalExamForm['influenza_resultDate'] = $this->input->post('influenza_resultDate'); }
if($this->input->post('Diphtheria')!=""){ $physicalExamForm['Diphtheria'] = $this->input->post('Diphtheria'); }
if($this->input->post('Tetanus')!=""){ $physicalExamForm['Tetanus'] = $this->input->post('Tetanus'); }
if($this->input->post('Mumps')!=""){ $physicalExamForm['Mumps'] = $this->input->post('Mumps'); }
if($this->input->post('RubellaVaccine')!=""){ $physicalExamForm['RubellaVaccine'] = $this->input->post('RubellaVaccine'); }
if($this->input->post('MeaslesVaccine1')!=""){ $physicalExamForm['MeaslesVaccine1'] = $this->input->post('MeaslesVaccine1'); }
if($this->input->post('MeaslesVaccine2')!=""){ $physicalExamForm['MeaslesVaccine2'] = $this->input->post('MeaslesVaccine2'); }
if($this->input->post('HB1')!=""){ $physicalExamForm['HB1'] = $this->input->post('HB1'); }
if($this->input->post('HB2')!=""){ $physicalExamForm['HB2'] = $this->input->post('HB2'); }
if($this->input->post('HB3')!=""){ $physicalExamForm['HB3'] = $this->input->post('HB3'); }
if($this->input->post('DrugScreen')!=""){ $physicalExamForm['DrugScreen'] = $this->input->post('DrugScreen'); }
if($this->input->post('lot_num')!=""){ $physicalExamForm['lot_num'] = $this->input->post('lot_num'); }
if($this->input->post('lot_exp')!=""){ $physicalExamForm['lot_exp'] = $this->input->post('lot_exp'); }
if($this->input->post('due_to_pregnancy')!=""){ $physicalExamForm['due_to_pregnancy'] = $this->input->post('due_to_pregnancy'); }
if($this->input->post('list_of_medications')!=""){ $physicalExamForm['list_of_medications'] = $this->input->post('list_of_medications'); }
if($this->input->post('eyeglasses')!=""){ $physicalExamForm['eyeglasses'] = $this->input->post('eyeglasses'); }
if($this->input->post('hearingAid')!=""){ $physicalExamForm['hearingAid'] = $this->input->post('hearingAid'); }
if($this->input->post('extended_periods')!=""){ $physicalExamForm['extended_periods'] = $this->input->post('extended_periods'); }
if($this->input->post('extended_periods_explain')!=""){ $physicalExamForm['extended_periods_explain'] = $this->input->post('extended_periods_explain'); }
if($this->input->post('disorders')!=""){ $physicalExamForm['disorders'] = $this->input->post('disorders'); }
if($this->input->post('extended_periods_explain')!=""){ $physicalExamForm['extended_periods_explain'] = $this->input->post('extended_periods_explain'); }
$physicalExamFormJson = json_encode($physicalExamForm);
$emp_health_assesment = array();
if($this->input->post('diabetes')!=""){ $emp_health_assesment['diabetes'] = $this->input->post('diabetes'); }
if($this->input->post('kidney_disease')!=""){ $emp_health_assesment['kidney_disease'] = $this->input->post('kidney_disease'); }
if($this->input->post('heart_disease')!=""){ $emp_health_assesment['heart_disease'] = $this->input->post('heart_disease'); }
if($this->input->post('high_blood_pressure')!=""){ $emp_health_assesment['high_blood_pressure'] = $this->input->post('high_blood_pressure'); }
if($this->input->post('arthritis')!=""){ $emp_health_assesment['arthritis'] = $this->input->post('arthritis'); }
if($this->input->post('mental_illness')!=""){ $emp_health_assesment['mental_illness'] = $this->input->post('mental_illness'); }
if($this->input->post('epilepsy')!=""){ $emp_health_assesment['epilepsy'] = $this->input->post('epilepsy'); }
if($this->input->post('swelling_extremities')!=""){ $emp_health_assesment['swelling_extremities'] = $this->input->post('swelling_extremities'); }
if($this->input->post('allergies')!=""){ $emp_health_assesment['allergies'] = $this->input->post('allergies'); }
if($this->input->post('back_pain')!=""){ $emp_health_assesment['back_pain'] = $this->input->post('back_pain'); }
if($this->input->post('pain_urination')!=""){ $emp_health_assesment['pain_urination'] = $this->input->post('pain_urination'); }
if($this->input->post('change_bowel_habit')!=""){ $emp_health_assesment['change_bowel_habit'] = $this->input->post('change_bowel_habit'); }
if($this->input->post('increased_thirst')!=""){ $emp_health_assesment['increased_thirst'] = $this->input->post('increased_thirst'); }
if($this->input->post('persistent_lumps')!=""){ $emp_health_assesment['persistent_lumps'] = $this->input->post('persistent_lumps'); }
if($this->input->post('infectious_disease')!=""){ $emp_health_assesment['infectious_disease'] = $this->input->post('infectious_disease'); }
if($this->input->post('cancer')!=""){ $emp_health_assesment['cancer'] = $this->input->post('cancer'); }
if($this->input->post('other_disability')!=""){ $emp_health_assesment['other_disability'] = $this->input->post('other_disability'); }
// _die($emp_health_assesment);
// $this->Caregiver_model->saveCaregivercertificate('caregiver_certificate',$data, $caregiver_table_id,$crt_type[$i]);
if($emp_health_assesment){
$this->Caregiver_model->saveHealthCondition('user_health_assessments',$emp_health_assesment, $id);
}
// TuberCulosis
$tuberculosisArr = array();
if($this->input->post('cough_3_weeks')!=""){ $tuberculosisArr['cough_3_weeks'] = $this->input->post('cough_3_weeks'); }
if($this->input->post('blood_sputum')!=""){ $tuberculosisArr['blood_sputum'] = $this->input->post('blood_sputum'); }
if($this->input->post('shortness_breath')!=""){ $tuberculosisArr['shortness_breath'] = $this->input->post('shortness_breath'); }
if($this->input->post('night_sweat')!=""){ $tuberculosisArr['night_sweat'] = $this->input->post('night_sweat'); }
if($this->input->post('chest_pain')!=""){ $tuberculosisArr['chest_pain'] = $this->input->post('chest_pain'); }
if($this->input->post('unexplained_weight_loss')!=""){ $tuberculosisArr['unexplained_weight_loss'] = $this->input->post('unexplained_weight_loss'); }
if($this->input->post('appetite_loss')!=""){ $tuberculosisArr['appetite_loss'] = $this->input->post('appetite_loss'); }
if($this->input->post('hoarseness')!=""){ $tuberculosisArr['hoarseness'] = $this->input->post('hoarseness'); }
if($this->input->post('thirst_increase')!=""){ $tuberculosisArr['thirst_increase'] = $this->input->post('thirst_increase'); }
if($this->input->post('fatigue')!=""){ $tuberculosisArr['fatigue'] = $this->input->post('fatigue'); }
if($this->input->post('fever')!=""){ $tuberculosisArr['fever'] = $this->input->post('fever'); }
if($tuberculosisArr){
$this->Caregiver_model->saveHealthCondition('user_tuberculosis_questionnaire',$tuberculosisArr, $id);
}
// TuberCulosis
// if($this->input->post('hepatatis_vaccine')!=""){ $tuberculosisArr['hepatatis_vaccine'] = $this->input->post('hepatatis_vaccine');}
// if($this->input->post('positive_ppd')!=""){ $tuberculosisArr['positive_ppd'] = $this->input->post('positive_ppd'); }
// if($this->input->post('ppd_explain')!=""){ $tuberculosisArr['ppd_explain'] = $this->input->post('ppd_explain'); }
$under_careArr=[];
if($this->input->post('under_care')!=""){ $under_careArr['under_care'] = $this->input->post('under_care'); }
if($this->input->post('under_care_explain')!=""){ $under_careArr['under_care_explain'] = $this->input->post('under_care_explain'); }
if($this->input->post('name_of_physician')!=""){ $under_careArr['name_of_physician'] = $this->input->post('name_of_physician'); }
if($this->input->post('tel_of_physician')!=""){ $under_careArr['tel_of_physician'] = $this->input->post('tel_of_physician'); }
//drugScreenArr
$drugScreenArr = array();
if($this->input->post('change_behaviour')!=""){ $drugScreenArr['change_behaviour'] = $this->input->post('change_behaviour'); }
if($this->input->post('change_behaviour_explain')!=""){ $drugScreenArr['change_behaviour_explain'] = $this->input->post('change_behaviour_explain'); }
//drugScreenArr
//Physical Assessment
$physcialAssesmentArr = array();
// if($this->input->post('prescription_medications')!=""){
// $presArr=array(
// 'short_code'=> 'prescription_medications',
// 'status'=> $this->input->post('prescription_medications'),
// 'explain'=> $this->input->post('prescription_medications_explain'),
// );
// array_push($physcialAssesmentArr,$presArr);
// }
// if($this->input->post('prescription_medications')!=""){
// $presArr=array(
// 'short_code'=> 'prescription_medications',
// 'status'=> $this->input->post('prescription_medications'),
// 'explain'=> $this->input->post('prescription_medications_explain'),
// );
// array_push($physcialAssesmentArr,$presArr);
// }
// _die($physcialAssesmentArr);
if($this->input->post('prescription_medications')!=""){ $physcialAssesmentArr['prescription_medications'] = $this->input->post('prescription_medications'); }
if($this->input->post('prescription_medications_explain')!=""){ $physcialAssesmentArr['prescription_medications_explain'] = $this->input->post('prescription_medications_explain'); }
if($this->input->post('screening_test')!=""){ $physcialAssesmentArr['screening_test'] = $this->input->post('screening_test'); }
if($this->input->post('screening_test_explain')!=""){ $physcialAssesmentArr['screening_test_explain'] = $this->input->post('screening_test_explain'); }
if($this->input->post('past_illness')!=""){ $physcialAssesmentArr['past_illness'] = $this->input->post('past_illness'); }
if($this->input->post('past_illness_explain')!=""){ $physcialAssesmentArr['past_illness_explain'] = $this->input->post('past_illness_explain'); }
if($this->input->post('physicaldefects')!=""){ $physcialAssesmentArr['physicaldefects']['status'] = $this->input->post('physicaldefects'); }
if($this->input->post('physicaldefects_details')!=""){ $physcialAssesmentArr['physicaldefects']['explain'] = $this->input->post('physicaldefects_details'); }
if($this->input->post('injured')!=""){ $physcialAssesmentArr['injured'] = $this->input->post('injured'); }
if($this->input->post('injuryDetails')!=""){ $physcialAssesmentArr['injuryDetails'] = $this->input->post('injuryDetails'); }
if($this->input->post('defects')!=""){ $physcialAssesmentArr['defects'] = $this->input->post('defects'); }
if($this->input->post('hearingdefectsDetails')!=""){ $physcialAssesmentArr['hearingdefectsDetails'] = $this->input->post('hearingdefectsDetails'); }
if($this->input->post('inVision')!=""){ $physcialAssesmentArr['inVision'] = $this->input->post('inVision'); }
if($this->input->post('visiondefectsDetails')!=""){ $physcialAssesmentArr['visiondefectsDetails'] = $this->input->post('visiondefectsDetails'); }
if($this->input->post('speach')!=""){ $physcialAssesmentArr['speach'] = $this->input->post('speach'); }
if($this->input->post('speechdefectsDetails')!=""){ $physcialAssesmentArr['speechdefectsDetails'] = $this->input->post('speechdefectsDetails'); }
//Physical Assessment
pre($physcialAssesmentArr);die;
// $emp_health_assesmentJson =json_encode($emp_health_assesment);
$drugScreenJson =json_encode($drugScreenArr);
$physcialAssesmentJson =json_encode($physcialAssesmentArr);
$under_careJson =json_encode($under_careArr);
// _die($emp_health_assesmentJson);
$hb_form = array();
if($this->input->post('Allergies')!=""){ $hb_form['Allergies'] = $this->input->post('Allergies'); }
if($this->input->post('date_of_exposure')!=""){ $hb_form['date_of_exposure'] = $this->input->post('date_of_exposure'); }
if($this->input->post('location')!=""){ $hb_form['location'] = $this->input->post('location'); }
if($this->input->post('type_of_exposure')!=""){ $hb_form['type_of_exposure'] = $this->input->post('type_of_exposure'); }
if($this->input->post('incident_report')!=""){ $hb_form['incident_report'] = $this->input->post('incident_report'); }
if($this->input->post('report_completed')!=""){ $hb_form['report_completed'] = $this->input->post('report_completed'); }
if($this->input->post('Initial_Dose_Type')!=""){ $hb_form['Initial_Dose_Type'] = $this->input->post('Initial_Dose_Type'); }
if($this->input->post('Initial_Dose_Date')!=""){ $hb_form['Initial_Dose_Date'] = $this->input->post('Initial_Dose_Date'); }
if($this->input->post('Initial_Dose')!=""){ $hb_form['Initial_Dose'] = $this->input->post('Initial_Dose'); }
if($this->input->post('Initial_Dose_Site')!=""){ $hb_form['Initial_Dose_Site'] = $this->input->post('Initial_Dose_Site'); }
if($this->input->post('Initial_Dose_Type2')!=""){ $hb_form['Initial_Dose_Type2'] = $this->input->post('Initial_Dose_Type2'); }
if($this->input->post('Initial_Dose_Date2')!=""){ $hb_form['Initial_Dose_Date2'] = $this->input->post('Initial_Dose_Date2'); }
if($this->input->post('Initial_Dose2')!=""){ $hb_form['Initial_Dose2'] = $this->input->post('Initial_Dose2'); }
if($this->input->post('Initial_Dose_Site2')!=""){ $hb_form['Initial_Dose_Site2'] = $this->input->post('Initial_Dose_Site2'); }
if($this->input->post('Initial_Dose_Type3')!=""){ $hb_form['Initial_Dose_Type3'] = $this->input->post('Initial_Dose_Type3'); }
if($this->input->post('Initial_Dose_Date3')!=""){ $hb_form['Initial_Dose_Date3'] = $this->input->post('Initial_Dose_Date3'); }
if($this->input->post('Initial_Dose3')!=""){ $hb_form['Initial_Dose3'] = $this->input->post('Initial_Dose3'); }
if($this->input->post('Initial_Dose_Site3')!=""){ $hb_form['Initial_Dose_Site3'] = $this->input->post('Initial_Dose_Site3'); }
if($this->input->post('Initial_Dose_Type4')!=""){ $hb_form['Initial_Dose_Type4'] = $this->input->post('Initial_Dose_Type4'); }
if($this->input->post('Initial_Dose_Date4')!=""){ $hb_form['Initial_Dose_Date4'] = $this->input->post('Initial_Dose_Date4'); }
if($this->input->post('Initial_Dose4')!=""){ $hb_form['Initial_Dose4'] = $this->input->post('Initial_Dose4'); }
if($this->input->post('Initial_Dose_Site4')!=""){ $hb_form['Initial_Dose_Site4'] = $this->input->post('Initial_Dose_Site4'); }
if($this->input->post('lab_date1')!=""){ $hb_form['lab_date1'] = $this->input->post('lab_date1'); }
if($this->input->post('lab_type1')!=""){ $hb_form['lab_type1'] = $this->input->post('lab_type1'); }
if($this->input->post('lab_result1')!=""){ $hb_form['lab_result1'] = $this->input->post('lab_result1'); }
if($this->input->post('lab_action1')!=""){ $hb_form['lab_action1'] = $this->input->post('lab_action1'); }
if($this->input->post('lab_date2')!=""){ $hb_form['lab_date2'] = $this->input->post('lab_date2'); }
if($this->input->post('lab_type2')!=""){ $hb_form['lab_type2'] = $this->input->post('lab_type2'); }
if($this->input->post('lab_result2')!=""){ $hb_form['lab_result2'] = $this->input->post('lab_result2'); }
if($this->input->post('lab_action2')!=""){ $hb_form['lab_action2'] = $this->input->post('lab_action2'); }
if($this->input->post('lab_date3')!=""){ $hb_form['lab_date3'] = $this->input->post('lab_date3'); }
if($this->input->post('lab_type3')!=""){ $hb_form['lab_type3'] = $this->input->post('lab_type3'); }
if($this->input->post('lab_result3')!=""){ $hb_form['lab_result3'] = $this->input->post('lab_result3'); }
if($this->input->post('lab_action3')!=""){ $hb_form['lab_action3'] = $this->input->post('lab_action3'); }
if($this->input->post('lab_date4')!=""){ $hb_form['lab_date4'] = $this->input->post('lab_date4'); }
if($this->input->post('lab_type4')!=""){ $hb_form['lab_type4'] = $this->input->post('lab_type4'); }
if($this->input->post('lab_result4')!=""){ $hb_form['lab_result4'] = $this->input->post('lab_result4'); }
if($this->input->post('lab_action4')!=""){ $hb_form['lab_action4'] = $this->input->post('lab_action4'); }
//pr($physicalExamFormJson);die;
$hb_form_Json =json_encode($hb_form);
$employementHistory = array();
if($this->input->post('no_job_history')!=""){ $employementHistory['no_job_history'] = $this->input->post('no_job_history'); }
//else{
if($this->input->post('Current_emp_1')!=""){ $employementHistory['Current_emp_1'] = $this->input->post('Current_emp_1'); } else { $employementHistory['Current_emp_1'] = "0"; }
if($this->input->post('name_of_employeer')!=""){ $employementHistory['name_of_employeer'] = $this->input->post('name_of_employeer'); }
if($this->input->post('address_of_employer')!=""){ $employementHistory['address_of_employer'] = $this->input->post('address_of_employer'); }
if($this->input->post('tel_of_employer')!=""){ $employementHistory['tel_of_employer'] = $this->input->post('tel_of_employer'); }
if($this->input->post('work_performance_years')!=""){ $employementHistory['work_performance_years'] = $this->input->post('work_performance_years'); }
if($this->input->post('work_performance_months')!=""){ $employementHistory['work_performance_months'] = $this->input->post('work_performance_months'); }
if($this->input->post('reasonForLeaving')!=""){ $employementHistory['reasonForLeaving'] = $this->input->post('reasonForLeaving'); }
if($this->input->post('Current_emp_2')!=""){ $employementHistory['Current_emp_2'] = $this->input->post('Current_emp_2'); } else { $employementHistory['Current_emp_2'] = "0"; }
if($this->input->post('name_of_employeer1')!=""){ $employementHistory['name_of_employeer1'] = $this->input->post('name_of_employeer1'); }
if($this->input->post('address_of_employer1')!=""){ $employementHistory['address_of_employer1'] = $this->input->post('address_of_employer1'); }
if($this->input->post('tel_of_employer1')!=""){ $employementHistory['tel_of_employer1'] = $this->input->post('tel_of_employer1'); }
if($this->input->post('work_performance_years1')!=""){ $employementHistory['work_performance_years1'] = $this->input->post('work_performance_years1'); }
if($this->input->post('work_performance_months1')!=""){ $employementHistory['work_performance_months1'] = $this->input->post('work_performance_months1'); }
if($this->input->post('reasonForLeaving1')!=""){ $employementHistory['reasonForLeaving1'] = $this->input->post('reasonForLeaving1'); }
//}
if($this->input->post('license_no')!=""){ $employementHistory2['license_no'] = $this->input->post('license_no'); }
if($this->input->post('rn_lic_state')!=""){ $employementHistory2['rn_lic_state'] = $this->input->post('rn_lic_state'); }
if($this->input->post('license_exp_date')!=""){
$employementHistory2['license_exp_date'] = $this->input->post('license_exp_date');
docExpireDate($id,'rn_license',null,$employementHistory2['license_exp_date']);
}
// if(file_exists($_FILES['license_document']['tmp_name'])){
// $uploadData['NEW_FILENAME_START']='LIC';
// $uploadData['NAME']='license_document';
// $output=fileStore($_FILES,$uploadData);
// $employementHistory['license_document']=$output['PATH'].''.$output['NEW_FILE_NAME'];
// }else{
// $employementHistory['license_document']=$this->input->post('pre_license_document');
// }
// if(file_exists($_FILES['malpractice_document']['tmp_name'])){
// $uploadData['NEW_FILENAME_START']='MLP';
// $uploadData['NAME']='malpractice_document';
// $output1=fileStore($_FILES,$uploadData);
// $employementHistory['malpractice_document']=$output1['PATH'].''.$output1['NEW_FILE_NAME'];
// }else{
// $employementHistory['malpractice_document']=$this->input->post('pre_malpractice_document');
// }
if($this->input->post('malpractice_co')!=""){ $employementHistory2['malpractice_co'] = $this->input->post('malpractice_co'); }
if($this->input->post('malpractice_policy_no')!=""){ $employementHistory2['malpractice_policy_no'] = $this->input->post('malpractice_policy_no'); }
if($this->input->post('malpractice_policy_exp_date')!=""){
$employementHistory2['malpractice_policy_exp_date'] = $this->input->post('malpractice_policy_exp_date');
docExpireDate($id,'malpractice_policy',null,$employementHistory2['malpractice_policy_exp_date']);
}
if($this->input->post('license_investigated')!=""){ $employementHistory2['license_investigated'] = $this->input->post('license_investigated'); }
if($this->input->post('malpractice_claim')!=""){ $employementHistory2['malpractice_claim'] = $this->input->post('malpractice_claim'); }
if($this->input->post('license_explanation')!=""){ $employementHistory2['license_explanation'] = $this->input->post('license_explanation'); }
if($this->input->post('malpractice_explanation')!=""){ $employementHistory2['malpractice_explanation'] = $this->input->post('malpractice_explanation'); }
if($this->input->post('pre_work_certificate_no')!=""){ $employementHistory2['pre_work_certificate_no'] = $this->input->post('pre_work_certificate_no'); }
if($this->input->post('pre_work_certificate_state')!=""){ $employementHistory2['pre_work_certificate_state'] = $this->input->post('pre_work_certificate_state'); }
if($this->input->post('last_hha_employed_date')!=""){ $employementHistory2['last_hha_employed_date'] = $this->input->post('last_hha_employed_date'); }
if($this->input->post('last_employed_for')!=""){ $employementHistory2['last_employed_for'] = $this->input->post('last_employed_for'); }
/** UAS CERTIFICATE */
if($this->input->post('uas_certificate')!=""){ $employementHistory2['uas_certificate'] = $this->input->post('uas_certificate'); }
if($this->input->post('uas_certificate_license')!=""){ $employementHistory2['uas_certificate_license'] = $this->input->post('uas_certificate_license'); }
if($this->input->post('nursing_reg_no')!=""){ $employementHistory2['nursing_reg_no'] = $this->input->post('nursing_reg_no'); }
// Certificates
$crt_type=$this->input->post('type');
$crt_status=$this->input->post('certificate_status');
$crt_certificate_number=$this->input->post('certificate_number');
$crt_certificate_exp_date=$this->input->post('certificate_exp_date');
$caregiver_table_id = $this->input->post('id');
$crt_name = $this->input->post('name');
if($this->input->post('type')!=''){
if(count($crt_type) > 0){
for($i=0; $i<count($crt_type);$i++){
$data['type'] = $crt_type[$i];
$data['status'] = $crt_status[$i];
$data['certificate_name'] = $crt_name[$i];
if($crt_status[$i]==1){
$data['certificate_number'] = $crt_certificate_number[$i];
$data['exp_date'] = $crt_certificate_exp_date[$i];
}else{
$data['certificate_number'] = '';
$data['exp_date'] = '';
}
$data['caregiver_table_id'] = $caregiver_table_id;
$this->Caregiver_model->saveCaregivercertificate('caregiver_certificate',$data, $caregiver_table_id,$crt_type[$i]);
}
}
}
$employementHistoryJson = json_encode($employementHistory);
$employementHistoryJson2 = json_encode($employementHistory2);
// pre($employementHistory);die;
$data = array();
if($this->input->post('concent_signature')!=""){ $data['concent_signature'] = $this->input->post('concent_signature'); }
if($this->input->post('concent_date')!=""){ $data['concent_date'] = $this->input->post('concent_date'); }
if($this->input->post('Emergency_Contact_Name')!=""){ $data['Emergency_Contact_Name'] = $this->input->post('Emergency_Contact_Name'); }
if($this->input->post('Emergency_Contact_Relationship')!=""){ $data['Emergency_Contact_Relationship'] = $this->input->post('Emergency_Contact_Relationship'); }
if($this->input->post('Emergency_Contact_Telephone')!=""){ $data['Emergency_Contact_Telephone'] = $this->input->post('Emergency_Contact_Telephone'); }
if($this->input->post('Emergency_Contact_Cellphone')!=""){ $data['Emergency_Contact_Cellphone'] = $this->input->post('Emergency_Contact_Cellphone'); }
if($this->input->post('Emergency_Contact_Other')!=""){ $data['Emergency_Contact_Other'] = $this->input->post('Emergency_Contact_Other'); }
if($this->input->post('Emergency_Contact_Email')!=""){ $data['Emergency_Contact_Email'] = $this->input->post('Emergency_Contact_Email'); }
if($this->input->post('Emergency_Contact_Address')!=""){ $Emergency_Contact['Emergency_Contact_Address'] = $this->input->post('Emergency_Contact_Address'); }
if($this->input->post('Emergency_Contact_zipcode')!=""){ $Emergency_Contact['Emergency_Contact_zipcode'] = $this->input->post('Emergency_Contact_zipcode'); }
if($this->input->post('Emergency_Contact_County')!=""){ $Emergency_Contact['Emergency_Contact_County'] = $this->input->post('Emergency_Contact_County'); }
if($this->input->post('Emergency_Contact_State')!=""){ $Emergency_Contact['Emergency_Contact_State'] = $this->input->post('Emergency_Contact_State'); }
if($this->input->post('Emergency_Contact_City')!=""){ $Emergency_Contact['Emergency_Contact_City'] = $this->input->post('Emergency_Contact_City'); }
if($this->input->post('Emergency_Contact_Lang')!=""){ $Emergency_Contact['Emergency_Contact_Lang'] = $this->input->post('Emergency_Contact_Lang'); }
if($this->input->post('Emergency_Contact_Long')!=""){ $Emergency_Contact['Emergency_Contact_Long'] = $this->input->post('Emergency_Contact_Long'); }
if($this->input->post('Emergency_Contact_Address')!=""){ $data['Emergency_Contact_Address']=json_encode($Emergency_Contact); }
if($this->input->post('Emergency_Contact_Name1')!=""){ $data['Emergency_Contact_Name1'] = $this->input->post('Emergency_Contact_Name1'); }
if($this->input->post('Emergency_Contact_Relationship1')!=""){ $data['Emergency_Contact_Relationship1'] = $this->input->post('Emergency_Contact_Relationship1'); }
if($this->input->post('Emergency_Contact_Telephone1')!=""){ $data['Emergency_Contact_Telephone1'] = $this->input->post('Emergency_Contact_Telephone1'); }
if($this->input->post('Emergency_Contact_Cellphone1')!=""){ $data['Emergency_Contact_Cellphone1'] = $this->input->post('Emergency_Contact_Cellphone1'); }
if($this->input->post('Emergency_Contact_Other1')!=""){ $data['Emergency_Contact_Other1'] = $this->input->post('Emergency_Contact_Other1'); }
if($this->input->post('Emergency_Contact_Email1')!=""){ $data['Emergency_Contact_Email1'] = $this->input->post('Emergency_Contact_Email1'); }
if($this->input->post('Emergency_Contact_Address1')!=""){ $Emergency_Contact1['Emergency_Contact_Address1'] = $this->input->post('Emergency_Contact_Address1'); }
if($this->input->post('Emergency_Contact_zipcode1')!=""){ $Emergency_Contact1['Emergency_Contact_zipcode1'] = $this->input->post('Emergency_Contact_zipcode1'); }
if($this->input->post('Emergency_Contact_County1')!=""){ $Emergency_Contact1['Emergency_Contact_County1'] = $this->input->post('Emergency_Contact_County1'); }
if($this->input->post('Emergency_Contact_State1')!=""){ $Emergency_Contact1['Emergency_Contact_State1'] = $this->input->post('Emergency_Contact_State1'); }
if($this->input->post('Emergency_Contact_City1')!=""){ $Emergency_Contact1['Emergency_Contact_City1'] = $this->input->post('Emergency_Contact_City1'); }
if($this->input->post('Emergency_Contact_Lang1')!=""){ $Emergency_Contact1['Emergency_Contact_Lang1'] = $this->input->post('Emergency_Contact_Lang1'); }
if($this->input->post('Emergency_Contact_Long2')!=""){ $Emergency_Contact1['Emergency_Contact_Long2'] = $this->input->post('Emergency_Contact_Long2'); }
if($this->input->post('Emergency_Contact_Address1')!=""){ $data2['Emergency_Contact_Address1']=json_encode($Emergency_Contact1); }
if($this->input->post('citizen')!=""){ $data['citizen'] = $citizenJson; }
if($this->input->post('preferred_shifts')!=""){ $data['preferred_shifts'] = $this->input->post('preferred_shifts'); }
if($this->input->post('lic_no')!=""){ $data['lic_no'] = $this->input->post('lic_no'); }
if($this->input->post('lic_exp_date')!=""){ $data['lic_exp_date'] = $this->input->post('lic_exp_date'); }
if($this->input->post('lic_state')!=""){ $data['lic_state'] = $this->input->post('lic_state'); }
// if($this->input->post('alien_Authorized')!=""){ $data['alien_Authorized'] = $this->input->post('alien_Authorized'); }
// if($this->input->post('other_reg_number')!=""){ $data['other_reg_number'] = $this->input->post('other_reg_number'); }
// if($this->input->post('uscis')!=""){ $data['uscis'] = $this->input->post('uscis'); }
if($this->input->post('documents_type')!=""){ $data['documents_type'] = $this->input->post('documents_type'); }
if($this->input->post('documents_no')!=""){ $data['documents_no'] = $this->input->post('documents_no'); }
if($this->input->post('doc_state')!=""){
if($this->input->post('documents_type')=="State ID"){
$data['doc_state']=$this->input->post('doc_state');
}else{
$data['doc_state']="";
}
}
if($this->input->post('documents_expire_date')!=""){
$data['documents_expire_date'] = $this->input->post('documents_expire_date');
docExpireDate($id,'CTZ',null,$data['documents_expire_date']);
}
if($this->input->post('documents_type')=="Citizenship Document"){ $data['documents_expire_date']=""; }
if($physicalExamFormJson!="" && $this->input->post('form_status')=="5"){ $data['physical_exam_form'] = $physicalExamFormJson; }
// if($emp_health_assesmentJson!=""){ $data['emp_health_assesment'] = $emp_health_assesmentJson; }
if($drugScreenJson !=""){ $data['drug_screen'] = $drugScreenJson; }
if($physcialAssesmentJson!=""){ $data['physical_assesment'] = $physcialAssesmentJson; }
if($under_careJson!=""){ $data['under_care_physician'] = $under_careJson; }
if($this->input->post('hepatatis_vaccine')!=""){ $data['hepatatis_vaccine'] = $this->input->post('hepatatis_vaccine');}
if($this->input->post('positive_ppd')!=""){ $data['positive_ppd'] = $this->input->post('positive_ppd'); }
if($hb_form_Json!=""){ $data['hb_form'] = $hb_form_Json; }
if($employementHistoryJson!="" && $this->input->post('form_status')=="4"){ $data['employementHistory'] = $employementHistoryJson; }
if($employementHistoryJson2!=""&& $employementHistoryJson2!="[]" && $this->input->post('form_status')=="4"){ $data['employementHistory2'] = $employementHistoryJson2; }
if($this->input->post('position_applied')!=""){ $data['position_applied'] = $this->input->post('position_applied'); }
// _die($_POST);
// echo '<pre>'; print_r($data); die;
//pre($data);die;
// pr($data);die;
if($this->input->post('nursing_license_type')!=""){ $data['nursing_license_type'] = $this->input->post('nursing_license_type'); }
if($this->input->post('school')){
$schoolCount = count($this->input->post('school'));
$school=$this->input->post('school');
for($i = 0; $i<$schoolCount; $i++){
$educationBackground[$i]['school']=$_POST['school'][$i];
$educationBackground[$i]['location_school']=$_POST['location_school'][$i];
$educationBackground[$i]['edu_years']=$_POST['edu_years'][$i];
$educationBackground[$i]['certificate_date']=$_POST['certificate_date'][$i];
$educationBackground[$i]['major_subject']=$_POST['major_subject'][$i];
}
$data['educationBackground'] = json_encode($educationBackground);
}
// _die($data['educationBackground']);
//pr($id);die;
$to_email = $this->input->post('email');
$ion_user_id = $this->input->post('ion_id');
if(!empty($data))
{
$success=$this->Caregiver_model->saveCaregiverStep('caregiver_step2',$data,$id);
if(($this->input->post('uas_certificate')!="") && ($this->input->post('uas_certificate')==0)){$this->sendCertificatemail($to_email,$id,$ion_user_id,'uas-certification');}
};
$data = array();
if($this->input->post('fname')!=""){ $data['fname'] = $this->input->post('fname'); }
if($this->input->post('mid_name')!="" || $this->input->post('mid_name')==""){ $data['mid_name'] = $this->input->post('mid_name'); }
if($this->input->post('lname')!=""){ $data['lname'] = $this->input->post('lname'); }
if($this->input->post('fname')!=""){ $data['fname'] = $this->input->post('fname'); }
if($this->input->post('email')!=""){ $data['email'] = $this->input->post('email'); }
if($this->input->post('qualification_type')!=""){ $data['qualification_type'] = $qualification_type; }
if($this->input->post('address')!=""){ $data['address'] = $this->input->post('address'); }
if($this->input->post('phone')!=""){ $data['phone'] = $this->input->post('phone'); }
if($this->input->post('primary_langualge')!=""){ $data['primary_langualge'] = $primary_language; }
if($this->input->post('gender')!=""){ $data['gender'] = $this->input->post('gender'); }
if($this->input->post('marital_status')!=""){ $data['marital_status'] = $this->input->post('marital_status'); }
if($this->input->post('maiden_name')!=""){ $data['maiden_name'] = $this->input->post('maiden_name'); }
if($this->input->post('dependents')!=""){ $data['dependents'] = $this->input->post('dependents'); }
if($this->input->post('dob')!=""){ $data['dob'] = $this->input->post('dob'); }
if($this->input->post('soc_sec')!=""){ $data['soc_sec'] = $this->input->post('soc_sec'); }
if($this->input->post('ethnicity')!=""){ $data['ethnicity'] = $this->input->post('ethnicity'); }
if($this->input->post('eye_color')!=""){ $data['eye_color'] = $this->input->post('eye_color'); }
if($this->input->post('hair_color')!=""){ $data['hair_color'] = $this->input->post('hair_color'); }
if($this->input->post('address1')!=""){ $data['address1'] = $this->input->post('address1'); }
// if($this->input->post('direction1')!=""){ $data['direction1'] = $this->input->post('direction1'); }
if($this->input->post('state1')!=""){ $data['state1'] = $this->input->post('state1'); }
if($this->input->post('county1')!=""){ $data['county1'] = $this->input->post('county1'); }
if($this->input->post('zipcode1')!=""){ $data['zipcode1'] = $this->input->post('zipcode1'); }
if($this->input->post('apt1')!=""){ $data['apartment1'] = $this->input->post('apt1'); }
if($this->input->post('city1')!=""){ $data['city1'] = $this->input->post('city1'); }
if($this->input->post('submission_date')!=""){ $data['submission_date'] = $this->input->post('submission_date'); }
if($this->input->post('lang1')!=""){ $data['lang1'] = $this->input->post('lang1'); }
if($this->input->post('long1')!=""){ $data['long1'] = $this->input->post('long1'); }
if($this->input->post('other_contact')!=""){ $data['other_contact'] = $this->input->post('other_contact'); }
if($this->input->post('alternative_email')!=""){ $data['alternative_email'] = $this->input->post('alternative_email'); }
if($this->input->post('preferred_contact')!=""){ $data['preferred_contact'] = $this->input->post('preferred_contact'); }
if($this->input->post('availability')!=""){ $data['availability'] = $availability; }
if($this->input->post('availability_borough')!=""){ $data['availability_borough'] = $availability_borough; }
if($this->input->post('availability_time_slot')!=""){ $data['availability_time_slot'] = $this->input->post('availability_time_slot'); }
if($this->input->post('availability_stay')!=""){ $data['availability_stay'] = $this->input->post('availability_stay'); }
if($this->input->post('availability_note')!=""){ $data['availability_note'] = $this->input->post('availability_note'); }
if($this->input->post('referral_source')!=""){ $data['referral_source'] = $this->input->post('referral_source'); }
if($this->input->post('photo')!=""){ $data['photo'] = $this->input->post('photo'); }
if($this->input->post('PCA_Registry_Number')!=""){ $data['PCA_Registry_Number'] = $this->input->post('PCA_Registry_Number'); }
if($this->input->post('NPI_Number')!=""){ $data['NPI_Number'] = $this->input->post('NPI_Number'); }
if($this->input->post('live_with_patient')!=""){ $data['live_with_patient'] = $this->input->post('live_with_patient'); }
if($this->input->post('have_key')!=""){ $data['have_key'] = $this->input->post('have_key'); }
if($this->input->post('Religious_Preferences')!=""){ $data['Religious_Preferences'] = $this->input->post('Religious_Preferences'); }
if($this->input->post('Preffered_Gender')!=""){ $data['Preffered_Gender'] = $this->input->post('Preffered_Gender'); }
if($this->input->post('Notes')!=""){ $data['Notes'] = $this->input->post('Notes'); }
if($this->input->post('ion_user_id')!=""){ $data['ion_user_id'] = $this->input->post('ion_user_id'); }
// _die($data);
$caregiver = $this->Caregiver_model->getNurseById($id);
if($form_status==$caregiver->form_status){ if($this->input->post('form_status')!=""){ $data['form_status'] = $this->input->post('form_status'); } }
if($this->input->post('application_date')!=""){ $data['application_date'] = $this->input->post('application_date'); }
if($this->input->post('submited_for_verification')!=""){ $data['submited_for_verification'] = $this->input->post('submited_for_verification'); }
if($this->input->post('verification_submitted_by')!=""){ $data['verification_submitted_by'] = $this->input->post('verification_submitted_by'); }
if($this->input->post('verification_status')!=""){ $data['verification_status'] = $this->input->post('verification_status'); }
if($this->input->post('verification_date')!=""){ $data['verification_date'] = $this->input->post('verification_date'); }
if($this->input->post('referral_source')!=""){ $data['referral_source'] = $this->input->post('referral_source'); }
if($this->input->post('status')!=""){ $data['status'] = $this->input->post('status'); }
if($this->input->post('created_by')!=""){ $data['created_by'] = $this->input->post('created_by'); }
if($this->input->post('years_of_exp')!=""){ $data['years_of_exp'] = $years_of_exp; }
$caregiverPer = json_decode($caregiver->from_tab_status_pctg);
$empAppPectg = $this->empAppPectg($id,$form_status);
// pre($empAppPectg);
$caregiverPer->{'form'.$form_status} = $empAppPectg;
// pre($caregiverPer);die;
$data['from_tab_status_pctg'] = json_encode($caregiverPer);
// pre($data['from_tab_status_pctg']);die;
//if($this->input->post('from_tab_status_pctg')!=""){ $data['from_tab_status_pctg'] = $this->input->post('from_tab_status_pctg'); }
//pr($form_status."".$data);die;
if(!empty($data))
{
$success=$this->Caregiver_model->saveCaregiverStep('caregiver',$data,$id);
};
$data = array();
if($this->input->post('country_of_birth')!=""){ $data['country_of_birth'] = $this->input->post('country_of_birth'); }
if($this->input->post('height')!=""){ $data['height'] = $this->input->post('height'); }
if($this->input->post('weight')!=""){ $data['weight'] = $this->input->post('weight'); }
if($this->input->post('address2')!=""){ $data['address2'] = $this->input->post('address2'); }
if($this->input->post('direction2')!=""){ $data['direction2'] = $this->input->post('direction2'); }
if($this->input->post('state2')!=""){ $data['state2'] = $this->input->post('state2'); }
if($this->input->post('county2')!=""){ $data['county2'] = $this->input->post('county2'); }
if($this->input->post('zipcode2')!=""){ $data['zipcode2'] = $this->input->post('zipcode2'); }
if($this->input->post('apt2')!=""){ $data['apartment2'] = $this->input->post('apt2'); }
if($this->input->post('city2')!=""){ $data['city2'] = $this->input->post('city2'); }
if($this->input->post('lang2')!=""){ $data['lang2'] = $this->input->post('lang2'); }
if($this->input->post('long2')!=""){ $data['long2'] = $this->input->post('long2'); }
if($this->input->post('phone2')!=""){ $data['phone2'] = $this->input->post('phone2'); }
if($this->input->post('profession')!=""){ $data['profession'] = $this->input->post('profession'); }
if($this->input->post('employee_type')!=""){ $data['employee_type'] = $this->input->post('employee_type'); }
if($this->input->post('pre_employment_skill')!=""){ $data['pre_employment_skill'] = $this->input->post('pre_employment_skill'); }
if($this->input->post('Personal_References_Name')!=""){
$data['Personal_References_Name']=$this->input->post('Personal_References_Name');
}if($this->input->post('Personal_References_Address')!=""){
$data['Personal_References_Address']=$this->input->post('Personal_References_Address');
}if($this->input->post('Personal_References_Telephone')!=""){
$data['Personal_References_Telephone']=$this->input->post('Personal_References_Telephone');
}
if($this->input->post('Profesonal_References_Name')!=""){
$data['Profesonal_References_Name'] = $this->input->post('Profesonal_References_Name');
}if($this->input->post('Profesonal_References_Address')!=""){
$data['Profesonal_References_Address'] = $this->input->post('Profesonal_References_Address');
}if($this->input->post('Profesonal_References_Telephone')!=""){
$data['Profesonal_References_Telephone'] = $this->input->post('Profesonal_References_Telephone');
}
if($this->input->post('additional_professional_references_name')!=""){
$data['additional_professional_references_name'] = $this->input->post('additional_professional_references_name');
}if($this->input->post('additional_professional_references_address')!=""){
$data['additional_professional_references_address'] = $this->input->post('additional_professional_references_address');
}if($this->input->post('additional_professional_references_telephone')!=""){
$data['additional_professional_references_telephone'] = $this->input->post('additional_professional_references_telephone');
}
if($this->input->post('PPD_Quantiferonon')!=""){ $data['PPD_Quantiferonon'] = $this->input->post('PPD_Quantiferonon'); }
if($this->input->post('PPD_Quantiferonon_status')!=""){ $data['PPD_Quantiferonon_status'] = $this->input->post('PPD_Quantiferonon_status'); }
if($this->input->post('CXR')!=""){ $data['CXR'] = $this->input->post('CXR'); }
if($this->input->post('drive_info')!=""){ $data['drive_info'] = $this->input->post('drive_info'); }
if($this->input->post('ny_drive_info')!=""){ $data['ny_drive_info'] = $this->input->post('ny_drive_info'); }
if($this->input->post('Carrier_Name')!=""){ $data['Carrier_Name'] = $this->input->post('Carrier_Name'); }
if($this->input->post('Policy_Number')!=""){ $data['Policy_Number'] = $this->input->post('Policy_Number'); }
if($this->input->post('Expiration_Date')!=""){ $data['Expiration_Date'] = $this->input->post('Expiration_Date'); }
if($this->input->post('Automobile_Policy_Holder_Name')!=""){ $data['Automobile_Policy_Holder_Name'] = $this->input->post('Automobile_Policy_Holder_Name'); }
if($this->input->post('Automobile_Policy_Number')!=""){ $data['Automobile_Policy_Number'] = $this->input->post('Automobile_Policy_Number'); }
if($this->input->post('Automobile_Policy_Expiration_Date')!=""){ $data['Automobile_Policy_Expiration_Date'] = $this->input->post('Automobile_Policy_Expiration_Date'); }
if($this->input->post('CPR_Certification_Expiration_Date')!=""){ $data['CPR_Certification_Expiration_Date'] = $this->input->post('CPR_Certification_Expiration_Date'); }
if($this->input->post('preferancesData'))
{
$prefDat = $this->input->post('preferancesData');
}
if($this->input->post('other_References_Name')){
$otherReferencesCount = count($this->input->post('other_References_Name'));
$this->Caregiver_model->DeleteOtherReferencesByCaregiverId($id);
// $school=$this->input->post('other_References_Name');
for($i = 0; $i<$otherReferencesCount; $i++){
$otherReferences['other_References_Name']=$_POST['other_References_Name'][$i];
$otherReferences['other_References_Address']=$_POST['other_References_Address'][$i];
$otherReferences['other_References_Telephone']=$_POST['other_References_Telephone'][$i];
$this->Caregiver_model->saveOtherReferences($otherReferences,$id);
}
}
if($this->input->post('license_no')){
$licenseCount = count($this->input->post('license_no'));
$this->Caregiver_model->DeleteLicenseDataByCaregiverId($id);
// $school=$this->input->post('other_References_Name');
for($i = 0; $i<$licenseCount; $i++){
$licenseData['license_no']=$_POST['license_no'][$i];
$licenseData['state']=$_POST['rn_lic_state'][$i];
$licenseData['license_exp_date']=$_POST['license_exp_date'][$i];
$this->Caregiver_model->saveLicenseData($licenseData,$id);
}
}
if(!empty($data))
{
$success=$this->Caregiver_model->saveCaregiverStep('caregiver_step3',$data,$id);
};
}
if (empty($id)) {
$this->session->set_flashdata('feedback_error', 'Data Saving Error.');
redirect('CaregiversDashboard');
} else {
// Updating Nurse
if($form_status==1){
$shPref = $this->Caregiver_model->updateShiftPreferances($id, $prefDat);
// _die($shPref);
$this->Caregiver_model->updateNurse($id, $data,$data2,$data3);
$this->Caregiver_model->updateService($id, $service);
//$this->Caregiver_model->updateNurse($id, $data,$data2);
$this->session->set_flashdata('feedback_success', 'Basic Information Updated.');
}else if($form_status==2){
$post = $this->input->post();
if(isset($post['none_demographic'])){
$data2['demographics_exp']='';
}else{
$demographysic_exp=json_encode($post['demo_exp_label']);
$data2['demographics_exp']=$demographysic_exp;
}
//pre($demographysic_exp);die;
// _die($post);
$this->Caregiver_model->updateNurse($id, $data,$data2);
$this->Caregiver_model->caregiversExperience($id, $post);
$this->Caregiver_model->updateService($id, $service);
$this->session->set_flashdata('feedback_success', 'Experience & skills Updated.');
}else if($form_status==3){
$this->Caregiver_model->updateNurse($id,$data,$data2,$data3);
$this->session->set_flashdata('feedback_success', 'Contact Information Updated.');
}
}
// Loading View
redirect($_SERVER['HTTP_REFERER']);
}
#================================================================
#uas-certification Email
public function sendCertificatemail($to_email,$id,$ion_user_id,$type)
{
$Maildata=$this->Caregiver_model->getFromMailLogTable($id,$ion_user_id,$type);
if($Maildata){
// mail and update
foreach($Maildata as $md){
$mainId[]=$md->id;
}
$sendEmail=$this->sendEmail($type,$to_email);
if($sendEmail){
$firstEmailData=$this->Caregiver_model->updateMailLogTable($mainId,$diffTime);
$diffTime=((strtotime($firstEmailData->email_send_date))-(strtotime($Maildata[0]->email_send_date)));
// pre($diffTime);
$futureEmailData=$this->Caregiver_model->updateMailLogTable($mainId,$diffTime);
}
}else{
// mail and insert
$data["caregiver_table_id"]=$id;
$data["ion_user_id"]=$ion_user_id;
$data["type"]=$type;
$data["email_status"]=1;
$data["send_status"]=0;
$sendEmail=$this->sendEmail($type,$to_email);
if($sendEmail){
$firstEmailData=$this->Caregiver_model->insertIntoMailLogTable($data,$emailsendDate);
$emailsendDate=createDateTimeForNextEmails($firstEmailData);
$futureEmailData=$this->Caregiver_model->insertIntoMailLogTable($data,$emailsendDate);
}
}
}
public function sendEmail($type,$to_email)
{
$mailBody = $this->Caregiver_model->getMailBody($type);
$message = html_entity_decode($mailBody->message);
$from = array(
'name' => 'HMS Admin',
'email' => 'moli@sentientgeeks.com'
);
$subject ='UAS Certification';
//$to_email="naransaha02@gmail.com";
$send=send_email($from,$to_email,$subject,$message);
return true;
}
public function createDateTimeForNextEmails($firstEmailData)
{
$startDateTime=$firstEmailData->email_send_date;
$mailBody=$this->Mail_model->getMailBodySettingsByid("1");
$no_email=$mailBody->max_email;
$emailPrefArray=json_decode($mailBody->email_interval,true);
foreach($emailPrefArray as $ep){
$days=$ep['days'];
$hours=$ep['hours'];
$minutes=$ep['minutes'];
$seconds="0";
$time=($days*86400+$hours*3600+$minutes*60+$seconds*1);
$a=(strtotime($startDateTime)+$time);
$date=date("Y-m-d H:i:s",$a);
if($emailsendDate){
$length=count($emailsendDate)-1;
$b=(strtotime($emailsendDate[$length])+$time);
$date=date("Y-m-d H:i:s",$b);
$emailsendDate[]=$date;
}else{
$emailsendDate[]=$date;
}
}
return $emailsendDate;
}
#uas-certification Email
#================================================================
/**** OLD corn job functionality for Mail */
// public function mailSendWithTimeInterval(){
// $caregiverDetails = $this->Caregiver_model->getCaregiverStatus();
// foreach($caregiverDetails as $val){
// $caregiver_id = $val['id'];
// $ion_user_id = $val['ion_user_id'];
// $to_email = $val['email'];
// $submited_for_verification = $val['submited_for_verification'];
// if($val['employementHistory2'] !=''){
// $employementHistory2= json_decode($val['employementHistory2']);
// if (!empty($employementHistory2->uas_certificate)){
// $uas_certificate = $employementHistory2->uas_certificate;
// }
// if(($uas_certificate == 0) && ($submited_for_verification == 'no')){
// $getmailLog = $this->Caregiver_model->getMailLogById($caregiver_id,$ion_user_id,'uas-certification');
// $sendMailDate = date('Y-m-d H:i A', strtotime($getmailLog->email_send_date.'+4 hour'));
// $mailLogId = $getmailLog->id;
// $mail_count = $getmailLog->mail_count + 1;
// $currDate = date('Y-m-d H:i');
// $currUTCdate =date('Y-m-d H:i A', strtotime($currDate.'+4 hour'));
// if(strtotime($sendMailDate)==strtotime($currUTCdate)){
// $mailSend= $this->sendCertificatemail($to_email,$caregiver_id,$ion_user_id,'uas-certification');
// if($mailSend){
// $this->Caregiver_model->updateMailCount($mailLogId, $mail_count);
// }
// }
// }
// }
// $created_on = date('Y-m-d H:i', $val['created_on']);
// $sendMailDate = date('Y-m-d H:i A', strtotime($created_on.'+24 hour'));
// $currDate = date('Y-m-d H:i A');
// if(strtotime($sendMailDate)==strtotime($currDate)){
// $mailSend= $this->sendCertificatemail($to_email,$caregiver_id,$ion_user_id,'pending-application');
// if($mailSend){
// $this->Caregiver_model->updateMailCount($mailLogId, $mail_count);
// }
// }
// }
// }
//***End of OLD corn job functionality for Mail */
// function mergemypdfs()
// {
// $this->load->helper('generatePdf_helper');
// mergePdf();
// }
public function empAppPectg($id,$form_status)
{
$res = $this->Caregiver_model->getNurseById($id);
if($form_status == 1){
if($res->qualification_type==4){
//$total = 30;//Basic Tab RN
$total = 21;//Basic Tab RN
}else if($res->qualification_type==6 || $res->qualification_type==7){
//$total = 28;//Basic Tab HHA PCADD
$total = 20;//Basic Tab HHA PCADD
}else{
$total = 23;//Basic Tab LPN
// $total = 22;//Basic Tab LPN
}
}
elseif($form_status == 2){
$total = 20;//Experience
}
elseif($form_status == 4){
$total = 15;//Emp History
}
elseif($form_status == 5){
$total = 20;//Physical Info
}
// $res = $this->Caregiver_model->getNurseById($id);
// // echo "<pre>"; print_r($res); die;
// foreach ($mandateFields as $value)
// {
// if($res->$value == '')
// {
// // echo $value .':'. $res->$value .'<br>';
// $total = $total;
// }
// }
return ceil($total);
}
public function getTabStatus($id){
$caregiverData=$this->Caregiver_model->getNurseById($id);
$from_tab_status_pctg=json_decode($caregiverData->from_tab_status_pctg);
// pre($caregiverData);
// pre($from_tab_status_pctg);die;
if($caregiverData->concent_date!=""){
$tabstatus['auth']=2;
}else{
$tabstatus['auth']=1;
}
if($tabstatus['auth']==1){
$tabstatus['basic']=0;
}else if($from_tab_status_pctg->form1!=0){
$tabstatus['basic']=2;
}else{
$tabstatus['basic']=1;
}
if($from_tab_status_pctg->form2!=0 && $tabstatus['basic']==2){
$tabstatus['exp']=2;
}else if($tabstatus['basic']==2){
$tabstatus['exp']=1;
}else{
$tabstatus['exp']=0;
}
if($from_tab_status_pctg->form4!=0 && $tabstatus['exp']==2){
$tabstatus['emp']=2;
}else if($tabstatus['exp']==2){
$tabstatus['emp']=1;
}else{
$tabstatus['emp']=0;
}
if($from_tab_status_pctg->form5!=0 && $tabstatus['emp']==2){
$tabstatus['phy']=2;
}else if($tabstatus['emp']==2){
$tabstatus['phy']=1;
}else{
$tabstatus['phy']=0;
}
if($caregiverData->qualification_type==4){
$doc_per=24;
}else if($caregiverData->qualification_type==5){
$doc_per=14;
}else if($caregiverData->qualification_type==6 || $caregiverData->qualification_type==7){
$doc_per=17;
}
//pre($doc_per);
if($from_tab_status_pctg->form11>=$doc_per && $tabstatus['phy']=2){
$tabstatus['doc']=2;
}else if($tabstatus['phy']==2){
$tabstatus['doc']=1;
}else{
$tabstatus['doc']=0;
}
if($from_tab_status_pctg->submited_for_verification=='yes' && $tabstatus['doc']==2){
$tabstatus['dis']=2;
}else if($tabstatus['doc']==2){
$tabstatus['dis']=1;
}else{
$tabstatus['dis']=0;
}
return $tabstatus;
// var_dump($tabstatus);
// _die();
//pre($tabstatus);
}
public function getTabStatus_ajax($id){
$caregiverData=$this->Caregiver_model->getNurseByIonId($id);
$from_tab_status_pctg=json_decode($caregiverData->from_tab_status_pctg);
//pre($caregiverData);
//pre($from_tab_status_pctg);
if($caregiverData->concent_date!=""){
$tabstatus['auth']=2;
}else{
$tabstatus['auth']=1;
}
if($tabstatus['auth']==1){
$tabstatus['basic']=0;
}else if($from_tab_status_pctg->form1!=0){
$tabstatus['basic']=2;
}else{
$tabstatus['basic']=1;
}
if($from_tab_status_pctg->form2!=0 && $tabstatus['basic']==2){
$tabstatus['exp']=2;
}else if($tabstatus['basic']==2){
$tabstatus['exp']=1;
}else{
$tabstatus['exp']=0;
}
if($from_tab_status_pctg->form4!=0 && $tabstatus['exp']==2){
$tabstatus['emp']=2;
}else if($tabstatus['exp']==2){
$tabstatus['emp']=1;
}else{
$tabstatus['emp']=0;
}
if($from_tab_status_pctg->form5!=0 && $tabstatus['emp']==2){
$tabstatus['phy']=2;
}else if($tabstatus['emp']==2){
$tabstatus['phy']=1;
}else{
$tabstatus['phy']=0;
}
if($caregiverData->qualification_type==4){
$doc_per=24;
}else if($caregiverData->qualification_type==5){
$doc_per=14;
}else if($caregiverData->qualification_type==6 || $caregiverData->qualification_type==7){
$doc_per=17;
}
//pre($doc_per);
if($from_tab_status_pctg->form11>=$doc_per && $tabstatus['phy']=2){
$tabstatus['doc']=2;
}else if($tabstatus['phy']==2){
$tabstatus['doc']=1;
}else{
$tabstatus['doc']=0;
}
if($from_tab_status_pctg->submited_for_verification=='yes' && $tabstatus['doc']==2){
$tabstatus['dis']=2;
}else if($tabstatus['doc']==2){
$tabstatus['dis']=1;
}else{
$tabstatus['dis']=0;
}
echo json_encode($tabstatus);
// var_dump($tabstatus);
// _die();
//pre($tabstatus);
}
public function profileOtherInfo(){
// echo '<pre>'; print_r($this->input->post()); echo '</pre>';
// echo '<pre>'; print_r($_FILES); echo '</pre>';die;
$usertype='Caregiver';
$savetime=date ('Y-m-d H:i:s', now());
$data_type=$this->input->post('data_type');
$id=$this->input->post('id');
$Ion_id=$this->input->post('Ion_id');
$form_status=$this->input->post('form_status');
$progress=$this->input->post('progress');
$pre_update_data=$this->Caregiver_model->getNurseByIonId($Ion_id);
if($pre_update_data->form_status->$form_status){ $form_status=$pre_update_data->form_status; }
//pre($data_type);die;
if($data_type=='data_for_varification'){
if($pre_update_data->availability_borough!=""){
$progress=$pre_update_data->progress;
}else{
$progress=$pre_update_data->progress + $progress;
}
$data=array(
'availability_borough'=>$this->input->post('availability_borough'),
'availability_time_slot'=>$this->input->post('availability_time_slot'),
'availability_stay'=>$this->input->post('availability_stay'),
'availability_note'=>$this->input->post('availability_note'),
'referral_source'=>$this->input->post('referral_source'),
'application_date'=>$this->input->post('application_date'),
'PCA_Registry_Number'=>$this->input->post('PCA_Registry_Number'),
'NPI_Number'=>$this->input->post('NPI_Number'),
'progress'=>$progress,
'form_status'=>$form_status,
);
$data3=array(
'profession'=>$this->input->post('profession'),
'employee_type'=>$this->input->post('employee_type'),
'pre_employment_skill'=>$this->input->post('pre_employment_skill')
);
//echo $id;
// echo '<pre>'; print_r($data); echo '</pre>';die;
$this->Caregiver_model->updateNurse($id,$data,$data2,$data3);
$activitydata = array(
'activity_description' =>'Data for Varification Updated.',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
);
echo json_encode($output);
}else if($data_type=='data_reference'){
//pre($pre_update_data);die;
if($pre_update_data->Personal_References_Name!=""){
$process=$pre_update_data->from_tab_status_pctg;
}else{
//$progress=$pre_update_data->progress + $progress;
$caregiverPer = json_decode($pre_update_data->from_tab_status_pctg);
$caregiverPer->form11 = $caregiverPer->form11 + 1;
$process= json_encode($caregiverPer);
}
$data=array(
'from_tab_status_pctg' => $process,
'form_status' => $form_status,
);
//pre($data);die;
$data3=array(
'Personal_References_Name'=>$this->input->post('Personal_References_Name'),
'Personal_References_Address'=>$this->input->post('Personal_References_Address'),
'Personal_References_Telephone'=>$this->input->post('Personal_References_Telephone'),
'Profesonal_References_Name'=>$this->input->post('Profesonal_References_Name'),
'Profesonal_References_Address'=>$this->input->post('Profesonal_References_Address'),
'Profesonal_References_Telephone'=>$this->input->post('Profesonal_References_Telephone'),
);
// echo $id;
//echo '<pre>'; print_r($data); echo '</pre>';die;
$this->Caregiver_model->updateNurse($id,$data,$data2,$data3);
$activitydata = array(
'activity_description' =>'Data for Reference Updated.',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
);
echo json_encode($output);
}else if($data_type=='Malpractice_Insurance_Policy'){
if($pre_update_data->Policy_Number!=""){
$progress=$pre_update_data->progress;
}else{
$progress=$pre_update_data->progress + $progress;
}
$data=array(
'progress'=>$progress,
'form_status'=>$form_status,
);
$data3=array(
'Carrier_Name'=>$this->input->post('Carrier_Name'),
'Policy_Number'=>$this->input->post('Policy_Number'),
'Expiration_Date'=>$this->input->post('Expiration_Date'),
);
// echo $id;
//echo '<pre>'; print_r($data); echo '</pre>';die;
$this->Caregiver_model->updateNurse($id,$data,$data2,$data3);
$activitydata = array(
'activity_description' =>'Data for Malpractice_Insurance_Policy Updated.',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
);
echo json_encode($output);
}else if($data_type=='Automobile_Insurance_Policy'){
if($pre_update_data->Automobile_Policy_Number!=""){
$progress=$pre_update_data->progress;
}else{
$progress=$pre_update_data->progress + $progress;
}
$data=array(
'progress'=>$progress,
'form_status'=>$form_status,
);
$data3=array(
'Automobile_Policy_Holder_Name'=>$this->input->post('Automobile_Policy_Holder_Name'),
'Automobile_Policy_Number'=>$this->input->post('Automobile_Policy_Number'),
'Automobile_Policy_Expiration_Date'=>$this->input->post('Automobile_Policy_Expiration_Date'),
'CPR_Certification_Expiration_Date'=>$this->input->post('CPR_Certification_Expiration_Date'),
);
// echo $id;
//echo '<pre>'; print_r($data); echo '</pre>';die;
$this->Caregiver_model->updateNurse($id,$data,$data2,$data3);
$activitydata = array(
'activity_description' =>'Data for Automobile_Insurance_Policy Updated.',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
);
echo json_encode($output);
}else if($data_type=='Emergency_Contact'){
if($pre_update_data->Emergency_Contact_Name!=""){
$progress=$pre_update_data->progress;
}else{
$progress=$pre_update_data->progress + $progress;
}
$data=array(
'live_with_patient'=>$this->input->post('live_with_patient'),
'have_key'=>$this->input->post('have_key'),
'progress'=>$progress,
'form_status'=>$form_status,
);
$data2=array(
'Emergency_Contact_Name'=>$this->input->post('Emergency_Contact_Name'),
'Emergency_Contact_Relationship'=>$this->input->post('Emergency_Contact_Relationship'),
'Emergency_Contact_Address'=>$this->input->post('Emergency_Contact_Address'),
'Emergency_Contact_Telephone'=>$this->input->post('Emergency_Contact_Telephone'),
'Emergency_Contact_Cellphone'=>$this->input->post('Emergency_Contact_Cellphone'),
'Emergency_Contact_Other'=>$this->input->post('Emergency_Contact_Other'),
'Emergency_Contact_Email'=>$this->input->post('Emergency_Contact_Email'),
);
// echo $id;
//echo '<pre>'; print_r($data); echo '</pre>';die;
$this->Caregiver_model->updateNurse($id,$data,$data2);
$activitydata = array(
'activity_description' =>'Data for Emergency_Contact Updated.',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
);
echo json_encode($output);
}else if($data_type=='Caregiver_Preferences'){
if($pre_update_data->Religious_Preferences!=""){
$progress=$pre_update_data->progress;
}else{
$progress=$pre_update_data->progress + $progress;
}
$data=array(
'Religious_Preferences'=>$this->input->post('Religious_Preferences'),
'Preffered_Gender'=>$this->input->post('Preffered_Gender'),
'Notes'=>$this->input->post('Notes'),
'progress'=>$progress,
'form_status'=>$form_status,
);
// echo $id;
//echo '<pre>'; print_r($data); echo '</pre>';die;
$this->Caregiver_model->updateNurse($id,$data);
$activitydata = array(
'activity_description' =>'Data for Caregiver_Preferences Updated.',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $ionid,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
);
echo json_encode($output);
}else if($data_type=='Additional_Certifications'){
// pre($_POST);die;
$folder_name='USER_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
$uploadto="uploads/Documents/".$folder_name."/";
$doc_type=$this->input->post('doc_type');
$documentId=$this->input->post('doc_id');
if($_FILES[$doc_type]['name'] || $_POST['image']){
if($_POST['image']){
$img = $_POST['image'];
$image_parts = explode(";base64,", $img);
$image_type_aux = explode("image/", $image_parts[0]);
$image_type = $image_type_aux[1];
$image_base64 = base64_decode($image_parts[1]);
$file_name_pieces = uniqid() . '.'.$image_type;
$new_file_name = $doc_type.'_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces;
$file = $uploadto . $new_file_name;
file_put_contents($file, $image_base64);
// pre($file);die;
}
if($_FILES[$doc_type]['name']){
$file_name = $_FILES[$doc_type]['name'];
$file_name_pieces = explode('.', $file_name);
$count=count($file_name_pieces);
$new_file_name = $doc_type.'_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces[$count-1];
$config = array(
'file_name' => $new_file_name,
'upload_path' => "./".$uploadto,
'allowed_types' => "gif|jpg|png|jpeg|pdf",
'overwrite' => False,
'max_size' => "20480000",
//'max_height' => "1768",
//'max_width' => "2024"
);
$this->load->library('Upload', $config);
$this->upload->initialize($config);
if ($this->upload->do_upload($doc_type)) {
$path = $this->upload->data();
//$photo = $path['file_name'];
}
}
if($path['file_name']!="" || $image_base64!=""){
if($path['file_name']!=""){
$data = array(
'ion_user_id' => $Ion_id,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $path['file_name'],
'originalfilename' => $_FILES[$doc_type]['name'],
'documents_type' => $doc_type
);
}else if($image_base64!=""){
$data = array(
'ion_user_id' => $Ion_id,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $new_file_name,
'originalfilename' => $file_name_pieces,
'documents_type' => $doc_type
);
}
//pre($data_type);die;
$check_doc_exsist=$this->Caregiver_model->checkDocumentsExsist($Ion_id,$doc_type);
if($check_doc_exsist==0){
$caregiver_data=$this->Caregiver_model->getNurseByIonId($Ion_id);
$caregiverPer = json_decode($caregiver_data->from_tab_status_pctg);
$caregiverPer->form11 = $caregiverPer->form11 + 1;
$process= json_encode($caregiverPer);
$caregiverUpdate=array(
'from_tab_status_pctg' => $process,
'form_status' => $form_status,
);
//pre($caregiverUpdate);die;
$this->Caregiver_model->updateNurse($id,$caregiverUpdate);
}
//die;
$this->Caregiver_model->deleteNursePreDocuments($documentId);
$documentId = $this->Caregiver_model->addNurseDocuments($data);
if($path['file_name']!=""){
$data2 = array(
'path' => $uploadto,
'file_name' => $path['file_name'],
'originalfilename' => $_FILES[$doc_type]['name'],
'documents_type' => $doc_type ,
'users_documents_id' => $documentId
);
}else if($image_base64!=""){
$data2 = array(
'path' => $uploadto,
'file_name' => $new_file_name,
'originalfilename' => $file_name_pieces,
'documents_type' => $doc_type ,
'users_documents_id' => $documentId
);
}
$license_no=$this->input->post('Additional_Certifications_Number');
$license_id = $this->input->post('Additional_Certifications_id');
$this->Caregiver_model->updateLicenseDocuments($data2,$id,$license_id);
if($path['file_name']!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $path['file_name'],
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}else if($image_base64!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $new_file_name,
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}
$this->Home_model->activity_log($activitydata);
}
}
// $remarks=$this->input->post('Name_Additional_Certifications');
$remarks= 'license';
$documents_no=$this->input->post('Additional_Certifications_Number');
$nameState=$this->input->post('Name_Additional_Certifications_state');
$data = array(
'remarks' => $remarks,
'documents_no' => $documents_no,
'state' => $nameState
);
$this->Caregiver_model->updateNurseDocuments($data,$documentId);
$activitydata = array(
'activity_description' => $doc_type .' Documents Name Update',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
'file_url'=>$uploadto.$path['file_name'],
);
echo json_encode($output);
}else if($data_type=='Other_Reference'){
// pre($data_type);die;
$folder_name='USER_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
$uploadto="uploads/Documents/".$folder_name."/";
$doc_type=$this->input->post('doc_type');
$documentId=$this->input->post('doc_id');
if($_FILES[$doc_type]['name'] || $_POST['image']){
if($_POST['image']){
$img = $_POST['image'];
$image_parts = explode(";base64,", $img);
$image_type_aux = explode("image/", $image_parts[0]);
$image_type = $image_type_aux[1];
$image_base64 = base64_decode($image_parts[1]);
$file_name_pieces = uniqid() . '.'.$image_type;
$new_file_name = $doc_type.'_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces;
$file = $uploadto . $new_file_name;
file_put_contents($file, $image_base64);
// pre($file);die;
}
if($_FILES[$doc_type]['name']){
$file_name = $_FILES[$doc_type]['name'];
$file_name_pieces = explode('.', $file_name);
$count=count($file_name_pieces);
$new_file_name = $doc_type.'_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces[$count-1];
$config = array(
'file_name' => $new_file_name,
'upload_path' => "./".$uploadto,
'allowed_types' => "gif|jpg|png|jpeg|pdf",
'overwrite' => False,
'max_size' => "20480000",
//'max_height' => "1768",
//'max_width' => "2024"
);
$this->load->library('Upload', $config);
$this->upload->initialize($config);
if ($this->upload->do_upload($doc_type)) {
$path = $this->upload->data();
//$photo = $path['file_name'];
}
}
if($path['file_name']!="" || $image_base64!=""){
if($path['file_name']!=""){
$data = array(
'ion_user_id' => $Ion_id,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $path['file_name'],
'originalfilename' => $_FILES[$doc_type]['name'],
'documents_type' => $doc_type
);
}else if($image_base64!=""){
$data = array(
'ion_user_id' => $Ion_id,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $new_file_name,
'originalfilename' => $file_name_pieces,
'documents_type' => $doc_type
);
}
//pre($data_type);die;
$check_doc_exsist=$this->Caregiver_model->checkDocumentsExsist($Ion_id,$doc_type);
if($check_doc_exsist==0){
$caregiver_data=$this->Caregiver_model->getNurseByIonId($Ion_id);
$caregiverPer = json_decode($caregiver_data->from_tab_status_pctg);
$caregiverPer->form11 = $caregiverPer->form11;
$process= json_encode($caregiverPer);
$caregiverUpdate=array(
'from_tab_status_pctg' => $process,
'form_status' => $form_status,
);
//pre($caregiverUpdate);die;
$this->Caregiver_model->updateNurse($id,$caregiverUpdate);
}
//die;
$this->Caregiver_model->deleteNursePreDocuments($documentId);
$documentId = $this->Caregiver_model->addNurseDocuments($data);
if($path['file_name']!=""){
$data2 = array(
'path' => $uploadto,
'file_name' => $path['file_name'],
'originalfilename' => $_FILES[$doc_type]['name'],
'documents_type' => $doc_type ,
'users_documents_id' => $documentId
);
}else if($image_base64!=""){
$data2 = array(
'path' => $uploadto,
'file_name' => $new_file_name,
'originalfilename' => $file_name_pieces,
'documents_type' => $doc_type ,
'users_documents_id' => $documentId
);
}
$other_reference_id=$this->input->post('other_reference_id');
$this->Caregiver_model->updateOtherReferenceDocuments($data2,$id,$other_reference_id);
if($path['file_name']!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $path['file_name'],
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}else if($image_base64!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $new_file_name,
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}
$this->Home_model->activity_log($activitydata);
}
}
// $remarks=$this->input->post('Name_Additional_Certifications');
$remarks= 'other_reference';
$data = array(
'remarks' => $remarks,
);
$this->Caregiver_model->updateNurseDocuments($data,$documentId);
$activitydata = array(
'activity_description' => $doc_type .' Documents Name Update',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
'file_url'=>$uploadto.$path['file_name'],
);
echo json_encode($output);
}else if($data_type=='Education_Certifications'){
// pre($data_type);die;
$folder_name='USER_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
$uploadto="uploads/Documents/".$folder_name."/";
$doc_type=$this->input->post('doc_type');
$documentId=$this->input->post('doc_id');
if($_FILES[$doc_type]['name'] || $_POST['image']){
if($_POST['image']){
$img = $_POST['image'];
$image_parts = explode(";base64,", $img);
$image_type_aux = explode("image/", $image_parts[0]);
$image_type = $image_type_aux[1];
$image_base64 = base64_decode($image_parts[1]);
$file_name_pieces = uniqid() . '.'.$image_type;
$new_file_name = $doc_type.'_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces;
$file = $uploadto . $new_file_name;
file_put_contents($file, $image_base64);
// pre($file);die;
}
if($_FILES[$doc_type]['name']){
$file_name = $_FILES[$doc_type]['name'];
$file_name_pieces = explode('.', $file_name);
$count=count($file_name_pieces);
$new_file_name = $doc_type.'_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces[$count-1];
$config = array(
'file_name' => $new_file_name,
'upload_path' => "./".$uploadto,
'allowed_types' => "gif|jpg|png|jpeg|pdf",
'overwrite' => False,
'max_size' => "20480000",
//'max_height' => "1768",
//'max_width' => "2024"
);
$this->load->library('Upload', $config);
$this->upload->initialize($config);
if ($this->upload->do_upload($doc_type)) {
$path = $this->upload->data();
//$photo = $path['file_name'];
}
}
if($path['file_name']!="" || $image_base64!=""){
if($path['file_name']!=""){
$data = array(
'ion_user_id' => $Ion_id,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $path['file_name'],
'originalfilename' => $_FILES[$doc_type]['name'],
'documents_type' => $doc_type
);
}else if($image_base64!=""){
$data = array(
'ion_user_id' => $Ion_id,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $new_file_name,
'originalfilename' => $file_name_pieces,
'documents_type' => $doc_type
);
}
//pre($data_type);die;
$check_doc_exsist=$this->Caregiver_model->checkDocumentsExsist($Ion_id,$doc_type);
if($check_doc_exsist==0){
$caregiver_data=$this->Caregiver_model->getNurseByIonId($Ion_id);
$caregiverPer = json_decode($caregiver_data->from_tab_status_pctg);
$caregiverPer->form11 = $caregiverPer->form11;
$process= json_encode($caregiverPer);
$caregiverUpdate=array(
'from_tab_status_pctg' => $process,
'form_status' => $form_status,
);
//pre($caregiverUpdate);die;
$this->Caregiver_model->updateNurse($id,$caregiverUpdate);
}
//die;
$this->Caregiver_model->deleteNursePreDocuments($documentId);
$documentId = $this->Caregiver_model->addNurseDocuments($data);
if($path['file_name']!=""){
$data2 = array(
'path' => $uploadto,
'file_name' => $path['file_name'],
'originalfilename' => $_FILES[$doc_type]['name'],
'type' => $doc_type ,
'users_documents_id' => $documentId
);
}else if($image_base64!=""){
$data2 = array(
'path' => $uploadto,
'file_name' => $new_file_name,
'originalfilename' => $file_name_pieces,
'type' => $doc_type ,
'users_documents_id' => $documentId
);
}
$certficateID=$this->input->post('certficateID');
$this->Caregiver_model->updateCertificateDocuments($data2,$id,$certficateID);
if($path['file_name']!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $path['file_name'],
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}else if($image_base64!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $new_file_name,
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}
$this->Home_model->activity_log($activitydata);
}
}
// $remarks=$this->input->post('Name_Additional_Certifications');
$remarks= 'certificate';
$data = array(
'remarks' => $remarks
);
$this->Caregiver_model->updateNurseDocuments($data,$documentId);
$activitydata = array(
'activity_description' => $doc_type .' Documents Name Update',
'request_data' => serialize($_REQUEST),
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
$this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
'file_url'=>$uploadto.$path['file_name'],
);
echo json_encode($output);
}
else{
$output=array(
'upload'=>'failed',
'msg'=>'Update Failed',
);
echo json_encode($output);
}
//echo '<pre>'; print_r($data); echo '</pre>';
}
function formPrint($id){
// $id = 11;
$data['nurse'] = $this->Caregiver_model->getNurseById($id);
//pr($data);die;
$this->load->view('caregivers/rnLpnForm',$data); // just the header file
}
public function send_for_approval(){
$ionid=$this->input->post('ion_id');
/*---------------------------Signature section---------------------------------*/
$data = array();
$data['document_details'] = $this->input->post("documentType");
$data['caregiver_id'] = $this->input->post("id");
$data['signature'] = $this->input->post("signature");
$data['signature_date'] = $this->input->post("date");
if(!isset($_POST['signature_type']))
{
$data['signature_type'] = 'draw';
}
else
{
$data['signature_type'] =$this->input->post("signature_type");
}
$this->CaregiverDashboard_model->saveDislosureSignature($data);
/*---------------------------Signature section---------------------------------*/
$verification_submitted_by=$this->session->userdata('user_id');
$savetime=date ('Y-m-d H:i:s', now());
$caregiverData=$this->Caregiver_model->getNurseByIonId($ionid);
//if($caregiverData->progress >=100){
$data=array(
'submited_for_verification'=>'yes',
'submission_date'=>$savetime,
'verification_submitted_by'=>$verification_submitted_by
);
//echo '<pre>'; print_r($data); echo '</pre>';die;
$this->Caregiver_model->updateNurse($caregiverData->caregiver_table_id,$data);
$name=$caregiverData->fname." ".$caregiverData->lname;
$from = array(
'name' => 'HMS Admin',
'email' => 'admin@hms.com'
);
$subject ='Successfully send for approval';
$emaildata['emaildata'] = array(
'name' =>$name
);
$to = $caregiverData->email;
$message= $this->load->view('email_template_management/cararegiver_send_approval',$emaildata,TRUE);
send_email($from,$to,$subject,$message);
//}
if($ionid == $verification_submitted_by){
redirect('CaregiversDashboard');
}else{
redirect('caregivers/pendingAcceptance');
}
//echo '<pre>'; print_r($caregiverData); echo '</pre>';die;
}
function getNurse() {
$requestData = $_REQUEST;
$start = $requestData['start'];
$limit = $requestData['length'];
$search = $this->input->post('search')['value'];
// if ($limit == -1) {
// if (!empty($search)) {
// $data['users'] = $this->Coordinators_model->getCoordinatorBysearch($search);
// } else {
// $data['users'] = $this->Coordinators_model->getCoordinator();
// }
// } else {
// if (!empty($search)) {
// $data['users'] = $this->Coordinators_model->getCoordinatorByLimitBySearch($limit, $start, $search);
// } else {
// $data['users'] = $this->Coordinators_model->getCoordinatorByLimit($limit, $start);
// }
// }
$data['caregiver'] = $this->Caregiver_model->getNurse();
foreach ($data['caregiver'] as $caregiver) {
if ($this->ion_auth->in_group(array('admin'))) {
$options1 = '<a class="btn btn-info btn-xs btn_width" title="' . lang('Edit') . '" href="caregivers/addNewView?id='.$caregiver->id.'"><i class="fa fa-edit"> </i> ' . lang('edit') . '</a>';
}
if ($this->ion_auth->in_group(array('admin'))) {
$options2 = '<a class="btn btn-info btn-xs btn_width" title="' . lang('Verify') . '" href="coordinators/editCoordinator?id='.$caregiver->id.'"><i class="fa fa-edit"> </i> ' . lang('Verify') . '</a>';
}
if ($this->ion_auth->in_group(array('admin'))) {
$options3 = '<a class="btn btn-info btn-xs btn_width" title="' . lang('Medical/Physical') . '" href="coordinators/editCoordinator?id='.$caregiver->id.'"><i class="fa fa-edit"> </i> ' . lang('Medical/Physical') . '</a>';
}
if ($this->ion_auth->in_group(array('admin'))) {
$options4 = '<a class="btn btn-info btn-xs btn_width" title="' . lang('Pre Employment Info') . '" href="coordinators/editCoordinator?id='.$caregiver->id.'"><i class="fa fa-edit"> </i> ' . lang('Pre Employment Info') . '</a>';
}
if ($this->ion_auth->in_group(array('admin'))) {
$options5 = '<a class="btn btn-info btn-xs btn_width" title="' . lang('Employment Info') . '" href="coordinators/editCoordinator?id='.$caregiver->id.'"><i class="fa fa-edit"> </i> ' . lang('Employment Info') . '</a>';
}
if ($this->ion_auth->in_group(array('admin'))) {
$options6 = '<a class="btn btn-info btn-xs btn_width" title="' . lang('Pre Employment Verify') . '" href="coordinators/editCoordinator?id='.$caregiver->id.'"><i class="fa fa-edit"> </i> ' . lang('Pre Employment Verify') . '</a>';
}
// if ($this->ion_auth->in_group(array('admin'))) {
// $options10 = '<a class="btn btn-info btn-xs btn_width detailsbutton inffo" title="permission" href="coordinators/addNewPermissionView?id=' . $caregiver->id . '" onclick="return confirm(\'Are you sure you want to manage permission?\');"><i class="fas fa-tasks"></i> Manage Permission</a>';
// }
if($caregiver->form_status=="1")
$status='<span class="badge badge-secondary">Basic Info</span>';
if($caregiver->form_status=="2")
$status='<span class="badge badge-secondary">Contact Info</span>';
if($caregiver->form_status=="3")
$status='<span class="badge badge-secondary">Data Added</span>';
$info[] = array(
$caregiver->id,
$caregiver->fname.' ' .$caregiver->lname,
$caregiver->email,
$caregiver->phone,
$caregiver->zipcode1,
$status,
$options1.' '.$options2.' '.$options3.' '.$options4.' '.$options5.' '.$options6,
);
}
if (!empty($data['caregiver'])) {
$output = array(
"draw" => intval($requestData['draw']),
"recordsTotal" => $this->db->get('caregiver')->num_rows(),
"recordsFiltered" => $this->db->get('caregiver')->num_rows(),
"data" => $info
);
} else {
$output = array(
// "draw" => 1,
"recordsTotal" => 0,
"recordsFiltered" => 0,
"data" => []
);
}
echo json_encode($output);
}
function editNurse() {
$data = array();
$id = $this->input->get('id');
$data['nurse'] = $this->nurse_model->getNurseById($id);
$this->load->view('home/dashboard'); // just the header file
$this->load->view('add_new', $data);
$this->load->view('home/footer'); // just the footer file
}
function editNurseByJason() {
$id = $this->input->get('id');
$data['nurse'] = $this->nurse_model->getNurseById($id);
echo json_encode($data);
}
function delete() {
$data = array();
$id = $this->input->get('id');
$user_data = $this->db->get_where('nurse', array('id' => $id))->row();
$path = $user_data->img_url;
if (!empty($path)) {
unlink($path);
}
$ion_user_id = $user_data->ion_user_id;
$this->db->where('id', $ion_user_id);
$this->db->delete('users');
$this->nurse_model->delete($id);
$this->session->set_flashdata('feedback', 'Deleted');
redirect('nurse');
}
function caregiverEventDetails()
{
$id = $this->input->get('id');
$caregiverSchedule=$this->Caregiver_model->getCaregiverEventSchedule($id);
// $caregiverSchedule=$this->Caregiver_model->getCaregiverEventSchedule(394);
// pre($caregiverSchedule);die();
foreach($caregiverSchedule as $schedule)
{
$sed[]=$schedule;
}
echo json_encode($sed,true);
}
function PreviuosSchedule(){
$id = $this->session->userdata('user_id');
$data['nurse']=$this->Caregiver_model->getNurseByIonId($id);
$data['cgSchedule']=$this->Caregiver_model->getPreviousCaregiverPatientSchedule($data['nurse']->id);
$data['page_title']='Previous Schedule';
foreach($data['cgSchedule'] as $cgSch)
{
$sch_id=$cgSch->scheduleId;
$data['clockInOut_info'][]=$this->CaregiverDashboard_model->getClockInOutInfo($sch_id);
}
// pre($data);die;
$this->load->view('home/dashboard',$data); // just the header file
$this->load->view('myschedule',$data);
$this->load->view('home/footer',$data);
}
function UpcomingSchedule(){
$id = $this->session->userdata('user_id');
$data['nurse']=$this->Caregiver_model->getNurseByIonId($id);
$data['cgSchedule']=$this->Caregiver_model->getUpcommingCaregiverPatientSchedule($data['nurse']->id);
foreach($data['cgSchedule'] as $cgSch)
{
$sch_id=$cgSch->scheduleId;
$data['clockInOut_info'][]=$this->CaregiverDashboard_model->getClockInOutInfo($sch_id);
}
$data['page_title']='Upcoming Schedule';
// pre($data);die;
$this->load->view('home/dashboard',$data); // just the header file
$this->load->view('myschedule',$data);
$this->load->view('home/footer',$data);
}
public function updateAcceptence()
{
$data=$this->input->post();
//echo '<pre>'; print_r($data); echo '</pre>';die;
$id=$data['scheduleId'];
unset($data['scheduleId']);
unset($data['submit']);
if($data['acceptance_status']=='Accepted'){
unset($data['rejection_reason']);
$success=$this->CaregiverDashboard_model->updateAcceptance($data,$id);
if($success){
$this->session->set_flashdata('UpdateAlert', 'You have '.$data['acceptance_status'].' the schesule');
}
}else if($data['rejection_reason']!=""){
$success=$this->CaregiverDashboard_model->updateAcceptance($data,$id);
if($success){
$this->session->set_flashdata('UpdateAlert', 'You have '.$data['acceptance_status'].' the schesule');
}
}else{
$this->session->set_flashdata('UpdateFail', 'Please enter reason for declined.');
}
// echo $this->db->last_query();
// $this->load->helper('NotificationUpdate_helper');
// NotificationUpdate("sdf","sdfsd");
redirect($_SERVER['HTTP_REFERER']);
//redirect('CaregiversDashboard/mySchedule');
}
public function viewPatient()
{
$id = $this->session->userdata('user_id');
$data['nurse']=$this->Caregiver_model->getNurseByIonId($id);
$caregiver_id=$data['nurse']->id;
$data['patient']=$this->CaregiverDashboard_model->getPatientByCaregiverId($caregiver_id);
// pre($data['patient']);die();
$this->load->view('home/dashboard',$data); // just the header file
$this->load->view('patient_details',$data);
$this->load->view('home/footer',$data);
}
public function patientView()
{
$pid =$_GET['id'];
$data['pid']=$_GET['id'];
$allData = $this->Referral_model->getWherevalue($pid)[0];
$data['datas'] = $allData;
$insdata = $this->Referral_model->getWherevalueInsInfo($pid)[0];
$data['idata'] = $insdata;
$data['serviceActivityTherapy'] = servicetherapy($allData->level_of_service);
$data['lvlService'] = $this->Referral_model->getLevelService();
$data['accessType'] = $this->Referral_model->getAccessType();
$data['patientList'] = $this->Referral_model->patientLists();
$data['relationList'] = $this->Referral_model->relationLists();
$data['mdorders'] = $this->Referral_model->getMdOrdersByPatientId($pid);
$skl = $this->cg_skill->getWherevalue($data['datas']->level_of_service)[0];
$data['datas']->level_of_service_name=$skl->name;
if($data['datas']->service_type_required == 'Service')
{
// _die($data['datas']->service_ids);
$stn = $this->Referral_model->getServiceNameByID($data['datas']->service_ids);
$data['datas']->serviceTherapyName=$stn->name;
}
else{
$stn = $this->Referral_model->getTherapyNameByID($data['datas']->therapy_ids);
$data['datas']->serviceTherapyName=$stn->name;
}
$data['datas']->service_or_therapy_name = $stn;
$type_access_arr = explode(',', $data['datas']->type_access);
$taa = array();
foreach ($type_access_arr as $value)
{
$ta = $this->Referral_model->getAccessNameByID($value)->name;
$taa[] = $ta;
}
$data['datas']->type_access_names= implode(',', $taa);
$allDataIns = $this->Referral_model->getWherevalueInsInfo($pid)[0];
$data['dataIns'] = $allDataIns;
$pdocsTRACH = $this->Referral_model->getPatientDoc($pid,'TRACH');
$data['TRACHdocs'] = $pdocsTRACH;
$pdocsPAGD = $this->Referral_model->getPatientDoc($pid,'PAGD');
$data['PAGDdocs'] = $pdocsPAGD;
$pdocsINSD = $this->Referral_model->getPatientDoc($pid,'INSD');
$data['INSDdocs'] = $pdocsINSD;
/*assessment*/
$data['asmData'] = $this->Referral_model->getWhereAssessment($pid);
/*assessment end*/
// pre($data['dataIns']);die();
$this->load->view('home/dashboard'); // just the header file
$this->load->view('patientView',$data);
$this->load->view('home/footer');
}
function checkEmergencyAddress(){
$response=address_info($_GET['address'],$_GET['zipcode']);
echo json_encode($response);
}
function deleteDocument(){
$id = $this->input->get('id');
$success=$this->Caregiver_model->updateCaregiverDoc($id);
if($success){
$this->session->set_flashdata('UpdateAlert', 'Deleted Successfully');
}else{
$this->session->set_flashdata('UpdateFail', 'Error! Not Possible to delete.');
}
}
function getExperienceDetails(){
$caregiver_type=$this->input->get('caregiver_type');
$caregiverId=$this->input->get('CargiverId');
$YearExperience=$this->input->get('YearExperience');
if($YearExperience>3){
$lvlThree='';
}else{
$lvlThree='disabled';
}
if($YearExperience<1){
$lvlZero='disabled';
}else{
$lvlZero='';
}
$exprience_head=$this->Caregiver_model->getServiceHeadByType($caregiver_type); //fetch priority base all heading topics
$caregiver_experience=$this->Caregiver_model->get_caregiver_experience($caregiverId); //fetch all saved experience list
foreach($caregiver_experience as $exp){
$exp_arr['experience_value'][$exp->experience_id]=$exp->experience_value;
$group[] = $exp->group_id;
}
foreach($exp_arr['experience_value'] as $key=>$val){
$cg_exp_arr[]=$key;
}
$output='';
$output2='';
foreach($exprience_head as $exp_head){
$experience_level=$this->Caregiver_model->getExperienceByHeadId($caregiver_type,$exp_head->service_head_id);
if($exp_head->service_head_id==6 && $caregiver_type==4){
$check_required_class='PULMONARY';
$required_lvl_class='required-field';
}else if($exp_head->service_head_id==19 && $caregiver_type==4){
$check_required_class='WOUND';
$required_lvl_class='required-field';
}else if($exp_head->service_head_id==22 && $caregiver_type==4){
$check_required_class='IVTHERAPY';
$required_lvl_class='required-field';
}else if($exp_head->service_head_id==16 && $caregiver_type==4){
$check_required_class='GASTROINTESTINAL';
$required_lvl_class='required-field';
}else if($exp_head->service_head_id==70){
$check_required_class='HOMEHEALTHCARE';
$required_lvl_class='required-field';
}else if($exp_head->service_head_id==29 && $caregiver_type==4){
$check_required_class='Hospice';
$required_lvl_class='required-field';
}else if($exp_head->service_head_id==27 && $caregiver_type==4){
$check_required_class='Pediatrics';
$required_lvl_class='required-field';
}else if($exp_head->service_head_id==30 && $caregiver_type==4){
$check_required_class='Medications';
$required_lvl_class='required-field';
}else if($exp_head->service_head_id==12 && $caregiver_type==4){
$check_required_class='CARDIOVASCULAR';
$required_lvl_class='required-field';
}else{
$check_required_class='';
$required_lvl_class='';
}
if(!in_array($exp_head->service_head_id,$group)){
$head_check='checked';
$style='style="display:none;"';
$style1='';
}else{
$head_check='';
$style='';
$style1='style="display:none;"';
}
if($required_lvl_class!='')
{
$output.='<div class="col-md-8 skill-row" style="border: 0.5px solid lavender;">';
$output.='<h5 class="'.$required_lvl_class.'" ><strong>'.ucwords(($exp_head->service_head_name)).'</strong><label class="pull-right open_close_btn" for="NoneExp_'.$exp_head->service_head_id.'" > <i class="la la-angle-down"></i> </label></h5>';
$output.='<div class="chkTxt">';
$output.='<div class="form-group col-md-12">';
$output.='<input style="display:none;" type="checkbox" class="exp_label_'.$exp_head->service_head_id.'" id="NoneExp_'.$exp_head->service_head_id.'" onclick="checkNone('.$exp_head->service_head_id.');" '.$head_check.'>';
$output.='</div>';
foreach ($experience_level as $expLbl){
if(in_array($expLbl->id, $cg_exp_arr)){
$exp_check="checked";
$required='value';
}else{
$exp_check="";
$required='none';
}
$output.='<div class="form-group col-md-12 nonExp_All NoneExp_'.$exp_head->service_head_id.'" '.$style.'>';
$output.='<label class="expLblName" for="experience_id_'.$expLbl->id.'">'.ucwords($expLbl->service_name).'</label>';
$output.='<div class="pull-right">';
if(isset($exp_arr['experience_value'][$expLbl->id]) && $exp_arr['experience_value'][$expLbl->id]==1){
$check_value="checked";
}else{
$check_value="";
}
$output.='<div class="form-check form-check-inline">';
$output.='<input class="form-check-input toggle_check '.$check_required_class.'" type="radio" name="exp_label['.$expLbl->id.']" id="exp_label_'.$expLbl->id.'_1" value="1" '.$check_value.' '.$lvlZero.'>';
$output.='<label class="form-check-label " for="exp_label_'.$expLbl->id.'_1">1</label>';
$output.='</div>';
if(isset($exp_arr['experience_value'][$expLbl->id]) && $exp_arr['experience_value'][$expLbl->id]==2){
$check_value="checked";
}else{
$check_value="";
}
$output.='<div class="form-check form-check-inline">';
$output.='<input class="form-check-input toggle_check '.$check_required_class.'" type="radio" name="exp_label['.$expLbl->id.']" id="exp_label_'.$expLbl->id.'_2" value="2" '.$check_value.' '.$lvlZero.'>';
$output.='<label class="form-check-label" for="exp_label_'.$expLbl->id.'_2">2</label>';
$output.='</div>';
if(isset($exp_arr['experience_value'][$expLbl->id]) && $exp_arr['experience_value'][$expLbl->id]==3){
$check_value="checked";
}else{
$check_value="";
}
$output.='<div class="form-check form-check-inline">';
$output.='<input class="form-check-input toggle_check '.$check_required_class.'" type="radio" name="exp_label['.$expLbl->id.']" id="exp_label_'.$expLbl->id.'_3" value="3" '.$check_value.' '.$lvlThree.'>';
$output.='<label class="form-check-label" for="exp_label_'.$expLbl->id.'_3">3</label>';
$output.='</div>';
$output.='<!--div class="form-check form-check-inline clear_check" for="exp_label['.$expLbl->id.']" style="height: 20px;width: 20px;border: 1px solid lavender;text-align: center;cursor: pointer;"><i class="fa fa-trash" aria-hidden="true"></i></div!-->';
$output.='</div>';
$output.='</div>';
}
$output.='<label class="pull-right open_close_btn close_btn nonExp_All NoneExp_'.$exp_head->service_head_id.'" for="NoneExp_'.$exp_head->service_head_id.'" '.$style.'> Close </label>';
$output.='</div>';
$output.='</div>';
}
else
{
$output2.='<div class="col-md-8 skill-row" style="border: 0.5px solid lavender;">';
$output2.='<h5 class=" '.$required_lvl_class.'" ><strong>'.ucwords(($exp_head->service_head_name)).'</strong><label class="pull-right open_close_btn" for="NoneExp_'.$exp_head->service_head_id.'" > <i class="la la-angle-down"></i></label></h5>';
$output2.='<div class="chkTxt">';
$output2.='<div class="form-group col-md-12">';
$output2.='<input style="display:none;" type="checkbox" class="exp_label_'.$exp_head->service_head_id.'" id="NoneExp_'.$exp_head->service_head_id.'" onclick="checkNone('.$exp_head->service_head_id.');" '.$head_check.'>';
$output2.='</div>';
foreach($experience_level as $expLbl){
if(in_array($expLbl->id, $cg_exp_arr)){
$exp_check="checked";
$required='value';
}else{
$exp_check="";
$required='none';
}
$output2.='<div class="form-group col-md-12 nonExp_All NoneExp_'.$exp_head->service_head_id.'" '.$style.'>';
$output2.='<label class="expLblName" for="experience_id_'.$expLbl->id.'">'.ucwords($expLbl->service_name).'</label>';
$output2.='<div class="pull-right">';
if(isset($exp_arr['experience_value'][$expLbl->id]) && $exp_arr['experience_value'][$expLbl->id]==1){
$check_value="checked";
}else{
$check_value="";
}
$output2.='<div class="form-check form-check-inline">';
$output2.='<input class="form-check-input toggle_check '.$check_required_class.'" type="radio" name="exp_label['.$expLbl->id.']" id="exp_label_'.$expLbl->id.'_1" value="1" '.$check_value.' '.$lvlZero.'>';
$output2.='<label class="form-check-label" for="exp_label_'.$expLbl->id.'_1">1</label>';
$output2.='</div>';
if(isset($exp_arr['experience_value'][$expLbl->id]) && $exp_arr['experience_value'][$expLbl->id]==2){
$check_value="checked";
}else{
$check_value="";
}
$output2.='<div class="form-check form-check-inline">';
$output2.='<input class="form-check-input toggle_check '.$check_required_class.'" type="radio" name="exp_label['.$expLbl->id.']" id="exp_label_'.$expLbl->id.'_2" value="2" '.$check_value.' '.$lvlZero.'>';
$output2.='<label class="form-check-label" for="exp_label_'.$expLbl->id.'_2">2</label>';
$output2.='</div>';
if(isset($exp_arr['experience_value'][$expLbl->id]) && $exp_arr['experience_value'][$expLbl->id]==3){
$check_value="checked";
}else{
$check_value="";
}
$output2.='<div class="form-check form-check-inline">';
$output2.='<input class="form-check-input toggle_check '.$check_required_class.'" type="radio" name="exp_label['.$expLbl->id.']" id="exp_label_'.$expLbl->id.'_3" value="3" '.$check_value.' '.$lvlThree.'>';
$output2.='<label class="form-check-label" for="exp_label_'.$expLbl->id.'_3">3</label>';
$output2.='</div>';
$output2.='<!--div class="form-check form-check-inline clear_check" for="exp_label['.$expLbl->id.']" style="height: 20px;width: 20px;border: 1px solid lavender;text-align: center;cursor: pointer;">X</div-->';
$output2.='</div>';
$output2.='</div>';
}
$output2.='<label class="pull-right open_close_btn close_btn nonExp_All NoneExp_'.$exp_head->service_head_id.'" for="NoneExp_'.$exp_head->service_head_id.'" '.$style.'> Close </label>';
$output2.='</div>';
$output2.='</div>';
}
$output.='<script>';
$output.="$('.open_close_btn').click(function(){
var forval=$(this).attr('for');
var foundobj=$('.open_close_btn').find('[for='+forval+']').hide();
// console.log(foundobj);
//$('for[forval]').hide();
})";
$output.='</script>';
$output.='<script>';
$output.="$('.clear_check').click(function(){
var forval=$(this).attr('for');
var foundobj=$('input[name=\"'+forval+'\"]').attr('checked', false);
console.log(foundobj);
//$('for[forval]').hide();
})";
$output.='</script>';
}
$output.='<script>';
$output.="$('.toggle_check').click(function(){
var radio = $(this);
// console.log(this.name);
if (radio.data('waschecked') == true){
radio.prop('checked', false);
radio.data('waschecked', false);
}else{
radio.data('waschecked', true);
}
// remove was checked from other radios
radio.siblings('input[name=this.name]').data('waschecked', false);
})";
$output.='</script>';
echo $output.$output2;
}
function getExperienceDetails2(){
$caregiver_type=$this->input->get('caregiver_type');
$caregiverId=$this->input->get('CargiverId');
$YearExperience=$this->input->get('YearExperience');
$service_heads_info=$this->Caregiver_model->getServiceHeads($caregiverId,$caregiver_type);
$get_experience_info=$this->Caregiver_model->getExperienceInfo($caregiverId,$caregiver_type);
// pre($service_heads_info);die();
if($YearExperience>3){
$disabled='';
}else{
$disabled='disabled';
}
#for getting required classess
$req_classes="";
foreach($service_heads_info as $req_info){
if($req_info->required>0){
$classes[]="exp_label_".$req_info->id;
}
}
$req_classes=implode(",",$classes);
// pre($req_classes);
#for getting required classess
$output="";
foreach($service_heads_info as $sh_info){
if($sh_info->required>0){
$required_field="required-field";
// $html_check_min='&ensp;<small class="">( check minimum '.$sh_info->required.' )</small>';
$html_check_min='';
$html_req_no='<input type="hidden" class="no-of-require-'.$sh_info->id.'" value="'.$sh_info->required.'">';
}else{
$required_field="";
$html_check_min="";
$html_req_no="";
}
if(array_key_exists($sh_info->id,$get_experience_info)){
$panel_show_hide="have-exp-label";
}else{
$panel_show_hide="have-not-exp-label";
}
$output.='
<div class="col-md-8 col-sm-8 border-05-lavender show-hide-div pointer">
'.$html_req_no.'
<h5 class="'.$required_field.'">
<strong class="show-hide-- text-capitalize pointer service-head-name-'.$sh_info->id.'">'.$sh_info->service_head_name.'</strong>'.$html_check_min.'
<label class="pull-right show-hide-- pointer" for="">
<i class="la la-angle-down"></i>
</label>
</h5>';
if(empty($sh_info->data)){
$output.='</div>';
}else{
$output.='<div class="col-md-12 col-sm-12 '.$panel_show_hide.'">';
foreach($sh_info->data as $dt){
if($get_experience_info[$sh_info->id][$dt->id]==1 || $get_experience_info[$sh_info->id][$dt->id]=="1"){
$check1="checked";
}else{
$check1="";
}if($get_experience_info[$sh_info->id][$dt->id]==2 || $get_experience_info[$sh_info->id][$dt->id]=="2"){
$check2="checked";
}else{
$check2="";
}if($get_experience_info[$sh_info->id][$dt->id]==3 || $get_experience_info[$sh_info->id][$dt->id]=="3"){
$check3="checked";
}else{
$check3="";
}
$output.='
<div class="row mb-0">
<div class="col-md-8 col-sm-12">
<span class="text-capitalize">'.$dt->service_name.'</span>
</div>
<div class="col-md-4 col-sm-12">
<label class="pull-right">
<div class="form-check form-check-inline">
<input class="form-check-input exp-radio exp_label_'.$sh_info->id.'" type="radio" name="exp_label['.$dt->id.']" id="exp_label_'.$dt->id.'_1" value="1" '.$check1.'>
<label class="form-check-label" for="cg_service_'.$dt->id.'_1">1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input exp-radio exp_label_'.$sh_info->id.'" type="radio" name="exp_label['.$dt->id.']" id="exp_label_'.$dt->id.'_2" value="2" '.$check2.'>
<label class="form-check-label" for="cg_service_'.$dt->id.'_2">2</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input exp-radio exp_label_'.$sh_info->id.'" type="radio" name="exp_label['.$dt->id.']" id="exp_label_'.$dt->id.'_3" value="3" '.$check3.' '.$disabled.'>
<label class="form-check-label" for="cg_service_'.$dt->id.'_3">3</label>
</div>
</label>
</div>
</div>';
}
$output.='</div></div>';
}
}
$output.='<input type="hidden" id="req_classess" value="'.$req_classes.'">';
echo $output;
}
function AnnualPhysicalExaminationForm($caregiver_id){
$data=array();
return generate_pdf("welcome.pdf", "forms_pdf/physicalExamForm3.php", $data);
}
function EMPLOYEE_HEP_B_VACCINE_WAIVER ($caregiver_id){
$data=array();
echo generate_html("welcome.pdf", "forms_pdf/EMPLOYEE_HEP_B_VACCINE_WAIVER.php", $data);
}
function CHEST_X_RAY_FORM($caregiver_id){
$data=array();
generate_pdf("welcome.pdf", "forms_pdf/CHEST_X_RAY_FORM.php", $data);
}
public function ChangePassword(){
$id = $this->input->get('id');
$data['nurse']=$this->Caregiver_model->getNurseById($id);
$this->load->view('home/dashboard'); // just the header file
$this->load->view('change_password',$data);
$this->load->view('home/footer');
}
function UpdatePassword(){
$id = $this->input->post('id');
$ionid = $this->input->post('ionid');
$password = $this->input->post('password');
$repassword = $this->input->post('repassword');
$email = $this->input->post('email');
if($password!=$repassword){
$this->session->set_flashdata('feedback_error', 'Confirm Password Not Matched!');
redirect('CaregiversDashboard/ChangePassword?id='.$id);
}else
if($password==""){
$this->session->set_flashdata('feedback_error', 'Password Can Not Blank!');
redirect('CaregiversDashboard/ChangePassword?id='.$id);
}else
if ($this->Caregiver_model->update_email_check($email,$ionid)) {
$this->session->set_flashdata('feedback_error', 'This Email Address Is Already Registered');
redirect('CaregiversDashboard/ChangePassword?id='.$id);
}else{
$password = $this->ion_auth_model->hash_password($password);
$this->Caregiver_model->updateIonUser($email,$password,$id,$ionid);
$this->session->set_flashdata('feedback_success', 'Updated');
redirect('CaregiversDashboard/ChangePassword?id='.$id);
}
}
public function HOME_CARE_REGISTRY_RELEASE_FORM($id = '')
{
if($id != '')
{
$data['nurse']=$this->Caregiver_model->getNurseById($id);
// _die($data['nurse']);
}
$data['city_of_birth']="";
$data['mothersMaidenName']="";
$data['mothersFirstName']="";
$data['Registry']="";
$data['signature']="";
$data['date']="";
$data['tick'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAaQAAAGkBcaGY2AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNzdCxDYJgEAbQxwK6g2ED7QyTWFKxhQPQso4tIzAAG0AN2GhiYfLjmaDXv+++O3492Rf2hGMUFxjRRfAZA3rk/4EbXBL4efPbzTdMKCMYdmgxo1pbe03Ixw/bP0Im1KnaqSZLBL82ueIQwdvPHdIVIU3fgaM4AAAAAElFTkSuQmCC';
//$data['title']=($datas->fname!='')? : "N/A" ;
//$data = array('title' => 'N/A | ERP','data' => 'Test');
// generate_pdf("welcome.pdf", array("HOME_CARE_REGISTRY_RELEASE_FORM.php"), $data);
$data['pages'] = array('home_care_registry_release_form.css.php','home_care_registry_release_form.template.php');
return generate_html("welcome.pdf", "forms_pdf/generate_html_cmn", $data);
// die;
}
public function Application_For_Home_Health_Aides($id = '')
{
if($id != '')
{
$datas = $this->Caregiver_model->getNurseById($id);
$data['cg'] = $datas;
$data['eha'] = json_decode($datas->emp_health_assesment);
$data['emg_contact'] = json_decode($datas->Emergency_Contact_Address);
$data['employementHistory2'] = json_decode($datas->employementHistory2);
$emg_relation_id = $datas->Emergency_Contact_Relationship;
$data['emg_relation_name'] = $this->Caregiver_model->getRelationshipName($emg_relation_id);
// _die($data['emg_relation_name']);
}
$data['tick'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAaQAAAGkBcaGY2AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNzdCxDYJgEAbQxwK6g2ED7QyTWFKxhQPQso4tIzAAG0AN2GhiYfLjmaDXv+++O3492Rf2hGMUFxjRRfAZA3rk/4EbXBL4efPbzTdMKCMYdmgxo1pbe03Ixw/bP0Im1KnaqSZLBL82ueIQwdvPHdIVIU3fgaM4AAAAAElFTkSuQmCC';
$data['pages'] = array('WECURO_HHA_APPLICATION_1st_Disclosure_Page.css.php','WECURO_HHA_APPLICATION_1st_Disclosure_Page.template.php');
return generate_html("welcome.pdf", "forms_pdf/generate_html_cmn", $data);
}
public function Professional_Profile($id = '')
{
if($id != '')
{
$datas = $this->Caregiver_model->getNurseById($id);
$data['cg'] = $datas;
$data['eha'] = json_decode($datas->emp_health_assesment);
// _die($data['cg']);
}
$data['tick'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAaQAAAGkBcaGY2AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNzdCxDYJgEAbQxwK6g2ED7QyTWFKxhQPQso4tIzAAG0AN2GhiYfLjmaDXv+++O3492Rf2hGMUFxjRRfAZA3rk/4EbXBL4efPbzTdMKCMYdmgxo1pbe03Ixw/bP0Im1KnaqSZLBL82ueIQwdvPHdIVIU3fgaM4AAAAAElFTkSuQmCC';
$data['pages'] = array('WECURO_HHA_APPLICATION_1st_Disclosure_Page2.css.php','WECURO_HHA_APPLICATION_1st_Disclosure_Page2.template.php');
return generate_html("welcome.pdf", "forms_pdf/generate_html_cmn", $data);
}
public function ANNUAL_PHYSICAL_EXAMINATION_FORM($id = '')
{
if($id != '')
{
$datas = $this->Caregiver_model->getNurseById($id);
$data['cg'] = $datas;
$data['eha'] = json_decode($datas->emp_health_assesment);
// _die($data['cg']);
}
$data['tick'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAaQAAAGkBcaGY2AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNzdCxDYJgEAbQxwK6g2ED7QyTWFKxhQPQso4tIzAAG0AN2GhiYfLjmaDXv+++O3492Rf2hGMUFxjRRfAZA3rk/4EbXBL4efPbzTdMKCMYdmgxo1pbe03Ixw/bP0Im1KnaqSZLBL82ueIQwdvPHdIVIU3fgaM4AAAAAElFTkSuQmCC';
$data['pages'] = array('ANNUAL_PHYSICAL_EXAMINATION_FORM.css.php','ANNUAL_PHYSICAL_EXAMINATION_FORM.template.php');
return generate_html("welcome.pdf", "forms_pdf/generate_html_cmn", $data);
}
public function Employee_Health($id='')
{
if($id != '')
{
$datas = $this->Caregiver_model->getNurseById($id);
$data['cg'] = $datas;
$data['eha'] = json_decode($datas->emp_health_assesment);
// _die($data['cg']);
}
$data['tick'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAaQAAAGkBcaGY2AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNzdCxDYJgEAbQxwK6g2ED7QyTWFKxhQPQso4tIzAAG0AN2GhiYfLjmaDXv+++O3492Rf2hGMUFxjRRfAZA3rk/4EbXBL4efPbzTdMKCMYdmgxo1pbe03Ixw/bP0Im1KnaqSZLBL82ueIQwdvPHdIVIU3fgaM4AAAAAElFTkSuQmCC';
$data['pages'] = array('employee_health.css.php','employee_health.template.php');
return generate_html("welcome.pdf", "forms_pdf/generate_html_cmn", $data);
}
function deleteOtherReference(){
$id = $this->input->get('id');
$success=$this->Caregiver_model->deleteOtherReference($id);
if($success){
$this->session->set_flashdata('UpdateAlert', 'Deleted Successfully');
}else{
$this->session->set_flashdata('UpdateFail', 'Error! Not Possible to delete.');
}
}
function deleteLicenseData(){
$id = $this->input->get('id');
$success=$this->Caregiver_model->deleteLicenseData($id);
if($success){
$this->session->set_flashdata('UpdateAlert', 'Deleted Successfully');
}else{
$this->session->set_flashdata('UpdateFail', 'Error! Not Possible to delete.');
}
}
// function getImageNames(){
// echo "hii";exit;
// $data = $this->input->post('data');
// _die($data);
// }
public function phyDocumentSave(){
// pre($_POST);pre($_FILES);die;
$usertype='Caregiver';
$savetime=date ('Y-m-d H:i:s', now());
$data_type=$this->input->post('data_type');
$id=$this->input->post('id');
$Ion_id=$this->input->post('Ion_id');
$form_status=$this->input->post('form_status');
$progress=$this->input->post('progress');
$pre_update_data=$this->Caregiver_model->getNurseByIonId($Ion_id);
if($pre_update_data->form_status->$form_status){ $form_status=$pre_update_data->form_status; }
if($data_type=='health_assessment'){
// pre($_POST);die;
$folder_name='USER_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT);
if (!is_dir('uploads/Documents/'.$folder_name)) {
mkdir('./uploads/Documents/' . $folder_name, 0777, TRUE);
}
$uploadto="uploads/Documents/".$folder_name."/";
$doc_type=$this->input->post('doc_type');
$documentId=$this->input->post('doc_id');
if($_FILES[$doc_type]['name'] || $_POST['image']){
if($_POST['image']){
$img = $_POST['image'];
$image_parts = explode(";base64,", $img);
$image_type_aux = explode("image/", $image_parts[0]);
$image_type = $image_type_aux[1];
$image_base64 = base64_decode($image_parts[1]);
$file_name_pieces = uniqid() . '.'.$image_type;
$new_file_name = $doc_type.'_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces;
$file = $uploadto . $new_file_name;
file_put_contents($file, $image_base64);
// pre($file);die;
}
if($_FILES[$doc_type]['name']){
$file_name = $_FILES[$doc_type]['name'];
$file_name_pieces = explode('.', $file_name);
$count=count($file_name_pieces);
$new_file_name = $doc_type.'_'.str_pad($Ion_id, 6, "0", STR_PAD_LEFT).'_'.date('YmdHis').'_01.'.$file_name_pieces[$count-1];
$config = array(
'file_name' => $new_file_name,
'upload_path' => "./".$uploadto,
'allowed_types' => "gif|jpg|png|jpeg|pdf",
'overwrite' => False,
'max_size' => "20480000",
//'max_height' => "1768",
//'max_width' => "2024"
);
$this->load->library('Upload', $config);
$this->upload->initialize($config);
if ($this->upload->do_upload($doc_type)) {
$path = $this->upload->data();
//$photo = $path['file_name'];
}
}
if($path['file_name']!="" || $image_base64!=""){
if($path['file_name']!=""){
$data = array(
'ion_user_id' => $Ion_id,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $path['file_name'],
'originalfilename' => $_FILES[$doc_type]['name'],
'documents_type' => $doc_type
);
}else if($image_base64!=""){
$data = array(
'ion_user_id' => $Ion_id,
'userid' => $id,
'user_type' => $usertype,
'path' => $uploadto,
'file_name' => $new_file_name,
'originalfilename' => $file_name_pieces,
'documents_type' => $doc_type
);
}
// pre($data_type);die;
$check_doc_exsist=$this->Caregiver_model->checkDocumentsExsist($Ion_id,$doc_type);
if($check_doc_exsist==0){
$caregiver_data=$this->Caregiver_model->getNurseByIonId($Ion_id);
$caregiverPer = json_decode($caregiver_data->from_tab_status_pctg);
$caregiverPer->form11 = $caregiverPer->form11 + 0;
$process= json_encode($caregiverPer);
$caregiverUpdate=array(
'from_tab_status_pctg' => $process,
'form_status' => $form_status,
);
//pre($caregiverUpdate);die;
$this->Caregiver_model->updateNurse($id,$caregiverUpdate);
}
//die;
$this->Caregiver_model->deleteNursePreDocuments($documentId);
$documentId = $this->Caregiver_model->addNurseDocuments($data);
if($path['file_name']!=""){
$data2 = array(
'documents_type' => $doc_type ,
'users_documents_id' => $documentId
);
}else if($image_base64!=""){
$data2 = array(
'documents_type' => $doc_type ,
'users_documents_id' => $documentId
);
}
$phy_id = $this->input->post('health_assessment_id');
$this->Caregiver_model->updateHealthDocuments($data2,$id,$phy_id);
if($path['file_name']!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $path['file_name'],
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}else if($image_base64!=""){
$activitydata = array(
'activity_description' => $doc_type .' Upload',
'request_data' => $new_file_name,
'activity_user_id' => $Ion_id,
'activity_user_type' => $usertype,
'activity_time' => $savetime,
'activity_page' => $_SERVER['REQUEST_URI'],
);
}
$this->Home_model->activity_log($activitydata);
}
}
// $remarks=$this->input->post('Name_Additional_Certifications');
// $remarks= 'license';
// $documents_no=$this->input->post('Additional_Certifications_Number');
// $nameState=$this->input->post('Name_Additional_Certifications_state');
// $data = array(
// 'remarks' => $remarks,
// 'documents_no' => $documents_no,
// 'state' => $nameState
// );
// $this->Caregiver_model->updateNurseDocuments($data,$documentId);
// $activitydata = array(
// 'activity_description' => $doc_type .' Documents Name Update',
// 'request_data' => serialize($_REQUEST),
// 'activity_user_id' => $Ion_id,
// 'activity_user_type' => $usertype,
// 'activity_time' => $savetime,
// 'activity_page' => $_SERVER['REQUEST_URI'],
// );
// $this->Home_model->activity_log($activitydata);
$output=array(
'upload'=>'success',
'msg'=>'Updated Successfully.',
'file_url'=>$uploadto.$path['file_name'],
);
echo json_encode($output);
}
}
}
/* End of file nurse.php */
/* Location: ./application/modules/nurse/controllers/nurse.php */