14 include_once (
"WHAT/Lib.Common.php");
20 $r[
"date"] = date(
"Y-m-d H:i:s");
21 $r[
"delay"] = $nextdelay;
22 if ($date && $date !=
"null") {
23 $sql = sprintf(
"select * from doclog where level=4 and date >= '%s' and date < '%s' limit %d", pg_escape_string($date) , pg_escape_string(
$r[
"date"]) , $limit);
26 $result = @pg_query(
$c,
$sql);
28 $nbrows = pg_numrows($result);
30 $r[
"notifications"] = pg_fetch_all($result);
31 foreach (
$r[
"notifications"] as $k => $v)
if ($v[
"arg"])
$r[
"notifications"][$k][
"arg"] = unserialize($v[
"arg"]);
34 $r[
"error"] = pg_last_error(
$c);
38 return json_encode(
$r);