<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "id") 
    $lo_id = $paramValue;  
  else if ($paramName == "lotinterpret_id") 
    $lotinterpret_id = $paramValue;  
  else if ($paramName == "rationale") 
    $rationale = $paramValue;  
  else if ($paramName == "lottype_id") 
    $lottype_id = $paramValue;  
  else if ($paramName == "note") 
    $note_id = $paramValue;  
}

$dal = new DAL();

$sql = "UPDATE lot SET lottype_id=$lottype_id, " .
       "rationale='$rationale',  lotinterpret_id=$lotinterpret_id, note='$note' " .
       "WHERE id = $lo_id " ;
$result = $dal->query($sql);
    
echo json_encode($lo_id);

?>

