18 lines
473 B
PHP
18 lines
473 B
PHP
<?php
|
|
include 'conexion.php';
|
|
$datos = json_decode(file_get_contents("php://input"), true);
|
|
|
|
$error = false;
|
|
foreach ($datos as $h) {
|
|
$dia = $h['dia'];
|
|
$ape = $h['ape'];
|
|
$cie = $h['cie'];
|
|
|
|
$sql = "UPDATE horarios SET Hora_Apertura = '$ape', Hora_Cierre = '$cie' WHERE Dia = '$dia'";
|
|
if (!mysqli_query($conexion, $sql)) {
|
|
$error = true;
|
|
}
|
|
}
|
|
|
|
echo $error ? "Error al actualizar algunos horarios" : "Horarios actualizados correctamente";
|
|
?>
|