<?php

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

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

$sql = "SELECT OC.id, OCJ.title AS inpValue, OCJ.status_id AS addValue, " .
       "OCJ.date AS datValue " .
       "FROM organizationcontact OC, organizationcontactjobtitle OCJ " .
       "WHERE OC.id = $oc_id AND OCJ.organizationcontact_id = OC.id ";
$result = $dal->query($sql);

echo json_encode($result);
?>

