<?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 PG.id, PG.geomorphology_id, PG.name AS text " .
       "FROM part P, partgeomorphology PG, geomorphology GE " .
       "WHERE P.spatialunit_id = $su_id AND PG.part_id = P.id " .
       "AND GE.id = PG.partgeomorphology_id " ;
$result = $dal->query($sql);

echo json_encode($result);
?>

