<?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  inclusion IC " .
       "LEFT JOIN lotcompositioninclusion LCI " .
       "ON LCI.inclusion_id = IC.id AND LCI.lotcomposition_id = $lc_id " .
       "WHERE IC.active = 1 AND LCI.id IS NULL " .
       "ORDER BY descr ";
$result = $dal->query($sql);

echo json_encode($result);

?>

