-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetail.php
More file actions
113 lines (93 loc) · 3.76 KB
/
detail.php
File metadata and controls
113 lines (93 loc) · 3.76 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
<?php
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Thông tin sản phẩm</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="T Chow" name="keywords">
<meta content="T Chow" name="description">
<!-- Favicon -->
<link rel="shortcut icon" type="image/icon" href="./images/favicon.ico"/>
<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<!-- Font Awesome -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<!-- Libraries Stylesheet -->
<link href="./lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Customized Bootstrap Stylesheet -->
<link href="./css/style.css" rel="stylesheet">
</head>
<body>
<!-- Topbar Start -->
<?php include 'header.php'; ?>
<!-- Topbar End -->
<!-- Page Header Start -->
<div class="container-fluid bg-secondary mb-5">
<div class="d-flex flex-column align-items-center justify-content-center" style="min-height: 120px">
<h1 class="font-weight-semi-bold text-uppercase mt-3">Chi tiết sản phẩm</h1>
<div class="d-inline-flex mb-3">
<p class="m-0"><a href="shop.php">Trang chủ</a></p>
<p class="m-0 px-2">-</p>
<p class="m-0">Chi tiết sản phẩm</p>
</div>
</div>
</div>
<!-- Page Header End -->
<form class="row px-xl-5" method="POST">
<?php
$pid = $_GET['pid'];
$select_products = $conn->prepare("SELECT * FROM `products` WHERE id = ?");
$select_products->execute([$pid]);
if($select_products->rowCount() > 0){
while($fetch_products = $select_products->fetch(PDO::FETCH_ASSOC)){
?>
<div class="col-lg-8 table-responsive mb-5 card mb-3">
<div class="row no-gutters">
<div class="col-md-4">
<img class="img-fluid w-100" src="./admin/uploaded_img/<?= $fetch_products['image']; ?>" alt="...">
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title"><?= $fetch_products['name']; ?></h5>
<p class="card-text"><?= $fetch_products['details']; ?></p>
<h6><?= number_format($fetch_products['price'],0,',','.'); ?> đ</h6>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="border-secondary bg-transparent">
<a href="shop.php" type="button" class="btn btn-block btn-success py-3 border">Tiếp tục mua sắm</a>
</div>
</div>
<?php
}
}else{
echo '<p class="empty">Sản phẩm không tồn tại!</p>';
}
?>
</form>
<!-- Footer Start -->
<?php include 'footer.php'; ?>
<!-- Footer End -->
<!-- JavaScript Libraries -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"></script>
<script src="./lib/easing/easing.min.js"></script>
<script src="./lib/owlcarousel/owl.carousel.min.js"></script>
<!-- Contact Javascript File -->
<script src="./mail/jqBootstrapValidation.min.js"></script>
<script src="./mail/contact.js"></script>
<!-- Template Javascript -->
<script src="./js/main.js"></script>
</body>
</html>