Exemple #1
0
function getMenu1($input)
{
    switch ($input) {
        case 1:
            $response = "Please enter your names";
            break;
        case 2:
            $result = getStaff($phoneNumber);
            $phonecheck = $result['phoneNumber'];
            if ($phoneNumber == $phonecheck) {
                $response = getHomeMenu2();
                sendOutput($response, 2);
                exit;
            }
            $response = "Please register as you aren't in our records";
            break;
        default:
            getHomeMenu();
            break;
    }
    sendOutput($response, 1);
    return $response;
}
Exemple #2
0
//connection to the database
require_once 'connection.php';
$phoneNumber = "0" . substr(trim($_GET["phoneNumber"]), 3, 9);
//start
$text = $_REQUEST['text'];
$result = getLevel($text);
$level = $result['level'];
$message = $result['latest_message'];
global $name, $dob, $location, $pwds, $phoneNumber;
switch (strtolower($level)) {
    case 0:
        $result = getMember($phoneNumber);
        $phonecheck = $result['phoneNumber'];
        if ($phoneNumber == $phonecheck) {
            $response = getHomeMenu2();
            sendOutput($response, 2);
            exit;
        }
        $response = getHomeMenu();
        break;
    case 1:
        $response = getLevelOneMenu($message);
        $result = createMember($phoneNumber, $name);
        break;
    case 2:
        $response = getLevelTwoMenu($message);
        //take $dob
        $result = updateMemberDob($phoneNumber, $dob);
        break;
    case 3: