<?php

require_once 'src/autoload.php';

Class Sms
{

	function send_sms($login_number,$otp_code)
	{
		$message = new \Esendex\Model\DispatchMessage(
	    "Orbis", // Send from
	    '+'.$login_number, // Send to any valid number
	    $otp_code,
	    \Esendex\Model\Message::SmsType
		);

		$authentication = new \Esendex\Authentication\LoginAuthentication(
		    "EX0234314", // Your Esendex Account Reference
		    "Shaun.wilcock@orbisprotect.com", // Your login email address
		    "IIVOrules!!" // Your password
		);

		$service = new \Esendex\DispatchService($authentication);
		$result = $service->send($message);
		return $result->id();
	}

	function check_sms_report($msg_id)
	{
		$authentication = new \Esendex\Authentication\LoginAuthentication(
		    "EX0234314", // Your Esendex Account Reference
		    "Shaun.wilcock@orbisprotect.com", // Your login email address
		    "IIVOrules!!" // Your password
		);

		$headerService = new \Esendex\MessageHeaderService($authentication);
		$message = $headerService->message($msg_id);
		return ($message->status());
	}
}