<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "projectworkday_fk")
    $pw_id = $paramValue;
  else if ($paramName == "operation_fk")
    $op_id = $paramValue;
}

$dal = new DAL();
$sql = "SELECT id FROM projectworkdayoperation " .
       "WHERE projectworkday_id = $pw_id AND operation_id = $op_id LIMIT 1 " ;
$pwo_id = $dal->query($sql)->id;

if (null === $pwo_id)
  $pwo_id = 0;

echo json_encode($pwo_id);

?>

