<?php
session_start();

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

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

$dal = new DAL();
$sql = "SELECT PF.id,     PF.parcel_id AS fkid, " .
       "PF.id AS name_id, FO.name AS name_id_text, " .
       "FO.foptype_id,    FO.foptype_id AS foptype_id_text, " .
       "FO.mapareaid,     FO.mapareaid AS mapareaid_text, " .
       "PF.note,          PF.note AS note_text, " .
       "PF.field_descr,   PF.field_descr AS field_descr_text, " .
       "PF.office_descr,  PF.office_descr AS office_descr_text, " .
       "PF.fieldefined,   PF.fieldefined AS fieldefined_text " .
       "FROM parcelfop PF, fop FO " .
       "WHERE PF.id = $pf_id AND FO.id = PF.fop_id LIMIT 1 ";
$result = $dal->query($sql);

echo json_encode($result);

?>

