%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); } define('STATUS', array('1'=>'Request Submitted','2'=>'Verification Inprogress','3'=>'Verified','4'=>'Slot Booked','5'=>'Slot Confirmed')); define('PAYMENT_STATUS', array('1'=>'Pending','2'=>'In-Progress','3'=>'COD','4'=>'Payment Received','5'=>'Cash Received','6'=>'Online Payment FAILED','7'=>'NA')); // Define API Url define('API_URL','http://api.shardahospital.org/api/PatientApp/'); // define('FACILITY_ID','3'); define('HOSPITAL_FACILITY_ID','4'); define('SH_FACILITY_ID','2'); define('PORTAL_NAME','Doctor Appointment Booking Portal'); /* * Function : resizeImage * */ function resizeImage($filename, $width=250, $height=250, $path='attachments/testimonial_images') { $source_path = $_SERVER['DOCUMENT_ROOT'] . '/'. $path.'/'. $filename; $target_path = $_SERVER['DOCUMENT_ROOT'] . '/'.$path.'/thumbnail/'; $config_manip = array( 'image_library' => 'gd2', 'source_image' => $source_path, 'new_image' => $target_path, 'maintain_ratio' => TRUE, 'create_thumb' => TRUE, 'thumb_marker' => '', 'width' => $width, 'height' => $height ); $CI =& get_instance(); $CI->load->library('image_lib', $config_manip); if (!$CI->image_lib->resize()) { echo $CI->image_lib->display_errors(); die; } $CI->image_lib->clear(); } /* * function : getAge * */ function getAge($dob = '1981-10-07') { $diff = (date('Y') - date('Y',strtotime($dob))); return $diff; } /* * function : remove_html_tags * */ function remove_html_tags($string) { return preg_replace('/[^a-zA-Z0-9\s]/', '', strip_tags(html_entity_decode($string))); } function except_letters($string) { // $onlyLetters = mb_ereg_replace('[^\\p{L}\s]', '', $string); $onlyLetters = preg_replace('/([\s])\1+/', ' ', $onlyLetters); $onlyLetters = preg_replace('/\s/', '_', trim($onlyLetters)); return $onlyLetters; } function allletters_lowercase($string) { $only_lowercase = strtolower($string); return replaceblankspace($only_lowercase); } function firstletterCapital($string) { $ucwords = ucwords(strtolower($string)); return $ucwords; } function striphtmltags($string) { $removeallhtmlchar = strip_tags($string); return $removeallhtmlchar; } function replaceblankspace($string) { $only_replaceblankspace = str_replace(" ","-",$string); return $only_replaceblankspace; } function setcharlimit($string, $limit=15, $start=0) { $return_string = ''; $return_string .= substr(html_entity_decode($string),$start,$limit); if(strlen($string)>$limit) { $return_string .= '...'; } return $return_string; } /* * Function : Get Default Image Name */ function getDefaultImage($string) { $response = ''; $stringArray = explode(" ",$string); if(count($stringArray)>=2) { $response = substr($stringArray[0],0,1).''.substr($stringArray[1],0,1); } else { $response = substr($string,0,2); } return '<span class="frist-letter">'.strtoupper($response).'</span>'; } function splitArrayAlphabetOrder($records) { $temp=array(); $first_char=""; for($i=0;$i<count($records);$i++) { $first_char= strtoupper ($records[$i][0]); if(!in_array($first_char, $temp)) { echo strtoupper($first_char).'<br>'; //print A / B / C etc } $temp[]= $first_char; echo $records[$i]."<br>"; } } function valid_seo_friendly_url($string){ $string = str_replace(array('[\', \']',"’",":",";","|","%","@","$","^","*","(",")","?","&","<",">",",",".","/","--","+"), '', $string); $string = preg_replace('/\[.*\]/U', '', $string); $string = htmlentities($string, ENT_COMPAT, 'utf-8'); $string = strtolower(str_replace(" ","-",$string)); return cleanString(trim($string, '-')); } function seo_friendly_url($string){ $string = str_replace(array('[\', \']',"’"), '', $string); $string = preg_replace('/\[.*\]/U', '', $string); $string = htmlentities($string, ENT_COMPAT, 'utf-8'); return cleanString(trim($string, '-')); } function seo_friendly_url_desc($string){ $string = str_replace(array('[\', \']',"’"), '', $string); $string = preg_replace('/\[.*\]/U', '', $string); $string = htmlentities($string, ENT_COMPAT, 'utf-8'); return cleanString(trim($string, '-')); } function cleanString($text) { $utf8 = array( '/[áàâãªä]/u' => 'a', '/[ÁÀÂÃÄ]/u' => 'A', '/[ÍÌÎÏ]/u' => 'I', '/[íìîï]/u' => 'i', '/[éèêë]/u' => 'e', '/[ÉÈÊË]/u' => 'E', '/[óòôõºö]/u' => 'o', '/[ÓÒÔÕÖ]/u' => 'O', '/[úùûü]/u' => 'u', '/[ÚÙÛÜ]/u' => 'U', '/ç/' => 'c', '/Ç/' => 'C', '/ñ/' => 'n', '/Ñ/' => 'N', '/–/' => '-', // UTF-8 hyphen to "normal" hyphen '/[’‘‹›‚]/u' => ' ', // Literally a single quote '/[“”«»„]/u' => ' ', // Double quote '/ /' => ' ', // nonbreaking space (equiv. to 0x160) ); return preg_replace(array_keys($utf8), array_values($utf8), $text); } /* * Function : get_client_ip */ function get_client_ip() { $ipaddress = ''; if (getenv('HTTP_CLIENT_IP')) $ipaddress = getenv('HTTP_CLIENT_IP'); else if(getenv('HTTP_X_FORWARDED_FOR')) $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); else if(getenv('HTTP_X_FORWARDED')) $ipaddress = getenv('HTTP_X_FORWARDED'); else if(getenv('HTTP_FORWARDED_FOR')) $ipaddress = getenv('HTTP_FORWARDED_FOR'); else if(getenv('HTTP_FORWARDED')) $ipaddress = getenv('HTTP_FORWARDED'); else if(getenv('REMOTE_ADDR')) $ipaddress = getenv('REMOTE_ADDR'); else $ipaddress = 'UNKNOWN'; return $ipaddress; } /* * Function : getSchoolList */ function getSchoolList($slug = '') { $result = ''; $ci=& get_instance(); $ci->load->database(); if($slug!=''){ $column = '*'; $sqlQ = "select $column from tbl_school where slug = '".$slug."' AND is_published='1' order by position ASC"; $querys = $ci->db->query($sqlQ); $result = $querys->result(); $results = $result[0]; } else { $column = '*'; $sqlQ = "select $column from tbl_school where is_published='1' order by position ASC"; $querys = $ci->db->query($sqlQ); $results = $querys->result(); } return $results; } /* * Get Test Details */ function getBookingStatus($order_id) { $ci=& get_instance(); $ci->load->database(); $ci->db->where('order_id', $order_id); $query = $ci->db->get('tbl_order_master'); $results = $query->row(); return PAYMENT_STATUS[$results->status]; } /* * Get Test Details */ function getSlotDetails($slot_id) { $ci=& get_instance(); $ci->load->database(); $ci->db->where('id', $slot_id); $query = $ci->db->get('tbl_slot_master'); $results = $query->result(); return $results; } /* * Get Test Details */ function getCompanyDetails($name) { $ci=& get_instance(); $ci->load->database(); $ci->db->where('title',$name); $query = $ci->db->get('tbl_company_master'); return $query->row(); } /* * Get Test Details */ function getTestDetails($test_id) { $ci=& get_instance(); $ci->load->database(); $ci->db->where('id',$test_id); $query = $ci->db->get('tbl_test_master'); return $query->result(); } /* * Get Menu Items */ function getmenuItems() { $ci=& get_instance(); $ci->load->database(); $ci->db->where('in_menu', 1); $ci->db->order_by('position'); $query = $ci->db->get('articles'); return $query->result(); } /* * Get Menu Items */ function getsubmenuItems() { $ci=& get_instance(); $ci->load->database(); $ci->db->where('sub_menu', 1); $ci->db->order_by('position'); $query = $ci->db->get('articles'); $results = array(); foreach($query->result() as $val) { $results[$val->category_id][] = $val; } return $results; } /* * Function : getHappeningsnew */ function getHappeningsnew() { $ci=& get_instance(); $ci->load->database(); $ci->db->where('is_deleted', '0'); $ci->db->order_by('display_order'); $query = $ci->db->get('su_promotional_banner'); $results = array(); return $query->result(); } /* * Function : mentorNotification */ function mentorNotification() { $ci=& get_instance(); $ci->load->database(); $nextDate = date("Y-m-d", strtotime("-3 day")); $ci->db->where('createdon BETWEEN "'. date('Y-m-d', strtotime($nextDate)). ' : 00:00:00" and "'. date('Y-m-d').' 23:59:59"'); $query = $ci->db->get('tbl_notifications_master'); //echo $ci->db->last_query(); die; $results = array(); return $query->result(); } /* * Function : setHistory */ function setHistory($activity) { $ci=& get_instance(); $ci->load->database(); $user = $ci->session->userdata('userName'); if (!$ci->db->insert('history', array( 'activity' => $activity, 'username' => $user, 'ip_address' => $_SERVER['REMOTE_ADDR'], 'time' => time()) )) { log_message('error', print_r($ci->db->error(), true)); show_error(lang('database_error')); } } /* * Function : send_email_pepipost * Description : Send Email */ function send_email_pepipost_email($to_emails, $subject, $message, $fromname='', $fromemail='', $replyto=''){ $fromname=$fromname?$fromname:'Sharda Hospital'; $fromemail=$fromemail?$fromemail:'assets@shardauniversity.com'; //Change This Email ID; $replyto=$replyto?$replyto:'noreply@sharda.ac.in'; //Change the Email ID; if(!$to_emails){ return; } if(is_string($to_emails)){ $to_emails=explode(",", $to_emails); } foreach($to_emails as $to){ $d=array ( 'personalizations' => array (0 => array ('recipient' => $to)), 'from' => array ('fromEmail' => $fromemail, 'fromName' => $fromname), 'replyToId'=>$replyto, 'subject' => $subject, 'content' => $message, ); $email_jason_data=json_encode($d); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.pepipost.com/v2/sendEmail", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $email_jason_data, CURLOPT_HTTPHEADER => array( "api_key: c77184012dcf9bd5cd1886b4e0a2bb89", // "api_key: aab3f77715e90569034f0c6e5d912714", "content-type: application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } // else { // echo $response; // } // die; } //EOF //EOF } /* * Function : getMenteeGRADES * PS_S_STU_GRADES_VW * */ function getMenteeGRADES($EMPLID, $STRM) { $dafaultarray = array('EMPLID'=>$recordArray['system_id'],'STRM'=>$recordArray['STRM']); $post = [ 'table' => 'PS_S_STU_GRADES_VW', 'conditions' => $dafaultarray ]; $resultsArray = ''; $url = 'https://slotbooking.sharda.ac.in/mentorapi/getCommonDetails'; if (!empty($url) && !empty($post)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); $response = curl_exec($ch); } return json_decode($response); } /* * Function : deleteDirectory * */ if (!function_exists('deleteDirectory')) { function deleteDirectory($dir) { if (!file_exists($dir)) return true; if (!is_dir($dir) || is_link($dir)) return unlink($dir); foreach (scandir($dir) as $item) { if ($item == '.' || $item == '..') continue; if (!deleteDirectory($dir . "/" . $item)) { chmod($dir . "/" . $item, 0777); if (!deleteDirectory($dir . "/" . $item)) return false; }; } return rmdir($dir); } } function sendSMS($mobile_number, $sms_content){ $feedid = 363901; $senderid = urlencode('shardacom_trans'); $username = "9015129267"; $password = "wgtpt"; $api_url = 'http://bulkpush.mytoday.com/BulkSms/SingleMsgApi'; if(strlen($mobile_number)>=10){ $params_url = ''; //send OTP to user $params_url = 'feedid='.$feedid.'&senderid='.$senderid.'&username='.$username.'&password='.$password.'&To='.$mobile_number.'&Text='.$sms_content; $otpresponse = $this->sendOTP($api_url, $params_url); // Send OTP return $otpresponse; } } /* * Function : send_sms * */ function send_sms_nold($mob, $msg=''){ $mob='91'.$mob; $msg=urlencode($msg); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, "http://bulkpush.mytoday.com/BulkSms/SingleMsgApi"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "feedid=363901&username=9015129267&password=wgtpt&To=".$mob."&Text=".$msg."&time=&senderid=shardacom_trans"); $buffer = curl_exec($ch); //$err = curl_error($ch); //echo $err; die; curl_close($ch); } function send_sms($mob, $message){ //echo $mob.' '.$otp; //$mob='91'.$mob; $msg= $message;//"Your OTP is $otp. Please use this code to initiate your application for Sharda University. Call us at +91120-4570000 for any queries."; $msg=urlencode($msg); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, "http://bulkpush.mytoday.com/BulkSms/SingleMsgApi"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "feedid=363901&username=9015129267&password=wgtpt&To=".$mob."&Text=".$msg."&time=&senderid=shardacom_trans"); $buffer = curl_exec($ch); curl_close($ch); return true; } /* * Function : send_email * */ function send_email($data, $fromname="", $fromemail="", $replyto=""){ $fromname=$fromname?$fromname:'Sharda University'; $fromemail=$fromemail?$fromemail:'info@shardauniversity.com'; $replyto=$replyto?$replyto:'info@shardauniversity.com'; foreach($data as $d){ if(!$d['email']){ continue; } $d=array ( 'personalizations' => array (0 => array ('recipient' => $d['email'])), 'from' => array ('fromEmail' => $fromemail, 'fromName' => $fromname), 'replyToId'=>$replyto, 'subject' => $d['subject'], 'content' => $d['msg'], ); $email_jason_data=json_encode($d); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.pepipost.com/v2/sendEmail", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $email_jason_data, CURLOPT_HTTPHEADER => array( "api_key: c77184012dcf9bd5cd1886b4e0a2bb89", "content-type: application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { //echo "cURL Error #:" . $err; } else { //echo $response; } } } function generate_otp(){ return rand(111111, 999999); //return '232524'; } //EOF /* * Function : send Confiramtion SMS */ function send_otp($mob, $message){ $msg= $message; $msg=urlencode($msg); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, "http://bulkpush.mytoday.com/BulkSms/SingleMsgApi"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "feedid=377945&username=9540074804&password=default%321SH&To=".$mob."&Text=".$msg."&time=&senderid=shardaeduapi"); $buffer = curl_exec($ch); curl_close($ch); print_r($buffer); die; } function sendNewsms($mob, $message){ $msg=urlencode($msg); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, "http://bulkpush.mytoday.com/BulkSms/SingleMsgApi"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "feedid=363901&username=9015129267&password=wgtpt&To=".$mob."&Text=".$msg."&time=&senderid=shardacom_trans"); $buffer = curl_exec($ch); $err = curl_error($ch); //pr($err); curl_close($ch); return $buffer; } function postExistingRequest($apiUrl, $payload='') { $url = API_URL.$apiUrl; // Create a new cURL resource $ch = curl_init($url); // Attach encoded JSON string to the POST fields curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); // Set the content type to application/json curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); // Return response instead of outputting curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Execute the POST request $result = curl_exec($ch); // Close cURL resource curl_close($ch); return $result; } /* * Function : phpcurlpostdataapi * Desc : thirdpary set new details API * */ function phpcurlpostdataapi($apiUrl, $data='') { $url = API_URL.$apiUrl; //die; //$data = json_encode($data); //print_r($data); die; $curl = curl_init($url); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $headers = array( "Content-Type: application/json", ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); //for debug only! curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($curl); //print_r($response); $http = curl_getinfo($curl, CURLINFO_HTTP_CODE); if (curl_errno($curl)) { $error_msg = curl_error($curl); print_r($error_msg); die('TEST'); } curl_close($curl); // Close the connection if ($http == 200) { $json = @json_decode($response, TRUE); return $json; } else { echo "$http => There was a problem fetching your details..."; } } function calculateSurveyPercentage($totalResponses, $positiveResponses) { if ($totalResponses <= 0) { return 0; // Prevent division by zero } // Calculate the percentage $percentage = ($positiveResponses / $totalResponses) * 100; return $percentage; } $percentage = ($positiveResponses / $totalResponses) * 100; return $percentage;