91 lines
3.6 KiB
PHP
91 lines
3.6 KiB
PHP
<?php
|
|
require_once __DIR__ . "/../controllers/UsuarioController.php";
|
|
|
|
$resultado = UsuarioController::obtenerUsuarios();
|
|
$hayUsuarios = true;
|
|
|
|
// Si hubo algún error se retorno un array con el estado y mensaje, comprobar si existe
|
|
if (isset($resultado['estado'])){
|
|
$hayUsuarios = false;
|
|
echo "<script>console.log('".$resultado['mensaje']."');</script>";
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/boxicons@latest/css/boxicons.min.css'>
|
|
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="../css/inicio.css">
|
|
<link rel="stylesheet" href="../font/bootstrap-icons.css">
|
|
<title>Control de usuarios</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="inicio.html"><i class='bx bxs-dashboard icon' ></i>Dashboard</a></li>
|
|
<li><a href="formulario-candidato.html" target="_blank"><i class='bx bxs-dashboard icon' ></i>Formulario de registro</a></li>
|
|
<li><a href="control-candidatos.php"><i class='bx bxs-dashboard icon' ></i>Control candidatos</a></li>
|
|
<li><a href="control-usuarios.php" class="active"><i class='bx bxs-dashboard icon' ></i>Control usuario</a></li>
|
|
</ul>
|
|
|
|
|
|
</section>
|
|
<!-- .SIDEBAR -->
|
|
|
|
|
|
<section id="content">
|
|
<!-- ========== MAIN ========== -->
|
|
<main>
|
|
|
|
<h1 class="title" style="margin: 2% 1%">Control de usuarios</h1>
|
|
|
|
<!-- ------------------------------ div qué contiene la tabla ------------------------------------------ -->
|
|
<div style="margin: 1%">
|
|
<div class="table-responsive rounded-4" style="height: 100%;width: 100%;">
|
|
<table class="table table-hover table-bordered border-dark-subtle shadow-sm">
|
|
<thead>
|
|
<tr class="table-dark">
|
|
<th>Nombre</th>
|
|
<th>Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="table-group-divider">
|
|
<?php if ($hayUsuarios): ?>
|
|
<?php foreach ($resultado as $usuario): ?>
|
|
<tr>
|
|
<td><?php echo $usuario['usuario'] ?></td>
|
|
<td>
|
|
<a class="btn border rounded-3 shadow" role="button" style="background-color: #35245b;color: white;" href="modificar-usuario.php?id=<?php echo $usuario['id'] ?>&usuario=<?php echo urlencode($usuario['usuario']) ?>"><i class="bi bi-pencil-square"></i> Modificar</a>
|
|
<button class="boton-eliminar btn border rounded-3 shadow" role="button" style="background-color: #35245b;color: white;" data-id-usuario="<?php echo $usuario['id'] ?>" data-nombre-usuario="<?php echo $usuario['usuario'] ?>"><i class="bi bi-trash"></i> Eliminar</button>
|
|
</td>
|
|
<tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<!-- ------------------------------ /div qué contiene la tabla ----------------------------------------- -->
|
|
</main>
|
|
<!-- .......... MAIN .......... -->
|
|
</section>
|
|
|
|
|
|
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
|
|
|
<script src="../js/sidebar-navbar.js"></script>
|
|
<script src="../js/control-usuario.js"></script>
|
|
|
|
<script src="https://website-widgets.pages.dev/dist/sienna.min.js" defer></script>
|
|
</body>
|
|
</html>
|