<?php

require './vendor/autoload.php';
$auth = new BasicAuth("rwkelkwk", "giscmswq");

// instance of ApiHost
$apiHost = new ApiHost($auth);

// instance of AccountApi
$accountApi = new AccountApi($apiHost);

// set web console logging to false
$disableConsoleLogging = false;

// Let us try to send some message
$messagingApi = new MessagingApi($apiHost, $disableConsoleLogging);
try {
//     // Send a quick message
//     $a = 0;
//     for ($i = 0; $i<5; $i++) 
// {
//     $a .= mt_rand(0,9);
// }
    $messageResponse = $messagingApi->sendQuickMessage("OTSHS/OFFICE OF THE HOUSE MASTER", "+233555733180", "Test SMS");

    if ($messageResponse instanceof MessageResponse) {
         echo $messageResponse->getStatus();
        //echo 1;
        // $phone_code->insert(array("code"=>$a,"user_id"=>$id));
    } elseif ($messageResponse instanceof HttpResponse) {
        echo "\nServer Response Status : " . $messageResponse->getStatus();
    }
} catch (Exception $ex) {
    echo $ex->getTraceAsString();
}