-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproductdetails.php
More file actions
131 lines (119 loc) · 5.32 KB
/
Copy pathproductdetails.php
File metadata and controls
131 lines (119 loc) · 5.32 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
require_once('./config.php');
$url = $_ENV['BASE_URL'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product | Details</title>
<link rel="icon" href="webimage/shopicon.png" type="image/png">
<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<?php
include('connection.php');
include('header.php');
$recv = $_REQUEST['id'];
?>
<!-- 1st section -->
<section id="sec1">
<div class="container">
<h2 style="text-align: center;" class="txt1">Details of our Product</h2>
<div class="row">
<div class="col-lg-5">
<?php
$sql = "SELECT * FROM `products` WHERE `product_id`='$recv'";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)) {
$myimage = $row['image'];
?>
<!-- Product details -->
<hr>
<img src="<?php echo 'images/' . $myimage; ?>" class="rounded mx-auto d-block" height="300" width="300" alt="" srcset="">
<p style="text-align: center;font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;font-weight:400; font-size:18px;" class="p-4"><?php echo $row['product_name']; ?></p>
<p class="pprice">Price: <?php echo $row['price']; ?><span style="font-size: 18px;font-weight:bold">৳</span></p>
</div>
<div class="col-lg-7">
<hr>
<h3 style="font-family: 'Gill Sans';"><?php echo $row['product_name']; ?></h3>
<h4 style="font-family: 'Gill Sans';">Description:</h4>
<p style="font-family: 'Gill Sans';"><?php echo $row['unit']; ?></p>
<?php
$instock = $row['instock'];
if ($instock <= 0) {
?>
<p style="background-color: red; font-size:30px; color:aliceblue; width:45%;font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;" class="p-3">Out of the stock..!! </p>
<div class="row">
<div class="col-lg-8">
<h4>Payment Method</h4>
<div class="row">
<div class="col-lg-4">
<img src="webimage/bkash.png" class=" img-fluid" alt="" srcset="">
</div>
<div class="col-lg-4">
<img src="webimage/nagad.png" class=" img-fluid" alt="" srcset="">
</div>
</div>
</div>
</div>
<?php
}
else {
?>
<p style="background-color: green; color:aliceblue; width:15%;font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;" class="p-2">In Stock: <?php echo $instock; ?></p>
<div class="row">
<div class="col-lg-4">
<p class="txt2">
*Read the deatils carefully !
</p> <br>
<a href="http://localhost/All_Code/ecommerce_system/cart/3cart.php?id=<?php echo $row['product_id']; ?>" class="btn btn-info">Buy Now</a>
</div>
<div class="col-lg-8">
<h4>Payment Method</h4>
<div class="row">
<div class="col-lg-4">
<img src="webimage/bkash.png" class="p-2 img-fluid" alt="" srcset="">
</div>
<div class="col-lg-4">
<img src="webimage/nagad.png" class="p-2 img-fluid" alt="" srcset="">
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
</section>
<?php include('footer.php'); ?>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<!-- For Styling Product Details Page-->
<style>
.txt1 {
padding-top: 80px;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
.txt2 {
font-size: 18px;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
color: red;
}
.pprice {
text-align: center;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
font-weight: 500;
font-size: 20px;
margin-top: -36px;
color: blue;
}
</style>