gestor_models/list_tables.php
2025-06-14 17:01:29 -04:00

58 lines
2.1 KiB
PHP

<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Listar Tablas</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/1.13.4/css/dataTables.bootstrap5.min.css" rel="stylesheet">
</head>
<body class="bg-light">
<div class="container py-5">
<div class="card shadow-sm">
<div class="card-header bg-secondary text-white">
<h3>Modelos en la Base de Datos</h3>
</div>
<div class="card-body">
<table id="tables" class="table table-striped" style="width:100%">
<thead class="table-dark">
<tr>
<th>Nombre</th>
<th>Acción</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.4/js/dataTables.bootstrap5.min.js"></script>
<script>
$(function() {
$('#tables').DataTable({
serverSide: true,
processing: true,
ajax: 'ajax/get_tables.php',
columns: [{
data: 'name',
title: 'Nombre'
},
{
data: null,
orderable: false,
render: d => `<button class="btn btn-info btn-sm" onclick="alert('ID: '+d.id)">Ver</button>`
}
],
language: {
url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/es-ES.json'
}
});
});
</script>
</body>
</html>