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

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

$dal = new DAL();
      
$sql = "SELECT SU.id, SU.name AS 'Test-pit Name', space(1) AS Lots, " .
       "space(1) AS 'Total Artifacts' " .
       "FROM sitespatialunit SS, operationspatialunit OS, spatialunit SU " .
       "WHERE SS.culturalunit_id = $cu_id " .
       "AND OS.id = SS.operationspatialunit_id AND SU.id = OS.spatialunit_id " .
       "AND SU.spatialunittype_id = 5 "; 
$result = $dal->query($sql);

echo json_encode($result);

?>

