-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
203 lines (186 loc) · 9.45 KB
/
index.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="img/logo.png" type="image/x-icon">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<!-- Required meta tags -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Source+Serif+Pro:400,600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="fonts/icomoon/style.css">
<!-- Style CSS -->
<link rel="stylesheet" href="css/style.css">
<title>Home page</title>
</head>
<!-- body -->
<body style="background-color: #e7dede;">
<?php session_start(); ?>
<!-- nav -->
<!-- <nav class="navbar navbar-dark bg-dark"> -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.php"><strong>ATN</strong></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="index.php">Home Page</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="https://www.facebook.com/hoang.nguyenhuu.7330763/" target="_blank">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="https://btec.fpt.edu.vn/" target="_blank">About Us</a>
</li>
<!-- Decentralization / Phân quyền admin-->
<?php if (isset($_SESSION['admin'])) {
echo ("<li class='nav-item'>
<a class='nav-link' href='manageProduct.php' tabindex='-1'>Manage products</a>
</li>");
} ?>
<!-- Decentralization / Phân quyền user-->
<?php if (isset($_SESSION['admin']) or isset($_SESSION['user'])) {
echo ("<li class='nav-item'>
<a class='nav-link' href='cart.php'><i class='fas fa-shopping-cart'></i></a>
</li>");
} ?>
</ul>
<!-- Search, Login, Logout -->
<form action="search.php" method="POST" class="d-flex">
<input name="input" required class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button name="search" class="btn btn-outline-danger" type="submit"><b>Search</b></button>
</form>
<?php
if (isset($_SESSION['user']) or isset($_SESSION['admin'])) {
echo "<a style='margin-left: 1%;' href='delete.php' class='btn btn-warning btn-outline-success'>LogOut</a>";
} else {
echo "<a style='margin-left: 1%;' href='signin.php' class='btn btn-warning btn-outline-success'>LogIn</a>";
}
?>
</div>
</div>
<!-- end nav -->
</nav>
<div id="carouselExampleInterval" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active" data-bs-interval="10000">
<img src="https://product.hstatic.net/1000288177/product/upload_a80231319ea94692a5ac7e23f6152aad_master.jpg" style="height:600px" class="d-block w-100" alt="No photos found">
</div>
<div class="carousel-item" data-bs-interval="2000">
<img src="https://d1a9v60rjx2a4v.cloudfront.net/2018/01/21/17_29_29_480_optimus_prime_3d_model_c4d_max_obj_fbx_ma_lwo_3ds_3dm_stl_1878173_o_1.jpg" style="height:600px" class="d-block w-100" alt="No photos found">
</div>
<div class="carousel-item">
<img src="http://mohinhdep.net/wp-content/uploads/2018/10/batman-mohinhdep.net-5-2.jpg" class="d-block w-100" alt="No photos found" style="height:600px">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleInterval" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleInterval" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<!-- Container -->
<div class="container">
<div class="row">
<div class="col-lg-12">
<br>
<div class="row row-cols-1 row-cols-md-4 g-4">
<br>
<?php
include_once("connect.php");
$result = mysqli_query($con, "select * from product order by productId DESC");
while ($row = mysqli_fetch_array($result)) {
echo "
<div class='col-md-3'>
<div class='card border-success' >
<div class='card-header' style='background-color: rgb(0 0 0 / 8%);'>".$row['productName']."</div>
<div class='card-body'>
<p class='card-text'><img src='".$row['productImg']."' class = 'img-fluid rounded' style = 'height:13rem; width:100%' /></p>
</div>
<div class='card-footer' style='background-color: rgb(0 0 0 / 8%);'>
<a class='btn btn-warning' href='detail.php?id=".$row['productId']."'>Detail</a>
<a class='btn btn-primary' href='cart.php?id=".$row['productId']."'>Add to Cart</a>
</div>
</div>
</div>
";
}
?>
</div>
</div>
</div>
</div>
<!-- footer -->
<div style="height: 10vh;" class="content d-flex align-items-center bg-light">
<h2 class="w-100 text-center"></h2>
</div>
<footer class="footer-48201">
<div class="container">
<div class="row">
<div class="col-md-4 pr-md-5">
<a href="#" class="footer-site-logo d-block mb-4">ATN</a>
<p>ATN is a Vietnamese company that is selling toys to teenagers in many provinces across Vietnam.
The company has sales of over $500,000/year. Currently, each shop has its own database to store items
deals exclusively for that shop. Each store must send sales data to the management monthly and
It takes a lot of time for management to compile data collected from all stores.
In addition, the board cannot view real-time stock information updates.</p>
</div>
<div class="col-md">
<ul class="list-unstyled nav-links">
<li><a href="index.php">Home</a></li>
<li><a href="https://btec.fpt.edu.vn/">About Us</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Services</a></li>
<li><a href="https://www.facebook.com/hoang.nguyenhuu.7330763/">Contact</a></li>
</ul>
</div>
<div class="col-md">
<ul class="list-unstyled nav-links">
<li><a href="#">Clients</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Career</a></li>
<li><a href="#">Testimonials</a></li>
<li><a href="#">Journal</a></li>
</ul>
</div>
<div class="col-md">
<ul class="list-unstyled nav-links">
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms & Conditions</a></li>
<li><a href="#">Partners</a></li>
</ul>
</div>
<div class="col-md text-md-center">
<ul class="social list-unstyled">
<li><a href="#"><span class="icon-instagram"></span></a></li>
<li><a href="#"><span class="icon-twitter"></span></a></li>
<li><a href="https://www.facebook.com/hoang.nguyenhuu.7330763/"><span class="icon-facebook"></span></a></li>
<li><a href="#"><span class="icon-pinterest"></span></a></li>
<li><a href="#"><span class="icon-dribbble"></span></a></li>
</ul>
<p class=""><a href="https://btec.fpt.edu.vn/" class="btn btn-tertiary">Contact Us</a></p>
</div>
</div>
<div class="row ">
<div class="col-12 text-center">
<div class="copyright mt-5 pt-5">
<p><small>© 2021-2022 All Rights Reserved.</small></p>
</div>
</div>
</div>
</div>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
</body>
</html>