$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); } }
?> </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"])) {