<?php
//conexion a la BD
include("includes/conect.php");
$id = $_POST['id'];
// $result_areas = mysqli_query($conexion, 'SELECT area.id, area.id_rel_area, area.nombre, area_matriz.id_area_matriz, area_matriz.modalidad_reserva FROM area inner join area_matriz on area.id_rel_area = area_matriz.id_area_matriz where area.id = \''.$id.'\' ');
// $row_areas = mysqli_fetch_array($result_areas);
// echo $row_areas['modalidad_reserva'];

 

    // Get User Details
    // $query = "SELECT * FROM huesped WHERE id= '$id_huesped'";
    $query = 'SELECT area.id, area.id_rel_area, area.nombre, area_matriz.id_area_matriz, area_matriz.modalidad_reserva FROM area inner join area_matriz on area.id_rel_area = area_matriz.id_area_matriz where area.id = \''.$id.'\' ';
    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'] = 200;
        $response['message'] = "Sin Información!";
    }
    // display JSON data
    echo json_encode($response);


mysqli_free_result($result);
// mysqli_close($conexion);
?>