<?php

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

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

$sql = "SELECT OCT.id, OCT.telnotype AS selValue, " .
       "TN.value AS inp1Value, TN.exten AS inp2Value " .
       "FROM organizationcontactelno OCT, telno TN " .
       "WHERE OCT.organizationcontact_id = $oc_id " .
       "AND TN.id = OCT.telno_id AND OCT.active = 1 ";
$result = $dal->query($sql);

echo json_encode($result);
?>

