serenairani's picture
i want a dasboard for this data about fca required annual training completion progress
c7f695f verified
Raw History Blame Contribute Delete
26.3 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FCA Training Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></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>
<style>
.progress-bar {
height: 6px;
border-radius: 3px;
}
.progress-completed {
background-color: #10B981;
}
.progress-incomplete {
background-color: #F59E0B;
}
.progress-not-attempted {
background-color: #EF4444;
}
.user-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}
.filter-active {
background-color: #3B82F6;
color: white;
}
</style>
</head>
<body class="bg-gray-50">
<div class="min-h-screen">
<!-- Header -->
<header class="bg-white shadow-sm">
<div class="max-w-7xl mx-auto px-4 py-6 sm:px-6 lg:px-8 flex justify-between items-center">
<div>
<h1 class="text-2xl font-bold text-gray-900">FCA Training Completion Dashboard</h1>
<p class="text-gray-500">Annual compliance training progress tracking</p>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<input type="text" placeholder="Search employees..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i data-feather="search" class="absolute left-3 top-2.5 text-gray-400"></i>
</div>
<button class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition flex items-center">
<i data-feather="download" class="mr-2"></i>
Export
</button>
</div>
</div>
</header>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 py-6 sm:px-6 lg:px-8">
<!-- Summary Cards -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white p-6 rounded-xl shadow-sm">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500">Completed</p>
<h3 class="text-3xl font-bold text-gray-900 mt-1">24</h3>
<p class="text-green-500 text-sm mt-2">+5 from last month</p>
</div>
<div class="bg-green-100 p-3 rounded-full">
<i data-feather="check-circle" class="text-green-600"></i>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-sm">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500">Incomplete</p>
<h3 class="text-3xl font-bold text-gray-900 mt-1">3</h3>
<p class="text-yellow-500 text-sm mt-2">-2 from last month</p>
</div>
<div class="bg-yellow-100 p-3 rounded-full">
<i data-feather="alert-circle" class="text-yellow-600"></i>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-sm">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500">Not Attempted</p>
<h3 class="text-3xl font-bold text-gray-900 mt-1">58</h3>
<p class="text-red-500 text-sm mt-2">+3 from last month</p>
</div>
<div class="bg-red-100 p-3 rounded-full">
<i data-feather="x-circle" class="text-red-600"></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-xl shadow-sm">
<h3 class="text-lg font-semibold mb-4">Completion Status Distribution</h3>
<div class="h-64">
<canvas id="pieChart"></canvas>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-sm">
<h3 class="text-lg font-semibold mb-4">Monthly Progress</h3>
<div class="h-64">
<canvas id="lineChart"></canvas>
</div>
</div>
</div>
<!-- Filters -->
<div class="bg-white p-4 rounded-xl shadow-sm mb-6">
<div class="flex flex-wrap gap-2">
<button class="filter-btn px-4 py-2 rounded-full border hover:bg-gray-100" data-filter="all">All</button>
<button class="filter-btn px-4 py-2 rounded-full border hover:bg-gray-100" data-filter="completed">
<span class="inline-block w-2 h-2 rounded-full bg-green-500 mr-2"></span>
Completed
</button>
<button class="filter-btn px-4 py-2 rounded-full border hover:bg-gray-100" data-filter="incomplete">
<span class="inline-block w-2 h-2 rounded-full bg-yellow-500 mr-2"></span>
Incomplete
</button>
<button class="filter-btn px-4 py-2 rounded-full border hover:bg-gray-100" data-filter="not-attempted">
<span class="inline-block w-2 h-2 rounded-full bg-red-500 mr-2"></span>
Not Attempted
</button>
<button class="filter-btn px-4 py-2 rounded-full border hover:bg-gray-100" data-filter="partial">
<span class="inline-block w-2 h-2 rounded-full bg-blue-500 mr-2"></span>
Partial Completion
</button>
</div>
</div>
<!-- Employee List -->
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
<div class="px-6 py-4 border-b flex justify-between items-center">
<h3 class="text-lg font-semibold">Employee Training Status</h3>
<div class="text-sm text-gray-500">Showing <span id="showing-count">80</span> of 80 employees</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Employee</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Progress</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Modules</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Action</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="employee-table">
<!-- Employee rows will be inserted here by JavaScript -->
</tbody>
</table>
</div>
<div class="px-6 py-4 border-t flex justify-between items-center">
<div class="text-sm text-gray-500">Page 1 of 4</div>
<div class="flex space-x-2">
<button class="px-3 py-1 border rounded hover:bg-gray-100">Previous</button>
<button class="px-3 py-1 border rounded bg-blue-600 text-white">1</button>
<button class="px-3 py-1 border rounded hover:bg-gray-100">2</button>
<button class="px-3 py-1 border rounded hover:bg-gray-100">3</button>
<button class="px-3 py-1 border rounded hover:bg-gray-100">Next</button>
</div>
</div>
</div>
</main>
</div>
<script>
// Initialize feather icons
feather.replace();
// Sample data (would be replaced with actual data from your source)
const employeeData = [
{ name: "Adeel Ahsan", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Adrien Monteiro", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Alan Willis", completed: 12, incomplete: 0, notAttempted: 0 },
{ name: "Aleksandra Orywal", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Alessia Gigantesco", completed: 1, incomplete: 0, notAttempted: 11 },
{ name: "Alla Alqadi", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Amal Jaradat", completed: 0, incomplete: 1, notAttempted: 12 },
{ name: "Amelie Malta", completed: 6, incomplete: 2, notAttempted: 4 },
{ name: "Andrew McBean", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Andrew Tetley", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Annabel Malta", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Antonio Agresta", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Arkadii Sidorov", completed: 0, incomplete: 0, notAttempted: 13 },
{ name: "Armando Ortiz", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Arthur Clarkson", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Arunan Ravi", completed: 4, incomplete: 0, notAttempted: 8 },
{ name: "Audris Kezi", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Benjamin Thomas", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Benoit Riegel", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Bill Mackway-Jones", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Caroun Derderian", completed: 12, incomplete: 0, notAttempted: 0 },
{ name: "Catarina Malta", completed: 10, incomplete: 0, notAttempted: 3 },
{ name: "Christopher Stribling", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Corrado Ninzoli", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Domenico Fanelli", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Dominic Brindle", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Elena Boccaletti", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Emily Palit", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Emmanuel Valavanis", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Essam Alkadomi", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Fadi Kassis", completed: 5, incomplete: 0, notAttempted: 7 },
{ name: "Feras Batayneh", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Florian Josef", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Garvan Smith", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Giammarco Campolieti", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Giueseppe Gambardella", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Gregory Marbot", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Gustavo Messerlian", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Gwen Arnal", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Hejer Anane", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Hugh Grindon", completed: 12, incomplete: 0, notAttempted: 0 },
{ name: "Ian Wilkins", completed: 12, incomplete: 0, notAttempted: 0 },
{ name: "James Crammond", completed: 12, incomplete: 0, notAttempted: 0 },
{ name: "Jasper Falk", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Keith Temperton", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Linda Amrouche", completed: 12, incomplete: 0, notAttempted: 0 },
{ name: "Marc Levy-Walhain", completed: 12, incomplete: 0, notAttempted: 0 },
{ name: "Marcelo Calvi", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Marco Bach", completed: 13, incomplete: 0, notAttempted: 0 },
{ name: "Masoud Abdorrezai", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Matthieu Prevot", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Maxwell Underhill", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Meryem Kessler", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Naouel Souissi", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Navita Morgan", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Nicholas Tuite", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Oliver Espley", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Osman Khan", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Ozan Kalemdaroglu", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Peter Mulhall", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Ramiro Delfranco", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Robert Collins", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Russell Howard", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Sam Seman", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Samuel Cooper", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Sarp Kavrar", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Serena Irani", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Simon Kelsey", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Simon Luther Mead", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Simon Wise", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Steve Seman", completed: 12, incomplete: 0, notAttempted: 0 },
{ name: "Steven Bennett", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Taher Shakaa", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Terry Torrison", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Thomas Simeon", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Tiziano Chiappini", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Tobias Clothier", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Wasim Ahmad", completed: 0, incomplete: 0, notAttempted: 12 },
{ name: "Youssef Sabri", completed: 0, incomplete: 0, notAttempted: 12 }
];
// Calculate summary statistics
let totalCompleted = 0;
let totalIncomplete = 0;
let totalNotAttempted = 0;
employeeData.forEach(employee => {
totalCompleted += employee.completed;
totalIncomplete += employee.incomplete;
totalNotAttempted += employee.notAttempted;
});
// Update summary cards
document.addEventListener('DOMContentLoaded', function() {
// Update summary numbers (these would be calculated from your actual data)
document.querySelectorAll('.text-3xl')[0].textContent = totalCompleted;
document.querySelectorAll('.text-3xl')[1].textContent = totalIncomplete;
document.querySelectorAll('.text-3xl')[2].textContent = totalNotAttempted;
// Populate employee table
const tableBody = document.getElementById('employee-table');
employeeData.forEach(employee => {
const totalModules = employee.completed + employee.incomplete + employee.notAttempted;
const completionPercentage = (employee.completed / totalModules) * 100;
let statusBadge = '';
let statusClass = '';
if (employee.completed === totalModules) {
statusBadge = 'Completed';
statusClass = 'bg-green-100 text-green-800';
} else if (employee.completed === 0 && employee.incomplete === 0) {
statusBadge = 'Not Started';
statusClass = 'bg-red-100 text-red-800';
} else if (employee.incomplete > 0) {
statusBadge = 'Incomplete';
statusClass = 'bg-yellow-100 text-yellow-800';
} else {
statusBadge = 'In Progress';
statusClass = 'bg-blue-100 text-blue-800';
}
const row = document.createElement('tr');
row.className = 'hover:bg-gray-50';
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-gray-200 flex items-center justify-center">
<span class="text-gray-600">${employee.name.charAt(0)}</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">${employee.name}</div>
<div class="text-sm text-gray-500">${totalModules} modules</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${statusClass}">
${statusBadge}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-green-500 h-2 rounded-full" style="width: ${completionPercentage}%"></div>
</div>
<div class="text-xs text-gray-500 mt-1">${employee.completed}/${totalModules} completed</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<div class="flex space-x-1">
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800">
${employee.completed} ✓
</span>
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800">
${employee.incomplete} !
</span>
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800">
${employee.notAttempted} ✗
</span>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-blue-600 hover:text-blue-900 mr-3">Remind</button>
<button class="text-gray-600 hover:text-gray-900">View</button>
</td>
`;
tableBody.appendChild(row);
});
// Initialize charts
const pieCtx = document.getElementById('pieChart').getContext('2d');
const pieChart = new Chart(pieCtx, {
type: 'pie',
data: {
labels: ['Completed', 'Incomplete', 'Not Attempted'],
datasets: [{
data: [totalCompleted, totalIncomplete, totalNotAttempted],
backgroundColor: [
'#10B981',
'#F59E0B',
'#EF4444'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
}
}
}
});
const lineCtx = document.getElementById('lineChart').getContext('2d');
const lineChart = new Chart(lineCtx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [
{
label: 'Completed',
data: [2, 5, 8, 10, 12, 15, 18, 20, 22, 24, 24, 24],
borderColor: '#10B981',
backgroundColor: 'rgba(16, 185, 129, 0.1)',
tension: 0.3,
fill: true
},
{
label: 'Incomplete',
data: [10, 8, 6, 5, 4, 4, 3, 3, 3, 3, 3, 3],
borderColor: '#F59E0B',
backgroundColor: 'rgba(245, 158, 11, 0.1)',
tension: 0.3,
fill: true
},
{
label: 'Not Attempted',
data: [80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25],
borderColor: '#EF4444',
backgroundColor: 'rgba(239, 68, 68, 0.1)',
tension: 0.3,
fill: true
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top',
}
},
scales: {
y: {
beginAtZero: true
}
}
}
});
// Filter functionality
const filterButtons = document.querySelectorAll('.filter-btn');
filterButtons.forEach(button => {
button.addEventListener('click', function() {
// Remove active class from all buttons
filterButtons.forEach(btn => btn.classList.remove('filter-active', 'text-white'));
// Add active class to clicked button
this.classList.add('filter-active', 'text-white');
const filter = this.dataset.filter;
let visibleCount = 0;
// Filter table rows
const rows = tableBody.querySelectorAll('tr');
rows.forEach(row => {
const statusBadge = row.querySelector('span:first-child').textContent.trim().toLowerCase();
let showRow = false;
if (filter === 'all') {
showRow = true;
} else if (filter === 'completed' && statusBadge === 'completed') {
showRow = true;
} else if (filter === 'incomplete' && statusBadge === 'incomplete') {
showRow = true;
} else if (filter === 'not-attempted' && statusBadge === 'not started') {
showRow = true;
} else if (filter === 'partial' && statusBadge === 'in progress') {
showRow = true;
}
if (showRow) {
row.style.display = '';
visibleCount++;
} else {
row.style.display = 'none';
}
});
// Update showing count
document.getElementById('showing-count').textContent = visibleCount;
});
});
});
</script>
</body>
</html>