-
Notifications
You must be signed in to change notification settings - Fork 0
/
details.php
executable file
·40 lines (37 loc) · 1.49 KB
/
details.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
<?php
include('common.html.php');
$id = $_GET['pid'];
include('admin/config.php');
$query = "SELECT id, name, img, price, info FROM products where id ='".$id."'";
$result = mysqli_query($link, $query);
if (!$result)
{
$error = 'Error fetching electronics items: ' . mysqli_error($link);
include 'admin/error.html.php';
exit();
}
$item = mysqli_fetch_array($result);
?>
<body>
<?php include ('nav.html.php');?>
<div class="col-lg-9">
<div class="row">
<div class="col-lg-4 col-md-6 mb-4 text-center">
<img class="card-img-top img-fluid" src="../shopping/img/<?php echo htmlspecialchars($item['img'], ENT_QUOTES,'UTF-8'); ?>" alt="" style=" max-height: 300px;">
</div>
<div class="col-lg-8">
<h4 class="text-primary"><?php echo $item['name']; ?></h4>
<h5>Price : Rs.<?php echo $item['price']; ?></h5>
<hr>
<h6>Description</h6>
<p><?php echo htmlspecialchars($item['info'], ENT_QUOTES,'UTF-8'); ?></p>
<a href="cart.php?pid=<?php echo $id; ?>&addToCart" role="button" class= "btn btn-success">Add To Cart!</a>
</div>
</div>
</div>
</div>
</div>
<br><br>
<?php include ('admin/footer.html.php');?>
</body>
</html>