-
Notifications
You must be signed in to change notification settings - Fork 0
/
Admin_dashboard.php
182 lines (163 loc) · 5.48 KB
/
Admin_dashboard.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
<?php
session_start();
// Include database connection
$conn = require __DIR__ . "/db_connection.php";
// Initialize variables to store counts
$songCount = 0;
$artistCount = 0;
$playlistCount = 0;
$commentCount = 0;
$userCount = 0;
// Fetch the count of songs
$songResult = $conn->query("SELECT COUNT(*) as count FROM songs");
if ($songResult) {
$songCount = $songResult->fetch_assoc()['count'];
}
// Fetch the count of artists
$artistResult = $conn->query("SELECT COUNT(*) as count FROM artist");
if ($artistResult) {
$artistCount = $artistResult->fetch_assoc()['count'];
}
// Fetch the count of playlists
$playlistResult = $conn->query("SELECT COUNT(*) as count FROM playlist"); // Adjust the table name if necessary
if ($playlistResult) {
$playlistCount = $playlistResult->fetch_assoc()['count'];
}
// Fetch the count of comments
$commentResult = $conn->query("SELECT COUNT(*) as count FROM comments"); // Adjust the table name if necessary
if ($commentResult) {
$commentCount = $commentResult->fetch_assoc()['count'];
}
// Fetch the count of users
$userResult = $conn->query("SELECT COUNT(*) as count FROM users"); // Adjust the table name if necessary
if ($userResult) {
$userCount = $userResult->fetch_assoc()['count'];
}
// Close connection
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="Admin_list.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap" rel="stylesheet">
<style>
.main-content {
flex-grow: 1;
padding: 20px;
}
.stats {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.stat {
background-color: #ffffff;
border-radius: 10px;
padding: 20px;
width: 200px;
text-align: center;
margin: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease-in-out;
position: relative;
overflow: hidden;
}
.stat:hover {
transform: scale(1.05);
}
.stat h2 {
margin: 10px 0;
font-size: 2.5rem;
color: #333;
}
.stat p {
color: black;
font-size: 1.2rem;
}
.stat .icon {
font-size: 4rem;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0.2;
}
.stat.songs {
background-color: #3498db;
color: #ecf0f1;
}
.stat.artists {
background-color: #e74c3c;
color: #ecf0f1;
}
.stat.playlists {
background-color: #f39c12;
color: #ecf0f1;
}
.stat.comments {
background-color: #2ecc71;
color: #ecf0f1;
}
.stat.users {
background-color: #9b59b6;
color: #ecf0f1;
}
</style>
</head>
<body>
<div class="container">
<aside class="sidebar">
<div class="navbar">
<div class="navbar-logo">
<img src="assets/pic/Inspirational_Quote_Instagram_Post_1.png" alt="Logo" class="navbar-image">
<span>IKUN MUSIC</span>
</div>
<div class="navbar-links-container">
<a href="Admin_dashboard.php" class="navbar-link">Dashboard</a>
<a href="Admin_playlist_list.php" class="navbar-link">Playlist List</a>
<a href="Admin_song_list.php" class="navbar-link">Song List</a>
<a href="Admin_edit_comment.php" class="navbar-link">Comment List</a>
<a href="Admin_artist_list.php" class="navbar-link">Artist List</a>
<a href="Admin_user_list.php" class="navbar-link">Users List</a>
</div>
<a href="index.php" class="logout">Logout</a>
</div>
</aside>
<main class="main-content">
<h1>Admin Dashboard</h1>
<div class="stats">
<div class="stat songs">
<i class="fas fa-music icon"></i>
<h2><?php echo $songCount; ?></h2>
<p>Songs</p>
</div>
<div class="stat artists">
<i class="fas fa-user icon"></i>
<h2><?php echo $artistCount; ?></h2>
<p>Artists</p>
</div>
<div class="stat playlists">
<i class="fas fa-list icon"></i>
<h2><?php echo $playlistCount; ?></h2>
<p>Playlists</p>
</div>
<div class="stat comments">
<i class="fas fa-comments icon"></i>
<h2><?php echo $commentCount; ?></h2>
<p>Comments</p>
</div>
<div class="stat users">
<i class="fas fa-users icon"></i>
<h2><?php echo $userCount; ?></h2>
<p>Users</p>
</div>
</div>
</main>
</div>
</body>
</html>