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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "chkname")
    $project_name = $paramValue;
}

$dal = new DAL();

$sql = "SELECT id FROM project " .
       "WHERE name = '$project_name' ";
$result = $dal->query($sql);

if (null == $result)
  $next_project_name = $project_name;
else
  $next_project_name = "";

echo json_encode($next_project_name);

?>

