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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "scopeid")
    $pwo_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 operationspatialunit OS, spatialunit SU " .
       "WHERE OS.projectworkdayoperation_id = $pwo_id " .
       "AND SU.id = OS.spatialunit_id AND SU.spatialunittype_id = 2 " ; 
$result = $dal->query($sql);

echo json_encode($result);

?>

