Exemplo n.º 1
0
 function sendPhoneMessage($sendPhone, $sendMessage)
 {
     $msgObj = new MobileMsg();
     $data = array();
     $data['user'] = constant("SMSPHONE_USERNAME");
     $data['password'] = constant("SMSPHONE_PASSWORD");
     $data['msisdn'] = "91" . $sendPhone;
     $data['sid'] = constant("SMSPHONE_REGNUMBER");
     $data['msg'] = $sendMessage;
     $data['fl'] = constant("SMSPHONE_FL");
     list($header, $content) = $msgObj->PostRequest(constant("SMSPHONE_SENDURL"), "", $data);
     return $content;
 }
Exemplo n.º 2
0
    $pwd = $_GET["login_pwd"];
    if (strlen($userName) > 0 && strlen($pwd) > 0) {
        $acc = new UserAccounts();
        $res = $acc->getloginSession($userName, $pwd);
        echo $res;
    } else {
        echo "NoUser";
    }
} 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();