-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientsInterface.php
More file actions
64 lines (60 loc) · 2.31 KB
/
Copy pathClientsInterface.php
File metadata and controls
64 lines (60 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
session_start();
$id_nivel = $_SESSION['id_nivel'] ?? null;
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Gestión de Productos</title>
<link rel="stylesheet" href="cssFiles/TablesStyles.css">
<link rel="icon" href="images/web-logo.png" type="image/x-icon">
</head>
<body>
<h1>Sistema Operativo De Ventas</h1>
<a href="addClient.php">Agregar Cliente</a>
<a href="principalBar.php">Atras</a>
<table border="1">
<tr>
<th>ID</th>
<th>Nombre</th>
<th>Apellido</th>
<th>Direccion</th>
<th>Telefono</th>
<th>Correo</th>
<th>Registro</th>
<th>Acciones</th>
</tr>
<?php
include 'db.php';
// Definir la consulta SQL
$sql = "SELECT * FROM clientes";
// Ejecutar la consulta
$result = $connection->query($sql);
// Verificar si hay resultados
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()):
?>
<tr>
<td><?php echo $row['id_cliente']; ?></td>
<td><?php echo $row['nombre']; ?></td>
<td><?php echo $row['apellido']; ?></td>
<td><?php echo $row['direccion']; ?></td>
<td><?php echo $row['telefono']; ?></td>
<td><?php echo $row['email']; ?></td>
<td><?php echo $row['fecha_registro']; ?></td>
<td>
<a href="editClient.php?id_cliente=<?php echo $row['id_cliente']; ?>">Editar</a>
<a href="deleteClient.php?id_cliente=<?php echo $row['id_cliente']; ?>" onclick="return confirm('¿Estás seguro de eliminar a este usuario?');">Eliminar</a>
</td>
</tr>
<?php
endwhile;
} else {
echo "<tr><td colspan='8'>No hay Clientes registrados.</td></tr>";
}
?>
</table>
<?php $connection->close(); ?>
</body>
</html>