Names: Gakuru James Reg: 2011453 Topic: Library Management System Advanced Web Programming Project Index - HTML
Names: Gakuru James Reg: 2011453 Topic: Library Management System Advanced Web Programming Project Index - HTML
Names: Gakuru James Reg: 2011453 Topic: Library Management System Advanced Web Programming Project Index - HTML
Reg: 2011453
Index.html
<!DOCTYPE html>
<?php
session_start();
if(ISSET($_SESSION['admin_id'])){
header('location:home.php');
?>
<head>
<title>Library System</title>
</div>
</div>
</nav>
<br />
<br />
<h4>Login Here..</h4>
</div>
</div>
<br />
</div>
</form>
<div id = "result"></div>
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</div>
</div>
</div>
</nav>
</body>
</html>
Admin.php
<!DOCTYPE html>
<?php
require_once 'valid.php';
?>
<head>
<title>Library System</title>
</head>
</div>
</div>
</nav>
<br />
<br />
</div>
</ul>
</li>
</li>
</ul>
</li>
</ul>
</div>
<br />
<br />
<div id = "admin_table">
<tr>
<th>Username</th>
<th>Password</th>
<th>Firstname</th>
<th>Middlename</th>
<th>Lastname</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$q_admin = $conn->query("SELECT *
FROM `admin`") or die(mysqli_error());
while($f_admin = $q_admin-
>fetch_array()){
?>
<td><?php echo
$f_admin['username']?></td>
<td><?php echo
md5($f_admin['password'])?></td>
<td><?php echo
$f_admin['firstname']?></td>
<td><?php echo
$f_admin['middlename']?></td>
<td><?php echo
$f_admin['lastname']?></td>
</tr>
<?php
?>
</tbody>
</table>
</div>
<div id = "edit_form"></div>
<label>Username:</label>
</div>
<label>Password:</label>
</div>
<label>Firstname:</label>
</div>
<label>Middlename:</label>
</div>
<label>Lastname:</label>
</div>
</form>
</div>
</div>
</div>
</div>
<br />
<br />
<br />
</div>
</nav>
</body>
$(document).ready(function(){
$('#table').DataTable();
});
</script>
$(document).ready(function(){
$('#add_admin').click(function(){
$(this).hide();
$('#show_admin').show();
$('#admin_table').slideUp();
$('#admin_form').slideDown();
$('#show_admin').click(function(){
$(this).hide();
$('#add_admin').show();
$('#admin_table').slideDown();
$('#admin_form').slideUp();
});
});
});
</script>
$(document).ready(function(){
$result = $('<center><label>Deleting...</label></center>');
$('.deladmin_id').click(function(){
$admin_id = $(this).attr('value');
$(this).parents('td').empty().append($result);
$('.deladmin_id').attr('disabled', 'disabled');
$('.eadmin_id').attr('disabled', 'disabled');
setTimeout(function(){
}, 1000);
});
$('.eadmin_id').click(function(){
$admin_id = $(this).attr('value');
$('#show_admin').show();
$('#show_admin').click(function(){
$(this).hide();
$('#edit_form').empty();
$('#admin_table').show();
$('#add_admin').show();
});
$('#admin_table').fadeOut();
$('#add_admin').hide();
$('#edit_form').load('load_admin.php?admin_id=' + $admin_id);
});
});
</script>
</html>
Book.php
<!DOCTYPE html>
<?php
require_once 'valid.php';
?>
<head>
<title>Library System</title>
</head>
</div>
</div>
</nav>
<br />
<br />
</div>
<hr style = "border:1px dotted #d3d3d3;"/>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<br />
<br />
<div id = "book_table">
<tr>
<th>Book Title</th>
<th>Category</th>
<th>Author</th>
<th>Date Published</th>
<th>Available</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$qbook = $conn-
>query("SELECT * FROM `book`") or die(mysqli_error());
while($fbook = $qbook-
>fetch_array()){
?>
<tr>
<td><?php echo
$fbook['book_title']?></td>
<td><?php echo
$fbook['book_category']?></td>
<td><?php echo
$fbook['book_author']?></td>
</tr>
<?php
?>
</tbody>
</table>
</div>
<div id = "edit_form"></div>
<label>Book Title:</label>
<input type = "text" name =
"book_title" required = "required" class = "form-control" />
</div>
<label>Book
Description:</label>
</div>
<label>Book Category:</label>
</div>
<label>Book Author:</label>
</div>
<label>Date Published:</label>
</div>
<label>Quantity:</label>
</div>
</form>
</div>
</div>
</div>
</div>
<br />
<br />
<br />
</div>
</nav>
</body>
$(document).ready(function(){
$('#table').DataTable();
});
</script>
$(document).ready(function(){
$('#add_book').click(function(){
$(this).hide();
$('#show_book').show();
$('#book_table').slideUp();
$('#book_form').slideDown();
$('#show_book').click(function(){
$(this).hide();
$('#add_book').show();
$('#book_table').slideDown();
$('#book_form').slideUp();
});
});
});
</script>
$(document).ready(function(){
$result = $('<center><label>Deleting...</label></center>');
$('.delbook_id').click(function(){
$book_id = $(this).attr('value');
$(this).parents('td').empty().append($result);
$('.delbook_id').attr('disabled', 'disabled');
$('.ebook_id').attr('disabled', 'disabled');
setTimeout(function(){
}, 1000);
});
$('.ebook_id').click(function(){
$book_id = $(this).attr('value');
$('#show_book').show();
$('#show_book').click(function(){
$(this).hide();
$('#edit_form').empty();
$('#book_table').show();
$('#book_admin').show();
});
$('#book_table').fadeOut();
$('#add_book').hide();
$('#edit_form').load('load_book.php?book_id=' + $book_id);
});
});
</script>
</html>