-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinde.php
More file actions
345 lines (326 loc) · 13.8 KB
/
inde.php
File metadata and controls
345 lines (326 loc) · 13.8 KB
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<?php
session_start();
if(!isset($_SESSION['loggedin']) || $_SESSION['loggedin']!=true){
header("location: page.php");
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bookish - Dashboard</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@400;600;700&display=swap">
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<link rel="stylesheet" href="modern-dashboard.css">
<link rel="icon" type="image/png" href="image/logo.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200">
<script src="https://kit.fontawesome.com/d01fd9c369.js" crossorigin="anonymous"></script>
</head>
<body>
<!-- Sidebar -->
<aside class="sidebar">
<div class="sidebar-header">
<div class="logo">
<img src="image/logo.png" alt="Bookish Logo">
<h2>Bookish</h2>
</div>
<div class="user-welcome">
<div class="user-avatar">
<i class="fas fa-user-circle"></i>
</div>
<div class="user-info">
<p>Welcome back,</p>
<h3><?php echo $_SESSION['username']?></h3>
</div>
</div>
</div>
<nav class="sidebar-nav">
<div class="nav-section">
<h4>MAIN MENU</h4>
<ul>
<li class="active">
<a href="#">
<i class="fas fa-home"></i>
<span>Dashboard</span>
</a>
</li>
<li>
<a href="profile.php">
<i class="fas fa-user"></i>
<span>My Profile</span>
</a>
</li>
</ul>
</div>
<div class="nav-section">
<h4>BOOKS & SERVICES</h4>
<ul>
<li>
<a href="buy.php">
<i class="fas fa-shopping-cart"></i>
<span>Buy Books</span>
</a>
</li>
<li>
<a href="rent.php">
<i class="fas fa-sync"></i>
<span>Rent Books</span>
</a>
</li>
<li>
<a href="add_item.php">
<i class="fas fa-upload"></i>
<span>Sell Books</span>
</a>
</li>
<li>
<a href="audio.php">
<i class="fas fa-headphones"></i>
<span>Audio Books</span>
</a>
</li>
<li>
<a href="e-books.php">
<i class="fas fa-tablet-alt"></i>
<span>E-Books</span>
</a>
</li>
<li>
<a href="custom_order.php">
<i class="fas fa-magic"></i>
<span>Custom Order</span>
</a>
</li>
</ul>
</div>
<div class="nav-section">
<h4>MORE</h4>
<ul>
<li>
<a href="aboutus.html">
<i class="fas fa-info-circle"></i>
<span>About Us</span>
</a>
</li>
<li>
<a href="logoutt.php" class="logout-btn">
<i class="fas fa-sign-out-alt"></i>
<span>Logout</span>
</a>
</li>
</ul>
</div>
</nav>
<div class="social-links">
<a href="https://www.facebook.com/" target="_blank"><i class="fab fa-facebook"></i></a>
<a href="https://twitter.com/" target="_blank"><i class="fab fa-twitter"></i></a>
<a href="https://www.instagram.com/code._.craftt/" target="_blank"><i class="fab fa-instagram"></i></a>
<a href="https://www.linkedin.com/in/rajpal-rathore-4293151b6/" target="_blank"><i class="fab fa-linkedin"></i></a>
</div>
</aside>
<!-- Main Content -->
<main class="main-content">
<!-- Top Navigation -->
<nav class="top-nav">
<div class="search-bar">
<i class="fas fa-search"></i>
<input type="text" placeholder="Search for books, authors, or categories...">
</div>
<div class="nav-actions">
<button class="notification-btn">
<i class="fas fa-bell"></i>
<span class="badge">3</span>
</button>
<button class="theme-switch" id="themeSwitch" title="Toggle Dark Mode">
<i class="fas fa-moon"></i>
</button>
<a href="profile.php" class="profile-link">
<i class="fas fa-user-circle"></i>
</a>
</div>
</nav>
<!-- Dashboard Content -->
<div class="dashboard-content">
<!-- Welcome Section -->
<section class="welcome-section" data-aos="fade-up">
<div class="welcome-card">
<div class="welcome-text">
<h1>Welcome to Your Book Haven</h1>
<p>Explore your personalized dashboard and manage all your book-related activities in one place.</p>
</div>
<div class="quick-actions">
<a href="buy.php" class="action-btn">
<i class="fas fa-book"></i>
Browse Books
</a>
<a href="add_item.php" class="action-btn">
<i class="fas fa-upload"></i>
Sell a Book
</a>
<a href="custom_order.php" class="action-btn">
<i class="fas fa-magic"></i>
Custom Order
</a>
</div>
</div>
</section>
<!-- Stats Grid -->
<div class="stats-grid">
<div class="stat-card" data-aos="fade-up" data-aos-delay="100">
<div class="stat-icon">
<i class="fas fa-book"></i>
</div>
<div class="stat-info">
<h3>Books Available</h3>
<p class="stat-number">1,234</p>
</div>
</div>
<div class="stat-card" data-aos="fade-up" data-aos-delay="200">
<div class="stat-icon">
<i class="fas fa-users"></i>
</div>
<div class="stat-info">
<h3>Active Users</h3>
<p class="stat-number">856</p>
</div>
</div>
<div class="stat-card" data-aos="fade-up" data-aos-delay="300">
<div class="stat-icon">
<i class="fas fa-exchange-alt"></i>
</div>
<div class="stat-info">
<h3>Books Rented</h3>
<p class="stat-number">432</p>
</div>
</div>
<div class="stat-card" data-aos="fade-up" data-aos-delay="400">
<div class="stat-icon">
<i class="fas fa-star"></i>
</div>
<div class="stat-info">
<h3>Reviews</h3>
<p class="stat-number">2.5k</p>
</div>
</div>
</div>
<!-- Featured Sections -->
<div class="featured-sections">
<!-- Recent Books -->
<section class="recent-books" data-aos="fade-up">
<h2>Recently Added Books</h2>
<div class="books-grid">
<?php
include 'config.php';
// Fetch recently added books
$sql = "SELECT * FROM items ORDER BY id DESC LIMIT 6";
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_assoc($result)) {
echo '<div class="book-card" data-aos="fade-up">
<div class="book-image">
<img src="' . $row['image'] . '" alt="' . $row['name'] . '">
<div class="book-overlay">
<a href="buy.php?id=' . $row['id'] . '" class="buy-now">Buy Now</a>
</div>
</div>
<div class="book-info">
<h3>' . $row['name'] . '</h3>
<p class="author">' . $row['author'] . '</p>
<div class="book-meta">
<span class="price">₹' . $row['price'] . '</span>
<div class="rating">
<i class="fas fa-star"></i>
<span>4.5</span>
</div>
</div>
</div>
</div>';
}
?>
</div>
<div class="view-all-btn">
<a href="buy.php" class="btn-primary">View All Books</a>
</div>
</section>
<!-- Popular Categories -->
<section class="popular-categories" data-aos="fade-up">
<h2>Popular Categories</h2>
<div class="categories-grid">
<a href="#" class="category-card">
<i class="fas fa-book"></i>
<h3>Fiction</h3>
<p>1.2k+ Books</p>
</a>
<a href="#" class="category-card">
<i class="fas fa-graduation-cap"></i>
<h3>Academic</h3>
<p>800+ Books</p>
</a>
<a href="#" class="category-card">
<i class="fas fa-headphones"></i>
<h3>Audio Books</h3>
<p>500+ Books</p>
</a>
<a href="#" class="category-card">
<i class="fas fa-tablet-alt"></i>
<h3>E-Books</h3>
<p>1.5k+ Books</p>
</a>
</div>
</section>
</div>
</div>
</main>
<!-- Initialize AOS -->
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>
AOS.init({
duration: 800,
once: true,
offset: 100
});
// Dark Mode Toggle
const themeSwitch = document.getElementById('themeSwitch');
const body = document.body;
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
// Check for saved theme preference or system preference
if (localStorage.getItem('darkMode') === 'true' ||
(localStorage.getItem('darkMode') === null && prefersDarkScheme.matches)) {
body.classList.add('dark-mode');
themeSwitch.querySelector('i').classList.replace('fa-moon', 'fa-sun');
}
themeSwitch.addEventListener('click', () => {
body.classList.toggle('dark-mode');
const isDark = body.classList.contains('dark-mode');
localStorage.setItem('darkMode', isDark);
// Toggle icon
const icon = themeSwitch.querySelector('i');
if (isDark) {
icon.classList.replace('fa-moon', 'fa-sun');
} else {
icon.classList.replace('fa-sun', 'fa-moon');
}
});
// Add smooth animations for stats
const statNumbers = document.querySelectorAll('.stat-number');
const observerOptions = {
threshold: 0.5
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, observerOptions);
statNumbers.forEach(stat => {
stat.style.opacity = '0';
stat.style.transform = 'translateY(20px)';
stat.style.transition = 'all 0.6s ease-out';
observer.observe(stat);
});
</script>
</body>
</html>