Exemplo n.º 1
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';
    }
}
         } else {
             header("Location: ../Librarian.php?page=search_cd_dvd");
             exit;
         }
     }
 }
 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";
<?php

if (isset($_POST['Update_Book'])) {
    require_once 'private/LMS_Engine.php';
    $engine = new LMS_Engine();
    $engine->update_book($_POST['lib_book_id'], $_POST['title'], $_POST['author'], $_POST['publisher'], $_POST['publish_year'], $_POST['publish_address'], $_POST['call_id'], $_POST['copy_number'], $_POST['shelf_store'], $_POST['cat_id']);
    $The_Book = $engine->get_book($_POST['lib_book_id']);
} elseif ($_POST['Delete_Book']) {
    require_once 'private/LMS_Engine.php';
    $engine = new LMS_Engine();
    $engine->delete_book($_POST['lib_book_id']);
}
?>

<div class="container">
    <br>
    <div class="row"><div class="col-lg-12">
        <form class="form-horizontal"  method="post" action="Librarian.php?page=library_books">
            <div class="pull-right"style="margin-top: 20px" >
                    <input class="form-control btn-primary"name="Go_To_Library" type="submit" value="Go To Library"><br>
                </div>
            <br>
            </div>
        </form>
        <hr>
        </div>
        <h3>Edit Book Parameters</h3>
        <hr>
        <form class="form-horizontal"  method="post" action="">
            <div class="col-sm-4 col-md-4 col-lg-4" >
                <div class="col-sm-12 col-md-12 col-lg-12" style="margin: 10px">