<?php

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

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

$dal = new DAL();
$sql = "SELECT CI.id, SPACE(0) AS 'select', instance, location, CC.control  " .
       "FROM controlinit CI, controlconfig CC " .
       "WHERE CI.controlconfig_id = CC.id AND CI.active = 1 " .
       "ORDER BY CC.control, CI.location ";
$result = $dal->query($sql);

echo json_encode($result);

?>

