<?php
session_start();

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

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

if ($op_id > 0) {
  $dal = new DAL();
  $sql = "SELECT id, " .
         "projectparcel_id, '' AS projectparcel_id_text, " .
         "1 AS completeInd, '' AS completeInd_text, " .
         "name,             '' AS name_text, " .
         "operationtype_id, '' AS operationtype_id_text " .
         "FROM operation WHERE id = $op_id LIMIT 1 ";
  $result = $dal->query($sql);
}

$_SESSION['definedoperation'] = $op_id;
$_SESSION['dailyoperation'] = 0;

echo json_encode($result);

?>

