<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "previd") 
    $prev_op_id = $paramValue;  
  if ($paramName == "newid") 
    $new_op_id = $paramValue;  
  else if ($paramName == "val") 
    $op_name = $paramValue;  
}

$dal = new DAL();

$sql = "UPDATE operation SET name='$op_name' " .
       "WHERE id = $new_op_id ";
$result = $dal->query($sql);


echo json_encode($op_name);

?>

