<?php

require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$issue_info = $engine->get_issue_by_($book_id);
$User_Info = $engine->get_student($user_id);
$The_Book = $engine->get_book($book_id);
$prev_date = strtotime($issue_info['borrow_date']);
$date_dif = abs(time() - $prev_date);
if ($date_dif > 86400) {
    $days_ = floor($date_dif / (60 * 60 * 24));
    $date_dif = $days_ . " days ago";
} elseif ($date_dif > 3600) {
    $hour = floor($date_dif / (60 * 60));
    $date_dif = $hour . " hours ago";
} elseif ($date_dif > 60) {
    $min = floor($date_dif / 60);
    $date_dif = $min . " minutes ago";
} else {
    $min = floor($date_dif);
    $date_dif = $min . " seconds ago";
}
if (count($User_Info) > 0) {
    $user_type = "S";
} else {
    $User_Info = $engine->get_teacher_by_user_id($user_id);
    $user_type = "T";
}
?>
<div class="container" id="main">
    <div  class="row" id="contact">
<tr>
<?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
if (isset($type) && $type == "Books") {
    $path = "Librarian.php?page=issued_Book_detail";
    $issue_info = $engine->get_issue_by_($found['id']);
} elseif (isset($type) && $type == "CD-DVDs") {
    $path = "Librarian.php?page=issued_CD_detail";
    $state = $engine->is_issuedCD($found['id']);
    $issue_info = $engine->get_CD_issue_by_($found['id']);
} elseif (isset($type) && $type == "Magazines") {
    $path = "Librarian.php?page=issued_Magazine_detail";
    $state = $engine->is_issuedMagazine($found['id']);
    $issue_info = $engine->get_Meg_issue_by_($found['id']);
} else {
    $path = "Librarian.php?page=issued_Book_detail";
    $state = $engine->is_issuedBook($found['id']);
    $issue_info = $engine->get_issue_by_($found['id']);
}
$User_Info = $engine->get_student($issue_info['user_id']);
$prev_date = strtotime($issue_info['borrow_date']);
$date_dif = abs(time() - $prev_date);
if ($date_dif > 86400) {
    $days_ = floor($date_dif / (60 * 60 * 24));
    $date_dif = $days_ . " days ago";
} elseif ($date_dif > 3600) {
    $hour = floor($date_dif / (60 * 60));
    $date_dif = $hour . " hours ago";
} elseif ($date_dif > 60) {
    $min = floor($date_dif / 60);