<?php
session_start();

require_once($_SERVER['DOCUMENT_ROOT'] . '/sys/db.php');

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selid")
    $su_id = $paramValue;
}

$dal = new DAL();

$sql = "SELECT id, name AS ptp_name, mapareaid AS ptp_location " .
       "FROM spatialunit WHERE id = $su_id LIMIT 1 " ; 
$result = $dal->query($sql);

$_SESSION['spatialunit'] = $su_id;

echo json_encode($result);

?>

