sweetroute / admin-dashboard.html
Meech888's picture
Create an Admin Dashboard Page for a cake delivery system.
8a2ae57 verified
Raw History Blame Contribute Delete
30.9 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard - Pastry Delivery</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.dashboard-card {
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dashboard-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.map-container {
height: 400px;
border-radius: 0.5rem;
overflow: hidden;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.status-indicator {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 8px;
}
.status-active {
background-color: #10B981;
}
.status-pending {
background-color: #F59E0B;
}
.status-inactive {
background-color: #EF4444;
}
</style>
</head>
<body class="bg-slate-50 text-slate-800">
<!-- Navigation -->
<nav class="bg-blue-600 text-white shadow-lg">
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
<div class="flex items-center space-x-2">
<img src="https://huggingface.co/spaces/Meech888/sweetroute/resolve/main/images/ChatGPT%20Image%20Oct%2013%2C%202025%20at%2001_09_01%20PM.png" alt="Pastry Delivery Logo" class="h-10 w-auto">
<h1 class="text-2xl font-bold">Pastry Delivery</h1>
</div>
<div class="flex space-x-4">
<a href="index.html" class="px-4 py-2 rounded-lg bg-white text-blue-600 font-medium hover:bg-blue-50 transition">Home</a>
<a href="client-dashboard.html" class="px-4 py-2 rounded-lg bg-white text-blue-600 font-medium hover:bg-blue-50 transition">Client Dashboard</a>
<a href="vendor.html" class="px-4 py-2 rounded-lg bg-white text-blue-600 font-medium hover:bg-blue-50 transition">Vendor Dashboard</a>
<a href="admin-dashboard.html" class="px-4 py-2 rounded-lg bg-blue-700 text-white font-medium hover:bg-blue-800 transition">Admin Dashboard</a>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="container mx-auto px-4 py-8">
<div class="text-center mb-10">
<h2 class="text-3xl font-bold text-blue-600 mb-2">Admin Dashboard</h2>
<p class="text-slate-600 max-w-2xl mx-auto">Manage your cake delivery system with comprehensive analytics and controls</p>
</div>
<!-- Stats Overview -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="bg-white rounded-xl shadow p-5 dashboard-card">
<div class="flex justify-between items-start">
<div>
<p class="text-slate-500 text-sm">Total Deliveries</p>
<p class="text-3xl font-bold text-blue-600">1,248</p>
</div>
<div class="bg-blue-100 p-3 rounded-lg">
<i data-feather="truck" class="text-blue-600"></i>
</div>
</div>
<div class="mt-4">
<p class="text-sm text-slate-600"><span class="text-green-500">+12%</span> from last month</p>
</div>
</div>
<div class="bg-white rounded-xl shadow p-5 dashboard-card">
<div class="flex justify-between items-start">
<div>
<p class="text-slate-500 text-sm">Active Deliveries</p>
<p class="text-3xl font-bold text-amber-600">24</p>
</div>
<div class="bg-amber-100 p-3 rounded-lg">
<i data-feather="package" class="text-amber-600"></i>
</div>
</div>
<div class="mt-4">
<p class="text-sm text-slate-600"><span class="text-green-500">+3</span> from yesterday</p>
</div>
</div>
<div class="bg-white rounded-xl shadow p-5 dashboard-card">
<div class="flex justify-between items-start">
<div>
<p class="text-slate-500 text-sm">Completed Today</p>
<p class="text-3xl font-bold text-green-600">86</p>
</div>
<div class="bg-green-100 p-3 rounded-lg">
<i data-feather="check-circle" class="text-green-600"></i>
</div>
</div>
<div class="mt-4">
<p class="text-sm text-slate-600"><span class="text-green-500">+8%</span> from average</p>
</div>
</div>
<div class="bg-white rounded-xl shadow p-5 dashboard-card">
<div class="flex justify-between items-start">
<div>
<p class="text-slate-500 text-sm">Revenue</p>
<p class="text-3xl font-bold text-purple-600">$12,480</p>
</div>
<div class="bg-purple-100 p-3 rounded-lg">
<i data-feather="dollar-sign" class="text-purple-600"></i>
</div>
</div>
<div class="mt-4">
<p class="text-sm text-slate-600"><span class="text-green-500">+$1,240</span> today</p>
</div>
</div>
</div>
<!-- Charts Section -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
<div class="bg-white rounded-xl shadow-md p-6">
<h3 class="text-xl font-bold mb-4 text-blue-600">Delivery Analytics</h3>
<canvas id="deliveryChart" height="300"></canvas>
</div>
<div class="bg-white rounded-xl shadow-md p-6">
<h3 class="text-xl font-bold mb-4 text-blue-600">Revenue Overview</h3>
<canvas id="revenueChart" height="300"></canvas>
</div>
</div>
<!-- Management Sections -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-8">
<!-- Clients Management -->
<div class="bg-white rounded-xl shadow-md p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-600">Clients</h3>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded-lg text-sm">View All</button>
</div>
<div class="space-y-4">
<div class="border border-slate-200 rounded-lg p-3">
<div class="flex justify-between">
<div>
<h4 class="font-medium">Sarah Johnson</h4>
<p class="text-sm text-slate-600">sarah@example.com</p>
</div>
<div class="flex space-x-2">
<button class="text-blue-600 hover:text-blue-900">
<i data-feather="edit" class="w-4 h-4"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i data-feather="trash" class="w-4 h-4"></i>
</button>
</div>
</div>
<div class="mt-2 flex items-center">
<span class="status-indicator status-active"></span>
<span class="text-sm">Active</span>
</div>
</div>
<div class="border border-slate-200 rounded-lg p-3">
<div class="flex justify-between">
<div>
<h4 class="font-medium">Robert Chen</h4>
<p class="text-sm text-slate-600">robert@example.com</p>
</div>
<div class="flex space-x-2">
<button class="text-blue-600 hover:text-blue-900">
<i data-feather="edit" class="w-4 h-4"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i data-feather="trash" class="w-4 h-4"></i>
</button>
</div>
</div>
<div class="mt-2 flex items-center">
<span class="status-indicator status-active"></span>
<span class="text-sm">Active</span>
</div>
</div>
</div>
</div>
<!-- Riders Management -->
<div class="bg-white rounded-xl shadow-md p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-600">Riders</h3>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded-lg text-sm">View All</button>
</div>
<div class="space-y-4">
<div class="border border-slate-200 rounded-lg p-3">
<div class="flex justify-between">
<div>
<h4 class="font-medium">Michael Rodriguez</h4>
<p class="text-sm text-slate-600">Rating: 4.8 ★</p>
</div>
<div class="flex space-x-2">
<button class="text-green-600 hover:text-green-900">
<i data-feather="check-circle" class="w-4 h-4"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i data-feather="slash" class="w-4 h-4"></i>
</button>
</div>
</div>
<div class="mt-2 flex items-center">
<span class="status-indicator status-active"></span>
<span class="text-sm">Online</span>
</div>
</div>
<div class="border border-slate-200 rounded-lg p-3">
<div class="flex justify-between">
<div>
<h4 class="font-medium">Jennifer Lopez</h4>
<p class="text-sm text-slate-600">Rating: 4.9 ★</p>
</div>
<div class="flex space-x-2">
<button class="text-green-600 hover:text-green-900">
<i data-feather="check-circle" class="w-4 h-4"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i data-feather="slash" class="w-4 h-4"></i>
</button>
</div>
</div>
<div class="mt-2 flex items-center">
<span class="status-indicator status-pending"></span>
<span class="text-sm">Busy</span>
</div>
</div>
</div>
</div>
<!-- Recent Deliveries -->
<div class="bg-white rounded-xl shadow-md p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-600">Recent Deliveries</h3>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded-lg text-sm">View All</button>
</div>
<div class="space-y-4">
<div class="border border-slate-200 rounded-lg p-3">
<div class="flex justify-between">
<div>
<h4 class="font-medium">#DL-78945</h4>
<p class="text-sm text-slate-600">To: Sarah Johnson</p>
</div>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Delivered</span>
</div>
<div class="mt-2 flex justify-between text-sm">
<span>Rider: Michael R.</span>
<span>$24.50</span>
</div>
</div>
<div class="border border-slate-200 rounded-lg p-3">
<div class="flex justify-between">
<div>
<h4 class="font-medium">#DL-78944</h4>
<p class="text-sm text-slate-600">To: Robert Chen</p>
</div>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-amber-100 text-amber-800">In Transit</span>
</div>
<div class="mt-2 flex justify-between text-sm">
<span>Rider: Jennifer L.</span>
<span>$18.75</span>
</div>
</div>
</div>
</div>
</div>
<!-- Real-time Tracking Map -->
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-600">Live Delivery Tracking</h3>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm flex items-center">
<i data-feather="refresh-cw" class="w-4 h-4 mr-1"></i>
Refresh
</button>
</div>
<div class="map-container" id="adminMap"></div>
</div>
<!-- Payments & Transactions -->
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-600">Payments & Transactions</h3>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm flex items-center">
<i data-feather="download" class="w-4 h-4 mr-1"></i>
Export Report
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-slate-200">
<thead class="bg-slate-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider">Transaction ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider">Client</th>
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider">Amount</th>
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider">Date</th>
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-slate-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-slate-900">#TX-78945</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-slate-500">Sarah Johnson</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-slate-500">$24.50</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-slate-500">Oct 12, 2023</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">Completed</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<button class="text-blue-600 hover:text-blue-900 mr-3">View</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-slate-900">#TX-78944</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-slate-500">Robert Chen</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-slate-500">$18.75</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-slate-500">Oct 12, 2023</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-amber-100 text-amber-800">Pending</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<button class="text-blue-600 hover:text-blue-900 mr-3">View</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Customer Support Tickets -->
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-600">Support Tickets</h3>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm">View All Tickets</button>
</div>
<div class="space-y-4">
<div class="border border-slate-200 rounded-lg p-4">
<div class="flex justify-between">
<div>
<h4 class="font-medium">Delivery Delay Complaint</h4>
<p class="text-sm text-slate-600">Customer: Emma Wilson • Priority: High</p>
</div>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-amber-100 text-amber-800">Open</span>
</div>
<p class="mt-2 text-sm">Customer reports that their delivery was 30 minutes late without prior notification.</p>
<div class="mt-3 flex justify-between">
<span class="text-xs text-slate-500">Opened: Oct 12, 2023 14:30</span>
<button class="text-blue-600 hover:text-blue-900 text-sm">Respond</button>
</div>
</div>
<div class="border border-slate-200 rounded-lg p-4">
<div class="flex justify-between">
<div>
<h4 class="font-medium">Payment Issue</h4>
<p class="text-sm text-slate-600">Customer: David Kim • Priority: Medium</p>
</div>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Resolved</span>
</div>
<p class="mt-2 text-sm">Double charge reported. Issue resolved with refund processed.</p>
<div class="mt-3 flex justify-between">
<span class="text-xs text-slate-500">Closed: Oct 11, 2023 16:45</span>
<button class="text-blue-600 hover:text-blue-900 text-sm">View Details</button>
</div>
</div>
</div>
</div>
<!-- Notifications Panel -->
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-blue-600">System Notifications</h3>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm">Mark All Read</button>
</div>
<div class="space-y-4">
<div class="p-3 bg-blue-50 rounded-lg border border-blue-100">
<div class="flex">
<i data-feather="package" class="text-blue-500 mr-2"></i>
<div>
<h4 class="font-medium">New Delivery Request</h4>
<p class="text-sm text-slate-600">New order #DL-78950 received from client Sarah Johnson</p>
<p class="text-xs text-slate-500 mt-1">2 mins ago</p>
</div>
</div>
</div>
<div class="p-3 bg-amber-50 rounded-lg border border-amber-100">
<div class="flex">
<i data-feather="alert-triangle" class="text-amber-500 mr-2"></i>
<div>
<h4 class="font-medium">Payment Failed</h4>
<p class="text-sm text-slate-600">Payment for order #DL-78948 failed. Client notified.</p>
<p class="text-xs text-slate-500 mt-1">15 mins ago</p>
</div>
</div>
</div>
<div class="p-3 bg-green-50 rounded-lg border border-green-100">
<div class="flex">
<i data-feather="check-circle" class="text-green-500 mr-2"></i>
<div>
<h4 class="font-medium">Rider Verified</h4>
<p class="text-sm text-slate-600">New rider application approved: James Wilson</p>
<p class="text-xs text-slate-500 mt-1">1 hour ago</p>
</div>
</div>
</div>
</div>
</div>
<!-- Settings Section -->
<div class="bg-white rounded-xl shadow-md p-6">
<h3 class="text-xl font-bold mb-4 text-blue-600">Admin Settings</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="border border-slate-200 rounded-lg p-4">
<h4 class="font-medium mb-2">Account Security</h4>
<p class="text-sm text-slate-600 mb-3">Manage password and authentication settings</p>
<button class="w-full bg-slate-100 hover:bg-slate-200 text-slate-800 py-2 rounded-lg text-sm">Change Password</button>
</div>
<div class="border border-slate-200 rounded-lg p-4">
<h4 class="font-medium mb-2">Two-Factor Auth</h4>
<p class="text-sm text-slate-600 mb-3">Enable additional security layer</p>
<button class="w-full bg-slate-100 hover:bg-slate-200 text-slate-800 py-2 rounded-lg text-sm">Configure 2FA</button>
</div>
<div class="border border-slate-200 rounded-lg p-4">
<h4 class="font-medium mb-2">System Preferences</h4>
<p class="text-sm text-slate-600 mb-3">Adjust dashboard and notification settings</p>
<button class="w-full bg-slate-100 hover:bg-slate-200 text-slate-800 py-2 rounded-lg text-sm">Preferences</button>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-slate-800 text-white py-10 mt-12">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-6 md:mb-0">
<div class="flex items-center space-x-2">
<i data-feather="cake" class="w-8 h-8"></i>
<h2 class="text-2xl font-bold">Pastry Delivery</h2>
</div>
<p class="mt-2 text-slate-400 max-w-md">Delivering fresh pastries with secure transport and real-time tracking.</p>
</div>
<div class="grid grid-cols-2 md:grid-cols-3 gap-8">
<div>
<h3 class="font-bold text-lg mb-3">Services</h3>
<ul class="space-y-2 text-slate-400">
<li><a href="#" class="hover:text-white">Cake Delivery</a></li>
<li><a href="#" class="hover:text-white">Custom Cakes</a></li>
<li><a href="#" class="hover:text-white">Corporate Orders</a></li>
</ul>
</div>
<div>
<h3 class="font-bold text-lg mb-3">Company</h3>
<ul class="space-y-2 text-slate-400">
<li><a href="#" class="hover:text-white">About Us</a></li>
<li><a href="#" class="hover:text-white">Careers</a></li>
<li><a href="#" class="hover:text-white">Contact</a></li>
</ul>
</div>
</div>
</div>
<div class="border-t border-slate-700 mt-8 pt-6 text-center text-slate-400">
<p>&copy; 2023 Pastry Delivery. All rights reserved. Made with ❤️ for pastry lovers.</p>
</div>
</div>
</footer>
<script>
// Initialize Feather Icons
feather.replace();
// Initialize Maps
document.addEventListener('DOMContentLoaded', function() {
// Map for admin dashboard
const adminMap = L.map('adminMap').setView([40.7128, -74.0060], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(adminMap);
// Add multiple markers for active deliveries
L.marker([40.7128, -74.0060]).addTo(adminMap).bindPopup('Bakery HQ');
L.marker([40.7215, -74.0123]).addTo(adminMap).bindPopup('Rider: Michael R. (En Route)');
L.marker([40.7355, -74.0251]).addTo(adminMap).bindPopup('Rider: Jennifer L. (At Pickup)');
L.marker([40.7055, -73.9987]).addTo(adminMap).bindPopup('Rider: David K. (Delivered)');
// Add route lines
const route1 = [
[40.7128, -74.0060],
[40.7185, -74.0103],
[40.7215, -74.0123]
];
const route2 = [
[40.7355, -74.0251],
[40.7305, -74.0201],
[40.7255, -74.0151]
];
L.polyline(route1, {color: '#3b82f6'}).addTo(adminMap);
L.polyline(route2, {color: '#10b981'}).addTo(adminMap);
});
// Initialize Charts
document.addEventListener('DOMContentLoaded', function() {
const deliveryCtx = document.getElementById('deliveryChart').getContext('2d');
const deliveryChart = new Chart(deliveryCtx, {
type: 'bar',
data: {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
datasets: [{
label: 'Deliveries',
data: [42, 38, 55, 62, 58, 75, 68],
backgroundColor: 'rgba(59, 130, 246, 0.5)',
borderColor: 'rgb(59, 130, 246)',
borderWidth: 1
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
},
title: {
display: true,
text: 'Weekly Deliveries'
}
}
}
});
const revenueCtx = document.getElementById('revenueChart').getContext('2d');
const revenueChart = new Chart(revenueCtx, {
type: 'line',
data: {
labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4'],
datasets: [{
label: 'Revenue ($)',
data: [3200, 4100, 3800, 5200],
fill: false,
borderColor: 'rgb(139, 92, 246)',
tension: 0.1
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
},
title: {
display: true,
text: 'Monthly Revenue Trend'
}
}
}
});
});
</script>
</body>
</html>