<?php
	// required headers
	header("Access-Control-Allow-Origin: *");
	header("Content-Type: application/json; charset=UTF-8");
	 
	// include database and object files
	include_once '../config/database.php';
	include_once '../objects/room_type.php';
	 
	// instantiate database
	$database = new Database();
	$db = $database->getConnection();
	 
	$room_type = new RoomType($db);
	$data = json_decode(file_get_contents("php://input"));
	$room_type->id=$data->id;
	$room_type->getOneRow();

	$room_type=array(
		"id" =>$room_type->id,
		"room_type" =>$room_type->room_type,
		"description" =>$room_type->description,
		"room_rate" =>$room_type->room_rate,
		"max_occupancy" =>$room_type->max_occupancy,
		"amenities" =>$room_type->amenities,
		"extra_bed_rate" =>$room_type->extra_bed_rate
	);

	echo json_encode($room_type);
?>