
<?php 

header('Access-Control-Allow-Origin: *');

include('../conectardb.php');

include("timezone.php");
  
  if(isset($_POST['estado_rsv'])){  
   
    $query = 'SELECT * FROM reserva_online where estado_rsv = 0 and fecha_ing >=\''.$fecha_hoy.'\'';
    
   if (!$result = mysqli_query($conexion, $query)) {
        exit(mysqli_error());
    }
    $response = array();
    if(mysqli_num_rows($result) > 0) {
        while ($row = mysqli_fetch_array($result)) {
            $response = $row;
        }
    }
    else
    {
        $response['status'] = 505; 
    }
    
  }
  else
  {
      $response['status'] = 200;
      $response['message'] = "Sin Información!";
      echo 3;
  }

    // display JSON data
    echo json_encode($response);

mysqli_close($conexion);
?>
