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

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

if ($in_id > 0) {
  $dal = new DAL();
  $sql = "SELECT IN.id,      type_id AS id_attr, " .
         "type_id,           '' AS type_id_attr, " .
         "name,              '' AS name_attr, " .
         "1 AS complete_ind, '' AS complete_ind_attr " .
         "FROM instrument WHERE id = $in_id LIMIT 1 " ;
  $result = $dal->query($sql);
}

$_SESSION['instrument'] = $in_id;

echo json_encode($result);

?>

