<?php

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

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

if ($oc_id > 0) {
  $dal = new DAL();

  $sql = "SELECT OC.id,                          OC.id AS fkid, " . 
         "OC.contact_id AS contact_fk,           '' AS contact_fk_text, " .
         "OC.organization_id AS organization_fk, '' AS organization_fk_text, " .
         "OC.address_id AS address_fk,           '' AS address_fk_text, " .
         "OC.note,                               '' AS note_text, " .
         "OC.email,                              '' AS email_text, " .
         "OC.login,                              '' AS login_text, " .
         "OC.password,                           '' AS password_text  " .
         "FROM organizationcontact OC " .
         "WHERE OC.id = $oc_id  " .
         "LIMIT 1 ";
  $result = $dal->query($sql);
}

echo json_encode($result);

?>

