<?php
session_start();

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selectid")
    $pwo_id = $paramValue;
}

if ($pwo_id > 0) {
  $dal = new DAL();
  $sql = "SELECT id, " . 
         "operation_id,        '' AS operation_id_text, " .
         "projectworkevent_id, '' AS projectworkevent_id_text, " . 
         "startime,            '' AS startime_text, " .
         "breakdur,            '' AS breakdur_text, " .
         "stoptime,            '' AS stoptime_text, " .
         "duration,            '' AS duration_text " .
         "FROM projectworkdayoperation " .
         "WHERE id = $pwo_id LIMIT 1 ";
  $result = $dal->query($sql);
}

$_SESSION['dailyoperation'] = $pwo_id;

echo json_encode($result);

?>
