forked from yashasvi211/shopcity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
163 lines (147 loc) · 5.87 KB
/
home.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
<?php
$con = mysqli_connect('localhost', 'root', '', 'shopcity');
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
exit();
}
$sql = "SELECT * FROM products";
$result = mysqli_query($con, $sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
<!-- MDB CSS -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap">
<link rel="stylesheet" href="node_modules/mdbootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="node_modules/mdbootstrap/css/mdb.min.css">
<link rel="stylesheet" href="node_modules/mdbootstrap/css/style.css">
<link rel="stylesheet" href="css/styles.css" />
<link rel="stylesheet" media="screen" href="css/style2.css">
<title>ShopCity</title>
</head>
<body>
<nav class="navbar">
<div class="navbar-center">
<h1 id="logo">ShopCity</h1>
<div class="container">
<div class="row height d-flex justify-content-center align-items-center">
<div class="col-md-8">
<div class="search">
<i class="fa fa-search"></i>
<input type="text" class="form-control" placeholder="Search Any Item">
<button class="btn btn-primary">
<span id="textforsearch">Search</span>
</button>
</div>
</div>
</div>
</div>
<div class="cart-btn">
<span class="nav-icon">
<img src="cart_3433797.png" alt="" srcset="" style="height: 2.2rem" />
</span>
<div class="cart-items">0</div>
</div>
</div>
</nav>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="images/sliders/s0.jpg" alt="First slide" />
</div>
<div class="carousel-item">
<img class="d-block w-100" src="images/sliders/s1.1.jpg" alt="Second slide" />
</div>
<div class="carousel-item">
<img class="d-block w-100" src="images/sliders/s4.jpg" alt="Third slide" />
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!-- products section -->
<section class="products">
<div class="section-title">
<h2>Best of Our Products</h2>
</div>
<div class="products-center" id="products-center">
<?php
while ($product = mysqli_fetch_assoc($result)) {
?>
<article class="product" id="thisistheway">
<div class="img-container">
<a href="detail.html">
<img src="<?= $product["image"]; ?>" alt="Product image" class="product-img">
</a>
<button class="bag-btn" data-id="<?= $product["id"]; ?>">
<i class="fas fa-shopping-cart"></i> add to cart
</button>
</div>
<h3 class="product-title">
<?= $product["title"]; ?>
</h3>
<h4 class="product-price">₹
<?= $product["price"]; ?>
</h4>
</article>
<?php
}
?>
</div>
</section>
<!-- end of products section -->
<!-- cart -->
<div class="cart-overlay">
<div class="cart">
<span class="close-cart">
<i class="fas fa-window-close"></i>
</span>
<h2>your cart</h2>
<div class="cart-content">
<!-- cart item -->
<!-- <div class="cart-item">
</div> -->
<!-- end of cart item -->
</div>
<div class="cart-footer">
<h3>your total:₹<span class="cart-total">0</span></h3>
<button class="clear-cart banner-btn">clear cart</button>
</div>
</div>
</div>
<!-- end of cart -->
<!-- Include your script tags and other dependencies -->
<script src="js/app.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<script type="text/javascript" src="node_modules/mdbootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="node_modules/mdbootstrap/js/popper.min.js"></script>
<script type="text/javascript" src="node_modules/mdbootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="node_modules/mdbootstrap/js/mdb.min.js"></script>
</body>
</html>