<?php

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

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

$sql = "SELECT BO.id, BO.cardinal_id AS selValue, BO.descr AS inpValue " .
       "FROM operationspatialunit OS, spatialunit SU, bound BO, part P " .
       "WHERE OS.id = $os_id AND SU.id = OS.spatialunit_id " .
       "AND P.spatialunit_id = SU.id AND BO.part_id = P.id " ;
$result = $dal->query($sql);

echo json_encode($result);
?>

