commitall
This commit is contained in:
70
hostel/application/helpers/common_helper.php
Normal file
70
hostel/application/helpers/common_helper.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
function urlsafe_b64encode($string)
|
||||
{
|
||||
$data = base64_encode($string);
|
||||
$data = str_replace(array('+','/','='),array('-','_',''),$data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
function urlsafe_b64decode($string) {
|
||||
$data = str_replace(array('-','_'),array('+','/'),$string);
|
||||
$mod4 = strlen($data) % 4;
|
||||
if ($mod4) {
|
||||
$data .= substr('====', $mod4);
|
||||
}
|
||||
return base64_decode($data);
|
||||
}
|
||||
|
||||
function test_view_array($array) {
|
||||
echo '<pre>';
|
||||
print_r($array);
|
||||
exit();
|
||||
}
|
||||
|
||||
function cuurentNepaliDate($dateObj) {
|
||||
$date_arr = explode('-', date('Y-m-d'));
|
||||
list($y, $m, $d) = $date_arr;
|
||||
|
||||
// Convert BS to AD.
|
||||
$datearr = $dateObj->convertAdToBs($y, $m, $d);
|
||||
extract($datearr);
|
||||
$string = $year.'-'.$month.'-'.$day;
|
||||
$date = date_create_from_format('Y-m-d', $string);
|
||||
return $php_date = date_format($date, 'Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
/*function loggedin_admin_user_permissions()
|
||||
{
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('AdminRule_Model');
|
||||
$adminRules = $CI->AdminRule_Model->get_admin_rule_details('', "SELECT menu_id FROM admin_rule WHERE role_id=".$CI->session->userdata('role_id'));
|
||||
return $adminRules;
|
||||
}*/
|
||||
|
||||
|
||||
function ciSendEmail($data=array())
|
||||
{
|
||||
$CI = &get_instance();
|
||||
$CI->load->library('email');
|
||||
|
||||
//$CI->email->clear();
|
||||
//$config['mailtype'] = 'html';
|
||||
//$CI->email->initialize($config);
|
||||
|
||||
$CI->email->from('nandini@ezydemo.com', 'Erisn Classroom Hostel');
|
||||
$CI->email->to($data['to']);
|
||||
|
||||
//if(isset($data['cc_to']) && $data['cc_to']!='')
|
||||
//$CI->email->cc($data['cc_to']);
|
||||
|
||||
$CI->email->subject($data['subject']);
|
||||
$CI->email->message($data['message']);
|
||||
$CI->email->set_mailtype('html');
|
||||
|
||||
$res = $CI->email->send();
|
||||
//echo $res;exit;
|
||||
return $res;
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user