本文整理汇总了PHP中notifications::successMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP notifications::successMessage方法的具体用法?PHP notifications::successMessage怎么用?PHP notifications::successMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notifications
的用法示例。
在下文中一共展示了notifications::successMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Connection
<?php
session_start();
require_once "../models/connection.php";
require_once "../models/dao.php";
require_once "../controllers/notifications.php";
$con = new Connection();
$connection = $con->getConnection();
$DAOobject = new Dao($connection);
$notifyObject = new notifications();
if (isset($_POST["startSession"])) {
$state = $_POST["state"];
$DAOobject->configureNewSession($state);
$_SESSION["state"] = $state;
header("location: configure.php");
return;
} elseif (isset($_POST["endSession"])) {
$statename = "";
if (isset($_SESSION["state"])) {
$statename = $_SESSION["state"];
}
$DAOobject->EndSession($statename);
unset($_SESSION["state"]);
$msg = "The current session for '{$statename} 'has ended!!!";
echo $notifyObject->successMessage($msg);
}
?>
<html>
<br/>
<a href="../views/adminindex.php"><button class="btn btn-primary"> HOME </button></a>
</html>
示例2: header
if (!isset($_SESSION["Admin_Id"])) {
header("location:../views/login.php");
}
if ($_SESSION["level"] != 2) {
header("location:../views/login.php");
}
$con = new Connection();
$connection = $con->getConnection();
$misc = new MiscFunction($connection);
$notifyObject = new notifications();
if (isset($_POST["submit"])) {
$fullname = $_POST["fullname"];
$username = "QA" . $misc->createPassword();
//creates new admin username
$password = $misc->createPassword();
//creates nes admin password
//validate user input
$errMsg = $misc->validateInput($fullname);
if ($errMsg !== "") {
$_SESSION["error"] = $errMsg;
header("location: createAdmin.php");
} else {
$adminObj = new Admin($fullname, $username, $password);
$DAOobject = new Dao($connection);
$DAOobject->createNewAdmin($adminObj);
//create new QA admin
$msg = "Admin " . $fullname . " has been created <br/><br/>";
echo $notifyObject->successMessage($msg) . '<br/><br/>';
echo "<a href='../views/createAdmin.php'> Create new Admin </a>";
}
}