50 lines
1.6 KiB
PHP
Executable File
50 lines
1.6 KiB
PHP
Executable File
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
exit('No direct script access allowed');
|
|
|
|
class Pdf_model extends CI_model {
|
|
|
|
function __construct() {
|
|
parent::__construct();
|
|
$this->load->database();
|
|
}
|
|
|
|
function get_service_list($id = NULL)
|
|
{
|
|
if($id)
|
|
{
|
|
$getSkill=$this->db->get_where('caregiver', array('id' => $id))->row();
|
|
}
|
|
$heads = $this->db->get_where('master_service_head',array('skill_id'=>$getSkill->qualification_type))->result();
|
|
return $heads;
|
|
|
|
}
|
|
function get_cg_services($id = NULL)
|
|
{
|
|
$subHeads = $this->db->get_where('master_cg_service',array('service_head_id'=>$id))->result();
|
|
return $subHeads;
|
|
}
|
|
|
|
function generateWaiverPdf($caregiverID){
|
|
$this->load->model('website_settings/Website_model');
|
|
$this->load->helper('generatepdf_helper');
|
|
$data['basic']=$this->Website_model->getbasicInfo();
|
|
|
|
$this->db->select('fname,mid_name,lname,ion_user_id');
|
|
$this->db->where('id',$caregiverID);
|
|
$this->db->from('caregiver');
|
|
$data['cg']=$this->db->get()->row();
|
|
|
|
// _die($data);
|
|
$ionid=$data['cg']->ion_user_id;
|
|
$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);
|
|
}
|
|
$data['file_name']='uploads/Documents/'.$folder_name.'/EMPLOYEE_HEP_B_VACCINE_WAIVER.pdf';
|
|
$file_name=generate_pdf_file("welcome.pdf", array("forms_pdf/EMPLOYEE_HEP_B_VACCINE_WAIVER.php"), $data);
|
|
return $file_name;
|
|
}
|
|
}
|