CONSTANTS.PHP
/* custom development */
define('SMS_URL','http://sms.xxxxxxx.in/submitsms.jsp?');
define('SMS_USER','xxxxxxxxx');
define('SMS_KEY','xxxxxxx');
define('SMS_SENDER_ID','xxxxxxx');
define('SMS_SUPPORT_NO','1234567891');
/* custom development */
controller
if($insertCheck=='1'){
$this->session->set_flashdata('msg', '<p class="alert alert-success">Your request has been sent successfully.</p>');
/* sms */
$mobile = SMS_SUPPORT_NO;
$message = "New Suggestion/Problem Received\n
Name : ".$this->input->post('name')."
Mobile : ".$this->input->post('mobile')."
Ward No : ".$this->input->post('ward')."
\n\n:: Apna Roopangarh ::";
$this->Home_model->SendUnicodeSms($mobile,$message);
$mobile_user = $this->input->post('mobile');
$message_user = "आपकी शिकायत / सुझाव हमें प्राप्त हो गए हैं
\nजल्द ही हम आपसे संपर्क करेंगे
\nग्राम पंचायत रुपनगढ़";
$this->Home_model->SendUnicodeSms($mobile_user,$message_user);
/* sms */
}
Models
public function SendSms($mobiles,$message){
$key=SMS_KEY; //
$user=SMS_USER; //
$senderid = SMS_SENDER_ID;
/* sms */
$ch = curl_init(); // initiate curl
$url = SMS_URL; // where you want to post data
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true); // tell curl you want to post something
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&key=$key&mobile=$mobiles&message=$message&senderid=$senderid&accusage=1"); // NTFSMS , INFOSM, ROZGAR,define what you want to post
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
//curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Accept-Language: hi;q=0.5"));
$output = curl_exec ($ch); // execute
//echo $status = curl_getinfo($ch);
//print_r($output);
curl_close ($ch); // close curl handle
//var_dump($output); // show output
/* sms */
}
public function SendUnicodeSms($mobiles,$message){
$key=SMS_KEY; //
$user=SMS_USER; //
$senderid = SMS_SENDER_ID;
$ch = curl_init(); // initiate curl
$url = SMS_URL; // where you want to post data
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true); // tell curl you want to post something
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&key=$key&mobile=$mobiles&message=$message&senderid=$senderid&accusage=1&unicode=1"); // NTFSMS , INFOSM, ROZGAR,define what you want to post
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
//curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Accept-Language: hi;q=0.5"));
$output = curl_exec ($ch); // execute
//echo $status = curl_getinfo($ch);
//print_r($output);
curl_close ($ch); // close curl handle
//var_dump($output); // show output
}
/* custom development */
define('SMS_URL','http://sms.xxxxxxx.in/submitsms.jsp?');
define('SMS_USER','xxxxxxxxx');
define('SMS_KEY','xxxxxxx');
define('SMS_SENDER_ID','xxxxxxx');
define('SMS_SUPPORT_NO','1234567891');
/* custom development */
controller
if($insertCheck=='1'){
$this->session->set_flashdata('msg', '<p class="alert alert-success">Your request has been sent successfully.</p>');
/* sms */
$mobile = SMS_SUPPORT_NO;
$message = "New Suggestion/Problem Received\n
Name : ".$this->input->post('name')."
Mobile : ".$this->input->post('mobile')."
Ward No : ".$this->input->post('ward')."
\n\n:: Apna Roopangarh ::";
$this->Home_model->SendUnicodeSms($mobile,$message);
$mobile_user = $this->input->post('mobile');
$message_user = "आपकी शिकायत / सुझाव हमें प्राप्त हो गए हैं
\nजल्द ही हम आपसे संपर्क करेंगे
\nग्राम पंचायत रुपनगढ़";
$this->Home_model->SendUnicodeSms($mobile_user,$message_user);
/* sms */
}
Models
public function SendSms($mobiles,$message){
$key=SMS_KEY; //
$user=SMS_USER; //
$senderid = SMS_SENDER_ID;
/* sms */
$ch = curl_init(); // initiate curl
$url = SMS_URL; // where you want to post data
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true); // tell curl you want to post something
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&key=$key&mobile=$mobiles&message=$message&senderid=$senderid&accusage=1"); // NTFSMS , INFOSM, ROZGAR,define what you want to post
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
//curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Accept-Language: hi;q=0.5"));
$output = curl_exec ($ch); // execute
//echo $status = curl_getinfo($ch);
//print_r($output);
curl_close ($ch); // close curl handle
//var_dump($output); // show output
/* sms */
}
public function SendUnicodeSms($mobiles,$message){
$key=SMS_KEY; //
$user=SMS_USER; //
$senderid = SMS_SENDER_ID;
$ch = curl_init(); // initiate curl
$url = SMS_URL; // where you want to post data
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true); // tell curl you want to post something
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&key=$key&mobile=$mobiles&message=$message&senderid=$senderid&accusage=1&unicode=1"); // NTFSMS , INFOSM, ROZGAR,define what you want to post
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
//curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Accept-Language: hi;q=0.5"));
$output = curl_exec ($ch); // execute
//echo $status = curl_getinfo($ch);
//print_r($output);
curl_close ($ch); // close curl handle
//var_dump($output); // show output
}
No comments:
Post a Comment