58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
if (!function_exists('collectLeaveData')) {
|
|
|
|
function collectLeaveData($id){
|
|
|
|
$ci =& get_instance();
|
|
return $ci->Notification_model->get_leave_data_using_leave_id($id);
|
|
}
|
|
|
|
}
|
|
|
|
if (!function_exists('collectDelegationData')) {
|
|
|
|
function collectDelegationData($id){
|
|
|
|
$ci =& get_instance();
|
|
return $ci->Notification_model->get_delegation_data_using_delegation_id($id);
|
|
}
|
|
|
|
}
|
|
|
|
if (!function_exists('collectExpenceData')) {
|
|
|
|
function collectExpenceData($id){
|
|
|
|
$ci =& get_instance();
|
|
return $ci->Notification_model->get_expence_data_using_expence_id($id);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
if (!function_exists('getTempleteData')) {
|
|
|
|
function getTempleteData($code, $type){
|
|
|
|
$ci =& get_instance();
|
|
return $ci->Notification_model->get_template_data_using_code($code, $type);
|
|
}
|
|
|
|
}
|
|
|
|
if (!function_exists('replaceTemplateWithData')) {
|
|
|
|
function replaceTemplateWithData($originalTemplate, $placeholders) {
|
|
$notificationContent = $originalTemplate;
|
|
foreach ($placeholders as $value) {
|
|
$notificationContent = str_replace($value['placeholder'], $value['strval'], $notificationContent);
|
|
}
|
|
return $notificationContent;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
?>
|