rh / index.html
soutall's picture
Add 3 files
8105adc verified
Raw History Blame Contribute Delete
78.4 kB
<!DOCTYPE html> <html lang="pt-BR"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sistema de Gestão de Funcionários</title> <script src="https://cdn.tailwindcss.com"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> .sidebar { transition: all 0.3s; } .sidebar.collapsed { width: 70px; } .sidebar.collapsed .sidebar-text { display: none; } .sidebar.collapsed .sidebar-icon { margin-right: 0; } .content { transition: all 0.3s; } .content.expanded { margin-left: 70px; } .overdue { animation: pulse 2s infinite; } @keyframes pulse { 0% { background-color: rgba(239, 68, 68, 0.1); } 50% { background-color: rgba(239, 68, 68, 0.3); } 100% { background-color: rgba(239, 68, 68, 0.1); } } .progress-bar { height: 10px; border-radius: 5px; background-color: #e5e7eb; } .progress-fill { height: 100%; border-radius: 5px; transition: width 0.3s; } </style> </head> <body class="bg-gray-100 font-sans"> <div class="flex h-screen"> <!-- Sidebar --> <div class="sidebar bg-blue-800 text-white w-64 flex flex-col"> <div class="p-4 flex items-center justify-between border-b border-blue-700"> <div class="flex items-center"> <i class="fas fa-users-cog text-2xl sidebar-icon mr-3"></i> <span class="text-xl font-bold sidebar-text">Gestão de Funcionários</span> </div> <button id="toggleSidebar" class="text-white focus:outline-none"> <i class="fas fa-bars"></i> </button> </div> <nav class="flex-1 overflow-y-auto"> <div class="p-4"> <div class="mb-6"> <h3 class="text-xs uppercase font-semibold text-blue-300 mb-3 sidebar-text">Menu Principal</h3> <ul> <li class="mb-2"> <a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="dashboardTab"> <i class="fas fa-tachometer-alt sidebar-icon mr-3"></i> <span class="sidebar-text">Dashboard</span> </a> </li> <li class="mb-2"> <a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="employeesTab"> <i class="fas fa-users sidebar-icon mr-3"></i> <span class="sidebar-text">Funcionários</span> </a> </li> <li class="mb-2"> <a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="paymentsTab"> <i class="fas fa-money-bill-wave sidebar-icon mr-3"></i> <span class="sidebar-text">Pagamentos</span> </a> </li> <li class="mb-2"> <a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="goalsTab"> <i class="fas fa-bullseye sidebar-icon mr-3"></i> <span class="sidebar-text">Metas</span> </a> </li> <li class="mb-2"> <a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="reportsTab"> <i class="fas fa-chart-bar sidebar-icon mr-3"></i> <span class="sidebar-text">Relatórios</span> </a> </li> </ul> </div> <div class="mb-6"> <h3 class="text-xs uppercase font-semibold text-blue-300 mb-3 sidebar-text">Configurações</h3> <ul> <li class="mb-2"> <a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="settingsTab"> <i class="fas fa-cog sidebar-icon mr-3"></i> <span class="sidebar-text">Configurações</span> </a> </li> <li class="mb-2"> <a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="bonusTab"> <i class="fas fa-gift sidebar-icon mr-3"></i> <span class="sidebar-text">Bônus</span> </a> </li> </ul> </div> </div> </nav> <div class="p-4 border-t border-blue-700"> <div class="flex items-center"> <img src="https://via.placeholder.com/40" alt="User" class="rounded-full w-8 h-8 mr-3"> <div class="sidebar-text"> <p class="text-sm font-medium">Admin</p> <p class="text-xs text-blue-300">Administrador</p> </div> </div> </div> </div> <!-- Main Content --> <div class="content flex-1 overflow-y-auto"> <!-- Header --> <header class="bg-white shadow-sm"> <div class="px-6 py-4 flex items-center justify-between"> <h1 class="text-2xl font-semibold text-gray-800" id="pageTitle">Dashboard</h1> <div class="flex items-center space-x-4"> <div class="relative"> <input type="text" placeholder="Pesquisar..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i> </div> <button class="p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200"> <i class="fas fa-bell"></i> </button> </div> </div> </header> <!-- Dashboard Content --> <main class="p-6" id="dashboardContent"> <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"> <div class="flex items-center justify-between"> <div> <p class="text-gray-500">Total Funcionários</p> <h3 class="text-2xl font-bold" id="totalEmployees">0</h3> </div> <div class="bg-blue-100 p-3 rounded-full"> <i class="fas fa-users text-blue-600 text-xl"></i> </div> </div> <div class="mt-4"> <p class="text-sm text-gray-500"><span class="text-green-500 font-medium">+2.5%</span> desde o último mês</p> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-gray-500">Pagamentos Pendentes</p> <h3 class="text-2xl font-bold" id="pendingPayments">0</h3> </div> <div class="bg-yellow-100 p-3 rounded-full"> <i class="fas fa-money-bill-wave text-yellow-600 text-xl"></i> </div> </div> <div class="mt-4"> <p class="text-sm text-gray-500"><span class="text-red-500 font-medium">+3</span> desde ontem</p> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-gray-500">Metas Atingidas</p> <h3 class="text-2xl font-bold" id="goalsAchieved">0%</h3> </div> <div class="bg-green-100 p-3 rounded-full"> <i class="fas fa-bullseye text-green-600 text-xl"></i> </div> </div> <div class="mt-4"> <p class="text-sm text-gray-500"><span class="text-green-500 font-medium">+15%</span> desde a semana passada</p> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between"> <div> <p class="text-gray-500">Bônus Distribuídos</p> <h3 class="text-2xl font-bold" id="totalBonus">R$ 0,00</h3> </div> <div class="bg-purple-100 p-3 rounded-full"> <i class="fas fa-gift text-purple-600 text-xl"></i> </div> </div> <div class="mt-4"> <p class="text-sm text-gray-500"><span class="text-green-500 font-medium">+R$ 1.200,00</span> este mês</p> </div> </div> </div> <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6"> <div class="bg-white rounded-lg shadow p-6 lg:col-span-2"> <div class="flex items-center justify-between mb-4"> <h2 class="text-lg font-semibold">Últimos Pagamentos</h2> <a href="#" class="text-blue-600 text-sm">Ver todos</a> </div> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Funcionário</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valor</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="recentPaymentsTable"> <!-- Recent payments will be added here by JavaScript --> </tbody> </table> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <div class="flex items-center justify-between mb-4"> <h2 class="text-lg font-semibold">Metas em Andamento</h2> <a href="#" class="text-blue-600 text-sm">Ver todas</a> </div> <div class="space-y-4" id="ongoingGoals"> <!-- Ongoing goals will be added here by JavaScript --> </div> </div> </div> <div class="bg-white rounded-lg shadow p-6 mb-6"> <div class="flex items-center justify-between mb-4"> <h2 class="text-lg font-semibold">Produção Diária</h2> <div class="flex space-x-2"> <button class="px-3 py-1 bg-gray-100 rounded-md text-sm">Hoje</button> <button class="px-3 py-1 bg-gray-100 rounded-md text-sm">Semana</button> <button class="px-3 py-1 bg-blue-600 text-white rounded-md text-sm">Mês</button> </div> </div> <div class="h-64"> <canvas id="productionChart"></canvas> </div> </div> </main> <!-- Employees Content (hidden by default) --> <main class="p-6 hidden" id="employeesContent"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-semibold">Funcionários</h2> <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center" id="addEmployeeBtn"> <i class="fas fa-plus mr-2"></i> Adicionar Funcionário </button> </div> <div class="bg-white rounded-lg shadow overflow-hidden mb-6"> <div class="p-4 border-b flex justify-between items-center"> <div class="flex space-x-4"> <div class="relative"> <select class="block appearance-none bg-white border border-gray-300 text-gray-700 py-2 px-4 pr-8 rounded leading-tight focus:outline-none focus:border-blue-500"> <option>Todos Status</option> <option>Ativo</option> <option>Desligado</option> </select> <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> <i class="fas fa-chevron-down"></i> </div> </div> <div class="relative"> <input type="text" placeholder="Pesquisar..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i> </div> </div> <div> <button class="p-2 rounded-lg bg-gray-100 hover:bg-gray-200"> <i class="fas fa-filter text-gray-600"></i> </button> </div> </div> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nome</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data Início</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Chave PIX</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Meta</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="employeesTable"> <!-- Employees will be added here by JavaScript --> </tbody> </table> </div> <div class="p-4 border-t flex justify-between items-center"> <div class="text-sm text-gray-500"> Mostrando <span id="showingFrom">1</span> a <span id="showingTo">10</span> de <span id="totalRecords">0</span> registros </div> <div class="flex space-x-2"> <button class="px-3 py-1 bg-gray-100 rounded-md text-sm disabled" id="prevPageBtn"> <i class="fas fa-chevron-left"></i> </button> <button class="px-3 py-1 bg-gray-100 rounded-md text-sm disabled" id="nextPageBtn"> <i class="fas fa-chevron-right"></i> </button> </div> </div> </div> </main> <!-- Payments Content (hidden by default) --> <main class="p-6 hidden" id="paymentsContent"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-semibold">Pagamentos</h2> <div class="flex space-x-4"> <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center" id="addPaymentBtn"> <i class="fas fa-plus mr-2"></i> Adicionar Pagamento </button> <button class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center" id="batchPaymentBtn"> <i class="fas fa-money-bill-wave mr-2"></i> Pagamento em Lote </button> </div> </div> <div class="bg-white rounded-lg shadow overflow-hidden mb-6"> <div class="p-4 border-b flex justify-between items-center"> <div class="flex space-x-4"> <div class="relative"> <select class="block appearance-none bg-white border border-gray-300 text-gray-700 py-2 px-4 pr-8 rounded leading-tight focus:outline-none focus:border-blue-500" id="paymentStatusFilter"> <option value="all">Todos Status</option> <option value="paid">Pago</option> <option value="pending">Pendente</option> <option value="overdue">Atrasado</option> </select> <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> <i class="fas fa-chevron-down"></i> </div> </div> <div class="relative"> <input type="text" placeholder="Pesquisar..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" id="paymentSearch"> <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i> </div> </div> <div> <button class="p-2 rounded-lg bg-gray-100 hover:bg-gray-200" id="exportPaymentsBtn"> <i class="fas fa-file-export text-gray-600"></i> </button> </div> </div> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Funcionário</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valor</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data Pagamento</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data Recebimento</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="paymentsTable"> <!-- Payments will be added here by JavaScript --> </tbody> </table> </div> <div class="p-4 border-t flex justify-between items-center"> <div class="text-sm text-gray-500"> Mostrando <span id="paymentsShowingFrom">1</span> a <span id="paymentsShowingTo">10</span> de <span id="paymentsTotalRecords">0</span> registros </div> <div class="flex space-x-2"> <button class="px-3 py-1 bg-gray-100 rounded-md text-sm disabled" id="paymentsPrevPageBtn"> <i class="fas fa-chevron-left"></i> </button> <button class="px-3 py-1 bg-gray-100 rounded-md text-sm disabled" id="paymentsNextPageBtn"> <i class="fas fa-chevron-right"></i> </button> </div> </div> </div> </main> <!-- Goals Content (hidden by default) --> <main class="p-6 hidden" id="goalsContent"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-semibold">Metas</h2> <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center" id="addGoalBtn"> <i class="fas fa-plus mr-2"></i> Adicionar Meta </button> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"> <div class="bg-white rounded-lg shadow p-6"> <h3 class="text-lg font-semibold mb-4">Distribuição de Metas</h3> <div class="h-64"> <canvas id="goalsDistributionChart"></canvas> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <h3 class="text-lg font-semibold mb-4">Progresso Mensal</h3> <div class="h-64"> <canvas id="monthlyProgressChart"></canvas> </div> </div> </div> <div class="bg-white rounded-lg shadow overflow-hidden mb-6"> <div class="p-4 border-b flex justify-between items-center"> <div class="flex space-x-4"> <div class="relative"> <select class="block appearance-none bg-white border border-gray-300 text-gray-700 py-2 px-4 pr-8 rounded leading-tight focus:outline-none focus:border-blue-500" id="goalStatusFilter"> <option value="all">Todas Metas</option> <option value="achieved">Atingidas</option> <option value="not_achieved">Não Atingidas</option> <option value="in_progress">Em Progresso</option> </select> <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> <i class="fas fa-chevron-down"></i> </div> </div> <div class="relative"> <input type="text" placeholder="Pesquisar..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" id="goalSearch"> <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i> </div> </div> <div> <button class="p-2 rounded-lg bg-gray-100 hover:bg-gray-200" id="exportGoalsBtn"> <i class="fas fa-file-export text-gray-600"></i> </button> </div> </div> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Funcionário</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Meta</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Produção</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Progresso</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Bônus</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="goalsTable"> <!-- Goals will be added here by JavaScript --> </tbody> </table> </div> <div class="p-4 border-t flex justify-between items-center"> <div class="text-sm text-gray-500"> Mostrando <span id="goalsShowingFrom">1</span> a <span id="goalsShowingTo">10</span> de <span id="goalsTotalRecords">0</span> registros </div> <div class="flex space-x-2"> <button class="px-3 py-1 bg-gray-100 rounded-md text-sm disabled" id="goalsPrevPageBtn"> <i class="fas fa-chevron-left"></i> </button> <button class="px-3 py-1 bg-gray-100 rounded-md text-sm disabled" id="goalsNextPageBtn"> <i class="fas fa-chevron-right"></i> </button> </div> </div> </div> </main> <!-- Reports Content (hidden by default) --> <main class="p-6 hidden" id="reportsContent"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-semibold">Relatórios</h2> <div class="flex space-x-4"> <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center" id="generateReportBtn"> <i class="fas fa-file-pdf mr-2"></i> Gerar Relatório </button> </div> </div> <div class="bg-white rounded-lg shadow p-6 mb-6"> <h3 class="text-lg font-semibold mb-4">Filtros</h3> <div class="grid grid-cols-1 md:grid-cols-3 gap-6"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Período</label> <div class="flex space-x-2"> <input type="date" class="border rounded-lg px-3 py-2 w-full"> <input type="date" class="border rounded-lg px-3 py-2 w-full"> </div> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Funcionário</label> <select class="border rounded-lg px-3 py-2 w-full"> <option>Todos Funcionários</option> <!-- Employees will be added here by JavaScript --> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Tipo de Relatório</label> <select class="border rounded-lg px-3 py-2 w-full"> <option>Pagamentos</option> <option>Metas</option> <option>Produção</option> <option>Bônus</option> <option>Completo</option> </select> </div> </div> <div class="mt-4 flex justify-end"> <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg"> Aplicar Filtros </button> </div> </div> <div class="grid grid-cols-1 gap-6 mb-6"> <div class="bg-white rounded-lg shadow p-6"> <h3 class="text-lg font-semibold mb-4">Relatório de Pagamentos</h3> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Funcionário</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total Pago</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Pagamentos</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Atrasos</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Bônus</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="paymentsReportTable"> <!-- Payments report will be added here by JavaScript --> </tbody> </table> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <h3 class="text-lg font-semibold mb-4">Relatório de Metas</h3> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Funcionário</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Metas</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Atingidas</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Taxa de Sucesso</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Produção Média</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="goalsReportTable"> <!-- Goals report will be added here by JavaScript --> </tbody> </table> </div> </div> </div> </main> <!-- Settings Content (hidden by default) --> <main class="p-6 hidden" id="settingsContent"> <h2 class="text-2xl font-semibold mb-6">Configurações</h2> <div class="bg-white rounded-lg shadow p-6 mb-6"> <h3 class="text-lg font-semibold mb-4">Configurações Gerais</h3> <div class="space-y-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Nome da Empresa</label> <input type="text" class="border rounded-lg px-3 py-2 w-full" value="Minha Empresa"> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Moeda</label> <select class="border rounded-lg px-3 py-2 w-full"> <option>Real Brasileiro (R$)</option> <option>Dólar Americano ($)</option> <option>Euro (€)</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Formato de Data</label> <select class="border rounded-lg px-3 py-2 w-full"> <option>DD/MM/AAAA</option> <option>MM/DD/AAAA</option> <option>AAAA-MM-DD</option> </select> </div> </div> <div class="mt-6 flex justify-end"> <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg"> Salvar Configurações </button> </div> </div> <div class="bg-white rounded-lg shadow p-6 mb-6"> <h3 class="text-lg font-semibold mb-4">Configurações de Pagamento</h3> <div class="space-y-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Dia Padrão de Pagamento</label> <select class="border rounded-lg px-3 py-2 w-full"> <option>5º dia útil</option> <option>10º dia útil</option> <option>15º dia útil</option> <option>20º dia útil</option> <option>Último dia útil</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Método de Pagamento Padrão</label> <select class="border rounded-lg px-3 py-2 w-full"> <option>PIX</option> <option>TED</option> <option>DOC</option> <option>Boleto</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Notificar Pagamentos Pendentes</label> <div class="flex items-center"> <input type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" checked> <span class="ml-2 text-sm text-gray-700">Enviar alertas para pagamentos pendentes</span> </div> </div> </div> <div class="mt-6 flex justify-end"> <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg"> Salvar Configurações </button> </div> </div> </main> <!-- Bonus Content (hidden by default) --> <main class="p-6 hidden" id="bonusContent"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-semibold">Bônus</h2> <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center" id="addBonusRuleBtn"> <i class="fas fa-plus mr-2"></i> Adicionar Regra </button> </div> <div class="bg-white rounded-lg shadow p-6 mb-6"> <h3 class="text-lg font-semibold mb-4">Regras de Bônus</h3> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nome</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tipo</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Condição</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valor</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Aplicável</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="bonusRulesTable"> <!-- Bonus rules will be added here by JavaScript --> </tbody> </table> </div> </div> <div class="bg-white rounded-lg shadow p-6"> <h3 class="text-lg font-semibold mb-4">Histórico de Bônus</h3> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Funcionário</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Regra</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valor</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="bonusHistoryTable"> <!-- Bonus history will be added here by JavaScript --> </tbody> </table> </div> </div> </main> </div> </div> <!-- Add Employee Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="addEmployeeModal"> <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl"> <div class="p-6 border-b"> <h3 class="text-xl font-semibold">Adicionar Funcionário</h3> </div> <div class="p-6"> <form id="employeeForm"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Nome Completo*</label> <input type="text" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Data de Início*</label> <input type="date" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Chave PIX*</label> <input type="text" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Data de Recebimento*</label> <input type="date" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Salário Base*</label> <input type="number" step="0.01" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Status*</label> <select class="border rounded-lg px-3 py-2 w-full" required> <option value="active">Ativo</option> <option value="inactive">Desligado</option> </select> </div> <div class="md:col-span-2"> <label class="block text-sm font-medium text-gray-700 mb-1">Observações</label> <textarea class="border rounded-lg px-3 py-2 w-full" rows="3"></textarea> </div> </div> </form> </div> <div class="p-4 border-t flex justify-end space-x-3"> <button class="px-4 py-2 border rounded-lg hover:bg-gray-100" id="cancelEmployeeBtn">Cancelar</button> <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700" id="saveEmployeeBtn">Salvar</button> </div> </div> </div> <!-- Add Payment Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="addPaymentModal"> <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl"> <div class="p-6 border-b"> <h3 class="text-xl font-semibold">Adicionar Pagamento</h3> </div> <div class="p-6"> <form id="paymentForm"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Funcionário*</label> <select class="border rounded-lg px-3 py-2 w-full" required> <option value="">Selecione um funcionário</option> <!-- Employees will be added here by JavaScript --> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Valor*</label> <input type="number" step="0.01" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Data de Pagamento*</label> <input type="date" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Data de Recebimento*</label> <input type="date" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Status*</label> <select class="border rounded-lg px-3 py-2 w-full" required> <option value="paid">Pago</option> <option value="pending">Pendente</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Bônus</label> <input type="number" step="0.01" class="border rounded-lg px-3 py-2 w-full" value="0.00"> </div> <div class="md:col-span-2"> <label class="block text-sm font-medium text-gray-700 mb-1">Observações</label> <textarea class="border rounded-lg px-3 py-2 w-full" rows="3"></textarea> </div> </div> </form> </div> <div class="p-4 border-t flex justify-end space-x-3"> <button class="px-4 py-2 border rounded-lg hover:bg-gray-100" id="cancelPaymentBtn">Cancelar</button> <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700" id="savePaymentBtn">Salvar</button> </div> </div> </div> <!-- Add Goal Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="addGoalModal"> <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl"> <div class="p-6 border-b"> <h3 class="text-xl font-semibold">Adicionar Meta</h3> </div> <div class="p-6"> <form id="goalForm"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Funcionário*</label> <select class="border rounded-lg px-3 py-2 w-full" required> <option value="">Selecione um funcionário</option> <!-- Employees will be added here by JavaScript --> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Tipo de Meta*</label> <select class="border rounded-lg px-3 py-2 w-full" required> <option value="daily">Diária</option> <option value="weekly">Semanal</option> <option value="monthly">Mensal</option> <option value="quarterly">Trimestral</option> <option value="annual">Anual</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Valor da Meta*</label> <input type="number" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Unidade*</label> <input type="text" class="border rounded-lg px-3 py-2 w-full" value="unidades" required> </div> <div class="md:col-span-2"> <label class="block text-sm font-medium text-gray-700 mb-1">Descrição</label> <textarea class="border rounded-lg px-3 py-2 w-full" rows="3"></textarea> </div> </div> </form> </div> <div class="p-4 border-t flex justify-end space-x-3"> <button class="px-4 py-2 border rounded-lg hover:bg-gray-100" id="cancelGoalBtn">Cancelar</button> <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700" id="saveGoalBtn">Salvar</button> </div> </div> </div> <!-- Add Bonus Rule Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="addBonusRuleModal"> <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl"> <div class="p-6 border-b"> <h3 class="text-xl font-semibold">Adicionar Regra de Bônus</h3> </div> <div class="p-6"> <form id="bonusRuleForm"> <div class="grid grid-cols-1 gap-6"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Nome da Regra*</label> <input type="text" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Tipo de Bônus*</label> <select class="border rounded-lg px-3 py-2 w-full" required> <option value="fixed">Valor Fixo</option> <option value="percentage">Porcentagem</option> <option value="tiered">Escalonado</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Condição*</label> <select class="border rounded-lg px-3 py-2 w-full" required> <option value="goal_achieved">Meta Atingida</option> <option value="goal_exceeded">Meta Excedida</option> <option value="perfect_attendance">Presença Perfeita</option> <option value="performance">Desempenho</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Valor*</label> <input type="text" class="border rounded-lg px-3 py-2 w-full" required> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Aplicável a*</label> <select class="border rounded-lg px-3 py-2 w-full" required> <option value="all">Todos Funcionários</option> <option value="active">Apenas Ativos</option> <option value="department">Por Departamento</option> <option value="specific">Funcionários Específicos</option> </select> </div> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Descrição</label> <textarea class="border rounded-lg px-3 py-2 w-full" rows="3"></textarea> </div> </div> </form> </div> <div class="p-4 border-t flex justify-end space-x-3"> <button class="px-4 py-2 border rounded-lg hover:bg-gray-100" id="cancelBonusRuleBtn">Cancelar</button> <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700" id="saveBonusRuleBtn">Salvar</button> </div> </div> </div> <!-- Employee History Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="employeeHistoryModal"> <div class="bg-white rounded-lg shadow-xl w-full max-w-4xl"> <div class="p-6 border-b flex justify-between items-center"> <h3 class="text-xl font-semibold">Histórico do Funcionário</h3> <button class="text-gray-500 hover:text-gray-700" id="closeHistoryModal"> <i class="fas fa-times"></i> </button> </div> <div class="p-6"> <div class="mb-6"> <h4 class="text-lg font-medium mb-2">Informações do Funcionário</h4> <div class="grid grid-cols-1 md:grid-cols-3 gap-4"> <div> <p class="text-sm text-gray-500">Nome</p> <p class="font-medium" id="historyEmployeeName">-</p> </div> <div> <p class="text-sm text-gray-500">Data de Início</p> <p class="font-medium" id="historyEmployeeStartDate">-</p> </div> <div> <p class="text-sm text-gray-500">Status</p> <p class="font-medium" id="historyEmployeeStatus">-</p> </div> </div> </div> <div class="mb-6"> <h4 class="text-lg font-medium mb-2">Histórico de Pagamentos</h4> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valor</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Bônus</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="paymentHistoryTable"> <!-- Payment history will be added here by JavaScript --> </tbody> </table> </div> </div> <div class="mb-6"> <h4 class="text-lg font-medium mb-2">Histórico de Metas</h4> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Período</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Meta</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Produção</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Bônus</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="goalHistoryTable"> <!-- Goal history will be added here by JavaScript --> </tbody> </table> </div> </div> <div> <h4 class="text-lg font-medium mb-2">Histórico de Alterações</h4> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tipo</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Detalhes</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Responsável</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="changesHistoryTable"> <!-- Changes history will be added here by JavaScript --> </tbody> </table> </div> </div> </div> </div> </div> <!-- Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="confirmationModal"> <div class="bg-white rounded-lg shadow-xl w-full max-w-md"> <div class="p-6 border-b"> <h3 class="text-xl font-semibold" id="confirmationTitle">Confirmar Ação</h3> </div> <div class="p-6"> <p id="confirmationMessage">Tem certeza que deseja realizar esta ação?</p> </div> <div class="p-4 border-t flex justify-end space-x-3"> <button class="px-4 py-2 border rounded-lg hover:bg-gray-100" id="cancelConfirmationBtn">Cancelar</button> <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700" id="confirmActionBtn">Confirmar</button> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script> // Sample data for the application const employees = [ { id: 1, name: "João Silva", startDate: "2022-01-15", paymentDate: "2023-06-05", pixKey: "joao.silva@email.com", salary: 3500.00, status: "active", goals: [ { id: 1, type: "monthly", target: 100, current: 120, achieved: true, bonus: 350.00 }, { id: 2, type: "daily", target: 5, current: 4, achieved: false, bonus: 0.00 } ], payments: [ { id: 1, amount: 3500.00, paymentDate: "2023-05-05", dueDate: "2023-05-05", status: "paid", bonus: 350.00 }, { id: 2, amount: 3500.00, paymentDate: "2023-06-05", dueDate: "2023-06-05", status: "pending", bonus: 0.00 } ] }, { id: 2, name: "Maria Souza", startDate: "2022-03-10", paymentDate: "2023-06-10", pixKey: "123.456.789-00", salary: 4200.00, status: "active", goals: [ { id: 3, type: "monthly", target: 120, current: 115, achieved: false, bonus: 0.00 }, { id: 4, type: "daily", target: 6, current: 7, achieved: true, bonus: 210.00 } ], payments: [ { id: 3, amount: 4200.00, paymentDate: "2023-05-10", dueDate: "2023-05-10", status: "paid", bonus: 210.00 }, { id: 4, amount: 4200.00, paymentDate: "2023-06-10", dueDate: "2023-06-10", status: "pending", bonus: 0.00 } ] }, { id: 3, name: "Carlos Oliveira", startDate: "2021-11-20", paymentDate: "2023-06-15", pixKey: "+55 11 98765-4321", salary: 3800.00, status: "inactive", goals: [ { id: 5, type: "monthly", target: 90, current: 85, achieved: false, bonus: 0.00 } ], payments: [ { id: 5, amount: 3800.00, paymentDate: "2023-05-15", dueDate: "2023-05-15", status: "paid", bonus: 0.00 }, { id: 6, amount: 3800.00, paymentDate: "2023-06-15", dueDate: "2023-06-15", status: "pending", bonus: 0.00 } ] } ]; const bonusRules = [ { id: 1, name: "Meta Mensal Atingida", type: "percentage", condition: "goal_achieved", value: "10%", applicable: "all" }, { id: 2, name: "Meta Diária Excedida", type: "fixed", condition: "goal_exceeded", value: "R$ 30,00", applicable: "active" }, { id: 3, name: "Presença Perfeita", type: "fixed", condition: "perfect_attendance", value: "R$ 100,00", applicable: "all" } ]; // Initialize the application document.addEventListener('DOMContentLoaded', function() { // UI Elements const toggleSidebarBtn = document.getElementById('toggleSidebar'); const sidebar = document.querySelector('.sidebar'); const content = document.querySelector('.content'); const navTabs = document.querySelectorAll('[id$="Tab"]'); const contentSections = document.querySelectorAll('[id$="Content"]'); // Modal elements const addEmployeeModal = document.getElementById('addEmployeeModal'); const addPaymentModal = document.getElementById('addPaymentModal'); const addGoalModal = document.getElementById('addGoalModal'); const addBonusRuleModal = document.getElementById('addBonusRuleModal'); const employeeHistoryModal = document.getElementById('employeeHistoryModal'); const confirmationModal = document.getElementById('confirmationModal'); // Buttons const addEmployeeBtn = document.getElementById('addEmployeeBtn'); const addPaymentBtn = document.getElementById('addPaymentBtn'); const addGoalBtn = document.getElementById('addGoalBtn'); const addBonusRuleBtn = document.getElementById('addBonusRuleBtn'); // Cancel buttons const cancelEmployeeBtn = document.getElementById('cancelEmployeeBtn'); const cancelPaymentBtn = document.getElementById('cancelPaymentBtn'); const cancelGoalBtn = document.getElementById('cancelGoalBtn'); const cancelBonusRuleBtn = document.getElementById('cancelBonusRuleBtn'); const closeHistoryModal = document.getElementById('closeHistoryModal'); const cancelConfirmationBtn = document.getElementById('cancelConfirmationBtn'); // Save buttons const saveEmployeeBtn = document.getElementById('saveEmployeeBtn'); const savePaymentBtn = document.getElementById('savePaymentBtn'); const saveGoalBtn = document.getElementById('saveGoalBtn'); const saveBonusRuleBtn = document.getElementById('saveBonusRuleBtn'); // Confirmation button const confirmActionBtn = document.getElementById('confirmActionBtn'); // Toggle sidebar toggleSidebarBtn.addEventListener('click', function() { sidebar.classList.toggle('collapsed'); content.classList.toggle('expanded'); }); // Navigation tabs navTabs.forEach(tab => { tab.addEventListener('click', function() { const tabId = this.id.replace('Tab', ''); // Hide all content sections contentSections.forEach(section => { section.classList.add('hidden'); }); // Show the selected content section document.getElementById(`${tabId}Content`).classList.remove('hidden'); // Update page title document.getElementById('pageTitle').textContent = this.querySelector('.sidebar-text').textContent; // Update active tab styling navTabs.forEach(t => { t.classList.remove('bg-blue-700'); }); this.classList.add('bg-blue-700'); // Load data for the selected tab switch(tabId) { case 'dashboard': loadDashboardData(); break; case 'employees': loadEmployeesTable(); break; case 'payments': loadPaymentsTable(); break; case 'goals': loadGoalsTable(); break; case 'reports': loadReportsData(); break; case 'settings': // No data to load break; case 'bonus': loadBonusData(); break; } }); }); // Show add employee modal addEmployeeBtn.addEventListener('click', function() { addEmployeeModal.classList.remove('hidden'); }); // Show add payment modal addPaymentBtn.addEventListener('click', function() { // Populate employee dropdown const select = addPaymentModal.querySelector('select'); select.innerHTML = '<option value="">Selecione um funcionário</option>'; employees.forEach(employee => { if (employee.status === 'active') { const option = document.createElement('option'); option.value = employee.id; option.textContent = employee.name; select.appendChild(option); } }); addPaymentModal.classList.remove('hidden'); }); // Show add goal modal addGoalBtn.addEventListener('click', function() { // Populate employee dropdown const select = addGoalModal.querySelector('select'); select.innerHTML = '<option value="">Selecione um funcionário</option>'; employees.forEach(employee => { if (employee.status === 'active') { const option = document.createElement('option'); option.value = employee.id; option.textContent = employee.name; select.appendChild(option); } }); addGoalModal.classList.remove('hidden'); }); // Show add bonus rule modal addBonusRuleBtn.addEventListener('click', function() { addBonusRuleModal.classList.remove('hidden'); }); // Close modals cancelEmployeeBtn.addEventListener('click', function() { addEmployeeModal.classList.add('hidden'); }); cancelPaymentBtn.addEventListener('click', function() { addPaymentModal.classList.add('hidden'); }); cancelGoalBtn.addEventListener('click', function() { addGoalModal.classList.add('hidden'); }); cancelBonusRuleBtn.addEventListener('click', function() { addBonusRuleModal.classList.add('hidden'); }); closeHistoryModal.addEventListener('click', function() { employeeHistoryModal.classList.add('hidden'); }); cancelConfirmationBtn.addEventListener('click', function() { confirmationModal.classList.add('hidden'); }); // Save buttons - in a real app, these would save to a database saveEmployeeBtn.addEventListener('click', function() { // Validate form const form = document.getElementById('employeeForm'); if (!form.checkValidity()) { form.reportValidity(); return; } // In a real app, you would save the employee here alert('Funcionário salvo com sucesso!'); addEmployeeModal.classList.add('hidden'); loadEmployeesTable(); }); savePaymentBtn.addEventListener('click', function() { // Validate form const form = document.getElementById('paymentForm'); if (!form.checkValidity()) { form.reportValidity(); return; } // In a real app, you would save the payment here alert('Pagamento salvo com sucesso!'); addPaymentModal.classList.add('hidden'); loadPaymentsTable(); }); saveGoalBtn.addEventListener('click', function() { // Validate form const form = document.getElementById('goalForm'); if (!form.checkValidity()) { form.reportValidity(); return; } // In a real app, you would save the goal here alert('Meta salva com sucesso!'); addGoalModal.classList.add('hidden'); loadGoalsTable(); }); saveBonusRuleBtn.addEventListener('click', function() { // Validate form const form = document.getElementById('bonusRuleForm'); if (!form.checkValidity()) { form.reportValidity(); return; } // In a real app, you would save the bonus rule here alert('Regra de bônus salva com sucesso!'); addBonusRuleModal.classList.add('hidden'); loadBonusData(); }); // Confirm action confirmActionBtn.addEventListener('click', function() { // In a real app, you would perform the action here alert('Ação confirmada!'); confirmationModal.classList.add('hidden'); }); // Initialize dashboard loadDashboardData(); // Set dashboard as active tab document.getElementById('dashboardTab').click(); }); // Load dashboard data function loadDashboardData() { // Update summary cards document.getElementById('totalEmployees').textContent = employees.length; const pendingPayments = employees.reduce((acc, employee) => { return acc + employee.payments.filter(p => p.status === 'pending').length; }, 0); document.getElementById('pendingPayments').textContent = pendingPayments; const achievedGoals = employees.reduce((acc, employee) => { return acc + employee.goals.filter(g => g.achieved).length; }, 0); const totalGoals = employees.reduce((acc, employee) => { return acc + employee.goals.length; }, 0); const achievementRate = totalGoals > 0 ? Math.round((achievedGoals / totalGoals) * 100) : 0; document.getElementById('goalsAchieved').textContent = `${achievementRate}%`; const totalBonus = employees.reduce((acc, employee) => { return acc + employee.goals.reduce((sum, goal) => sum + goal.bonus, 0); }, 0); document.getElementById('totalBonus').textContent = `R$ ${totalBonus.toFixed(2)}`; // Load recent payments table const recentPaymentsTable = document.getElementById('recentPaymentsTable'); recentPaymentsTable.innerHTML = ''; // Get all payments and sort by date (newest first) const allPayments = []; employees.forEach(employee => { employee.payments.forEach(payment => { allPayments.push({ ...payment, employeeName: employee.name }); }); }); allPayments.sort((a, b) => new Date(b.paymentDate) - new Date(a.paymentDate)); // Show only the 5 most recent payments allPayments.slice(0, 5).forEach(payment => { const row = document.createElement('tr'); // Check if payment is overdue const today = new Date(); const dueDate = new Date(payment.dueDate); const isOverdue = payment.status === 'pending' && today > dueDate; if (isOverdue) { row.classList.add('overdue'); } row.innerHTML = ` <td class="px-6 py-4 whitespace-nowrap"> <div class="flex items-center"> <div class="ml-4"> <div class="text-sm font-medium text-gray-900">${payment.employeeName}</div> </div> </div> </td> <td class="px-6 py-4 whitespace-nowrap"> <div class="text-sm text-gray-900">R$ ${payment.amount.toFixed( </html>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sistema de Gestão de Funcionários</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.sidebar {
transition: all 0.3s;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .sidebar-text {
display: none;
}
.sidebar.collapsed .sidebar-icon {
margin-right: 0;
}
.content {
transition: all 0.3s;
}
.content.expanded {
margin-left: 70px;
}
.overdue {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
background-color: rgba(239, 68, 68, 0.1);
}
50% {
background-color: rgba(239, 68, 68, 0.3);
}
100% {
background-color: rgba(239, 68, 68, 0.1);
}
}
.progress-bar {
height: 10px;
border-radius: 5px;
background-color: #e5e7eb;
}
.progress-fill {
height: 100%;
border-radius: 5px;
transition: width 0.3s;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="flex h-screen">
<!-- Sidebar -->
<div class="sidebar bg-blue-800 text-white w-64 flex flex-col">
<div class="p-4 flex items-center justify-between border-b border-blue-700">
<div class="flex items-center">
<i class="fas fa-users-cog text-2xl sidebar-icon mr-3"></i>
<span class="text-xl font-bold sidebar-text">Gestão de Funcionários</span>
</div>
<button id="toggleSidebar" class="text-white focus:outline-none">
<i class="fas fa-bars"></i>
</button>
</div>
<nav class="flex-1 overflow-y-auto">
<div class="p-4">
<div class="mb-6">
<h3 class="text-xs uppercase font-semibold text-blue-300 mb-3 sidebar-text">Menu Principal</h3>
<ul>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="dashboardTab">
<i class="fas fa-tachometer-alt sidebar-icon mr-3"></i>
<span class="sidebar-text">Dashboard</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="employeesTab">
<i class="fas fa-users sidebar-icon mr-3"></i>
<span class="sidebar-text">Funcionários</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="paymentsTab">
<i class="fas fa-money-bill-wave sidebar-icon mr-3"></i>
<span class="sidebar-text">Pagamentos</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="goalsTab">
<i class="fas fa-bullseye sidebar-icon mr-3"></i>
<span class="sidebar-text">Metas</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 transition" id="reportsTab">
<i class="fas fa-chart-bar sidebar-icon mr-3"></i>
<span class="sidebar-text">Relatórios</span>
</a>