<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "currid")
    $su_id = $paramValue;
}
  
$dal = new DAL();

$sql = "SELECT BO.id, BO.cardinal_id AS select_id, BO.descr AS text " .
       "FROM part P, bound BO " .
       "WHERE P.spatialunit_id = $su_id AND BO.part_id = P.id " ;
$result = $dal->query($sql);

echo json_encode($result);
?>

