<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "currid")
    $su_id = $paramValue;
  else if ($paramName == "scopeid")
    $pwo_id = $paramValue;
}
  
$dal = new DAL();

$sql = "SELECT PF.id, PF.name " .
       "FROM parcelfop PF, parcel PA, projectworkday PW, projectworkdayoperation PWO  " .
       "WHERE PWO.id = $pwo_id AND PWO.projectworkday_id = PW.id " .
       "AND PW.parcel_id = PA.id AND PF.parcel_id = PA.id" ;
$result = $dal->query($sql);

echo json_encode($result);
?>

