2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 function newEvent($event, $user, $groupname, $comments="") {
5 $adodb = $GLOBALS['adodb']['db'];
6 $sql = "insert into log ( date, event, user, groupname, comments ) " .
7 "values ( NOW(), " . $adodb->qstr($event) . "," . $adodb->qstr($user) .
8 "," . $adodb->qstr($groupname) . "," .$adodb->qstr($comments) . ")";
9 return sqlInsertClean($sql);
12 function getEventByDate($date, $user="",
13 $cols="DISTINCT date, event, user, groupname, comments")
15 $sql = "SELECT $cols FROM log WHERE date >= '$date 00:00:00' AND date <= '$date 23:59:59'";
16 if ($user) $sql .= " AND user LIKE '$user'";
17 $sql .= " ORDER BY date DESC LIMIT 5000";
18 $res = sqlStatement($sql);
19 for($iter=0; $row=sqlFetchArray($res); $iter++) {