attendance-payroll-pro / reports.html
ContentArcade's picture
Create a complete Attendance Management System and Payroll System in Python Flask with MySQL database. The system should strictly follow these attendance rules, leave policy, and payroll calculations:
ef77576 verified
Raw History Blame Contribute Delete
22 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reports & Analytics | Attendance & Payroll Pro</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#4F46E5',
secondary: '#10B981',
dark: '#1E293B'
},
fontFamily: {
sans: ['Inter', 'sans-serif']
}
}
}
}
</script>
</head>
<body class="bg-gray-50 min-h-screen font-sans">
<!-- Navigation -->
<nav class="bg-white shadow-sm">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<i data-feather="bar-chart-2" class="h-8 w-8 text-primary"></i>
<span class="ml-2 text-xl font-bold text-gray-900">Attendance & Payroll Pro</span>
</div>
<div class="hidden sm:ml-6 sm:flex sm:space-x-8">
<a href="index.html" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Dashboard</a>
<a href="employees.html" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Employees</a>
<a href="attendance.html" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Attendance</a>
<a href="payroll.html" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Payroll</a>
<a href="#" class="border-primary text-gray-900 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">Reports</a>
</div>
</div>
<div class="hidden sm:ml-6 sm:flex sm:items-center">
<button class="bg-white p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none">
<i data-feather="bell" class="h-6 w-6"></i>
</button>
<div class="ml-3 relative">
<div class="flex items-center">
<button class="flex text-sm rounded-full focus:outline-none">
<img class="h-8 w-8 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
</button>
<span class="ml-2 text-sm font-medium text-gray-700">Admin</span>
</div>
</div>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Page Header -->
<div class="flex flex-col md:flex-row md:items-center md:justify-between mb-8">
<div>
<h1 class="text-3xl font-bold text-gray-900">Reports & Analytics</h1>
<p class="mt-2 text-gray-600">Generate detailed reports and analyze workforce data</p>
</div>
<div class="mt-4 md:mt-0 flex space-x-3">
<button class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none">
<i data-feather="download" class="mr-2 h-4 w-4"></i>
Export Report
</button>
<button class="inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary hover:bg-indigo-700 focus:outline-none">
<i data-feather="plus" class="mr-2 h-4 w-4"></i>
Generate Report
</button>
</div>
</div>
<!-- Report Filters -->
<div class="bg-white rounded-lg shadow-sm p-6 mb-8">
<div class="grid grid-cols-1 md:grid-cols-5 gap-4">
<div>
<label for="report-type" class="block text-sm font-medium text-gray-700 mb-1">Report Type</label>
<select id="report-type" class="w-full rounded-md border-gray-300 shadow-sm focus:border-primary focus:ring-primary sm:text-sm">
<option value="">Select Report</option>
<option value="attendance">Attendance Summary</option>
<option value="payroll">Payroll Report</option>
<option value="leave">Leave Analysis</option>
<option value="performance">Performance Metrics</option>
</select>
</div>
<div>
<label for="period" class="block text-sm font-medium text-gray-700 mb-1">Period</label>
<select id="period" class="w-full rounded-md border-gray-300 shadow-sm focus:border-primary focus:ring-primary sm:text-sm">
<option value="">Select Period</option>
<option value="daily">Daily</option>
<option value="weekly">Weekly</option>
<option value="monthly" selected>Monthly</option>
<option value="quarterly">Quarterly</option>
<option value="yearly">Yearly</option>
</select>
</div>
<div>
<label for="month" class="block text-sm font-medium text-gray-700 mb-1">Month</label>
<select id="month" class="w-full rounded-md border-gray-300 shadow-sm focus:border-primary focus:ring-primary sm:text-sm">
<option value="">Select Month</option>
<option value="1">January 2023</option>
<option value="2">February 2023</option>
<option value="3">March 2023</option>
<option value="4">April 2023</option>
<option value="5" selected>May 2023</option>
</select>
</div>
<div>
<label for="department" class="block text-sm font-medium text-gray-700 mb-1">Department</label>
<select id="department" class="w-full rounded-md border-gray-300 shadow-sm focus:border-primary focus:ring-primary sm:text-sm">
<option value="">All Departments</option>
<option value="hr">Human Resources</option>
<option value="engineering">Engineering</option>
<option value="marketing">Marketing</option>
<option value="sales">Sales</option>
</select>
</div>
<div class="flex items-end">
<button class="w-full bg-primary hover:bg-indigo-700 text-white font-medium py-2 px-4 rounded-md transition duration-150 ease-in-out">
Generate Report
</button>
</div>
</div>
</div>
<!-- Report Summary Cards -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white rounded-lg shadow-sm p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Average Attendance</p>
<p class="text-3xl font-bold text-gray-900 mt-2">92%</p>
</div>
<div class="p-3 rounded-lg bg-green-100">
<i data-feather="check-circle" class="h-8 w-8 text-green-600"></i>
</div>
</div>
<div class="mt-4">
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-green-600 h-2 rounded-full" style="width: 92%"></div>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Late Arrivals</p>
<p class="text-3xl font-bold text-gray-900 mt-2">8.5%</p>
</div>
<div class="p-3 rounded-lg bg-yellow-100">
<i data-feather="clock" class="h-8 w-8 text-yellow-600"></i>
</div>
</div>
<div class="mt-4">
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-yellow-500 h-2 rounded-full" style="width: 8.5%"></div>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Leave Utilization</p>
<p class="text-3xl font-bold text-gray-900 mt-2">12%</p>
</div>
<div class="p-3 rounded-lg bg-blue-100">
<i data-feather="calendar" class="h-8 w-8 text-blue-600"></i>
</div>
</div>
<div class="mt-4">
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-blue-500 h-2 rounded-full" style="width: 12%"></div>
</div>
</div>
</div>
</div>
<!-- Charts Section -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
<!-- Attendance Chart -->
<div class="bg-white rounded-lg shadow-sm p-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">Weekly Attendance Trend</h3>
<div class="h-64 flex items-end space-x-2">
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 40%">
<div class="w-full bg-primary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Mon</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 60%">
<div class="w-full bg-primary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Tue</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 80%">
<div class="w-full bg-primary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Wed</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 70%">
<div class="w-full bg-primary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Thu</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 90%">
<div class="w-full bg-primary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Fri</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 50%">
<div class="w-full bg-primary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Sat</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 20%">
<div class="w-full bg-gray-400 rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Sun</span>
</div>
</div>
</div>
<!-- Payroll Chart -->
<div class="bg-white rounded-lg shadow-sm p-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">Monthly Payroll Distribution</h3>
<div class="h-64 flex items-end space-x-4">
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 70%">
<div class="w-full bg-secondary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">HR</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 90%">
<div class="w-full bg-secondary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Engineering</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 60%">
<div class="w-full bg-secondary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Marketing</span>
</div>
<div class="flex-1 flex flex-col items-center">
<div class="w-full bg-gray-200 rounded-t-lg" style="height: 50%">
<div class="w-full bg-secondary rounded-t-lg h-full"></div>
</div>
<span class="mt-2 text-sm text-gray-500">Sales</span>
</div>
</div>
</div>
</div>
<!-- Detailed Report Table -->
<div class="bg-white rounded-lg shadow-sm overflow-hidden">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-medium text-gray-900">Attendance Summary Report - May 2023</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">Department</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Employees</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Present</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Late</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Absent</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">On Leave</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Attendance Rate</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">Human Resources</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">12</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">228</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">12</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">6</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">4</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-24 bg-gray-200 rounded-full h-2 mr-2">
<div class="bg-green-600 h-2 rounded-full" style="width: 92%"></div>
</div>
<span class="text-sm text-gray-500">92%</span>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Engineering</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">45</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">855</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">35</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">10</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-24 bg-gray-200 rounded-full h-2 mr-2">
<div class="bg-green-600 h-2 rounded-full" style="width: 94%"></div>
</div>
<span class="text-sm text-gray-500">94%</span>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Marketing</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">28</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">504</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">18</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">8</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">6</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-24 bg-gray-200 rounded-full h-2 mr-2">
<div class="bg-green-600 h-2 rounded-full" style="width: 90%"></div>
</div>
<span class="text-sm text-gray-500">90%</span>
</div>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Sales</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">57</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1026</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">42</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">12</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="w-24 bg-gray-200 rounded-full h-2 mr-2">
<div class="bg-green-600 h-2 rounded-full" style="width: 93%"></div>
</div>
<span class="text-sm text-gray-500">93%</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</main>
<script>
feather.replace();
</script>
</body>
</html>