if (isset($_POST['confirm_book_borrow'])) { //include '../includes/Pages_Func.php'; require_once '../private/LMS_Engine.php'; $engine = new LMS_Engine(); $user_id = $_POST['user_id']; $book_id = $_POST['book_id']; $pocket_id = $_POST['pocket_id']; $user_type = $_POST['user_type']; $call_id = $_POST['call_id']; $The_Book = $engine->get_book($book_id); $librarian_id = $_COOKIE['user_id']; if ($user_type == "student") { $user_type = "S"; $The_STD = $engine->get_student_by_pid($pocket_id); $cur_time = date("y-m-d H:i:s", time()); $stat = $engine->insert_book_borrows($user_id, $user_type, $book_id, $librarian_id, $cur_time); if ($stat) { header("Location: ../Librarian.php?page=search_book"); exit; } else { header("Location: ../Librarian.php?page=search_book"); exit; } } else { $user_type = "T"; $cur_time = date("y-m-d H:i:s", time()); $stat = $engine->insert_book_borrows($pocket_id, $user_type, $book_id, $librarian_id, $cur_time); if ($stat) { header("Location: ../Librarian.php?page=search_book"); exit; } else {