-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
81 lines (63 loc) · 1.82 KB
/
home.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
if(isset($_SESSION['message']))
{
echo "<p class='alert alert-warning'>";
echo $_SESSION['message'];
unset ($_SESSION['message']);
echo "</p>";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>This Listing Page</title>
<link rel="stylesheet" href="assets/css/bootstrap.css"/>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-6">
<a href="additem.php" class="btn btn-primary" role="button">Add Item</a>
</div>
<div class="col-sm-6">
<a href="logout.php" class="btn btn-primary" role="button">Logout</a>
</div>
</div>
<br>
<br>
<div class="row">
<table class="table table-bordered table-responsive">
<tr>
<th>Id</th>
<th>Product Name</th>
<th>Product Price</th>
<th>category name </th>
<th>Product photo</th>
<th>Delete</th>
<th>Edit</th>
</tr>
<?php
include("dbconnection.php");
$sql = "select product.productid,product.productname,product.image,product.productprice,category.categoryname from product inner join category ON product.categoryid=category.categoryid";
$res = mysqli_query($conn,$sql);
$i=1;
$total = mysqli_num_rows($res);
while($row = mysqli_fetch_object($res))
{
echo "<tr>";
echo "<td>".$row->productid."</td>";
echo "<td>".$row->productname."</td>";
echo "<td>".$row->productprice."</td>";
echo "<td>".$row->categoryname."</td>";
//echo "<td>".$row->image."</td>";
echo "<td><img src='assets/image/".$row->image."' height='100' width='100'></td>";
echo "<td> <a href='deleterecord.php?id=$row->productid'>Delete </a></td>";
echo "<td> <a 'href='editdata.php?id=$row->productid'>Edit </a></td>";
echo "<tr>";
}
?>
</table>
</div>
</div>
</body>
</html>