<?php
require_once('../../../'.$_REQUEST['tenant'].'/config.php');

// Fetch active surveyors
$sql = "SELECT id, forename, surname FROM surveyor WHERE statuslive = 1";
$result = $con->query($sql);
$surveyors = [];

while ($row = $result->fetch_assoc()) {
    $surveyors[] = $row;
}

echo json_encode(['surveyors' => $surveyors]);
?>