<?php

class Sms extends CI_Controller {

    
    private $slug_page = 'sms'; 
    
    private $title = 'الرسائل'; 
    
    private $add_title = 'الرسائل'; 
     
    public function __construct() 
    {
        
        parent::__construct();

        require_admin_login();

        $this->load->model('db_get');

        $this->load->model('others');

        $this->load->library('ckeditor');
 
    }
        
  
          
    
            function index()
    {

          $url="http://62.150.26.41/SmsWebService.asmx/send";
          
        //$url = 'http://62.150.26.41/Default.aspx';
          
        $params = array(
                'username' => 'Electron',
                'password' => 'rRrRNcAe',
                'token' => 'hjazfzzKhahF3MHj5fznngsb',
                'sender' => 'Electron',
                'message' => 'اهلا بكم في شركة الكترون للإلكترونيات',
                'dst' => '60680264',
                'type' => 'text',
                'coding' => 'unicode', 
                'datetime' => 'now'
                       );


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);


$result = curl_exec($ch);
if(curl_errno($ch) !== 0) {
    error_log('cURL error when connecting to ' . $url . ': ' . curl_error($ch));
}

curl_close($ch);
print_r($result); 
                    

    }
    
    
}
    
?>
