timewizard / time-tracking.html
cyberZag's picture
add add plese roports page too
52ce0b0 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TimeWizard - Time Tracking</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>
<style>
.dashboard-bg {
background-color: #F8FAFC;
}
.time-card {
transition: all 0.3s ease;
}
.time-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);
}
.sidebar-link.active {
border-left: 4px solid #4F46E5;
background-color: rgba(79, 70, 229, 0.1);
}
</style>
</head>
<body class="font-sans antialiased">
<!-- Employee Dashboard -->
<div class="min-h-screen flex">
<!-- Sidebar -->
<div class="w-64 bg-white shadow-md">
<div class="p-6 flex items-center space-x-3">
<div class="w-10 h-10 bg-primary rounded-full flex items-center justify-center">
<i data-feather="user" class="text-white w-5 h-5"></i>
</div>
<div>
<p class="font-medium text-dark">John Doe</p>
<p class="text-xs text-gray-500">Employee</p>
</div>
</div>
<nav class="mt-8 px-4 space-y-1">
<a href="index.html" class="sidebar-link flex items-center px-4 py-3 text-sm font-medium text-gray-600 hover:text-dark rounded-lg">
<i data-feather="home" class="mr-3"></i> Dashboard
</a>
<a href="time-tracking.html" class="sidebar-link active flex items-center px-4 py-3 text-sm font-medium text-dark rounded-lg">
<i data-feather="clock" class="mr-3 text-primary"></i> Time Tracking
</a>
<a href="vacation.html" class="sidebar-link flex items-center px-4 py-3 text-sm font-medium text-gray-600 hover:text-dark rounded-lg">
<i data-feather="calendar" class="mr-3"></i> Vacation
</a>
<a href="reports.html" class="sidebar-link flex items-center px-4 py-3 text-sm font-medium text-gray-600 hover:text-dark rounded-lg">
<i data-feather="file-text" class="mr-3"></i> Reports
</a>
<a href="settings.html" class="sidebar-link flex items-center px-4 py-3 text-sm font-medium text-gray-600 hover:text-dark rounded-lg">
<i data-feather="settings" class="mr-3"></i> Settings
</a>
</nav>
</div>
<!-- Main Content -->
<div class="flex-1 dashboard-bg p-8">
<div class="flex justify-between items-center mb-8">
<h1 class="text-2xl font-bold text-dark">Time Tracking</h1>
<div class="flex items-center space-x-4">
<button class="p-2 rounded-full bg-white shadow hover:bg-gray-50">
<i data-feather="bell"></i>
</button>
<button class="p-2 rounded-full bg-white shadow hover:bg-gray-50">
<i data-feather="help-circle"></i>
</button>
</div>
</div>
<!-- Time Tracking Controls -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<div class="bg-white rounded-xl shadow-md p-6 time-card">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-medium text-dark">Clock In/Out</h2>
<div class="bg-primary bg-opacity-10 p-2 rounded-full">
<i data-feather="clock" class="text-primary w-5 h-5"></i>
</div>
</div>
<div class="flex justify-between mt-4">
<button class="flex-1 mr-2 bg-primary text-white py-3 px-4 rounded-lg text-sm font-medium hover:bg-primary-dark">
Clock In
</button>
<button class="flex-1 bg-gray-200 text-gray-700 py-3 px-4 rounded-lg text-sm font-medium hover:bg-gray-300">
Clock Out
</button>
</div>
</div>
<div class="bg-white rounded-xl shadow-md p-6 time-card">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-medium text-dark">Break Time</h2>
<div class="bg-secondary bg-opacity-10 p-2 rounded-full">
<i data-feather="coffee" class="text-secondary w-5 h-5"></i>
</div>
</div>
<div class="flex justify-between mt-4">
<button class="flex-1 mr-2 bg-secondary text-white py-3 px-4 rounded-lg text-sm font-medium hover:bg-secondary-dark">
Start Break
</button>
<button class="flex-1 bg-gray-200 text-gray-700 py-3 px-4 rounded-lg text-sm font-medium hover:bg-gray-300">
End Break
</button>
</div>
</div>
</div>
<!-- Time History -->
<div class="bg-white rounded-xl shadow-md p-6">
<div class="flex items-center justify-between mb-6">
<h2 class="text-lg font-medium text-dark">Time History</h2>
<div class="flex space-x-2">
<button class="text-sm text-primary font-medium hover:text-primary-dark">This Week</button>
<button class="text-sm text-gray-500 font-medium hover:text-dark">This Month</button>
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200" id="timeHistoryTable">
<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">Clock In</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Clock Out</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total Hours</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Break Time</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">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="timeHistoryBody">
<!-- Sample data rows will be populated by JavaScript -->
</tbody>
</table>
</div>
</div>
</div>
</div>
<script>
feather.replace();
// Sample time tracking data
const timeEntries = [
{
date: 'Mon, Jun 12',
clockIn: '9:00 AM',
clockOut: '5:30 PM',
totalHours: '8.5',
breakTime: '0:45',
status: 'Complete'
},
{
date: 'Tue, Jun 13',
clockIn: '8:45 AM',
clockOut: '5:15 PM',
totalHours: '8.5',
breakTime: '1:00',
status: 'Complete'
},
{
date: 'Wed, Jun 14',
clockIn: '9:15 AM',
clockOut: '5:45 PM',
totalHours: '8.5',
breakTime: '0:45',
status: 'Complete'
},
{
date: 'Thu, Jun 15',
clockIn: '9:00 AM',
clockOut: '-',
totalHours: '-',
breakTime: '-',
status: 'In Progress'
}
];
// Populate time history table
const timeHistoryBody = document.getElementById('timeHistoryBody');
timeEntries.forEach(entry => {
const row = document.createElement('tr');
// Status badge color
let statusClass = '';
if (entry.status === 'Complete') {
statusClass = 'bg-green-100 text-green-800';
} else if (entry.status === 'In Progress') {
statusClass = 'bg-blue-100 text-blue-800';
} else if (entry.status === 'Pending') {
statusClass = 'bg-yellow-100 text-yellow-800';
}
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">${entry.date}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${entry.clockIn}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${entry.clockOut}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${entry.totalHours}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${entry.breakTime}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${statusClass}">${entry.status}</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<button class="text-primary hover:text-primary-dark">Edit</button>
</td>
`;
timeHistoryBody.appendChild(row);
});
// Clock In/Out functionality
document.addEventListener('DOMContentLoaded', function() {
const clockInBtn = document.querySelector('.bg-primary');
const clockOutBtn = document.querySelector('.flex-1.bg-gray-200');
const breakStartBtn = document.querySelector('.bg-secondary');
const breakEndBtn = document.querySelectorAll('.flex-1.bg-gray-200')[1];
if (clockInBtn) {
clockInBtn.addEventListener('click', function(e) {
e.preventDefault();
alert('Clocked in at ' + new Date().toLocaleTimeString());
clockInBtn.disabled = true;
clockOutBtn.disabled = false;
});
}
if (clockOutBtn) {
clockOutBtn.addEventListener('click', function(e) {
e.preventDefault();
alert('Clocked out at ' + new Date().toLocaleTimeString());
clockOutBtn.disabled = true;
clockInBtn.disabled = false;
});
}
if (breakStartBtn) {
breakStartBtn.addEventListener('click', function(e) {
e.preventDefault();
alert('Break started at ' + new Date().toLocaleTimeString());
breakStartBtn.disabled = true;
breakEndBtn.disabled = false;
});
}
if (breakEndBtn) {
breakEndBtn.addEventListener('click', function(e) {
e.preventDefault();
alert('Break ended at ' + new Date().toLocaleTimeString());
breakEndBtn.disabled = true;
breakStartBtn.disabled = false;
});
}
});
</script>
</body>
</html>