function checkForCalendar()
{
    $roomControl = new RoomControl();
    $not_available_dates = array();
    $maxDate = $roomControl->getMaxAvailableDate($_REQUEST['hotel_id']);
    $rc_in_date = date("Y-m-d", time());
    $rc_out_date = date("Y-m-d", strtotime("+12 months"));
    if (count($maxDate) > 0) {
        if ($maxDate[0]['maxDate'] != "") {
            $rc_out_date = date("Y-m-d", strtotime($maxDate[0]['maxDate']));
        }
    }
    foreach (Common::createDateRangeArray($rc_in_date, $rc_out_date) as $k => $v) {
        $roomData = $roomControl->getAvailableRoomCountForHotelForDate($v, $_REQUEST['hotel_id']);
        $assignedRooms = $roomControl->getAssignedRoomCountForHotelForDate($v, $_REQUEST['hotel_id']);
        $checkInCheckOut = $roomControl->getIfCheckInOutAvailableForHotelForDate($v, $_REQUEST['hotel_id']);
        if (count($assignedRooms) > 0) {
            if ($assignedRooms[0]['num_of_rooms'] > 0) {
                $assignedRooms = $assignedRooms[0]['num_of_rooms'];
            } else {
                $assignedRooms = 0;
            }
        } else {
            $assignedRooms = 0;
        }
        if (count($checkInCheckOut) > 0) {
            if ($checkInCheckOut[0]['reservation_count'] > 1) {
                if ($checkInCheckOut[0]['reserved_rooms'] / $checkInCheckOut[0]['reservation_count'] < $assignedRooms) {
                    $checkInCheckOut = false;
                } else {
                    $checkInCheckOut = true;
                }
            } else {
                $checkInCheckOut = false;
            }
        } else {
            $checkInCheckOut = false;
        }
        if (count($roomData) > 0) {
            if ($roomData[0]['available_rooms'] > 0) {
                //array_push($not_available_dates, $v);
                $not_available_dates[$v] = $checkInCheckOut;
            }
        }
    }
    echo json_encode($not_available_dates);
}