-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDelete_Form.php
57 lines (57 loc) · 1.56 KB
/
Delete_Form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
session_start();
if(!isset($_SESSION['username']))
{
header('location:http://localhost/BRM/Login_Page.php');
}
$con=mysqli_connect('localhost','root','','BRM','3308');
mysqli_select_db($con,'BRM');
$q="select * from Book";
$result=mysqli_query($con,$q);
$num=mysqli_num_rows($result);
mysqli_close($con);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Delete Records</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="Delete_Style.css"/>
</head>
<body>
<h1>Book Record Management</h1>
<a href="Home.php"><img id="home" src="Home.png"/></a>
<a href="Login_Page.php"><img id="logout" src="Logout.png"</a>
<form action="Deletion.php" method="POST">
<table id="view_table">
<tr>
<th>Book ID</th>
<th>Title</th>
<th>Author</th>
<th>Price</th>
<th>Select to delete</th>
</tr>
<tr>
<?php
for($i=1;$i<=$num;$i++)
{
$row=mysqli_fetch_array($result);
?>
<tr>
<td><?php echo $row['BookId']?></td>
<td><?php echo $row['Title']?></td>
<td><?php echo $row['Author']?></td>
<td><?php echo $row['Price']?></td>
<td><input id="select" type="checkbox" value="<?php echo $row['BookId'];?>" name="b<?php echo $i;?>"/></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5"><input id="del" type="submit" value="Delete" /></td>
</tr>
</table>
</form>
</body>
</html>