} //No action yet elseif (!$_POST['username'] OR !$_POST['password']) { drawlogin("missing"); } elseif (validate($_POST['username'],$_POST['password'])) { redirect("index.php"); } else { drawlogin("invalid"); } ob_end_flush(); // Flush the buffer out to client document_footer(); mysql_end(); function drawlogin($error) { ?> <script type="text/javascript"> function formfocus() { document.getElementById('username').focus(); } window.onload = formfocus; </script> <body id="login-body"> <div class="login container center"> <img src='images/logo.png' /><img src='images/thesystemlogo.png'><br /> <h3 class="text-muted small">Please Log In</h3> <? if ($error == "invalid")
echo include_stylesheet_dir("stylesheets", $debug); check_validated(); //If a new user was submitted! if (isset($_POST['newuser-submit'])) { $userinfo = array("username" => $_POST['username'], "fname" => $_POST['fname'], "lname" => $_POST['lname'], "emplid" => $_POST['emplid'], "password" => $_POST['password'], "email" => $_POST['email'], "phone" => $_POST['phone'], "address" => $_POST['address'], "pwconfirm" => $_POST['pwconfirm']); adduser($userinfo); } if (!check_app_admin()) { header('Location: index.php'); } open_page("Not User Management"); draw_page(); close_page(); ob_end_flush(); // Flush the buffer out to client document_footer(); mysql_end(); //The actual page. function draw_page() { ?> <div class="container"> <?php open_panel("userlist", "User List", false); ?> <div class="row"> <div class="col-md-10"> <?php