<?php

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

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

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

  $sql = "SELECT id,        0 AS fkid, " . 
         "surname,          '' AS surname_text, " .
         "firstname,        '' AS firstname_text, " .
         "middlename,       '' AS middlename_text, " .
         "title,            '' AS title_text " .
         "FROM contact WHERE id = $co_id LIMIT 1 ";
  $result = $dal->query($sql);
}

echo json_encode($result);

?>

