-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
296 lines (285 loc) · 9.88 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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>BookStore.com</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link
href="https://fonts.googleapis.com/css?family=Ubuntu&display=swap"
rel="stylesheet"
/>
<script src="js/home_page.js" defer></script>
<script>
<?php
$host = 'localhost';
$username = 'root';
$password = '';
$dbname = 'Books';
$con = mysqli_connect($hostname, $username, $password, $dbname);
// mysqli_query($con, "Add * FROM Books");
$result = mysqli_query($con, "SELECT * FROM Books");
while($row = mysqli_fetch_assoc($result)) {
$json_array[] = $row;
}
?>
let books = <?php echo json_encode($json_array);?>;
// <main id="books_list">
/*
<div class="item">
<div class="item_title">
<a href="product_page/index.html" style="color: black;">
<img src="images/children/alice.jfif" class="image" />
<p class="price">$99.9</p>
<p class="title">Alice in the Wonderland</p>
<img src="images/stars/3st.jfif" class="book_ratings" />
<p class="discount">-21%</p>
</a>
</div>
<button class="add_to_cart">Add to Cart</button>
</div>
*/
let items1 = document.querySelector('article #books_list');
let items = items1.childNodes;
let newItem = document.createElement('div');
newItem.class = 'item';
console.log(newItem.class);
let newItemTitle = document.createElement('div');
newItemTitle.class = 'item_title';
<?php
mysqli_close($con);
?>
</script>
</head>
<body>
<header id="header_with_search_bar">
<img src="images/image.PNG" alt="" id="main_logo" />
<div id="search_bar_and_logo">
<input type="text" name="search" id="search" />
<input
type="image"
src="images/search-logo.png"
width="30px"
height="30px"
id="search_logo"
/>
</div>
<button id="sign_in">Sign in</button>
<div id="shopping_cart">
<img src="images/cart.png" alt="shopping cart image" width="50px" />
<div>
<p id="cart_size">0</p>
<p>In Cart</p>
</div>
</div>
</header>
<nav id="navbar">
<p><a href="#" id="home">Home</a></p>
<p><a href="products_list_page/index.html">Best Sellers</a></p>
<p><a href="products_list_page/index.html">New Releases</a></p>
<p><a href="products_list_page/index.html">Genres</a></p>
<p><a href="About_us/index.html">About us</a></p>
</nav>
<h2>Genres</h2>
<main id="genres">
<div class="genre">
<img src="images/genres/fiction.jfif" width="120px" height="120px" />
<p><a href="">Literature & Fiction</a></p>
</div>
<div class="genre">
<img src="images/genres/heart.png" width="120px" height="120px" />
<p><a href="">Romance</a></p>
</div>
<div class="genre">
<img src="images/genres/dollar.png" width="120px" height="120px" />
<p><a href="">Business books</a></p>
</div>
<div class="genre">
<img src="images/genres/children.png" width="120px" height="120px" />
<p><a href="">Children</a></p>
</div>
<div class="genre">
<img src="images/genres/dragon.png" width="120px" height="120px" />
<p><a href="">Fantasy</a></p>
</div>
<div class="genre">
<img src="images/genres/textbooks.jfif" width="120px" height="120px" />
<p><a href="">Textbooks</a></p>
</div>
<div class="genre">
<img src="images/genres/Auezov.jfif" width="120px" height="120px" />
<p><a href="">Kazakh books</a></p>
</div>
</main>
<article id="main_content">
<nav id="side_bar">
<div id="new_releases_div">
<h3>New Releases</h3>
<label>Last week</label><br />
<label>Last 30 days</label><br />
</div>
<div id="author_div">
<h3>Author</h3>
<input id="napoleon" type="checkbox" /><label for="napoleon"
>Napoleon Hill</label
><br />
<input id="auezov" type="checkbox" /><label for="auezov"
>Mukhtar Auezov</label
><br />
</div>
<div id="top_ratings_div">
<h3>Top ratings</h3>
<a href="#"
><img src="images/stars/5st.jfif" id="5st" width="100px" /><label
for="5st"
>Highly rated</label
></a
><br />
<a href="#"
><img src="images/stars/4st.jfif" id="4st" width="100px" /><label
for="4st"
>4 stars</label
></a
><br />
<a href="#"
><img src="images/stars/3st.jfif" id="3st" width="100px" /><label
for="3st"
>3 stars</label
></a
><br />
<a href="#"
><img src="images/stars/2st.gif" id="2st" width="100px" /><label
for="2st"
>2 stars</label
></a
><br />
<a href="#"
><img src="images/stars/1st.png" id="1st" width="100px" />
<label for="1st">1 star</label></a
><br />
</div>
<div id="format_div">
<h3>Format</h3>
<input id="audiobook" type="checkbox" /><label for="audiobook"
>Audiobook</label
><br />
<input id="hardcover" type="checkbox" /><label for="hardcover"
>Hardcover</label
><br />
<input id="kindle" type="checkbox" /><label for="kindle"
>Kindle eBooks</label
><br />
<input id="paperback" type="checkbox" /><label for="paperback"
>Paperback</label
><br />
</div>
<div id="price_div">
<h3>Price</h3>
<input id="under_1000" type="checkbox" /><label for="under_1000"
>Under 1000tg</label
><br />
<input id="1000_2000" type="checkbox" /><label for="1000_2000"
>1000tg - 2000tg</label
><br />
<input id="2000_3000" type="checkbox" /><label for="2000_3000"
>2000tg - 3000tg</label
><br />
<input id="over_3000" type="checkbox" /><label for="over_3000"
>over 3000tg</label
><br />
<input type="text" placeholder="Min" class="price_input" />
<input type="text" placeholder="Max" class="price_input" />
<button>Go</button>
</div>
</nav>
<main id="books_list">
<div class="item">
<div class="item_title">
<a href="product_page/index.html" style="color: black;">
<img src="images/children/alice.jfif" class="image" />
<p class="price">$99.9</p>
<p class="title">Alice in the Wonderland</p>
<img src="images/stars/3st.jfif" class="book_ratings" />
<p class="discount">-21%</p>
</a>
</div>
<button class="add_to_cart">Add to Cart</button>
</div>
<div class="item">
<div class="item_title">
<a href="product_page/index.html" style="color: black;">
<img src="images/fantasy/got.jfif" class="image" />
<p class="price">$99.9</p>
<p class="title">Game of Thrones</p>
<img src="images/stars/4st.jfif" alt="" class="book_ratings" />
<p class="discount">-10%</p>
</a>
</div>
<button class="add_to_cart">Add to Cart</button>
</div>
<div class="item">
<div class="item_title">
<a href="product_page/index.html" style="color: black;">
<img src="images/fiction/Forrest_gump.jfif" class="image" />
<p class="price">$99.9</p>
<p class="title">Forrest Gump</p>
<img src="images/stars/4st.jfif" alt="" class="book_ratings" />
</a>
</div>
<button class="add_to_cart">Add to Cart</button>
</div>
<div class="item">
<div class="item_title">
<a href="product_page/index.html" style="color: black;">
<img src="images/business/7_habits.jfif" class="image" />
<p class="price with_discount">$99.9</p>
<p class="title">7 Habits of Highly effective People</p>
<img src="images/stars/5st.jfif" alt="" class="book_ratings" />
<p class="discount">-10%</p>
</a>
</div>
<button class="add_to_cart">Add to Cart</button>
</div>
</main>
</article>
<div id="back_to_top" onclick="backToTop()">Back to top</div>
<footer>
<div>
<table>
<tr>
<th>About us</th>
<th>Contact us</th>
</tr>
<tr>
<td>
<a
href="https://github.com/MaratulyAli/WebProject"
target="_blank"
>My GitHub</a
>
</td>
<td>
<a
href="https://www.facebook.com/profile.php?id=100012186792129"
target="_blank"
>Facebook</a
>
</td>
</tr>
<tr>
<td></td>
<td>
<a href="https://t.me/maratuly_ali" target="_blank">Telegram</a>
</td>
</tr>
</table>
<select name="lang" id="switch_lang">
<option value="EN">English</option>
<option value="RU">Russian</option>
</select>
</div>
<p>© SDU 2019. All rights are not reserved.</p>
</footer>
</body>
</html>