本文整理汇总了PHP中Staff::GetByUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::GetByUsername方法的具体用法?PHP Staff::GetByUsername怎么用?PHP Staff::GetByUsername使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::GetByUsername方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CleanString
$username = CleanString($_POST["username"]);
$password = $_POST["password"];
$password_confirm = $_POST["password_confirm"];
$name = $_POST["name"];
$building = $_POST["building"];
$email = CleanString($_POST["email"]);
$phone_number = CleanString($_POST["phone_number"]);
$type = $_POST["type"];
if (empty($username) || empty($password) || empty($name) || empty($building) || empty($email) || empty($phone_number)) {
ShowError("One or more fields were empty!");
} elseif ($password != $password_confirm) {
ShowError("Passwords did not match! Go back and try again.");
} elseif (!Building::Exists($building) && $building !== "N/A") {
ShowError("Invalid building.");
} else {
$staff = Staff::GetByUsername($username);
if ($staff->IsValid()) {
if ($staff->IsActive()) {
ShowError("A staff member with that username already exists");
} else {
$staff->SetPassword(EncryptPassword($password));
$staff->Edit($name, $type, $building, $email, $phone_number);
ShowInfo("Created Staff Member Successfully");
RedirectTimer("admin&staff", 3);
}
} else {
Staff::Add($name, $type, $username, EncryptPassword($password), $building, $email, $phone_number);
ShowInfo("Created Staff Member Successfully");
RedirectTimer("admin&staff", 3);
}
}
示例2: ShowError
?>
</h1>
</div>
</div>
<?php
if (isset($_POST["update"])) {
$update_description = $_POST["update_description"];
if (empty($update_description)) {
ShowError("You must enter an update description.", true);
} else {
$me->IncrementPoints(2);
$ticket->AddUpdate($me->GetID(), $update_description);
}
} elseif (isset($_POST["reassign"])) {
$staff = Staff::GetByUsername($_POST["staffusername"]);
if ($staff->IsValid() && $staff->IsActive()) {
if ($staff->GetID() == $ticket->GetStaffID()) {
ShowError("You can not reassign a ticket to the same person!", true);
} else {
$body = $me->GetName() . " (" . $me->GetUsername() . ") has assigned you a ticket!";
$staff->SendTextMessage($body . " Reply for more information.");
$body .= $ticket->GetEmailBody($clientid, $name, $community, $building, $room);
$staff->SendEmail("Ticket Assignment", $body);
$ticket->SetStaffID($staff->GetID());
ShowInfo("Reassigned Successfully");
}
} else {
ShowError("Invalid staff member username", true);
}
} elseif (isset($_GET["status"])) {