flujo de pedido y pago

This commit is contained in:
Brisa
2026-06-30 14:58:06 -03:00
parent bc733c827d
commit 53e1b84cb0
3 changed files with 282 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
ob_start();
include("db.php");
ob_clean();
$query = "SELECT id, mensaje, fecha_publicacion
FROM promociones
WHERE fecha_publicacion >= NOW() - INTERVAL 1 DAY
ORDER BY id DESC LIMIT 1";
$resultado = mysqli_query($conexion, $query);
$promo = null;
if ($fila = mysqli_fetch_assoc($resultado)) {
$promo = [
'id' => (int)$fila['id'],
'mensaje' => $fila['mensaje'],
'fecha' => $fila['fecha_publicacion']
];
}
header('Content-Type: application/json');
echo json_encode($promo);
exit();
?>