-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrdersInterface.php
More file actions
68 lines (62 loc) · 2.49 KB
/
Copy pathOrdersInterface.php
File metadata and controls
68 lines (62 loc) · 2.49 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
65
66
67
68
<?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="addOrder.php">Agregar Producto</a>
<a href="principalBar.php">Atras</a>
<table border="1">
<tr>
<th>ID Pedido</th>
<th>ID Cliente</th>
<th>ID Producto</th>
<th>Costo del Pedido</th>
<th>Fecha de Orden</th>
<th>Estado del Pedido</th>
<th>Direccion de Envio</th>
<th>Fecha de Envio</th>
<th>Acciones</th>
</tr>
<?php
include 'db.php';
// Definir la consulta SQL
$sql = "SELECT * FROM pedidos";
// 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_pedido']; ?></td>
<td><?php echo $row['id_cliente']; ?></td>
<td><?php echo $row['id_producto']; ?></td>
<td><?php echo $row['costo_pedido']; ?></td>
<td><?php echo $row['fecha_pedido']; ?></td>
<td><?php echo $row['estado']; ?></td>
<td><?php echo $row['direccion_envio']; ?></td>
<td><?php echo $row['fecha_envio']; ?></td>
<td>
<a href="editOrder.php?id_pedido=<?php echo $row['id_pedido']; ?>">Editar</a> <br>
<a href="deleteOrder.php?id_pedido=<?php echo $row['id_pedido']; ?>" onclick="return confirm('¿Estás seguro de eliminar este producto?');">Eliminar</a><br>
</td>
</tr>
<?php
endwhile;
} else {
echo "<tr><td colspan='8'>No hay productos disponibles.</td></tr>";
}
?>
</table>
<?php $connection->close(); ?>
</body>
</html>