function import_Books($file)
{
    set_include_path(get_include_path() . PATH_SEPARATOR . 'Classes/');
    include 'PHPExcel/IOFactory.php';
    require_once 'private/LMS_Engine.php';
    $engine = new LMS_Engine();
    try {
        $objPHPExcel = PHPExcel_IOFactory::load($file);
        $Total_Sheet = $objPHPExcel->getSheetCount();
        for ($num = 0; $num < $Total_Sheet; $num++) {
            $Sheet = $objPHPExcel->getSheet($num)->toArray(null, true, true, true);
            $Row = count($Sheet);
            for ($pos = 3; $pos < $Row; $pos++) {
                $Title = trim($Sheet[$pos]['B']);
                $Author = trim($Sheet[$pos]['C']);
                $Publisher = trim($Sheet[$pos]['D']);
                $Pub_Year = trim($Sheet[$pos]['E']);
                $Pub_Add = trim($Sheet[$pos]['F']);
                $Call_ID = trim($Sheet[$pos]['G']);
                $Copy_Num = trim($Sheet[$pos]['H']);
                $Category = trim($Sheet[$pos]['I']);
                $Shelf_Store = trim($Sheet[$pos]['J']);
                $engine->add_new_book($Title, 1, $Author, $Publisher, $Pub_Year, $Pub_Add, $Call_ID, $Copy_Num, $Shelf_Store);
            }
        }
    } catch (Exception $e) {
        die('Error loading file "' . pathinfo($file, PATHINFO_BASENAME) . '": ' . $e->getMessage());
    }
}
<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);
                    <select class="form-control" name="from" id="from">
                        <?php 
echo "<option value=\"{$from}\">" . $from . '</option>';
?>
                        <option value="All">All</option>
                        <option value="Shelf">Shelf</option>
                        <option value="Store">Store</option>
                    </select>
                    </select>
                </div><br>
                <div class="col-lg-12">
                    <label>Search Category: </label>
                    <select class="form-control" name="cat_id" id="cat_id">
                        <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$vals = $engine->get_all_book_categories();
//if(isset($_POST['cat_id'])){
echo "<option value=\"" . $cat_id . '">' . $engine->get_book_cat_name($cat_id)['name'] . '</option>';
//}
foreach ($vals as $values) {
    echo "<option value='{$values['id']}'>{$values['name']}</option>";
}
?>
                    </select>
                </div><br>
                <div class="col-lg-12">
                    <label>Search hint: </label>
                    <input type="text" class="form-control" name="hint" placeholder="Search"><br>
                </div>
                <div class="col-md-2 col-lg-2">
echo $found['author'];
?>
</td>
    <td><?php 
echo $found['publisher'];
?>
</td>
    <td><?php 
echo $found['publish_year'];
?>
</td>
    <td>
        <form  class="form-vertical" method="POST"  action="Librarian.php">
            <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$state = $engine->is_issuedBook($found['id']);
if ($state) {
    $cond = '';
} else {
    $cond = 'hidden="hidden"';
}
?>
            <input type="text" hidden="hidden" name="book_id" value="<?php 
echo $found['id'];
?>
">
            <button  class="form-control btn-small" type="submit" value="<?php 
echo $found['id'];
?>
" name="make_book_issue">Issue </strong> </button>
<?php

require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
if (isset($_POST['add_new_cd_dvd'])) {
    $state = $engine->add_new_cds($_POST['title'], $_POST['subject'], $_POST['cd_number'], $_POST['copy_number'], $_POST['publisher'], $_POST['cat_id'], $_POST['call_number']);
}
$page_num = null;
$from = "All";
$hint = "";
$cat_id = 1;
if (!isset($_GET['page_num'])) {
    $page_num = 0;
    if (isset($_POST['upload_cds'])) {
        $from = $_POST['from'];
        $hint = $_POST['hint'];
        $cat_id = $_POST['cat_id'];
    }
} else {
    $page_num = $_GET['page_num'];
    $from = $_GET['from'];
    $hint = $_GET['hint'];
    $cat_id = $_GET['cat_id'];
}
?>
<div class="container" id="main">
    <div  class="row" id="contact">
        <hr>
        <div class="page-header">
            <h3>Manage Library CD-DVDs </h3>
        </div>
                    <select class="form-control" name="shelf_store" id="cat_id">
                        <?php 
if (isset($The_Book['shelf_or_store'])) {
    echo '<option>' . $The_Book['shelf_or_store'] . '</option>';
}
?>
                        <option>Shelf</option>
                        <option>Store</option>
                    </select>
                </div>
                <div class="col-sm-12 col-md-12 col-lg-12"style="margin: 10px">
                    <label class="label label-success">Category: </label>
                    <select class="form-control" name="cat_id" id="cat_id">
                        <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$vals = $engine->get_all_book_categories();
echo '<option value=' . $The_Book['cat_id'] . '>' . $engine->get_book_cat_name($The_Book['cat_id'])['name'] . '</option>';
foreach ($vals as $values) {
    echo "<option value='{$values['id']}'>{$values['name']}</option>";
}
?>
                    </select>
                </div>
                <div >
                <div class="col-sm-5" style="margin-top: 80px">
                    <input class="form-control btn-primary"name="Update_Book" type="submit" value="Save Changes"><br>
                </div>
                <div class="col-sm-5" style="margin-top: 80px">
                    <input class="form-control btn-default"name="Delete_Book" type="submit" value="Delete"><br>
                </div>
        </div>
        <div class="col-md-3 col-lg-8"  >
            <div class="table-responsive ">
                <table class="table table-hover">
                    <thead>
                    <tr style="background: #808080">
                        <th>Photo</th>
                        <th>Full Name</th>
                        <th>Pocket ID</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
if (isset($_POST['Search_Items'])) {
    $founds = $engine->search_stu_and_tea($_POST['from'], $_POST['full_name']);
} else {
    $founds = $engine->search_stu_and_tea("All", "");
}
foreach ($founds as $found) {
    include 'pages/elements/Users_Table_Lists.php';
}
?>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="col-md-3 col-lg-3" style="margin-left: 50px" >
<?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">
            <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
            <div class="table table-responsive ">
                <table class="table table-bordered ">
                    <thead>
                    <tr style="background: #ececec">
                        <th>Full Name</th>
                        <th>Department</th>
                        <th>User Name</th>
                        <th>Reg. Date</th>
                        <th></th>
                    </tr>
                    </thead class="table table-condensed">
                    <tbody >
                    <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$founds = $engine->get_all_teachers();
$total = count($founds);
$size = 10;
$start = $page_num * $size;
$i = 0;
$disp = 0;
foreach ($founds as $found) {
    if ($start > $i) {
        $i++;
        continue;
    } elseif ($i < $start + 10) {
        $User_Table = $found;
        $Staff_Table = $engine->get_staff_by($found['id']);
        include 'pages/elements/Teacher_Users_Table_Items.php';
        $disp++;
<?php

require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
if (isset($_POST['add_new_magazine'])) {
    $engine->add_new_magazine($_POST['title'], $_POST['subject'], $_POST['publisher'], $_POST['page_num'], $_POST['publish_date'], $_POST['call_num'], $_POST['copy_num'], 'store', $_POST['cat_id']);
}
$page_num = null;
$from = "All";
$hint = "";
$cat_id = 1;
if (!isset($_GET['page_num'])) {
    $page_num = 0;
    if (isset($_POST['Search_Items'])) {
        $from = $_POST['from'];
        $hint = $_POST['hint'];
        $cat_id = $_POST['cat_id'];
    }
} else {
    $page_num = $_GET['page_num'];
    $from = $_GET['from'];
    $hint = $_GET['hint'];
    $cat_id = $_GET['cat_id'];
}
?>
<div class="container" id="main">
    <div  class="row" id="contact">
        <hr>
        <div class="page-header">
            <h3>Manage Library Magazines </h3>
        </div>
                    <input class="form-control" type="text">
                </div>
                <div class="col-sm-12 col-md-12 col-lg-12">
                    <label class="label label-success">Call ID: </label>
                    <input class="form-control" type="text">
                </div>
                <div class="col-sm-12 col-md-12 col-lg-12">
                    <label class="label label-success">Number of Copies: </label>
                    <input class="form-control" type="text">
                </div>
                <div class="col-sm-12 col-md-12 col-lg-12">
                    <label class="label label-success">Category: </label>
                    <select class="form-control" name="cat_id" id="cat_id">
                        <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$vals = $engine->get_all_book_categories();
foreach ($vals as $values) {
    echo "<option value='{$values['id']}'>{$values['name']}</option>";
}
?>
                    </select>
                </div>
                <div class="col-sm-12 col-md-12 col-lg-12" style="margin-top: 20px">
                    <input class="form-control btn-primary" type="submit" value="Register">
                </div>
            </form>
        </div>

    </div>
</div>
Exemplo n.º 12
0
                        <ul class="dropdown-menu" role="menu">
                            <li class="divider"></li>
                            <li><a href="?page=log_out">Log out</a></li>
                            <li class="divider"></li>
                        </ul>
                    </li>

                </ul>
            </div>


    </nav>
    <hr>
    <?php 
require_once "private/LMS_Engine.php";
$engine = new LMS_Engine();
if (isset($_GET)) {
    if (isset($_GET['page']) && $_GET['page'] == "librarians") {
        if (isset($_POST['Remove_Librarian'])) {
            $user_id = $_POST['User_ID'];
            $engine->remove_user_by($user_id);
            include 'pages/Add_New_Librarian.php';
        } else {
            include 'pages/Add_New_Librarian.php';
        }
        if (isset($_POST['Add_New_Librarian'])) {
            if (strlen($_POST['Full_Name']) > 2 && strlen($_POST['User_Name']) > 2 && strlen($_POST['User_Pass']) > 2) {
                $engine->add_new_librarian($_POST['Full_Name'], $_POST['User_Name'], $_POST['User_Pass']);
            } else {
            }
        }
<?php

try {
    require_once 'private/LMS_Engine.php';
    $engine = new LMS_Engine();
} catch (mysqli_sql_exception $e) {
}
if (isset($_POST)) {
    if (isset($_POST['Reg_Items'])) {
        require_once '../private/LMS_Engine.php';
        $engine = new LMS_Engine();
        $val = $engine->Add_Book($_POST['title'], $_POST['cat_id'], $_POST['author'], $_POST['publisher'], $_POST['publish_year'], $_POST['publish_address'], $_POST['call_id'], $_POST['copy_num'], $_POST['shelf_or_store']);
        header("Location: ../Librarian.php?page=add_remove");
        exit;
    }
}
function get_Librarian_Add_User_Page()
{
    header("Location: ../Librarian.php?page=add_user");
    exit;
}
function get_Librarian_Manage_Books_Page()
{
    header("Location: ../Librarian.php?page=library_books");
    exit;
}
function get_Librarian_Add_New_Student_Page()
{
    header("Location: ../Librarian.php?page=add_new_student");
    exit;
}
                        <?php 
if (isset($_POST['s_from'])) {
    echo '<option>' . $_POST['s_from'] . '</option>';
}
?>
                        <option>Books</option>
                        <option>CD-DVDs</option>
                        <option>Magazines</option>
                    </select>
                </div>
                <div class="col-lg-12">
                    <label>Search Category: </label>
                    <select class="form-control" name="s_cat_id" id="cat_id">
                        <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$vals = $engine->get_all_book_categories();
if (isset($_POST['s_cat_id'])) {
    echo '<option value=' . $_POST['s_cat_id'] . '>' . $engine->get_book_cat_name($_POST['s_cat_id'])['name'] . '</option>';
}
foreach ($vals as $values) {
    echo "<option value='{$values['id']}'>{$values['name']}</option>";
}
?>
                    </select>
                </div>
                <div class="col-lg-12">
                    <label>Search hint: </label>
                    <input type="text" class="form-control" name="s_hint" placeholder="Search" value="<?php 
if (isset($_POST['s_hint'])) {
    echo $_POST['s_hint'];
                    <select class="form-control" name="from" id="from">
                        <?php 
echo "<option value=\"{$from}\">" . $from . '</option>';
?>
                        <option value="All">All</option>
                        <option value="Shelf">Shelf</option>
                        <option value="Store">Store</option>
                    </select>
                </div> <br>
                <div class="col-lg-12">
                    <br>
                    <label class="label label-success">Search Category: </label>
                    <select class="form-control" name="cat_id" id="cat_id">
                        <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$vals = $engine->get_all_cd_categories();
if (isset($_POST['cat_id'])) {
    echo '<option value=' . $cat_id . '>' . $engine->get_book_cat_name($cat_id)['name'] . '</option>';
}
foreach ($vals as $values) {
    echo "<option value='{$values['id']}'>{$values['name']}</option>";
}
?>
                    </select>
                </div> <br>
                <div class="col-lg-12">
                    <br>
                    <label class="label label-success">Search hint: </label>
                    <input type="text" class="form-control" name="hint" placeholder="Search"><br>
                </div>
<?php

require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$msg = "";
if (isset($_POST) && isset($_POST['update_profile'])) {
    if ($engine->is_librarian($_POST['cr_user_name'], $_POST['cr_user_pass'])) {
        if (strlen($_POST['nw_full_name']) > 3 && strlen($_POST['nw_user_name']) > 3 && strlen($_POST['nw_user_pass']) > 3) {
            if (!$engine->is_librarian($_POST['nw_user_name'], $_POST['nw_user_pass'])) {
                $con = $engine->add_new_librarian($_POST['nw_full_name'], $_POST['nw_user_name'], $_POST['nw_user_pass']);
                if ($con) {
                    $user_id = $engine->get_user_id_by($_POST['cr_user_name'], $_POST['cr_user_pass']);
                    $engine->remove_user_by($user_id);
                    $engine->add_new_librarian($_POST['nw_full_name'], $_POST['nw_user_name'], $_POST['nw_user_name']);
                    $msg = "Your profile is successfully updated!";
                } else {
                    $msg = "The system cannot update your profile! please notify to the Admin";
                }
            } else {
                $msg = "Your new user name and password are not valid. please use another one";
            }
        } else {
            $msg = "Your new user name and password character length is so short. please use 4 characters and more";
        }
    } else {
        $msg = "Your current user name and password are not valid";
    }
}
?>
<div class="container" id="main">
    <div  class="row" id="contact">
            <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
            <div class="table-responsive ">
                <table class="table table-bordered">
                    <thead>
                    <tr style="background: #ececec">
                        <th>Title</th>
                        <th>Author</th>
                        <th>Publisher</th>
                        <th>Publish Year</th>
                        <th></th>
                    </tr>
                    </thead class="table table-condensed">
                    <tbody >
                    <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
if (isset($_POST['Search_Items'])) {
    $founds = $engine->search_book_not_issued($_POST['hint'], $_POST['from'], $_POST['cat_id']);
} else {
    $founds = $engine->search_book_not_issued(null, null, 1);
}
foreach ($founds as $found) {
    include 'pages/elements/Search_Table_Items.php';
}
?>
                    </tbody>
                </table>
            </div>
            <div class="table table-responsive">
                <table class="table table-bordered">
                    <thead>
Exemplo n.º 18
0
                include 'pages/Issues/Issued_CD_2.php';
            } else {
                include 'pages/Issues/Issued_CD_1.php';
            }
        } else {
            $_id = $engine->get_teacher_id_by_name($user_id);
            if (isset($_id['use_id']) && $_id['use_id'] != 0) {
                include 'pages/Issues/Issued_CD_3.php';
            } else {
                include 'pages/Issues/Issued_CD_1.php';
            }
        }
    }
} elseif (isset($_POST['Mag_ID'])) {
    require_once "private/LMS_Engine.php";
    $engine = new LMS_Engine();
    $mag_id = $_POST['Mag_ID'];
    $Mag_data = $engine->get_magazine($mag_id);
    if (isset($_POST['make_magazine_issue'])) {
        include 'pages/Issues/Issued_Magazine_1.php';
    }
    if (isset($_POST['confirm_user'])) {
        $user_type = $_POST['user_type'];
        $user_id = $_POST['user_id'];
        if ($user_type == "student") {
            $_id = $engine->get_student_by_pid($user_id);
            if (isset($_id) && isset($_id['id'])) {
                $user = $_id;
                include 'pages/Issues/Issued_Magazine_2.php';
            } else {
                include 'pages/Issues/Issued_Magazine_1.php';
Exemplo n.º 19
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';
    }
}
Exemplo n.º 20
0
<?php

require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$val = $engine->search_book_not_issued(null, null, 0);
foreach ($val as $book) {
    if (is_array($book)) {
        print_r($book);
    } else {
        echo $book;
    }
    echo "<hr>";
}
<?php

if (isset($_POST['user_id'])) {
    $user_id = $_POST['user_id'];
    require_once 'private/LMS_Engine.php';
    $engine = new LMS_Engine();
    $Student = $engine->get_student_by_pid($user_id);
}
?>
<div class="container">
    <hr>
    <div class="row">
        <div class="container">
        </div>
        <hr>
        <div class="col-md-3 col-lg-3 ">
            <h3>Book Information</h3>
            <div class="container">
                <div  class="row" id="contact">
                    <form class="form-vertical" method="post" action="">
                        <label class="form-control" for="book_title">Book Title: <?php 
echo $book_data['title'];
?>
 </label> <br>
                        <label class="form-control">Book Call ID: <?php 
echo $book_data['call_id'];
?>
</label> <br>
                        <label class="form-control">Book Copy No: <?php 
echo $book_data['copy_number'];
?>
<?php

require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
if (isset($_POST['add_new_book'])) {
    $engine->add_new_book($_POST['title'], $_POST['cat_id'], $_POST['author'], $_POST['publisher'], $_POST['publish_year'], $_POST['publish_address'], $_POST['call_id'], $_POST['copy_number'], 'store');
}
$page_num = null;
$from = "All";
$hint = "";
$cat_id = 1;
if (!isset($_GET['page_num'])) {
    $page_num = 0;
    if (isset($_POST['Search_Items'])) {
        $from = $_POST['from'];
        $hint = $_POST['hint'];
        $cat_id = $_POST['cat_id'];
    }
} else {
    $page_num = $_GET['page_num'];
    $from = $_GET['from'];
    $hint = $_GET['hint'];
    $cat_id = $_GET['cat_id'];
}
?>
<div class="container" id="main">
    <div  class="row" id="contact">
        <hr>
        <div class="page-header">
            <h3>Manage Library Books </h3>
        </div>
Exemplo n.º 23
0
         $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 {
             header("Location: ../Librarian.php?page=search_book");
             exit;
         }
     }
 }
 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");
        <div class="col-md-3 col-lg-8"  >
            <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
            <div class="table table-responsive ">
                <table class="table table-bordered ">
                    <thead>
                    <tr style="background: #ececec">
                        <th>Full Name</th>
                        <th>User Name</th>
                        <th>Reg. Date</th>
                        <th></th>
                    </tr>
                    </thead class="table table-condensed">
                    <tbody >
                    <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$found = $engine->get_all_librarians();
foreach ($found as $found) {
    $User_Table = $found;
    $Staff_Table = $engine->get_staff_by($found['id']);
    include 'pages/elements/Librarian_Users_Table_Items.php';
}
?>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="col-md-3 col-lg-3" style="margin-left: 50px" >
            <form class="form-vertical" role="form" method="post" action="">
                <label class="control-label">Add New Librarian: </label>
Exemplo n.º 25
0
<?php

/**
 * Created by PhpStorm.
 * User: Robel
 * Date: 3/24/2015
 * Time: 6:47 AM
 */
require_once "LMS_Engine.php";
$eng = new LMS_Engine();
$username = "";
$password = "";
if (isset($_POST['username'])) {
    $username = $_POST['username'];
}
if (isset($_POST['password'])) {
    $password = $_POST['password'];
}
if ($eng->is_admin($username, $password)) {
    header("Location: ../public/admin/");
    exit;
} else {
}
            <div class="table-responsive ">
                <table class="table table-bordered">
                    <thead>
                    <tr  style="background:#ececec">
                        <th>Photo</th>
                        <th>Full Name</th>
                        <th>Pocket ID</th>
                        <th>Grade</th>
                        <th>Section</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
//                    if(isset($_POST['Search_Items'])) {
$founds = $engine->search_Student($hint, $grade, $section);
//                    }else {
//                        $founds = $engine->search_Student(null,null,null);
//                    }
$founds = array_reverse($founds, null);
$total = count($founds);
$size = 10;
$start = $page_num * $size;
$i = 0;
$disp = 0;
foreach ($founds as $found) {
    if ($start > $i) {
        $i++;
        continue;
<?php

require_once "private/LMS_Engine.php";
$engine = new LMS_Engine();
$book_count = $engine->get_number_of_books();
$cd_count = $engine->get_number_of_cds();
$mag_count = $engine->get_number_of_magazine();
$book_count_SH = $engine->get_number_of_book_on('shelf');
$cd_count_SH = $engine->get_number_of_cd_on('shelf');
$mag_count_SH = $engine->get_number_of_mag_on('shelf');
$book_count_ST = $engine->get_number_of_book_on('store');
$cd_count_ST = $engine->get_number_of_cd_on('store');
$mag_count_ST = $engine->get_number_of_mag_on('store');
if (isset($_POST['item_users'])) {
    $book_users = $engine->get_number_of_student_book_users_since($_POST['date']);
    $cds_users = $engine->get_number_of_student_cd_users_since($_POST['date']);
    $mag_users = $engine->get_number_of_student_mag_users_since($_POST['date']);
    $book_borrow = $engine->get_number_of_books_issued_since($_POST['date']);
    $book_returned = $engine->get_number_of_book_returned_issues_since($_POST['date']);
    $cds_borrow = $engine->get_number_of_cds_issued_since($_POST['date']);
    $cds_returned = $engine->get_number_of_cds_returned_issues_since($_POST['date']);
    $mag_borrow = $engine->get_number_of_mag_issued_since($_POST['date']);
    $mag_returned = $engine->get_number_of_mag_returned_issues_since($_POST['date']);
}
?>



<div class="container" id="main">
    <div  class="row" id="contact">
        <hr>
        <div class="col-md-3 col-lg-8"  >
            <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
            <div class="table table-responsive ">
                <table class="table table-bordered ">
                    <thead>
                    <tr style="background: #ececec">
                        <th>Full Name</th>
                        <th>User Name</th>
                        <th>Reg. Date</th>
                        <th></th>
                    </tr>
                    </thead class="table table-condensed">
                    <tbody >
                    <?php 
require_once 'private/LMS_Engine.php';
$engine = new LMS_Engine();
$found = $engine->get_all_admin();
foreach ($found as $found) {
    $User_Table = $found;
    include 'pages/elements/Librarian_Users_Table_Items.php';
}
?>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="col-md-3 col-lg-3" style="margin-left: 50px" >
            <form class="form-vertical" role="form" method="post" action="">
                <label class="control-label">Add New Admin: </label>
                <hr>
<?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">
<?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>