<?php

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

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

$dal = new DAL();
$sql = "SELECT id,        loginworkday_id as sumid, " .
       "start_time,       '' AS start_time_text, " .
       "cloudcover_id,    '' AS cloudcover_id_text, " .
       "atmosphere_id,    '' AS atmosphere_id_text, " .
       "temperature,      '' AS temperature_text, " .
       "humidity,         '' AS humidity_text, " .
       "lighting_id,      '' AS lighting_id_text, " .
       "precipitation_id, '' AS precipitation_id_text " .
       "FROM weather WHERE id = $we_id LIMIT 1 ";
$result = $dal->query($sql);

echo json_encode($result);
      
?>
