-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
262 lines (240 loc) · 9.46 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!DOCTYPE html>
<?php
session_start();
$conn = mysqli_connect("localhost", "root", "", "cashback");
if (!$conn) {
die("database server error");
}
$cmd = "SELECT * FROM categories";
$cat = mysqli_query($conn, $cmd);
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
<link rel="stylesheet" type="text/css" href="css/products.css">
<link rel="stylesheet" type="text/css" href="css/login.css">
<script type="text/javascript" src="javascript/jquery.js"></script>
<title>Index</title>
</head>
<body>
<!-----------------------------------login---------------------------------->
<div class=modal>
<div class="form-box">
<div class="button-box">
<div id="btn"></div>
<button type="button" class="toggle-btn" id="clicklogin">LogIn</button>
<button type="button" class="toggle-btn" id="clicksignup">Sign up</button>
</div>
<span class="cross_box"><i class="fa fa-times"></i></span>
<!-- <div class="social-icons">
<img src="fb.png" alt="facebook">
<img src="twitter.png" alt="twitter">
<img src="google.png" alt="google">
</div> -->
<form action="signin.php" id="login" class="input-group" method="post">
<input type="text" class="input-field" placeholder="Email ID" name="mail" required>
<input type="password" class="input-field" placeholder="Password" name="password" required>
<button type="submit" class="submit-btn">Log In</button>
</form>
<form action="join.php" id="signup" class="input-group" method="post" >
<input type="text" class="input-field" placeholder="Name" name="name" required>
<input type="text" class="input-field" placeholder="Email ID" name="mail" required>
<input type="password" class="input-field" placeholder="Password" name="password" required>
<button type="submit" class="submit-btn">Sign up</button>
</form>
</div>
</div>
<?php if(isset($_GET['loginerror'])) { ?>
<div class="loginerror">
<div class="login_error">
<div class="exclamation">
<h2>OOPS!! </h2>
<i class="fa fa-exclamation-circle"></i>
</div>
<h4>You have used invalid Credentials</h4>
<div class="tryagain">
<button class="btn">Try again</button></div>
</div>
</div>
<?php } ?>
<?php if(isset($_GET['accountcreated'])) { ?>
<div class="loginerror">
<div class="accountcreated">
<div class="check">
<i class="fa fa-check-circle"></i>
</div>
<h4>Account Created Sucessfully</h4>
<div class="tryagain">
<button class="btn">Login</button></div>
</div>
</div>
<?php } ?>
<?php if(isset($_GET['accountexists'])) { ?>
<div class="loginerror">
<div class="login_error">
<div class="exclamation">
<i class="fa fa-exclamation-circle"></i>
</div>
<h4>Mail is already registerd</h4>
<div class="tryagain">
<button class="btn">Login</button></div>
</div>
</div>
<?php } ?>
<?php if(isset($_GET['loginfirst'])){ ?>
<div class=modal style="display:block;">
<div class="form-box">
<div class="button-box">
<div id="btn"></div>
<button type="button" class="toggle-btn" id="clicklogin">LogIn</button>
<button type="button" class="toggle-btn" id="clicksignup">Sign up</button>
</div>
<span class="cross_box"><i class="fa fa-times"></i></span>
<!-- <div class="social-icons">
<img src="fb.png" alt="facebook">
<img src="twitter.png" alt="twitter">
<img src="google.png" alt="google">
</div> -->
<form action="signin.php" id="login" class="input-group" method="post">
<input type="text" class="input-field" placeholder="Email ID" name="mail" required>
<input type="password" class="input-field" placeholder="Password" name="password" required>
<button type="submit" class="submit-btn">Log In</button>
</form>
<form action="join.php" id="signup" class="input-group" method="post" >
<input type="text" class="input-field" placeholder="Name" name="name" required>
<input type="text" class="input-field" placeholder="Email ID" name="mail" required>
<input type="password" class="input-field" placeholder="Password" name="password" required>
<button type="submit" class="submit-btn">Sign up</button>
</form>
</div>
</div>
<?php } ?>
<!-- ----------------------------------------------------------------Navbar---------------------------------------------------------- -->
<div class="navbar">
<div class="col-md-5 heading"><h3><a href="index.php">Earning Shop</a></h3></div>
<div class="col-md-7 links">
<div class="col-md-4"></div>
<p class="linksp">
<?php if(isset($_SESSION['name'])) { ?>
<a href="account.php?account">My Account</a>
<a href="logout.php">Signout</a>
<a href="works.php">How it Works</a>
<?php }
else{?>
<a id="login_signup" style="cursor:pointer;">Login/Sign up</a>
<a href="works.php">How it Works</a>
<?php } ?>
<span class="menubar"><i class="fa fa-bars" style="color:white; font-size:20px;"></i></span>
<div class="openmenu">
<ul>
<li style="text-align:center;"><a href="products.php?allproducts">All Products</a></li>
<li style="text-align:center;"><a href="products.php?alldeals">All deals</a></li>
<li style="text-align:center;"><a href="#categories">Categories</a></li>
<li style="text-align:center;"><a href="about_us.php">About us</a></li>
</ul>
</div>
</p>
</div>
</div>
<div class="clearfix"></div>
<!-------------------------------------------------------------Searchbar-------------------------------------------------------------- -->
<div class="search">
<div class="col-md-5 mainheadings">
<p class="s_and_e">SHOP AND EARN</p>
<p class="col-md-4 onbestdeals">ON BEST DEALS</p>
</div>
<div class="clearfix"></div>
<div class="searchbar col-md-4">
<input type="text" placeholder="Search here......" name="search_txt" id="search_txt"><span class="searchicon"><i class="fa fa-search"></i></span>
</div>
<div class="col-md-4" style="padding-left:20px;">
<p class="earnpoints">Earn Points and Redeem them to your bank account.</p></div>
<div class="clearfix"></div>
</div>
<!-- -----------------------------------------------------------------Categories----------------------------------------------------- -->
<div class="clearfix"></div>
<div class="categories" id="categories">
<div style="margin:auto;width:95%;">
<div>
<h3>Categories</h3>
<?php while($row=mysqli_fetch_array($cat)) { ?>
<a href="products.php?cat=<?php echo $row[1]; ?>">
<div class="showcat col-md-2">
<div class="col-md-4"></div>
<div class="col-md-6"><img src="images/categories/<?php echo $row[2]; ?>"></div>
<div class="col-md-2"></div>
<div class="clearfix"></div>
<p align="center"><?php echo $row[1]; ?></p>
</div>
</a>
<?php } ?>
</div>
</div>
</div>
<div class="clearfix"></div>
<!---------------------------------------------------------Top deals------------------------------------------------------------------------->
<?php
$getdealy = "SELECT * FROM deals WHERE best = 'y'";
$result_getdealsy = mysqli_query($conn, $getdealy);
?>
<div class="topdeals">
<h2 style="margin-left:8px;font-weight:bold;color:#ff2e2e;">Top Deals</h2><hr>
<?php while($row_s=mysqli_fetch_array($result_getdealsy)) { ?>
<?php if(isset($_SESSION['name'])) { ?>
<a href="<?php echo $row_s[4]; ?>">
<?php }
else{ ?>
<a href="index.php?loginfirst">
<?php }?>
<div class="deals col-md-2">
<div class="shadow">
<img src="images/deals/<?php echo $row_s[2]; ?>" alt="img">
<p class="nameofprod"><?php echo $row_s[1] ?></p>
<p class=offerondeal><?php echo $row_s[3]; ?></p>
</div>
</div>
</a>
</a>
<?php } ?>
</div>
<div class="clearfix"></div>
<!--------------------------------------top products------------------------------------------------------------------------->
<?php
$getprody = "SELECT * FROM products WHERE banner = 'y'";
$result_getprody = mysqli_query($conn, $getprody);
?>
<div class="showproducts">
<br>
<h2 style="margin-left:8px;font-weight:bold;color:#ff2e2e;">Best Sellers</h2><hr>
<?php while($row_p = mysqli_fetch_array($result_getprody)) { ?>
<?php if(isset($_SESSION['name'])) { ?>
<a href="<?php echo $row_p[5]; ?>">
<?php }
else{?>
<a href="index.php?loginfirst">
<?php } ?>
<div class="products col-md-2">
<div class="shadow">
<img src="images/products/<?php echo $row_p[3]; ?>" alt="img" width="100%">
<p class="nameofprod"><?php echo $row_p[1] ?></p>
<p class=offeronprod><?php echo $row_p[6]; ?></p>
</div>
</div>
</a>
</a>
<?php } ?>
</div>
<div class="clearfix"></div>
<br>
<!--------------------------------footer----------------------------------------------------------->
<footer>
<div class="footer">
<a href="#"><span class="footer-content">Earning Shop | © 2021 Binary Beasts</span></a>
</div>
</footer>
<script type="text/javascript" src="javascript/login.js"></script>
<script type="text/javascript" src="javascript/myscript.js"></script>
</body>
</html>