<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selectid")
    $lc_id = $paramValue;
}

$dal = new DAL();

$sql = "SELECT IC.id, IC.descr AS text " .
       "FROM lotcompositioninclusion LCI, inclusion IC " .
       "WHERE LCI.lotcomposition_id = $lc_id AND IC.id = LCI.inclusion_id " .
       "ORDER BY descr ";
$result = $dal->query($sql);

echo json_encode($result);

?>

