<?php
session_start();
if (!isset($_SESSION['rol']) || !in_array($_SESSION['rol'], ['admin', 'adminTi', 'coordinador'])) {
  header('Location: ../../index.php');
  exit;
}
?>
<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>Banco de Candidatos</title>
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <!-- Bootstrap 5 + FontAwesome + MDB -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" />
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet" />
  <link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/6.4.0/mdb.min.css" rel="stylesheet" />
  <link href="../assets/css/recruiter.css" rel="stylesheet" />
</head>
<body class="bg-light">

<div class="d-flex">
  <?php include '../includes/sidebar.php'; ?>

  <div class="main-content w-100" id="mainContent">
    <?php include '../includes/topbar.php'; ?>

    <div class="container py-4">
      <h3 class="mb-4 fw-bold">Banco de Candidatos</h3>

      <div class="table-responsive">
        <table class="table table-hover align-middle">
          <thead class="table-light">
            <tr>
              <th>Nombre</th>
              <th>Estatus</th>
              <th>Fecha en Banco</th>
              <th>Acción</th>
            </tr>
          </thead>
          <tbody id="tablaCandidatosBanco">
            <!-- Rellenado por JS -->
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>


<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="../assets/js/banco.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', () => {
    cargarBancoCandidatos();
  });
</script>
</body>
</html>
