-
Notifications
You must be signed in to change notification settings - Fork 0
/
a-product-dt.php
59 lines (56 loc) · 1.63 KB
/
a-product-dt.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
<?php
$page_title = "a-product-details";
include("./config/constants.php");
include("./config/check_alogin.php");
if(isset($_GET['pid'])){
$product_id = $_GET['pid'];
$q = "SELECT * FROM product WHERE pid = '$product_id'";
$res = mysqli_query($conn,$q);
if($res && $res->num_rows==1)
{
$data = $res->fetch_assoc();
$product_name = $data['pname'];
$product_brand = $data['brand'];
$product_image = $data['img_src'];
$product_price = $data['price'];
$product_discount= $data['discount'];
$product_fprice = $data['fprice'];
}
else
{
header("location:dashboard.php");
}
}
else
{
header("location:dashboard.php");
}
?>
<style>
.employee{
display: none;
}
</style>
<!DOCTYPE html>
<html lang="en">
<body>
<div class="d-flex mb-3">
<div class="p-2">
<h1>Product Details</h1>
</div>
<div class="p-3">
<a class="btn btn-primary" href="a-productlist.php" role="button">All Products</a>
</div>
</div>
<br>
<div class="img-container">
<img src="<?php echo $product_image; ?>" alt="">
</div>
<h5>Product Id:<span class="dt-value"> <?php echo $product_id ?> </span></h5>
<h5>Product Name:<span class="dt-value"> <?php echo $product_name ?> </span></h5>
<h5>Brand:<span class="dt-value"> <?php echo $product_brand ?> </span></h5>
<h5>Product Price:<span class="dt-value"> <?php echo$product_price ?> $</span></h5>
<h5>Discount:<span class="dt-value"> <?php echo $product_discount ?> %</span></h5>
<h5>Final Price:<span class="dt-value"> <?php echo $product_fprice ?> $</span></h5>
</body>
</html>