<?php

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

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

$dal = new DAL();
$sql = "SELECT RS.id, RS.includeheader, RS.repfilename " .
       "FROM reportquerysetup RS, reportquery RQ " .
       "WHERE RQ.id = $rq_id AND RQ.reportquerysetup_id = RS.id LIMIT 1 " ;
$result = $dal->query($sql);

echo json_encode($result);

?>

