示例#1
0
} else {
    if ($action == 'SendMessage') {
        $state = $_GET["signup_state"];
        $sendPhone = $_GET["sendPhone"];
        $staffID = '0000';
        $otpCount = '0';
        $util = new Utils();
        $msgObj = new MobileMsg();
        $otpNum = $util->randomNumber(6);
        $otpMsg = $msgObj->otpMessage($otpNum);
        // Send Message
        $content = $msgObj->sendPhoneMessage($sendPhone, $otpMsg);
        //    echo $content;
        // Insert into Database
        $acc = new UserAccounts();
        $reqId = $acc->registerByStateAndPhone($sendPhone, $state, $staffID);
        $acc->addOTPatRegister($otpNum, $reqId, $otpCount);
        echo $reqId;
    } else {
        if ($action == 'validateOTP') {
            $otpNum = $_GET["otpNumber"];
            $regID = $_GET["regId"];
            $acc = new UserAccounts();
            $result = $acc->validateOTP($otpNum, $regID);
            echo $result;
        } else {
            if ($action == 'updateRegistration') {
                $util = new Utils();
                $regId = $_GET["regId"];
                $username = $_GET["uName"];
                $d_pwd = $util->randomNumber(10);