<?php
session_start();

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

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

$_SESSION["instrument"] = $in_id;

$dal = new DAL();
$sql = "SELECT IP.id, descr AS 'Period', changepct AS 'Change' " . 
       "FROM instrperform IP, instrperiod IR " .
	   "WHERE instrument_id = $in_id AND IR.id = IP.perfperiod_id " ;
$result = $dal->query($sql);

echo json_encode($result);

?>

