File size: 14,077 Bytes
3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 b1bcf9c 3c39635 | 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 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard | ShopSphere</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body class="bg-gray-100">
<admin-sidebar></admin-sidebar>
<div class="ml-64 p-8">
<div class="flex justify-between items-center mb-8">
<h1 class="text-3xl font-bold">Admin Dashboard</h1>
<div class="flex items-center gap-4">
<div class="relative">
<input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border rounded-lg">
<i data-feather="search" class="absolute left-3 top-2.5 text-gray-400"></i>
</div>
<button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center">
<i data-feather="plus" class="mr-2"></i>
Generate Report
</button>
</div>
</div>
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between">
<div>
<p class="text-gray-500">Total Sales</p>
<h3 class="text-2xl font-bold">$24,780</h3>
<p class="text-green-500 text-sm mt-1">+12% from last month</p>
</div>
<div class="bg-indigo-100 text-indigo-600 p-3 rounded-full">
<i data-feather="dollar-sign"></i>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between">
<div>
<p class="text-gray-500">Total Orders</p>
<h3 class="text-2xl font-bold">1,245</h3>
<p class="text-green-500 text-sm mt-1">+8% from last month</p>
</div>
<div class="bg-green-100 text-green-600 p-3 rounded-full">
<i data-feather="shopping-cart"></i>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between">
<div>
<p class="text-gray-500">New Customers</p>
<h3 class="text-2xl font-bold">142</h3>
<p class="text-green-500 text-sm mt-1">+15% from last month</p>
</div>
<div class="bg-blue-100 text-blue-600 p-3 rounded-full">
<i data-feather="users"></i>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between">
<div>
<p class="text-gray-500">Avg. Order Value</p>
<h3 class="text-2xl font-bold">$89.45</h3>
<p class="text-green-500 text-sm mt-1">+5% from last month</p>
</div>
<div class="bg-purple-100 text-purple-600 p-3 rounded-full">
<i data-feather="trending-up"></i>
</div>
</div>
</div>
</div>
<!-- Charts -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-bold mb-4">Monthly Sales</h3>
<canvas id="salesChart" height="300"></canvas>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-bold mb-4">Revenue by Category</h3>
<canvas id="categoryChart" height="300"></canvas>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-bold mb-4">Traffic Sources</h3>
<canvas id="trafficChart" height="300"></canvas>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="text-lg font-bold mb-4">Yearly Performance</h3>
<canvas id="yearlyChart" height="300"></canvas>
</div>
</div>
<!-- Recent Orders -->
<div class="bg-white rounded-lg shadow overflow-hidden">
<div class="px-6 py-4 border-b flex justify-between items-center">
<h3 class="text-lg font-bold">Recent Orders</h3>
<a href="/admin-orders.html" class="text-indigo-600 hover:text-indigo-800 text-sm font-medium">View All</a>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Order ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Customer</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">#ORD-7842</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Sarah Johnson</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">June 15, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$187.99</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Delivered</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<a href="#" class="text-indigo-600 hover:text-indigo-900 mr-3">View</a>
<a href="#" class="text-red-600 hover:text-red-900">Delete</a>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">#ORD-7841</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Michael Chen</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">June 14, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$245.50</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">Processing</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<a href="#" class="text-indigo-600 hover:text-indigo-900 mr-3">View</a>
<a href="#" class="text-red-600 hover:text-red-900">Delete</a>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">#ORD-7840</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">David Rodriguez</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">June 13, 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$98.75</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">Shipped</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<a href="#" class="text-indigo-600 hover:text-indigo-900 mr-3">View</a>
<a href="#" class="text-red-600 hover:text-red-900">Delete</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="components/admin-sidebar.js"></script>
<script src="script.js"></script>
<script>
feather.replace();
// Sales Chart
const salesCtx = document.getElementById('salesChart').getContext('2d');
const salesChart = new Chart(salesCtx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Sales ($)',
data: [8500, 10200, 9800, 12500, 14300, 16700, 15200, 18100, 17500, 19300, 21000, 24780],
backgroundColor: 'rgba(99, 102, 241, 0.1)',
borderColor: 'rgba(99, 102, 241, 1)',
borderWidth: 2,
tension: 0.3,
fill: true
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true
}
}
}
});
// Category Chart
const categoryCtx = document.getElementById('categoryChart').getContext('2d');
const categoryChart = new Chart(categoryCtx, {
type: 'doughnut',
data: {
labels: ['Electronics', 'Fashion', 'Home & Living', 'Beauty', 'Other'],
datasets: [{
data: [35, 25, 20, 15, 5],
backgroundColor: [
'rgba(99, 102, 241, 0.8)',
'rgba(79, 70, 229, 0.8)',
'rgba(109, 40, 217, 0.8)',
'rgba(139, 92, 246, 0.8)',
'rgba(168, 85, 247, 0.8)'
],
borderWidth: 0
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'right'
}
}
}
});
// Traffic Chart
const trafficCtx = document.getElementById('trafficChart').getContext('2d');
const trafficChart = new Chart(trafficCtx, {
type: 'bar',
data: {
labels: ['Direct', 'Organic', 'Social', 'Referral', 'Paid'],
datasets: [{
label: 'Traffic Sources',
data: [35, 40, 15, 7, 3],
backgroundColor: [
'rgba(99, 102, 241, 0.7)',
'rgba(79, 70, 229, 0.7)',
'rgba(109, 40, 217, 0.7)',
'rgba(139, 92, 246, 0.7)',
'rgba(168, 85, 247, 0.7)'
],
borderWidth: 0
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true
}
}
}
});
// Yearly Chart
const yearlyCtx = document.getElementById('yearlyChart').getContext('2d');
const yearlyChart = new Chart(yearlyCtx, {
type: 'line',
data: {
labels: ['2020', '2021', '2022', '2023'],
datasets: [{
label: 'Yearly Revenue',
data: [85000, 125000, 178000, 220000],
backgroundColor: 'rgba(99, 102, 241, 0.1)',
borderColor: 'rgba(99, 102, 241, 1)',
borderWidth: 2,
tension: 0.3,
fill: true
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
</body>
</html> |