Changed around line 1
+ // Initialize SQLite (mock implementation)
+ const db = {
+ evaluations: []
+ };
+
+ // Mock data for charts and rankings
+ const mockEmployees = [
+ { id: "EMP001", name: "John Doe", role: "java", score: 9.2 },
+ { id: "EMP002", name: "Jane Smith", role: "frontend", score: 8.8 },
+ { id: "EMP003", name: "Mike Johnson", role: "product", score: 9.5 },
+ { id: "EMP004", name: "Sarah Williams", role: "qa", score: 8.9 }
+ ];
+
+ // Tab switching functionality
+ document.querySelectorAll('.tab-btn').forEach(button => {
+ button.addEventListener('click', () => {
+ document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('active'));
+ document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active'));
+
+ button.classList.add('active');
+ document.getElementById(button.dataset.tab).classList.add('active');
+ });
+ });
+
+ // Render top performers
+ function renderTopPerformers() {
+ const topPerformersElement = document.getElementById('topPerformers');
+ const sortedEmployees = [...mockEmployees].sort((a, b) => b.score - a.score);
+
+ topPerformersElement.innerHTML = sortedEmployees
+ .map((employee, index) => `
+
+ #${index + 1} ${employee.name}
+ ${employee.score}
+
+ `)
+ .join('');
+ }
+
+ // Handle form submission
+ document.getElementById('evaluationForm').addEventListener('submit', (e) => {
+ e.preventDefault();
+
+ const evaluation = {
+ employeeId: document.getElementById('employeeId').value,
+ role: document.getElementById('role').value,
+ communication: parseInt(document.getElementById('communication').value),
+ teamwork: parseInt(document.getElementById('teamwork').value),
+ quality: parseInt(document.getElementById('quality').value),
+ timestamp: new Date().toISOString()
+ };
+
+ // Save to mock database
+ db.evaluations.push(evaluation);
+
+ alert('Evaluation submitted successfully!');
+ e.target.reset();
+ });
+
+ // Initialize dashboard
+ function initializeDashboard() {
+ renderTopPerformers();
+ }
+
+ // Initialize when DOM is loaded
+ document.addEventListener('DOMContentLoaded', initializeDashboard);