some cosmetic improvements and more helpful explanations of globals.php parameters
[openemr.git] / library / log.inc
blob11b4f546ad2a8e81f73f77b19a472946151ea1d6
1 <?php
2         require_once("{$GLOBALS['srcdir']}/sql.inc");
4         function newEvent($event,$user, $groupname, $comments="")
5         {
6                 $adodb = $GLOBALS['adodb']['db'];
7                 if($event == ("login" || "logout" || "backup" || "view" || "auth" || "upload"))
8                 {
9                         $sql = "insert into log (date, event, user, groupname, comments) values (NOW(), " . $adodb->qstr($event) . "," . $adodb->qstr($user) . "," . $adodb->qstr($groupname) . "," .$adodb->qstr($comments) . ")";
10                         return sqlInsertClean($sql);
11                 }
13                 else
14                 {
15                         return false;
16                 }
17         }
19 function        getEventByDate($date, $cols = "*")
20         {
21                 $res = sqlStatement("select $cols from log where date like '%$date%' order by date DESC");
23                 for($iter=0; $row=sqlFetchArray($res); $iter++)
24                 {
25                         $all[$iter] = $row;
26                 }
28                 return $all;
29         }