-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetails.php
152 lines (136 loc) · 6.25 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
include "functions/functions.php";
include "functions/db.php";
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- <link rel="stylesheet" type="text/css" href="styles/reset.css" media="all"> -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster">
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="https://kit.fontawesome.com/f724e98ccb.js" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="styles/style.css" media="all">
<link rel="stylesheet" type="text/css" href="styles/style_details.css" media="all">
<title>Tiệm bánh</title>
</head>
<body>
<div class="main-wrapper">
<div class="navigation-bar">
<div class="logo">
<a href="/quanlybanhang/index.php"><img src="images/logos/logo.jpg" alt="Cake"></a>
</div>
<div class="name-cakes">
<h3>Tiệm bánh hoàng tử lớn</h3>
</div>
<div class="user">
<div class="actionhotline">
<i class="fas fa-mobile"> </i> <span class="phone-number"> Đặt hàng: 0986775750 </span>
</div>
</div>
</div>
<div class="side-nav">
<ul>
<?php
if (!isset($_SESSION['user_id'])) {
echo "
<li><a href='login.php'><i class='far fa-user'></i>Đăng nhập</a></li>
";
} else {
echo "
<li><a href='logout.php'><i class='far fa-user'></i>Đăng xuất</a></li>
";
}
?>
<li><a href="cart.php"><i class="fas fa-cube"></i>Giỏ hàng</a></li>
<li><a href="my_order.php"><i class="fas fa-money-bill"></i>Đơn hàng của tôi</a></li>
<li><a href="index.php"><i class="fas fa-align-justify"></i>Tất cả sản phẩm</a></li>
<li><a href="#"><i class="far fa-address-card"></i>Liên hệ</a></li>
</ul>
</div>
<div class="page-container">
<div class="page-wrapper">
<div class="">
<div class="collapse navbar-collapse" id="bs-main-navbar-collapse-1" style="position: relative;">
<ul class="topbar">
<?php
getCats();
?>
</ul>
<div class="right-banner-desktop" style="float:right;height: 32px;">
</div>
</div>
</div>
<!-- -->
<!-- Start details -->
<div class="container">
<div class="product-images">
<div class='images'>
<?php
if (isset($_GET['pro_id'])) {
$product_id = $_GET['pro_id'];
$run_query_by_pro_id = mysqli_query($con, "select * from hanghoa where MSHH='$product_id' ");
while ($row_pro = mysqli_fetch_array($run_query_by_pro_id)) {
$pro_id = $row_pro['MSHH'];
$pro_title = $row_pro['TenHH'];
$pro_price = number_format($row_pro['Gia']);
$pro_soluong = $row_pro['SoLuongHang'];
$pro_cat = $row_pro['MaNhom'];
$pro_image = $row_pro['Hinh'];
$pro_description = $row_pro['MoTaHH'];
$old_price = number_format($row_pro['Gia'] * 10 / 100);
echo "
<img src='/quanlybanhang/admin/product_images/$pro_image' alt='$pro_title'>
";
}
}
?>
</div>
</div><!-- /#products_box -->
<div class='product-details'>
<h5><?php echo "$pro_title"; ?></h5>
<hr>
<br>
<p class='product-id'> Mã sản phẩm: <?php echo "$pro_id"; ?></p>
<h4 class='product-count'>Số lượng còn: <?php echo "$pro_soluong"; ?></h4>
<h2 class='product-price'><?php echo "$pro_price"; ?> VND</h2>
<h3 class='des'>MÔ TẢ</h3>
<p class='product-des'><?php echo "$pro_description"; ?></p>
<hr>
<div class="text-center">
<button onclick="window.location.href='index.php?add_cart=<?php echo "$pro_id"; ?> ';"
class="bnt btn-primary btn-chonmua">CHỌN MUA</button>
</div>
</div>
<script>
function myFunction() {
alert("Hello! I am an alert box!");
}
</script>
</div>
<br>
<h2>Sản phẩm tương tự</h2>
<div class="container">
<?php
details_show_pro_of_cat($pro_cat);
cart();
?>
</div>
<!-- End Details -->
</div>
<!-- End page container -->
</div> <!-- End main_wrapper-->
<!-- Footer -->
<footer class="footer">
<!-- Copyright -->
<div class="footer-copyright text-center p-4 footer-div">© 2020 Copyright:
<a href="/quanlybanhang/index.php">ngominhtrung</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
</body>
</html>