Exemplo n.º 1
0
		<input type="submit" name="borrowbook" value="Borrow Book">
		<br>
		
	</form>
	</div>
</center>
<?php 
}
?>

</body>
</html>

<?php 
include 'LIbraryDatabase.php';
$database = new LIbraryDatabase();
if (isset($_POST['login'])) {
    $e = $_POST['email1'];
    $p = $_POST['password1'];
    if ($database->login($e, $p)) {
        header("Refresh:0");
    } else {
        echo 'Invalid email or password';
    }
} else {
    if (isset($_POST['register'])) {
        $fn = $_POST['fname'];
        $ln = $_POST['lname'];
        $e = $_POST['email'];
        $p = $_POST['password'];
        $p2 = $_POST['password2'];
Exemplo n.º 2
0
 <!DOCTYPE html>
<html>
<head>
	<title>Books List</title>
</head>
<link rel="stylesheet" type="text/css" href="styletrial.css">
<body>

<?php 
include 'header.php';
require 'LIbraryDatabase.php';
?>
<div id="tables">
<?php 
$database = new LIbraryDatabase();
?>
<h3>Available Books:</h3>
<table>
<tr>
	<th>Title</th>
	<th>Author</th>
	<th>Available Copies</th>
	<th>ISBN</th>
</tr>
	<?php 
$books = $database->getAvailable();
while ($row = $books->fetch_assoc()) {
    echo "<tr><td>", $row['Title'], "</td>";
    echo "<td>", $row['Author'], "</td>";
    echo "<td>", $row['available_copies'], "</td>";
    echo "<td>", $row['ISBN'], "</td>";