Files
Employee_records/public/reports.html
T
2025-12-14 13:31:29 -06:00

182 lines
12 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Employee Reports - Employee Records</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/pocketbase/dist/pocketbase.umd.js"></script>
<!-- Quill.js Rich Text Editor -->
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Navigation Header -->
<nav class="bg-white shadow-sm border-b border-gray-200">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center h-auto sm:h-16 py-2 sm:py-0 gap-2 sm:gap-0">
<div class="flex items-center space-x-2 sm:space-x-4">
<a href="/dashboard.html" class="text-indigo-600 hover:text-indigo-700 font-medium text-sm sm:text-base">← Dashboard</a>
<h1 class="text-lg sm:text-xl font-bold text-gray-800">Employee Reports</h1>
</div>
<div class="flex flex-col sm:flex-row items-start sm:items-center space-y-2 sm:space-y-0 sm:space-x-4 w-full sm:w-auto">
<div class="text-xs sm:text-sm text-gray-600">
<span id="userEmail">Loading...</span>
</div>
<button
id="logoutButton"
class="bg-red-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition w-full sm:w-auto"
>
Logout
</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Header with Add Button -->
<div class="mb-6 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
<div>
<h2 class="text-xl sm:text-2xl font-bold text-gray-800 mb-2">Employee Reports</h2>
<p class="text-sm sm:text-base text-gray-600">Manage employee report records</p>
</div>
<button
id="addReportButton"
class="bg-indigo-600 text-white px-4 sm:px-6 py-2 sm:py-3 rounded-lg text-sm sm:text-base font-medium hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition w-full sm:w-auto"
>
+ Add Report
</button>
</div>
<!-- Error/Success Messages -->
<div id="messageContainer" class="mb-4"></div>
<!-- Loading Indicator -->
<div id="loadingIndicator" class="text-center py-8">
<div class="inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600"></div>
<p class="mt-2 text-gray-600">Loading reports...</p>
</div>
<!-- Reports Table -->
<div id="reportsTableContainer" class="hidden bg-white rounded-lg shadow overflow-hidden">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Employee</th>
<th class="px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Report</th>
<th class="px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Sentiment</th>
<th class="px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Report Date</th>
<th class="px-3 sm:px-6 py-2 sm:py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Links</th>
<th class="px-3 sm:px-6 py-2 sm:py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody id="reportsTableBody" class="bg-white divide-y divide-gray-200">
<!-- Reports will be inserted here -->
</tbody>
</table>
</div>
<!-- Pagination -->
<div id="paginationContainer" class="bg-white px-4 py-3 border-t border-gray-200 sm:px-6">
<!-- Pagination will be inserted here -->
</div>
</div>
<!-- Empty State -->
<div id="emptyState" class="hidden text-center py-12">
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
<h3 class="mt-2 text-sm font-medium text-gray-900">No reports</h3>
<p class="mt-1 text-sm text-gray-500">Get started by creating a new employee report.</p>
<div class="mt-6">
<button
id="addReportButtonEmpty"
class="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
+ Add Report
</button>
</div>
</div>
</main>
<!-- Add/Edit Modal -->
<div id="reportModal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50">
<div class="relative top-0 sm:top-10 mx-auto p-4 sm:p-5 border-0 sm:border w-full sm:max-w-2xl shadow-lg rounded-none sm:rounded-md bg-white mb-0 sm:mb-10 min-h-screen sm:min-h-0">
<div class="mt-3">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-medium text-gray-900" id="modalTitle">Add Employee Report</h3>
<button id="closeModal" class="text-gray-400 hover:text-gray-500">
<svg class="h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
<form id="reportForm" class="space-y-4 max-h-[calc(100vh-200px)] overflow-y-auto pr-2">
<input type="hidden" id="reportId" />
<div>
<label for="Employee" class="block text-sm font-medium text-gray-700 mb-1">Employee *</label>
<select id="Employee" name="Employee" required class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base">
<option value="">Select an employee...</option>
</select>
</div>
<div>
<label for="Report" class="block text-sm font-medium text-gray-700 mb-1">Report</label>
<div id="reportEditor" style="height: 200px;" class="mb-2"></div>
<textarea id="Report" name="Report" style="display: none;"></textarea>
</div>
<div>
<label for="Centiment" class="block text-sm font-medium text-gray-700 mb-1">Sentiment</label>
<select id="Centiment" name="Centiment" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base">
<option value="">Select sentiment...</option>
<option value="Positive">Positive</option>
<option value="Negative">Negative</option>
<option value="Neutral">Neutral</option>
</select>
</div>
<div>
<label for="Report_Date" class="block text-sm font-medium text-gray-700 mb-1">Report Date & Time</label>
<input type="datetime-local" id="Report_Date" name="Report_Date" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base" />
</div>
<div class="grid grid-cols-1 gap-4">
<div>
<label for="Link_01" class="block text-sm font-medium text-gray-700 mb-1">Link 1</label>
<input type="url" id="Link_01" name="Link_01" placeholder="https://..." class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base" />
</div>
<div>
<label for="Link_02" class="block text-sm font-medium text-gray-700 mb-1">Link 2</label>
<input type="url" id="Link_02" name="Link_02" placeholder="https://..." class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base" />
</div>
<div>
<label for="Link_03" class="block text-sm font-medium text-gray-700 mb-1">Link 3</label>
<input type="url" id="Link_03" name="Link_03" placeholder="https://..." class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base" />
</div>
<div>
<label for="Link_04" class="block text-sm font-medium text-gray-700 mb-1">Link 4</label>
<input type="url" id="Link_04" name="Link_04" placeholder="https://..." class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base" />
</div>
<div>
<label for="Link_05" class="block text-sm font-medium text-gray-700 mb-1">Link 5</label>
<input type="url" id="Link_05" name="Link_05" placeholder="https://..." class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base" />
</div>
</div>
<div class="flex flex-col sm:flex-row justify-end space-y-2 sm:space-y-0 sm:space-x-3 pt-4 border-t">
<button type="button" id="cancelButton" class="w-full sm:w-auto px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 text-base">
Cancel
</button>
<button type="submit" class="w-full sm:w-auto px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 text-base">
Save
</button>
</div>
</form>
</div>
</div>
</div>
<script src="/js/reports.js"></script>
</body>
</html>