<?php

$house_id = $_GET['id'];
$house_sql = 'SELECT v.id, h.name, u.user_login as phone, v.date, v.time, v.consultant_id as consultant_id, v.handle, v.handle_date FROM tospur_view_house v '
    . 'left join tospur_house h on v.house_id = h.id '
    . 'left join wp_users u on v.user_id = u.id '
    . 'where v.id = ' . $house_id;
$consultant_sql = 'SELECT u.id,u.display_name FROM wp_users u '
    . 'left join wp_usermeta m on u.id=m.user_id where meta_key="wp_user_level" and meta_value=7;';

global $wpdb;

$context['house_result'] = $wpdb->get_row($house_sql);
$context['consultant_result'] = $wpdb->get_results($consultant_sql);

$context['url'] = home_url();
$context['id'] = $house_id;

Timber::render('views/handle.html', $context);

?>