File: /var/www/html/nt/application/helpers/sms_helper.php
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function successfull_profile_created_sms($phoneno)
{
$data = array();
$ch = curl_init();
$baseurl = 'http://dndopen.jhaveritechno.com/api/v4/?api_key='.API_KEY_FOR_SMS;
$message = "Congratulations!%20You%20have%20successfully%20created%20your%20profile%20at%20WBHB.%20You%20may%20now%20add%20your%20co-applicant%20to%20your%20profile.%20WBHB";
$url = $baseurl.'&method=sms&message='.$message.'&to='.$phoneno.'&sender='.SENDER_FOR_SMS.'&entity_id='.ENTITY_ID_FOR_SMS.'&template_id=1207170359776170261';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
$error = 'Error:' . curl_error($ch);
}
curl_close($ch);
$data['error'] = $error;
$data['response'] = json_decode($result);
//echo "<pre>"; print_r($data);
//print_r(curl_getinfo($ch));
return $data;
}
function successfull_co_applicant_profile_created_sms($phoneno, $appName)
{
$data = array();
$ch = curl_init();
$baseurl = 'http://dndopen.jhaveritechno.com/api/v4/?api_key='.API_KEY_FOR_SMS;
$message = "Dear%20Applicant,%20App.%20ID:%20".$appName.",%20you%20have%20successfully%20added%20your%20Co-Applicant%20to%20your%20Profile.%20WBHB";
$url = $baseurl.'&method=sms&message='.$message.'&to='.$phoneno.'&sender='.SENDER_FOR_SMS.'&entity_id='.ENTITY_ID_FOR_SMS.'&template_id=1207170359774184827';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
$error = 'Error:' . curl_error($ch);
}
curl_close($ch);
$data['error'] = $error;
$data['response'] = json_decode($result);
//echo "<pre>"; print_r($data);
//print_r(curl_getinfo($ch));
return $data;
}
function successfull_application_submisson_sms($phoneno, $projectName, $applicationId)
{
$data = array();
$ch = curl_init();
$baseurl = 'http://dndopen.jhaveritechno.com/api/v4/?api_key='.API_KEY_FOR_SMS;
$message = "You%20have%20successfully%20submitted%20your%20application%20for%20".str_replace(' ', '%20', $projectName).",%20App%20ID%20".str_replace(' ', '%20', $applicationId)."%20subject%20to%20credit%20of%20application%20money%20within%20DUE%20time.%20Your%20application%20is%20incomplete%20without%20payment.%20WBHB";
$url = $baseurl.'&method=sms&message='.$message.'&to='.$phoneno.'&sender='.SENDER_FOR_SMS.'&entity_id='.ENTITY_ID_FOR_SMS.'&template_id=1207170359466343161';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
$error = 'Error:' . curl_error($ch);
}
curl_close($ch);
$data['error'] = $error;
$data['response'] = json_decode($result);
//echo "<pre>"; print_r($data);
//print_r(curl_getinfo($ch));
//echo $error; die;
return $data;
}
function send_physical_verification_sms($phoneno, $application_no, $date, $time)
{
$data = array();
$ch = curl_init();
$baseurl = 'http://dndopen.jhaveritechno.com/api/v4/?api_key='.API_KEY_FOR_SMS;
$date_time = $date.'%20'.$time;
//echo $application_no; die;
$message = "Dear,%20App.%20ID:%20".$application_no.",%20date%20of%20verification%20of%20original%20documents%20is%20".$date_time."%20at%20WBHB%20office%201st%20floor.%20Visit%20the%20website%20www.wbhousingboard.in.%20for%20further%20details.%20WBHB";
$url = $baseurl.'&method=sms&message='.$message.'&to='.$phoneno.'&sender='.SENDER_FOR_SMS.'&entity_id='.ENTITY_ID_FOR_SMS.'&template_id=1207170359450046396';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
$error = 'Error:' . curl_error($ch);
}
curl_close($ch);
$data['error'] = $error;
$data['response'] = json_decode($result);
//echo "<pre>"; print_r($data);
//print_r(curl_getinfo($ch));
//echo $error; die;
return $data;
}
function send_application_approval_sms($phoneno, $application_no, $category_name, $sub_type)
{
$data = array();
$ch = curl_init();
$baseurl = 'http://dndopen.jhaveritechno.com/api/v4/?api_key='.API_KEY_FOR_SMS;
//echo $application_no; die;
$message = "Dear%20Applicant,%20Application%20ID:%20%20".$application_no.".%20Your%20application%20for%20%20".$category_name."%20%20".$sub_type."%20has%20been%20approved%20after%20the%20verification%20of%20documents.%20Visit%20the%20website%20www.wbhousingboard.in%20regarding%20information%20about%20the%20lottery.";
$url = $baseurl.'&method=sms&message='.$message.'&to='.$phoneno.'&sender='.SENDER_FOR_SMS.'&entity_id='.ENTITY_ID_FOR_SMS.'&template_id=1207168733859628186';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
$error = 'Error:' . curl_error($ch);
}
curl_close($ch);
$data['error'] = $error;
$data['response'] = json_decode($result);
//echo "<pre>"; print_r($data);
//print_r(curl_getinfo($ch));
//echo $error; die;
return $data;
}
function payment_confirmed($phoneno, $amount, $notice_no, $payment_date)
{
$data = array();
$ch = curl_init();
$baseurl = 'http://dndopen.jhaveritechno.com/api/v4/?api_key=Acbb9b01166125066737f7170c4f573d3';
$message = "Amount%20Rs.%20".$amount."%20has%20been%20received%20successfully%20against%20Demand%20Notice%20with%20Ref%20No.%20".$notice_no."%20dated%20".str_replace(' ', '%20', $payment_date).".%20Please%20login%20to%20https://prdrent.syscentricdev.com%20to%20download%20the%20Payment%20Acknowledgement%20(Provisional).SYSCNT";
$url = $baseurl.'&method=sms&message='.$message.'&to='.$phoneno.'&sender=SYSCNT&entity_id=1301163999688234159&template_id=1507167451134463224';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
$error = 'Error:' . curl_error($ch);
}
curl_close($ch);
$data['error'] = $error;
$data['response'] = json_decode($result);
//echo "<pre>"; print_r($data);
//print_r(curl_getinfo($ch));
return $data;
}
?>