<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "role")
    $travelrole_id = $paramValue;
  elseif ($paramName == "id") 
    $pwp_id = $paramValue;  
  elseif ($paramName == "selid") 
    $tr_id = $paramValue;  
}

$dal = new DAL();
   
$sql = "UPDATE personneltravel SET travelrole_id='$travelrole_id' " .
       "WHERE projectworkdaypersonnel_id = $pwp_id AND travel_id = $tr_id " ;
$result = $dal->query($sql);

echo json_encode($result);

?>

