<?php require_once 'private/LMS_Engine.php'; $engine = new LMS_Engine(); if (isset($_POST)) { if (isset($_POST['Add_New_Librarian'])) { if (strlen($_POST['Full_Name']) > 5 && strlen($_POST['User_Name']) > 2 && strlen($_POST['User_Pass']) > 2) { $engine->add_new_librarian($_POST['Full_Name'], $_POST['User_Name'], $_POST['User_Pass']); } else { } } } ?> <div class="container" id="main"> <br> <br> <h2><strong>Saint Joseph School</strong> </h2> <hr> <label class="form-control">Librarians</label> <hr> <div class="row" id="contact"> <div class="col-md-3 col-lg-8" > <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> <div class="table table-responsive "> <table class="table table-bordered "> <thead> <tr style="background: #ececec"> <th>Full Name</th> <th>User Name</th> <th>Reg. Date</th> <th></th>
<?php require_once 'private/LMS_Engine.php'; $engine = new LMS_Engine(); $msg = ""; if (isset($_POST) && isset($_POST['update_profile'])) { if ($engine->is_librarian($_POST['cr_user_name'], $_POST['cr_user_pass'])) { if (strlen($_POST['nw_full_name']) > 3 && strlen($_POST['nw_user_name']) > 3 && strlen($_POST['nw_user_pass']) > 3) { if (!$engine->is_librarian($_POST['nw_user_name'], $_POST['nw_user_pass'])) { $con = $engine->add_new_librarian($_POST['nw_full_name'], $_POST['nw_user_name'], $_POST['nw_user_pass']); if ($con) { $user_id = $engine->get_user_id_by($_POST['cr_user_name'], $_POST['cr_user_pass']); $engine->remove_user_by($user_id); $engine->add_new_librarian($_POST['nw_full_name'], $_POST['nw_user_name'], $_POST['nw_user_name']); $msg = "Your profile is successfully updated!"; } else { $msg = "The system cannot update your profile! please notify to the Admin"; } } else { $msg = "Your new user name and password are not valid. please use another one"; } } else { $msg = "Your new user name and password character length is so short. please use 4 characters and more"; } } else { $msg = "Your current user name and password are not valid"; } } ?> <div class="container" id="main"> <div class="row" id="contact">