HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/crm.chaitanyahospitalvirar.com/application/libraries/Mobireach_lib.php
<?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class Mobireach_lib
{

    private $_CI;
    public $URL            = "https://api.mobireach.com.bd/SendTextMessage?";
    var $AUTH_KEY;     
    var $senderId; 
    var $routeId; 
    var $smsContentType; 

    public function __construct($params)
    {
    	
    $this->_CI          = &get_instance();
	$this->AUTH_KEY=$params['authkey'];     
	$this->senderId=$params['senderid']; 
	$this->routeId=$params['routeid']; 
	$this->smsContentType="";
        
    }

    public function sendSMS($to, $message)
    {

        $url = $this->URL . 'Username=' . rawurlencode($this->AUTH_KEY) .
        '&Password=' . rawurlencode($this->senderId) .
        '&From=' . rawurlencode($this->routeId) .
        '&To=' . rawurlencode($to) .
        '&Message=' . rawurlencode($message);
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response    = curl_exec($ch);
        $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        if (curl_errno($ch)) {
            $error_msg = curl_error($ch);
        }
        curl_close($ch);
        return $response;
    }

}