-
Notifications
You must be signed in to change notification settings - Fork 0
/
details.php
85 lines (65 loc) · 1.87 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
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
82
<?php
session_start();
// establishing connection
$con = mysqli_connect("localhost" , "root" , "" , "mercado");
if (mysqli_connect_errno()) {
echo "Failed to connect : " . mysqli_connect_error();
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink to fit= no">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="bootstrap/css/main.css" />
</head>
<body>
<!--navigation bar-->
<?php include 'header.php'; ?>
<?php
$product_id = $_GET['id'] ;
global $con ;
$get_pro = 'SELECT * FROM products where product_id = '.$product_id ;
$run_pro = mysqli_query($con , $get_pro) ;
$row_pro = mysqli_fetch_array($run_pro) ;
$product_name = $row_pro['product_name'] ;
$product_price = $row_pro['product_price'] ;
$product_img = $row_pro['product_image'] ;
$product_detail = $row_pro['product_description'] ;
?>
<div class="container my-5 pb-5" >
<div class="row py-2">
<div class="col-md-6 border py-5 border-dark ">
<?php
echo "
<img src='$product_img' class='img-fluid'>
";
?>
</div>
<div class="col-md-6 py-5 bg-secondary text-light ">
<div>
<?php
echo "
<h1>$product_name</h1>
<p>$product_detail</p>
<p>USD $$product_price</p>
";
?>
</div>
<form method='POST' action='query.php?id=<?php echo $product_id ; ?>'>
<div>
<input type='submit' name='contact_supplier' class='btn btn-success' value='Contact Supplier' />
</div>
</form>
</div>
</div>
</div>
<?php include 'footer.php' ; ?>
<!--scripts-->
<script src="bootstrap/js/jquery.min.js"></script>
<script src="bootstrap/js/popper.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</body>
</html>