<?php

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

if (isset($_REQUEST["id"])) {
  $pw_id = $_REQUEST["id"];
}

$dal = new DAL();

$sql = "SELECT PE.id, " .
       "CONCAT (surname, ', ', firstname, ' ', middlename) as text " .
       "FROM  personnel PE " .
       "LEFT JOIN projectworkdaypersonnel PP " .
       "ON PE.id = PP.personnel_id " .
       "WHERE PP.personnel_id IS NULL " .
       "ORDER BY surname ";
$result = $dal->query($sql);

echo json_encode($result);

?>

