<?php

require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$issue_info = $engine->get_Mag_issue_by_($book_id);
$User_Info = $engine->get_student($user_id);
$The_Mag = $engine->get_magazine($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">
    $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);
    $date_dif = $min . " minutes ago";
} else {
    $min = floor($date_dif);
    $date_dif = $min . " seconds ago";
}
Ejemplo n.º 3
0
<?php

require_once 'LMS_Engine.php';
$engine = new LMS_Engine();
print_r($_POST);
if (isset($_GET['page']) && $_GET['page'] == 'return_item') {
    if (isset($_POST['get_book_info'])) {
        $book_id = $engine->get_book_id($_POST['call_number'], $_POST['copy_number']);
        if ($book_id > 0 && $engine->is_borrowed($book_id) == 1) {
            $The_Item = $engine->get_book($book_id);
            $The_Issue = $engine->get_book_borrower($book_id);
            $The_User = $engine->get_student($The_Issue['user_id']);
            // include 'pages/Return/Return_Items_2.php';
            include 'pages/Return/Return_Items.php';
        } else {
            include 'pages/Return/Return_Items.php';
        }
    } elseif (isset($_POST['confirm_return'])) {
        if (isset($_POST['book_id'])) {
            $state = $engine->return_books($_POST['book_id']);
            if ($state) {
                include 'pages/Search_Issued.php';
            } else {
                include 'pages/Return/Return_Items.php';
            }
        }
    } else {
        include 'pages/Return/Return_Items.php';
    }
}
<?php

require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
if (isset($user_id)) {
    $Student = $engine->get_student($user_id);
}
?>
<div class="container">
    <br>
    <br>
    <br>
    <div class="row">
        <h3>Edit Student Parameters</h3>
        <hr>
        <form class="form-horizontal"  method="post" action="private/Page_Func.php" enctype="multipart/form-data">
            <div class="col-sm-3 col-md-3 col-lg-3" >
                <div class="col-sm-12 col-md-12 col-lg-12" style="margin: 10px; margin-right: 20px">
                    <label class="label label-success">Photo: </label>
                    <img class="img-rounded" src="images/<?php 
echo $Student['photo'];
?>
" width="120px" height="180px"><br><br>
                    <div class="col-sm-12 col-md-12 col-lg-12"">
                        <label class="label label-success">Photo: </label>
                        <input class="form-control" type="file" name="upload_image" id="photo" value="<?php 
echo $Student['photo'];
?>
"><br>
                    </div>
                </div>