<?php

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

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

$dal = new DAL();

$sql = "SELECT POC.id,                POC.id AS fkid, " . 
       "POC.project_id,               '' AS project_id_text, " .
       "POC.project_id AS project_fk, '' AS project_fk_text, " .
       "POC.organizationcontact_id AS organizationcontact_fk, " .
                                     "'' AS organization_fk_text, " .
       "POC.contactype_id,            '' AS contactype_id_text, " .
       "PR.descr,                     '' AS descr_text, " .
       "PR.stage_id,                  '' AS stage_id_text, " .
       "PR.development_refno,         '' AS development_refno_text, " . 
       "PR.approver_id,               '' AS approver_text, " .
       "PR.department_id,             '' AS department_id_text, " .
       "PR.licence_no,                '' AS licence_no_text, " .
       "PR.note,                      '' AS note_text " .
       "FROM projectorganizationcontact POC, project PR " .
       "WHERE POC.id = $poc_id AND PR.id = POC.project_id LIMIT 1 ";
$result = $dal->query($sql);

echo json_encode($result);

?>

