<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "id")
    $relatedlot_id = $paramValue;
  elseif ($paramName == "currid") 
    $sl_id = $paramValue;  
  elseif ($paramName == "val") 
    $re_id = $paramValue;  
}

$dal = new DAL();

$st_id = hexdec(uniqid());
 
$sql = "INSERT INTO stratigraphy " .
       "(id, spatialunitlot_id, relatedlot_id, relationship_id) " .
       "VALUES ($st_id, $sl_id, $relatedlot_id, $re_id) ";
$result = $dal->query($sql);

echo json_encode($result);

?>

