<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selid")
	$fh_id = $paramValue;
}

$dal = new DAL();
$sql = "SELECT id, controlinstance_id, property, value, " .
       "mandatory, uniquekey, confirm " .
       "FROM controlentry CE, controlform CF " .
       "WHERE CF.formhandler_id = $fh_id " .
       "AND CE.id = CF.controlinstance_id " ;
$result = $dal->query($sql);

echo json_encode($result);

?>

