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

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

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

echo json_encode($result);

?>

