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

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

if ($ip_id > 0) {
  $dal = new DAL();
  $sql = "SELECT id,       instrument_id AS id_attr, " .
         "instrument_id, 0 AS instrument_id_attr, " . 
         "period,        '' AS period_attr, " .
         "change,        '' AS change_attr " .
         "FROM instrperform WHERE id = $ip_id LIMIT 1 " ;
  $result = $dal->query($sql);
}

$_SESSION['instrperform'] = $ip_id;

echo json_encode($result);

?>

