safety-analytics / index.html
DataSafety27's picture
create me a cool visualization data for these data, this data includes: From Training (Year Quarter Month Week Date Site Name Entity Trainer's name Topic No. of Session Participants Head Count Male HC Male Manhour Female HC Female Manhour Total Manhour
b82fe61 verified
Raw History Blame Contribute Delete
29.3 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Training & Safety Data Visualization</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></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>
<style>
.gradient-bg {
background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}
.card-hover: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);
}
.sidebar-item:hover {
background-color: rgba(255, 255, 255, 0.1);
}
</style>
</head>
<body class="bg-gray-50">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="hidden md:flex md:flex-shrink-0">
<div class="flex flex-col w-64 gradient-bg text-white">
<div class="flex items-center h-16 px-4 border-b border-blue-800">
<i data-feather="shield" class="w-6 h-6 mr-2"></i>
<span class="text-xl font-semibold">Safety Analytics</span>
</div>
<div class="flex flex-col flex-grow overflow-y-auto">
<nav class="flex-1 px-2 py-4 space-y-1">
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium rounded-md sidebar-item bg-blue-900 text-white">
<i data-feather="home" class="w-5 h-5 mr-3"></i>
Dashboard
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium rounded-md sidebar-item text-blue-200 hover:text-white">
<i data-feather="book" class="w-5 h-5 mr-3"></i>
Training Data
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium rounded-md sidebar-item text-blue-200 hover:text-white">
<i data-feather="activity" class="w-5 h-5 mr-3"></i>
Gemba Walks
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium rounded-md sidebar-item text-blue-200 hover:text-white">
<i data-feather="users" class="w-5 h-5 mr-3"></i>
Safety Committee
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium rounded-md sidebar-item text-blue-200 hover:text-white">
<i data-feather="alert-triangle" class="w-5 h-5 mr-3"></i>
Mock Drills
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium rounded-md sidebar-item text-blue-200 hover:text-white">
<i data-feather="settings" class="w-5 h-5 mr-3"></i>
Settings
</a>
</nav>
</div>
<div class="p-4 border-t border-blue-800">
<div class="flex items-center">
<img class="w-10 h-10 rounded-full" src="http://static.photos/people/200x200/1" alt="User">
<div class="ml-3">
<p class="text-sm font-medium text-white">Admin User</p>
<p class="text-xs font-medium text-blue-200">Administrator</p>
</div>
</div>
</div>
</div>
</div>
<!-- Main content -->
<div class="flex flex-col flex-1 overflow-hidden">
<!-- Top navigation -->
<div class="flex items-center justify-between h-16 px-4 bg-white border-b border-gray-200">
<div class="flex items-center">
<button class="md:hidden text-gray-500 focus:outline-none">
<i data-feather="menu" class="w-6 h-6"></i>
</button>
<h1 class="ml-4 text-xl font-semibold text-gray-800">Training & Safety Dashboard</h1>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<button class="p-1 text-gray-400 rounded-full hover:text-gray-500 focus:outline-none">
<i data-feather="bell" class="w-6 h-6"></i>
</button>
<span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span>
</div>
<div class="relative">
<button class="p-1 text-gray-400 rounded-full hover:text-gray-500 focus:outline-none">
<i data-feather="message-square" class="w-6 h-6"></i>
</button>
<span class="absolute top-0 right-0 w-2 h-2 bg-blue-500 rounded-full"></span>
</div>
<div class="relative">
<img class="w-8 h-8 rounded-full" src="http://static.photos/people/200x200/1" alt="User">
</div>
</div>
</div>
<!-- Main content area -->
<div class="flex-1 overflow-auto p-4">
<!-- Filters -->
<div class="bg-white rounded-lg shadow p-4 mb-6">
<div class="flex flex-col md:flex-row md:items-center md:justify-between">
<div class="mb-4 md:mb-0">
<h2 class="text-lg font-semibold text-gray-800">Data Filters</h2>
</div>
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Time Period</label>
<select class="w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option>Weekly</option>
<option>Monthly</option>
<option>Quarterly</option>
<option>Yearly</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Site</label>
<select class="w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option>All Sites</option>
<option>Pune P2</option>
<option>WH Pune2</option>
<option>Surat FC</option>
<option>Indore</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Entity</label>
<select class="w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option>All Entities</option>
<option>WHS</option>
<option>B2B</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Trainer</label>
<select class="w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
<option>All Trainers</option>
<option>Prafulla</option>
<option>K. Cyril S.</option>
<option>Jignesh Parmar</option>
</select>
</div>
</div>
</div>
</div>
<!-- Summary Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="bg-white rounded-lg shadow p-6 card-hover transition-all duration-300" data-aos="fade-up">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Total Training Sessions</p>
<p class="mt-1 text-3xl font-semibold text-gray-900">187</p>
<p class="mt-2 text-sm text-green-600">+12.5% from last quarter</p>
</div>
<div class="p-3 rounded-full bg-blue-100 text-blue-600">
<i data-feather="book-open" class="w-6 h-6"></i>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6 card-hover transition-all duration-300" data-aos="fade-up" data-aos-delay="100">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Total Participants</p>
<p class="mt-1 text-3xl font-semibold text-gray-900">2,456</p>
<p class="mt-2 text-sm text-green-600">+8.3% from last quarter</p>
</div>
<div class="p-3 rounded-full bg-green-100 text-green-600">
<i data-feather="users" class="w-6 h-6"></i>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6 card-hover transition-all duration-300" data-aos="fade-up" data-aos-delay="200">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Open Safety Issues</p>
<p class="mt-1 text-3xl font-semibold text-gray-900">84</p>
<p class="mt-2 text-sm text-red-600">+5 from last month</p>
</div>
<div class="p-3 rounded-full bg-yellow-100 text-yellow-600">
<i data-feather="alert-triangle" class="w-6 h-6"></i>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6 card-hover transition-all duration-300" data-aos="fade-up" data-aos-delay="300">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Closed Safety Issues</p>
<p class="mt-1 text-3xl font-semibold text-gray-900">312</p>
<p class="mt-2 text-sm text-green-600">+28% resolution rate</p>
</div>
<div class="p-3 rounded-full bg-purple-100 text-purple-600">
<i data-feather="check-circle" class="w-6 h-6"></i>
</div>
</div>
</div>
</div>
<!-- Charts Section -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<!-- Training by Topic -->
<div class="bg-white rounded-lg shadow p-6" data-aos="fade-up">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold text-gray-800">Training Sessions by Topic</h3>
<div class="flex space-x-2">
<button class="px-3 py-1 text-xs bg-blue-100 text-blue-600 rounded-full">Quarter</button>
<button class="px-3 py-1 text-xs bg-gray-100 text-gray-600 rounded-full">Year</button>
</div>
</div>
<div class="h-64">
<canvas id="trainingTopicChart"></canvas>
</div>
</div>
<!-- Safety Issues by Priority -->
<div class="bg-white rounded-lg shadow p-6" data-aos="fade-up" data-aos-delay="100">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold text-gray-800">Safety Issues by Priority</h3>
<div class="flex space-x-2">
<button class="px-3 py-1 text-xs bg-blue-100 text-blue-600 rounded-full">Quarter</button>
<button class="px-3 py-1 text-xs bg-gray-100 text-gray-600 rounded-full">Year</button>
</div>
</div>
<div class="h-64">
<canvas id="safetyPriorityChart"></canvas>
</div>
</div>
</div>
<!-- Detailed Data Section -->
<div class="grid grid-cols-1 gap-6">
<!-- Training Sessions Table -->
<div class="bg-white rounded-lg shadow overflow-hidden" data-aos="fade-up">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-semibold text-gray-800">Recent Training Sessions</h3>
</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">Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Site</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Trainer</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Topic</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Participants</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Man Hours</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">30/06/2025</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">WH Pune2</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Prafulla</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Fire Safety & EPR</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">105</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">17.50</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">25/06/2025</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Pune P2</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Prafulla</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Material Handling</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">26</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4.33</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">20/06/2025</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Surat FC</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">K. Cyril S.</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">General Safety</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">14</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">3.50</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">15/06/2025</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Indore CPC 2</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Arshalan Khan</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Env Awareness</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">19</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4.75</td>
</tr>
</tbody>
</table>
</div>
<div class="px-6 py-4 border-t border-gray-200">
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">View All Training Sessions →</button>
</div>
</div>
<!-- Safety Issues Table -->
<div class="bg-white rounded-lg shadow overflow-hidden" data-aos="fade-up" data-aos-delay="100">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-semibold text-gray-800">Recent Safety Issues</h3>
</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">Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Site</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Issue</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Priority</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">Days Open</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">19/09/2025</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">CPC AMD 2</td>
<td class="px-6 py-4 text-sm text-gray-500">FE Blocked Near Entrance area</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">High</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Open</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">19/09/2025</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">CPC AMD 2</td>
<td class="px-6 py-4 text-sm text-gray-500">Sharp Edges on Battery Charger Stand</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">High</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Open</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">19/09/2025</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">CPC AMD 2</td>
<td class="px-6 py-4 text-sm text-gray-500">Emergency Evacuation Map Not Available</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">Medium</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Open</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">19/09/2025</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">CPC AMD 2</td>
<td class="px-6 py-4 text-sm text-gray-500">epoxy coated Not Available</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">High</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Open</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4</td>
</tr>
</tbody>
</table>
</div>
<div class="px-6 py-4 border-t border-gray-200">
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">View All Safety Issues →</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Initialize AOS
AOS.init({
duration: 800,
easing: 'ease-in-out',
once: true
});
// Initialize feather icons
feather.replace();
// Training by Topic Chart
const trainingTopicCtx = document.getElementById('trainingTopicChart').getContext('2d');
const trainingTopicChart = new Chart(trainingTopicCtx, {
type: 'bar',
data: {
labels: ['General Safety', 'Material Handling', 'Fire Safety', 'Electrical Safety', 'Env Awareness'],
datasets: [{
label: 'Training Sessions',
data: [65, 48, 32, 18, 24],
backgroundColor: [
'rgba(59, 130, 246, 0.7)',
'rgba(16, 185, 129, 0.7)',
'rgba(245, 158, 11, 0.7)',
'rgba(139, 92, 246, 0.7)',
'rgba(20, 184, 166, 0.7)'
],
borderColor: [
'rgba(59, 130, 246, 1)',
'rgba(16, 185, 129, 1)',
'rgba(245, 158, 11, 1)',
'rgba(139, 92, 246, 1)',
'rgba(20, 184, 166, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true,
ticks: {
stepSize: 10
}
}
}
}
});
// Safety Issues by Priority Chart
const safetyPriorityCtx = document.getElementById('safetyPriorityChart').getContext('2d');
const safetyPriorityChart = new Chart(safetyPriorityCtx, {
type: 'doughnut',
data: {
labels: ['High', 'Medium', 'Low'],
datasets: [{
data: [45, 28, 11],
backgroundColor: [
'rgba(239, 68, 68, 0.7)',
'rgba(245, 158, 11, 0.7)',
'rgba(16, 185, 129, 0.7)'
],
borderColor: [
'rgba(239, 68, 68, 1)',
'rgba(245, 158, 11, 1)',
'rgba(16, 185, 129, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right'
}
},
cutout: '70%'
}
});
</script>
</body>
</html>
This dashboard includes:
1. A responsive layout with sidebar navigation
2. Summary cards showing key metrics
3. Interactive charts for training topics and safety priorities
4. Data tables showing recent training sessions and safety issues
5. Filter options to view data by different time periods and categories
6. Animations and hover effects for better user experience
7. Mobile-friendly design
The dashboard visualizes the training and safety data with:
- Bar chart showing distribution of training sessions by topic
- Doughnut chart showing safety issues by priority level
- Tables displaying detailed records
- Summary statistics for quick insights
You can expand this with additional pages for each section (Gemba Walks, Safety Committee, etc.) by creating similar HTML files with specific visualizations for each data type.