本文整理汇总了PHP中UserController::AddUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserController::AddUser方法的具体用法?PHP UserController::AddUser怎么用?PHP UserController::AddUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserController
的用法示例。
在下文中一共展示了UserController::AddUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
if (isset($_POST["btnAddUser"])) {
include_once "../../../controller/UserController.php";
$name = $_POST["name"];
$email = $_POST["email"];
$pass = $_POST["pass"];
$phone = $_POST["phone"];
$role = $_POST["role"];
$result = UserController::AddUser($name, $pass, $email, $phone, $role);
if ($result) {
header("Location:../user_index.php?id=" . $result);
}
}
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "showPopupEdit") {
include_once "../../../controller/UserController.php";
$id = $_REQUEST["userId"];
$result = UserController::GetUserByID($id);
if ($result) {
require_once "../utils/user_util.php";
echo UserUtil::createFormEdit($result);
}
}
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "update") {
require_once "../../../controller/UserController.php";
require_once "../utils/user_util.php";
$email = $_REQUEST["email"];
$pass = $_REQUEST["pass"];
$phone = $_REQUEST["phone"];
$role = $_REQUEST["role"];
$id = $_REQUEST["id"];
示例2: date
$radio_gender = $_POST['gender'];
echo "<br>radio=" . $radio_gender;
$rsUpdate = UsersBUS::UpdateInfor($id, $username, $radio_gender, $address, $dt1, $dt2, $time);
if ($rsUpdate == true) {
Utils::redirect("../thongtinkhachhang.php?update=success");
} else {
Utils::redirect("../thongtinkhachhang.php?update=failed");
}
}
if (isset($_POST["btRegister"])) {
//echo "register";
include_once "UserController.php";
$password = $_POST["txtPassword"];
$username = $_POST["txtUsername"];
$phone = $_POST["txtPhone"];
//$dt2 = $_POST["txtMobile"];
$email = $_POST["txtEmail"];
$role = "1";
//$fRegister="false";
$time = date('Y-m-d');
$id = UserController::AddUser($username, $password, $email, $phone, $role);
if (!empty($id)) {
$fRegister = "true";
//echo "suceess";
//$_SESSION["register"] = "true";
Utils::redirect("../view/user/product-list.php?type=1&do=login");
} else {
echo "failed";
Utils::redirect("../view/user/register.php?do=failed");
}
}