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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selid")
    $cu_id = $paramValue;
}

$dal = new DAL();

$sql = "SELECT CU.id, name as site_name, descr as site_descr, mapareaid, " .
       "location as site_location, longaxis, shortaxis, orientation_id, " .
       "planshape_id, interpret_id, rationale as rationale_note, " .
       "note as cultunitnote, topography_id, bordenizable, bordenrationale_id, " .
       "stg2recommendation, recommendrationale_id " .
       "FROM culturalunit CU, site SI " .
       "WHERE CU.id = $cu_id AND SI.culturalunit_id = CU.id LIMIT 1";
$result = $dal->query($sql);
 
echo json_encode($result);

?>

