当前位置: 首页>>代码示例>>PHP>>正文


PHP Alert::addText方法代码示例

本文整理汇总了PHP中Alert::addText方法的典型用法代码示例。如果您正苦于以下问题:PHP Alert::addText方法的具体用法?PHP Alert::addText怎么用?PHP Alert::addText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Alert的用法示例。


在下文中一共展示了Alert::addText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Alert

            //echo ' in';
            //echo $user->getUserStatus();
            $user->setUserStatus(2);
            //echo 'in';
            $userManager->save($user);
            //echo $user->getUserStatus().'in';
            $message = new Alert("info", true);
            $message->addText('Thanks ' . $user->getFirstName() . '!</br>Your email is now confirmed. You can already login.');
            $message->messageToSession();
            //echo $user->getUserStatus().'should be there';
            header('Location: index.php');
            exit;
            //echo '</br> shouldnt be there';
        } else {
            //user already confirmed
            $message->addText("Your account is already confirmed.");
        }
    } else {
        //confirmCode doesnt exist
        $message->addText("Your comfirm link is broken.");
    }
    $message->messageToSession();
    header('Location: index.php');
    exit;
} else {
    //visitor goes on a wrong link
    $message = new Alert("danger", true);
    $message->addText("Your comfirm link is broken.");
    header('Location: index.php');
    exit;
}
开发者ID:JhumanJ,项目名称:Unisales,代码行数:31,代码来源:confirm.php

示例2: User

         //User doesn't exist yet, and data are checked
         //So we register user (userType 1,userStatus 1,..)
         $data = User::returnDataArrayFromData(1, 1, $email, $university->getId(), $firstName, $lastName, $passWord);
         $newUser = new User($data);
         $newUser->setEmailChecker();
         $mailer->sendEmailVerify($newUser);
         if ($mailer->sendEmailVerify($newUser)) {
             $message = new Alert('info', true);
             $message->addText('Welcome <strong>' . $firstName . '</strong>! Before you log in, please confirm your email by clicking the link you received.');
             $message->messageToSession();
             $userManager->save($newUser);
             header('Location: index.php');
             exit;
         } else {
             $message = new Alert('warning', true);
             $message->addText('Sorry <strong>' . $firstName . '</strong> we had a little problem! Please try again.');
             $message->messageToSession();
         }
     } else {
         //User exist already ( email already used)
         $message->addText('Email address already registered.');
     }
 }
 //-------All fields are NOT correct OR user already registered --------
 // From here, there was a problem with one of the field or user already registered
 // We show the form again, prefill in with error message
 //Save message to transmit it to page
 $message->messageToSession();
 //Save correct fields to transmit to page
 $_SESSION['correctFields'] = $correctFields;
 createPage("register");
开发者ID:JhumanJ,项目名称:Unisales,代码行数:31,代码来源:register.php

示例3: Alert

<?php

/**
 * Created by PhpStorm.
 * User: Julien
 * Date: 29/01/16
 * Time: 12:40
 */
?>



<div class="container">

    <?php 
//If user connects for the first time
if ($user->getUserStatus() == 2) {
    $message = new Alert("success", false);
    $message->addText('<p>Welcome ' . $user->getFirstName() . '!</p><p>Before your registration is fully completed, we need few more details...</p>');
    $message->show();
}
?>



</div>
开发者ID:JhumanJ,项目名称:Unisales,代码行数:26,代码来源:view.home.logged.php

示例4: UserManager

 } else {
     $loginCorrect = false;
     $message->addText('Password is not valid.');
 }
 //if the field content are correct, we check the user
 if ($loginCorrect) {
     $userManager = new UserManager($db);
     if ($userManager->getUniqueFromEmail($email) instanceof User) {
         $user = $userManager->getUniqueFromEmail($email);
         if ($user->getPassWord() == md5($passWord)) {
             //Email exists and password is the good one then check that user email is confirmed.
             if ($user->getUserStatus() >= 2) {
                 //email is confirmed.
                 $_SESSION['user'] = $user;
                 $message = new Alert('info', true);
                 $message->addText('Hello <strong>' . $user->getFirstName() . '</strong>!');
                 $message->messageToSession();
                 header('Location: index.php');
                 exit;
             } else {
                 $message->addText('Please confirm your email address by clicking the link you received.');
             }
         } else {
             $message->addText('Password invalid.');
         }
     } else {
         $message->addText('Email address doesn\'t correspond to any users.');
     }
 }
 $message->messageToSession();
 createPage("home.visitor");
开发者ID:JhumanJ,项目名称:Unisales,代码行数:31,代码来源:index.php


注:本文中的Alert::addText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。