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

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

$dal = new DAL();
$sql = "SELECT PF.id, FO.name AS 'Feature Name', FT.descr AS 'Feature Type', " .
       "SF.location AS 'Location in Part' " .  
       "FROM spatialunitfop SF, parcelfop PF, fop FO, foptype FT " .
       "WHERE SF.spatialunit_id = $su_id AND PF.id = SF.parcelfop_id " .
       "AND FO.id = PF.fop_id AND FT.id = FO.foptype_id  " .
       "ORDER BY FO.name " ; 
$result = $dal->query($sql);

echo json_encode($result);

?>

