<?php

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

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

$sql = "SELECT BO.id, BO.cardinal_id AS selValue, BO.descr AS inpValue " .
       "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);
?>

