"Fossies" - the Fresh Open Source Software Archive 
Member "eventh/tnadmin/history.php" (22 Aug 2007, 9197 Bytes) of package /linux/privat/old/eventh-1.1.11.tar.gz:
The requested HTML page contains a <FORM> tag that is unusable on "Fossies" in "automatic" (rendered) mode so that page is shown as HTML source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file. For more information about "history.php" see the
Fossies "Dox" file reference documentation.
1 <?
2 /*
3 This file is part of Event Horizon (EVH).
4
5 EVH is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 EVH is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 include "../inc.php";
20 ?>
21 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
22 <html>
23 <head>
24 <title><?=$appname; ?> - Admin</title>
25 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
26 <link href="../default.css" rel="stylesheet" type="text/css">
27 <script language="JavaScript" type="text/JavaScript">
28 <!--
29 function MM_goToURL() { //v3.0
30 var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
31 for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
32 }
33 //-->
34 </script>
35 </head>
36 <body>
37 <?=$titleandmenu; ?>
38 <form action="history.php" method="post" enctype="multipart/form-data" name="form1">
39 <input name="ba" type="hidden" id="ba" value="1">
40 <table width="500" border="0" align="center" cellpadding="3" cellspacing="1" class="border">
41 <tr>
42 <th align="left" valign="top" nowrap class="header" scope="row" colspan="5"><center>Filtering</center></th>
43 </tr>
44 <tr>
45 <th align="left" valign="top" nowrap class="content" scope="row">Date (YYYY-MM-DD)<br>
46 <input name="searchdate" type="text" value="<? if (isset($searchdate) && $_SERVER['REQUEST_METHOD'] != 'GET') echo $searchdate; else echo $mydate; ?>" size="12" maxlength="12" id="searchdate"><br>to<br>
47 <input name="searchdate2" type="text" value="<? if (isset($searchdate2) && $_SERVER['REQUEST_METHOD'] != 'GET') echo $searchdate2; else echo $mydate; ?>" size="12" maxlength="12" id="searchdate2"></th>
48 <th align="left" valign="top" nowrap class="content" scope="row">Type<br>
49 <select name="type" id="type">
50 <option value="" selected></option>
51 <option value="upload" <? if (isset($type) && $type == 'upload') echo 'selected'; ?>>upload</option>
52 <option value="download" <? if (isset($type) && $type == 'download') echo 'selected'; ?>>download</option>
53 <option value="modify" <? if (isset($type) && $type == 'modify') echo 'selected'; ?>>modify</option>
54 <option value="delete" <? if (isset($type) && $type == 'delete') echo 'selected'; ?>>delete</option>
55 <option value="expired" <? if (isset($type) && $type == 'expired') echo 'selected'; ?>>expired</option>
56 </select></th>
57 <th align="left" valign="top" nowrap class="content" scope="row">Filename<br>
58 <input name="filename" type="text" value="<? if (isset($filename)) echo $filename; ?>" size="20" maxlength="20" id="filename"></th>
59 <th align="left" valign="top" nowrap class="content" scope="row">Source IP<br>
60 <input name="srcip" type="text" value="<? if (isset($srcip)) echo $srcip; ?>" size="20" maxlength="20" id="srcip"></th>
61 <th align="left" valign="top" nowrap class="content" scope="row">Email<br>
62 <input name="email" type="text" value="<? if (isset($email)) echo $email; ?>" size="20" maxlength="20" id="email"></th>
63 </tr>
64 <tr>
65 <td align="left" valign="top" nowrap class="content" scope="row" colspan="3"><strong>Show:</strong><br>
66 <input name="showdate" type="checkbox" value="1" <? if (! isset($showdate) && $_SERVER['REQUEST_METHOD'] != 'GET') echo ''; else echo 'checked'; ?>> Date<br>
67 <input name="showtype" type="checkbox" value="1" <? if (! isset($showtype) && $_SERVER['REQUEST_METHOD'] != 'GET') echo ''; else echo 'checked'; ?>> Type<br>
68 <input name="showfile" type="checkbox" value="1" <? if (! isset($showfile) && $_SERVER['REQUEST_METHOD'] != 'GET') echo ''; else echo 'checked'; ?>> Filename<br>
69 <input name="showip" type="checkbox" value="1" <? if (! isset($showip) && $_SERVER['REQUEST_METHOD'] != 'GET') echo ''; else echo 'checked'; ?>> Source IP<br></td>
70 <td align="left" valign="top" nowrap class="content" scope="row" colspan="2"><strong> </strong><br>
71 <input name="showsrcemail" type="checkbox" value="1" <? if (! isset($showsrcemail) && $_SERVER['REQUEST_METHOD'] != 'GET') echo ''; else echo 'checked'; ?>> Source Email<br>
72 <input name="showdstemail" type="checkbox" value="1" <? if (! isset($showdstemail) && $_SERVER['REQUEST_METHOD'] != 'GET') echo ''; else echo 'checked'; ?>> Destination Email<br>
73 <input name="showbrowser" type="checkbox" value="1" <? if (! isset($showbrowser)) echo ''; else echo 'checked'; ?>> Browser<br></td>
74 </tr>
75 <tr>
76 <td align="left" valign="top" nowrap class="content" scope="row" colspan="5">
77 <div align="right"><input name="Submit" type="submit" value="Submit"></div></td>
78 </tr>
79 </table>
80
81 </form>
82 <br>
83 <table width="500" border="0" align="center" cellpadding="3" cellspacing="1" class="border">
84 <tr>
85 <? if (isset($showdate) && $showdate == 1) { ?>
86 <th align="left" valign="top" nowrap class="header" scope="row">Date</th>
87 <? }
88 if (isset($showtype) && $showtype == 1) { ?>
89 <th align="left" valign="top" nowrap class="header" scope="row">Type</th>
90 <? }
91 if (isset($showfile) && $showfile == 1) { ?>
92 <th align="left" valign="top" nowrap class="header" scope="row">File</th>
93 <? }
94 if (isset($showip) && $showip == 1) { ?>
95 <th align="left" valign="top" nowrap class="header" scope="row">Source IP</th>
96 <? }
97 if (isset($showsrcemail) && $showsrcemail == 1) { ?>
98 <th align="left" valign="top" nowrap class="header" scope="row">From</th>
99 <? }
100 if (isset($showdstemail) && $showdstemail == 1) { ?>
101 <th align="left" valign="top" nowrap class="header" scope="row">To</th>
102 <? }
103 if (isset($showbrowser) && $showbrowser == 1) { ?>
104 <th align="left" valign="top" nowrap class="header" scope="row">Browser</th>
105 <? } ?>
106 </tr>
107 <?
108 $querystart = 'select * from History where';
109 $querymid = '';
110
111 if (isset($searchdate) && $searchdate != '' && (! isset($searchdate2) || $searchdate2 == '')) $querymid .= ' and moddate >= "' . $searchdate . '"';
112 elseif (isset($searchdate) && $searchdate != '' && isset($searchdate2) && $searchdate2 != '') $querymid .= ' and moddate between "' . $searchdate . '" and "' . $searchdate2 . '"';
113 elseif (isset($searchdate2) && $searchdate2 != '' && (! isset($searchdate) || $searchdate == '')) $querymid .= ' and moddate <= "' . $searchdate2 . '"';
114 //if (isset($searchdate2) && $searchdate2 != '') $querymid .= ' and moddate between "' . $searchdate . '" and "' . $searchdate2 . '"';
115 //elseif (isset($searchdate) && $searchdate != '') $querymid .= ' and moddate = "' . $searchdate . '"';
116 if (isset($type) && $type != '') $querymid .= ' and type = "' . $type . '"';
117 if (isset($filename) && $filename != '') $querymid .= ' and filename like "%' . $filename . '%"';
118 if (isset ($srcip) && $srcip != '') $querymid .= ' and srcip like "%' . $srcip . '%"';
119 if (isset($email) && $email != '') $querymid .= ' and (srcemail like "%' . $email . '%" or dstemail like "%' . $email . '%")';
120
121 if ($querymid == '') $querymid = ' and moddate = "' . $mydate . '"'; // needs "and" part or the below substr command will fail;
122
123 $queryend = ' order by id';
124 $querymid = ' ' . substr($querymid,strpos($querymid,'and ')+4);
125 $query = $querystart . $querymid . $queryend;
126
127 $res = mysql_query($query,$dbh) or die("<p><b>A fatal database error occured</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
128
129 while ($row = mysql_fetch_row($res)) {
130 ?>
131 <tr>
132 <? if (isset($showdate) && $showdate == 1) { ?>
133 <td align="left" valign="top" nowrap class="content" scope="row" width="100"><?=$row[1]; ?></td>
134 <? }
135 if (isset($showtype) && $showtype == 1) { ?>
136 <td align="left" valign="top" nowrap class="content" scope="row" width="100"><?=$row[3]; ?></td>
137 <? }
138 if (isset($showfile) && $showfile == 1) { ?>
139 <td align="left" valign="top" nowrap class="content" scope="row"><?=$row[5]; ?></td>
140 <? }
141 if (isset($showip) && $showip == 1) { ?>
142 <td align="right" valign="top" nowrap class="content" scope="row"><?=$row[2]; ?></td>
143 <? }
144 if (isset($showsrcemail) && $showsrcemail == 1) { ?>
145 <td align="left" valign="top" nowrap class="content" scope="row"><?=$row[6]; ?></td>
146 <? }
147 if (isset($showdstemail) && $showdstemail == 1) { ?>
148 <td align="left" valign="top" nowrap class="content" scope="row"><?=$row[7]; ?></td>
149 <? }
150 if (isset($showbrowser) && $showbrowser == 1) { ?>
151 <td align="right" valign="top" nowrap class="content" scope="row"><?=$row[4]; ?></td>
152 <? } ?>
153 </tr>
154 <?
155 }
156 ?>
157 </table>
158 <?
159 if (isset($ba) and $ba == 1) {
160 echo '<p align="center"><span class="content-text"><strong><a href=index.php>Back to admin page</a></strong></span></p>';
161 }
162
163 print $footer;
164 ?>
165
166 </body>
167 </html>