<?php
session_start();

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

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

$dal = new DAL();

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

$_SESSION['spatialunit'] = $su_id;

echo json_encode($result);

?>

