2 include_once("../globals.php");
3 include_once("$srcdir/log.inc");
8 <link rel
=stylesheet href
="<?php echo $css_header;?>" type
="text/css">
11 <body
<?php
echo $top_bg_line;?
> topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
12 <font
class=title
><?php
xl('Logs Viewer','e'); ?
></font
>
16 $form_user = $_REQUEST['form_user'];
18 $res = sqlStatement("select distinct LEFT(date,10) as date from log order by date desc limit 30");
19 for($iter=0;$row=sqlFetchArray($res);$iter++
) {
23 // Get the users list.
24 $ures = sqlStatement("SELECT username, fname, lname FROM users " .
25 "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " .
26 "ORDER BY lname, fname");
30 <FORM METHOD
="GET" name
=the_form
>
31 <span
class=text
><?php
xl('Date','e'); ?
>: </span
>
34 $getdate = $_GET["date"] ?
$_GET["date"] : date("Y-m-d");
37 foreach ($ret as $iter) {
38 echo "<option value='{$iter["date
"]}'";
39 if (!$found && substr($iter["date"],0,10) == $getdate) {
43 echo ">{$iter["date
"]}</option>\n";
46 echo "<option value='$getdate'";
48 echo ">$getdate</option>\n";
53  
; 
;<span
class='text'><?php
xl('User','e'); ?
>: </span
>
56 echo "<select name='form_user'>\n";
57 echo " <option value=''>" . xl('All') . "</option>\n";
58 while ($urow = sqlFetchArray($ures)) {
59 if (!trim($urow['username'])) continue;
60 echo " <option value='" . $urow['username'] . "'";
61 if ($urow['username'] == $form_user) echo " selected";
62 echo ">" . $urow['lname'];
63 if ($urow['fname']) echo ", " . $urow['fname'];
68 $res = sqlStatement("select distinct event from log order by event ASC");
71 echo " <span class=text>";
72 for($iter=0;$row=sqlFetchArray($res);$iter++
) {
74 <input type
="radio" name
="event" value
="<?php echo $row["event
"];?>"
76 if ($row["event"] == $_GET["event"]) {
81 ><?
echo $row["event"]?
> 
; 
;
86 <input type
="radio" name
="event" value
="*"<?php
if (!$found) echo " checked";?
>><?php
xl('All','e'); ?
>
88 <a href
="javascript:document.the_form.submit();" class=link_submit
>[<?php
xl('Refresh','e'); ?
>]</a
>
93 <TABLE BORDER
=1 CELLPADDING
=4>
95 <TD
><span
class=bold
><?php
xl('Date'); ?
></span
></TD
>
96 <TD
><span
class=bold
><?php
xl('Event','e'); ?
></span
></TD
>
97 <TD
><span
class=bold
><?php
xl('User','e'); ?
></span
></TD
>
98 <TD
><span
class=bold
><?php
xl('Group','e'); ?
></span
></TD
>
99 <TD
><span
class=bold
><?php
xl('Comments','e'); ?
></span
></TD
>
102 if ($ret = getEventByDate($getdate, $form_user)) {
106 $gev = $_GET["event"];
107 foreach ($ret as $iter) {
108 if (($gev == "*") ||
($gev == $iter["event"])) {
111 <TD nowrap
><span
class=text
><?php
echo $iter["date"]?
></span
></TD
>
112 <TD
><span
class=text
><?php
echo $iter["event"]?
></span
></TD
>
113 <TD
><span
class=text
><?php
echo $iter["user"]?
></span
></TD
>
114 <TD
><span
class=text
><?php
echo $iter["groupname"]?
></span
></TD
>
115 <TD
><span
class=text
><?php
echo $iter["comments"]?
></span
></TD
>