}
 }
 if (isset($_POST['confirm_magazine_borrow'])) {
     //include '../includes/Pages_Func.php';
     require_once '../private/LMS_Engine.php';
     $engine = new LMS_Engine();
     $user_id = $_POST['user_id'];
     $mag_id = $_POST['Mag_ID'];
     $pocket_id = $_POST['pocket_id'];
     $user_type = $_POST['user_type'];
     $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_magazine_borrows($user_id, $user_type, $mag_id, $librarian_id);
         if ($stat) {
             header("Location: ../Librarian.php?page=search_magazine");
             exit;
         } else {
             header("Location: ../Librarian.php?page=search_magazine");
             exit;
         }
     } else {
         $user_type = "T";
         $cur_time = date("y-m-d H:i:s", time());
         $stat = $engine->insert_magazine_borrows($pocket_id, $user_type, $mag_id, $librarian_id);
         if ($stat) {
             header("Location: ../Librarian.php?page=search_magazine");
             exit;
         } else {