if ($status !== false) { if ($status == "True") { $status = "False"; } else { $status = "True"; } } if ($client->updateFieldByID($_GET['invert'], "valid", $status)) { echo '<p class="notification green">You have successfully inverted the status of a client.</p>'; $log->addLog($_SESSION['loggedIn']['id'], "Updated a client status."); } else { echo '<p class="notification red">Something went wrong while updating the status of the client.</p>'; } } elseif (!empty($_GET['edit']) && is_numeric($_GET['edit'])) { $showTable = true; if ($client->checkValueExists("id", $_GET['edit'])) { $showTable = false; if ($_SERVER['REQUEST_METHOD'] == "POST") { if (empty($_POST['client_firstname']) || empty($_POST['client_nickname']) || empty($_POST['client_valid'])) { echo '<p class="notification red">All fields are required.</p>'; } else { if (strlen($_POST['client_nickname']) > 32) { echo '<p class="notification red">The client username cannot contain more than 32 characters!</p>'; } elseif ($_POST['client_valid'] !== "True" && $_POST['client_valid'] !== "False") { echo '<p class="notification red">The client status is not valid.</p>'; } else { if ($client->updateFieldByID($_GET['edit'], "fname", $_POST['client_firstname']) && $client->updateFieldByID($_GET['edit'], "nickname", $_POST['client_nickname']) && $client->updateFieldByID($_GET['edit'], "valid", $_POST['client_valid'])) { echo '<p class="notification green">You have successfully updated a client user.</p>'; $log->addLog($_SESSION['loggedIn']['id'], "Updated a client."); $hideform = true; $showTable = true;