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

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

$dal = new DAL();
       
$sql = "SELECT AB.id, AF.descr AS Affiliation, MA.descr AS Material, FO.descr AS Form, " .
       "diagnostic, collectcount, docucount " .
       "FROM artifactbatch AB, affiliation AF, material MA, form FO " .
       "WHERE AB.bag_id = $ba_id AND AF.id = AB.affiliation_id " .
       "AND MA.id = AB.material_id AND FO.id = AB.form_id ";
$result = $dal->query($sql);;

echo json_encode($result);

?>

