114 lines
4.0 KiB
PHP
114 lines
4.0 KiB
PHP
<?php
|
|
require_once __DIR__ . "/../controllers/ControlCandidatos.php";
|
|
|
|
$candidatoControl = new ControlCandidatos();
|
|
$resultado = $candidatoControl->obtenerCandidatosSinFechaSalida();
|
|
|
|
if(isset($resultado['estado'])){
|
|
$hayCandidatos = false;
|
|
if($resultado['estado'] == 'error'){
|
|
// Enviar un console.error con $resultado['mensaje']
|
|
echo "<script>console.error('Error: " . $resultado['mensaje'] . "');</script>";
|
|
} else {
|
|
echo "<script>console.log(" . $resultado['mensaje'] . ");</script>";
|
|
}
|
|
} else {
|
|
$hayCandidatos = true;
|
|
}
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link href='https://unpkg.com/boxicons@2.0.9/css/boxicons.min.css' rel='stylesheet'>
|
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="../css/inicio.css">
|
|
<title>Control</title>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- SIDEBAR -->
|
|
<section id="sidebar">
|
|
<a href="inicio.html" class="brand"><i class='bx bx-code-alt icon' ></i> LANIA</a>
|
|
|
|
<ul class="side-menu">
|
|
<li><a href="#" class="active"><i class='bx bxs-dashboard icon' ></i> Dashboard</a></li>
|
|
<li class="divider" data-text="main">Main</li>
|
|
<li>
|
|
<a href="#"><i class='bx bxs-inbox icon' ></i> Elements <i class='bx bx-chevron-right icon-right' ></i></a>
|
|
<ul class="side-dropdown">
|
|
<li><a href="#">Alert</a></li>
|
|
<li><a href="#">Badges</a></li>
|
|
<li><a href="#">Breadcrumbs</a></li>
|
|
<li><a href="#">Button</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#"><i class='bx bxs-chart icon' ></i> Charts</a></li>
|
|
<li><a href="#"><i class='bx bxs-widget icon' ></i> Widgets</a></li>
|
|
<li class="divider" data-text="tablas y formularios">Tablas y formularios</li>
|
|
<li><a href="#"><i class='bx bx-table icon' ></i> Tablas</a></li>
|
|
<li>
|
|
<a href="#"><i class='bx bxs-notepad icon' ></i> Formularios <i class='bx bx-chevron-right icon-right' ></i></a>
|
|
<ul class="side-dropdown">
|
|
<li><a href="formulario-candidato.html">Registro de candidato</a></li>
|
|
<li><a href="formulario-datos-candidato.php">Datos de candidato</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<!-- <div class="ads">
|
|
<div class="wrapper">
|
|
<a href="#" class="btn-upgrade">Upgrade</a>
|
|
<p>Become a <span>PRO</span> member and enjoy <span>All Features</span></p>
|
|
</div>
|
|
</div> -->
|
|
</section>
|
|
<!-- .SIDEBAR -->
|
|
|
|
<!-- = = = = = = = = = = NAVBAR = = = = = = = = = = -->
|
|
<section id="content">
|
|
<!-- ========== MAIN ========== -->
|
|
<main>
|
|
<h1 class="title">Dashboard</h1>
|
|
<div>
|
|
<div class="table-responsive rounded-4" style="height: 100%;width: 100%;">
|
|
<table class="table table-hover table-bordered shadow-sm">
|
|
<thead>
|
|
<tr>
|
|
<th>Nombre</th>
|
|
<th>Fecha de entrada</th>
|
|
<th>Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if ($hayCandidatos): ?>
|
|
<?php foreach ($resultado as $candidato): ?>
|
|
<tr>
|
|
<td><?php echo $candidato['nombre_completo'] ?></td>
|
|
<td><?php echo $candidato['fecha_entrada'] ?></td>
|
|
<td>
|
|
<a class="btn border rounded" role="button" style="background-color: #35245b;color: white;" href="formulario-datos-candidato.php?id_candidato=<?php echo $candidato['id_candidato']?>" target="_blank">Abrir formulario</a>
|
|
<a class="btn border rounded" role="button" style="background-color: #35245b;color: white;">Eliminar</a>
|
|
</td>
|
|
<tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
<!-- .......... MAIN .......... -->
|
|
</section>
|
|
<!-- . . . . . . . . . . NAVBAR . . . . . . . . . . -->
|
|
|
|
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
|
|
|
<script type="module" src="../js/control-candidatos.js.js"></script>
|
|
|
|
<script src="https://website-widgets.pages.dev/dist/sienna.min.js" defer></script>
|
|
</body>
|
|
</html>
|