forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.inc
37 lines (25 loc) · 769 Bytes
/
log.inc
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
34
35
36
37
<?php
require_once("{$GLOBALS['srcdir']}/sql.inc");
function newEvent($event,$user, $groupname, $comments="")
{
$adodb = $GLOBALS['adodb']['db'];
if($event == ("login" || "logout" || "backup" || "view" || "auth" || "upload"))
{
$sql = "insert into log (date, event, user, groupname, comments) values (NOW(), " . $adodb->qstr($event) . "," . $adodb->qstr($user) . "," . $adodb->qstr($groupname) . "," .$adodb->qstr($comments) . ")";
return sqlInsertClean($sql);
}
else
{
return false;
}
}
function getEventByDate($date, $cols = "*")
{
$res = sqlStatement("select $cols from log where date like '%$date%' order by date DESC");
for($iter=0; $row=sqlFetchArray($res); $iter++)
{
$all[$iter] = $row;
}
return $all;
}
?>