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

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

$dal = new DAL();
       
$sql = "SELECT LC.id, CP.descr AS Material, MU.descr AS Colour, " .
       "CM.descr AS Compaction " .
       "FROM lotcomposition LC, composition CP, " .
       "munselcolour MU, compaction CM " .
       "WHERE LC.lot_id = $lo_id AND CP.id = LC.composition_id " .
       "AND MU.id = LC.munselcolour_id AND CM.id = LC.compaction_id " .
       "ORDER BY LC.id " ;
$result = $dal->query($sql);

echo json_encode($result);

?>

