<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selid")
    $pr_id = $paramValue;
}
  
$dal = new DAL();

$sql = "SELECT RP.relatedproject_id as id, 1 AS addValue, " .
       "CONCAT (PR.refno, ': ', PR.name) AS inpValue " .
       "FROM relatedproject RP, project PR " .
       "WHERE RP.project_id = $pr_id AND PR.id = RP.project_id " ;
$result = $dal->query($sql);

echo json_encode($result);
?>

