/adei/ui

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/ui
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
require("../adei.php");

header("Content-type: application/json");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");


try {
    $req = new DATARequest();
    $draw = $req->CreatePlotter();
    $legend = $draw->Legend();
} catch(ADEIException $ex) {
    $ex->logInfo(NULL, $draw);
    $error = $ex->getInfo();
}



if ($error) {
    echo json_encode(array("error" => $error));
} else {
    if ($draw) {
	echo json_encode(array_merge(array(
	    "error" => 0,
	), $legend));
    } else {
	echo json_encode(array("error" => 0));
    }
}


?>