Exemple #1
0
include_once '../libs/log.php';
include_once '../../src/Base/DataAccessBundle/Entity/Student.php';
//include_once '../../src/Base/DataAccessBundle/Controller/DefaultController.php';
ini_set('error_log', 'ussd-app-error.log');
//$dc =new DefaultController();
$receiver = new MoUssdReceiver();
// Create the Receiver object
$receiverSessionId = $receiver->getSessionId();
session_id($receiverSessionId);
//Use received session id to create a unique session
session_start();
$content = $receiver->getMessage();
// get the message content
$address = $receiver->getAddress();
// get the sender's address
$requestId = $receiver->getRequestID();
// get the request ID
$applicationId = $receiver->getApplicationId();
// get application ID
$encoding = $receiver->getEncoding();
// get the encoding value
$version = $receiver->getVersion();
// get the version
$sessionId = $receiver->getSessionId();
// get the session ID;
$ussdOperation = $receiver->getUssdOperation();
// get the ussd operation
logFile("[ content={$content}, address={$address}, requestId={$requestId}, applicationId={$applicationId}, encoding={$encoding}, version={$version}, sessionId={$sessionId}, ussdOperation={$ussdOperation} ]");
//your logic goes here......
$responseMsg = array("main" => "Welcome!\n                    1.Register\n                    2.Jobs\n                    99.Exit", "register" => "Please select a category\n                    1.Tech\n                    2.Business\n                    3.Entertainment\n                    99.Back", "jobs" => "You have received following jobs", "selected" => "\n                        1.Confirm registration\n                    99. Back", "registered" => "Thank you for register in our service\n                      Now you will receive jobs in selected category ");
$categories = array("1" => "Tech", "2" => "Business", "3" => "Entertainment");
Exemple #2
0
include_once '../libs/ussd/MoUssdReceiver.php';
include_once '../libs/ussd/MtUssdSender.php';
include_once 'config.php';
include_once '../libs/dbinteract.php';
include_once '../libs/log.php';
ini_set('error_log', 'ussd-app-error.log');
$getUSSD = new MoUssdReceiver();
$USSDSessionID = $getUSSD->getSessionId();
session_id($USSDSessionID);
session_start();
$content = $getUSSD->getMessage();
// get the message content
$address = $getUSSD->getAddress();
// get the sender's address
$requestId = $getUSSD->getRequestID();
// get the request ID
$applicationId = $getUSSD->getApplicationId();
// get application ID
$encoding = $getUSSD->getEncoding();
// get the encoding value
$version = $getUSSD->getVersion();
// get the version
$sessionId = $getUSSD->getSessionId();
// get the session ID;
$ussdOperation = $getUSSD->getUssdOperation();
// get the ussd operation
$Messages = array("main" => "Welcome to Lyrisize!\nEnter the name of the Song:");
logFile("Previous Menu is := " . $_SESSION['menu-Opt'] . $Messages["main"]);
if ($getUSSD->getUssdOperation() == "mo-init") {
    showView($USSDSessionID, $Messages["main"], $INFO);