<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "project_fk")
    $pr_id = $paramValue;
  else if ($paramName == "organizationcontact_fk")
    $oc_id = $paramValue;
}

$dal = new DAL();
$sql = "SELECT id FROM projectorganizationcontact " .
       "WHERE project_id = $pr_id AND organizationcontact_id = $oc_id LIMIT 1 " ;
$poc_id = $dal->query($sql)->id;
if (null === $poc_id)
  $poc_id = 0;

echo json_encode($poc_id);

?>

