[Openfirst-cvscommit] logger index.php,1.2,1.3 logger.php,1.3,1.4 rawdata.php,1.4,1.5 reset.php,1.3,
Brought to you by:
xtimg
From: <xt...@us...> - 2003-06-28 15:23:51
|
Update of /cvsroot/openfirst/logger In directory sc8-pr-cvs1:/tmp/cvs-serv10033 Modified Files: index.php logger.php rawdata.php reset.php track.php Log Message: Modify logger to meet openFIRST coding standards, fix minor error include file Index: index.php =================================================================== RCS file: /cvsroot/openfirst/logger/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.php 21 Jun 2003 12:42:44 -0000 1.2 --- index.php 28 Jun 2003 15:23:48 -0000 1.3 *************** *** 27,64 **** */ ! include("../config/globals.php"); include("$header"); ! mysql_select_db($sqldatabase,$sqlconnection); ! ! ! ! if (ISSET($_POST['view'])){ ! ! $min = $_POST['min']; ! ! $max = $_POST['max']; ! ! }else{ ! ! $min = 0; ! ! $max = 50; ! } - - - if (ISSET($_GET['DELETE'])){ - - mysql_query("DELETE FROM ofirst_logger WHERE IPAddress = '".$_GET['DELETE']."'") or die(mysql_error()); } - - $query = mysql_query("SELECT * FROM ofirst_logger GROUP BY IPAddress LIMIT $min,$max"); $amount = mysql_num_rows($query); --- 27,50 ---- */ ! include("../config/globals.php"); include("$header"); ! if (isset($_POST['view'])) { ! $min = $_POST['min']; ! $max = $_POST['max']; ! } else { ! $min = 0; ! $max = 50; } + if (isset($_GET['DELETE'])) { + mysql_query("DELETE FROM ofirst_logger WHERE IPAddress = '".$_GET['DELETE']."'") or die(mysql_error()); } + $query = mysql_query("SELECT * FROM ofirst_logger GROUP BY IPAddress LIMIT $min,$max"); $amount = mysql_num_rows($query); *************** *** 67,141 **** <h1>View Log Information</h1> ! <p>[ <a href="./">Track User Movement </a>] [<a href="rawdata.php"> View ! ! Raw Hits</a> ] [ <a href="reset.php">Reset Logger</a> ]</p> ! ! <p> ! ! <form action="./" method="POST"> ! <input name="min" type="text" id="min" value="<?php echo $min; ?>" size="10"> ! ! to ! <input name="max" type="text" id="max" value="<?php echo $max; ?>" size="10"> - <input name="view" type="submit" id="view" value="View"> ! ! (<strong><?php echo $amount; ?></strong> total unique visitors) ! </form></p> ! <div align="center"><font size="2">This page previews grouped unique visitors. ! If you wish to view the exact location that the user has visited click<br> ! ! the track button below:<br> ! ! </font><br> ! </div> ! <table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#999999"> ! ! <tr bgcolor="#999999"> ! ! <td width="6%"> <div align="center">ID</div></td> ! ! <td width="20%"> <div align="center">Date</div></td> ! ! <td width="20%"> <div align="center">IP Address</div></td> ! ! <td width="30%"> <div align="center">Host Lookup</div></td> ! ! <td width="30%"> <div align="center">Option</div></td> ! </tr> - <? while($log = mysql_fetch_object($query)){ - echo "<tr>"; ! ! echo " <td>$log->ID</td>"; ! ! echo " <td>$log->Date</td>"; ! ! echo " <td>$log->IPAddress</td>"; ! ! echo " <td>$log->HostLookup</td>"; ! ! echo " <td>[ <a href='./?DELETE=$log->IPAddress'>Delete</a> ] [ <a href='track.php?ID=$log->IPAddress'>Track</a> ]</td>"; ! ! echo "</tr>"; ! } ?></tr> - </table> ! ! <p> ! ! <?php include("$footer"); ?> --- 53,92 ---- <h1>View Log Information</h1> ! <form action="./" method="POST"> <input name="min" type="text" id="min" value="<?php echo $min; ?>" size="10"> ! to <input name="max" type="text" id="max" value="<?php echo $max; ?>" size="10"> <input name="view" type="submit" id="view" value="View"> ! (<strong><?php echo $amount; ?></strong> total unique visitors) </form></p> ! <div align="center">This page previews grouped unique visitors. If you wish to view the exact location that the user has visited click<br> ! the track button below: </div> ! <table> ! <tr> ! <th>ID</th> ! <th>Date</th> ! <th>IP Address</th> ! <th>Host Lookup</th> ! <th>Option</td> </tr> <? while($log = mysql_fetch_object($query)){ echo "<tr>"; ! echo " <td>$log->ID</td>"; ! echo " <td>$log->Date</td>"; ! echo " <td>$log->IPAddress</td>"; ! echo " <td>$log->HostLookup</td>"; ! echo " <td>[ <a href='./?DELETE=$log->IPAddress'>Delete</a> ] [ <a href='track.php?ID=$log->IPAddress'>Track</a> ]</td>"; ! echo "</tr>"; } ?></tr> </table> ! <?php ! include("$footer"); ! ?> \ No newline at end of file Index: logger.php =================================================================== RCS file: /cvsroot/openfirst/logger/logger.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** logger.php 21 Jun 2003 12:42:44 -0000 1.3 --- logger.php 28 Jun 2003 15:23:48 -0000 1.4 *************** *** 27,51 **** */ ! mysql_select_db($sqldatabase,$sqlconnection); ! ! $IP = $_SERVER['REMOTE_ADDR']; ! $HOST = gethostbyaddr($IP); ! $DATE = date("F j, Y, g:i a"); ! $SCRIPT = $_SERVER['PHP_SELF']; ! $BROWSER = $_SERVER['HTTP_USER_AGENT']; ! ! if (ISSET($_SERVER['QUERY_STRING'])){ ! $QUERYSTRING = $_SERVER['QUERY_STRING']; ! }else{ ! $QUERYSTRING = "NULL"; ! } ! ! mysql_query("INSERT INTO ofirst_logger (IPAddress,Date,Location,QueryString,HostLookup,Browser) ! values('".$IP."' ! ,'".$DATE."' ! ,'".$SCRIPT."' ! ,'".$QUERYSTRING."' ! ,'".$HOST."' ! ,'".$BROWSER."')") or die(mysql_error()); ! ! ?> --- 27,49 ---- */ ! $IP = $_SERVER['REMOTE_ADDR']; ! $HOST = gethostbyaddr($IP); ! $DATE = date("F j, Y, g:i a"); ! $SCRIPT = $_SERVER['PHP_SELF']; ! $BROWSER = $_SERVER['HTTP_USER_AGENT']; ! ! if (ISSET($_SERVER['QUERY_STRING'])){ ! $QUERYSTRING = $_SERVER['QUERY_STRING']; ! } else { ! $QUERYSTRING = "NULL"; ! } ! ! mysql_query("INSERT INTO ofirst_logger (IPAddress,Date,Location,QueryString,HostLookup,Browser) ! values('".$IP."' ! ,'".$DATE."' ! ,'".$SCRIPT."' ! ,'".$QUERYSTRING."' ! ,'".$HOST."' ! ,'".$BROWSER."')") or die(mysql_error()); ! ! ?> \ No newline at end of file Index: rawdata.php =================================================================== RCS file: /cvsroot/openfirst/logger/rawdata.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rawdata.php 21 Jun 2003 12:42:44 -0000 1.4 --- rawdata.php 28 Jun 2003 15:23:48 -0000 1.5 *************** *** 26,91 **** * */ ! include("../config/globals.php"); ! include("$header"); ! mysql_select_db($sqldatabase,$sqlconnection); ! ! if (ISSET($_POST['view'])){ ! $min = $_POST['min']; ! $max = $_POST['max']; ! }else{ ! $min = 0; ! $max = 50; ! } ! ! if (ISSET($_GET['DELETE'])){ ! mysql_query("DELETE FROM ofirst_logger WHERE ID = '".$_GET['DELETE']."'"); ! } ! ! $query = mysql_query("SELECT * FROM ofirst_logger LIMIT $min,$max"); ! $amount = mysql_num_rows($query); ! ?> ! <h1>View Log Information</h1> ! <p>[ <a href="./">Track User Movement </a>] [<a href="rawdata.php"> View ! Raw Hits</a> ] [ <a href="reset.php">Reset Logger</a> ]</p> ! <p> ! <form action="rawdata.php" method="POST"> ! <input name="min" type="text" id="min" value="<?php echo $min; ?>" size="10"> ! to ! <input name="max" type="text" id="max" value="<?php echo $max; ?>" size="10"> ! <input name="view" type="submit" id="view" value="View"> ! (<b><?php echo $amount; ?></b> total raw page hits) ! </form></p> ! <table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#999999"> ! <tr bgcolor="#999999"> ! <td width="6%"> ! <div align="center">ID</div></td> ! <td width="20%"> ! <div align="center">Date</div></td> ! <td width="20%"> ! <div align="center">IP Address</div></td> ! <td width="30%"> ! <div align="center">Host Lookup</div></td> ! <td width="18%"> ! <div align="center">Location</div></td> ! <td width="26%"> ! <div align="center">Query String</div></td> ! <td width="26%"> ! <div align="center">Options</div></td> ! </tr> ! <? ! while($log = mysql_fetch_object($query)){ ! echo "<tr>"; ! echo " <td>$log->ID</td>"; ! echo " <td>$log->Date</td>"; ! echo " <td>$log->IPAddress</td>"; ! echo " <td>$log->HostLookup</td>"; ! echo " <td>$log->Location</td>"; ! echo " <td>$log->QueryString</td>"; ! echo " <td>[ <a href='rawdata.php?DELETE=$log->ID'>Delete</a> ]</td>"; ! echo "</tr>"; ! } ! ?> ! </tr> ! </table> ! <p> ! <?php include("$footer"); ?> --- 26,82 ---- * */ ! include("../config/globals.php"); ! include("$header"); ! ! if (isset($_POST['view'])) { ! $min = $_POST['min']; ! $max = $_POST['max']; ! } else { ! $min = 0; ! $max = 50; ! } ! ! if (isset($_GET['DELETE'])) { ! mysql_query("DELETE FROM ofirst_logger WHERE ID = '".$_GET['DELETE']."'"); ! } ! ! $query = mysql_query("SELECT * FROM ofirst_logger LIMIT $min,$max"); ! $amount = mysql_num_rows($query); ! ?> ! <h1>View Log Information</h1> ! <p> ! <form action="rawdata.php" method="POST"> ! <input name="min" type="text" id="min" value="<?php echo $min; ?>" size="10"> ! to ! <input name="max" type="text" id="max" value="<?php echo $max; ?>" size="10"> ! <input name="view" type="submit" id="view" value="View"> ! (<b><?php echo $amount; ?></b> total raw page hits) ! </form></p> ! <table> ! <tr> ! <th>ID</th> ! <th>Date</th> ! <th>IP Address</th> ! <th>Host Lookup</th> ! <th>Location</th> ! <th>Query String</th> ! <th>Options</th> ! </tr> ! <? ! while($log = mysql_fetch_object($query)){ ! echo "<tr>"; ! echo " <td>$log->ID</td>"; ! echo " <td>$log->Date</td>"; ! echo " <td>$log->IPAddress</td>"; ! echo " <td>$log->HostLookup</td>"; ! echo " <td>$log->Location</td>"; ! echo " <td>$log->QueryString</td>"; ! echo " <td>[ <a href='rawdata.php?DELETE=$log->ID'>Delete</a> ]</td>"; ! echo "</tr>"; ! } ! ?> ! </tr> ! </table> ! <?php ! include("$footer"); ! ?> \ No newline at end of file Index: reset.php =================================================================== RCS file: /cvsroot/openfirst/logger/reset.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** reset.php 21 Jun 2003 12:42:44 -0000 1.3 --- reset.php 28 Jun 2003 15:23:48 -0000 1.4 *************** *** 26,59 **** * */ ! include("../config/globals.php"); ! include("$header"); ! mysql_select_db($sqldatabase,$sqlconnection); ! ! if (ISSET($_POST['confirm'])){ if(isset($user->user) == true && $user->membertype == 'administrator') { ! mysql_query("DELETE FROM ofirst_logger"); ! echo "<br><br><center>Logger system has been reset<center>"; } else { ! echo("You are not logged in, or do not have sufficient permission to reset the logger."); ! showlogin(); } ! } ! ! ?> ! <h1>View Log Information</h1> ! <p>[ <a href="./">Track User Movement </a>] [<a href="rawdata.php"> View ! Raw Hits</a> ] [ <a href="reset.php">Reset Logger</a> ]</p> ! <p> ! <form action="reset.php" method="POST"> ! <p align="center"><br> ! <br> ! Are you sure that you want to reset the entire logger system?<br> ! <br> ! <input name="confirm" type="submit" id="confirm" value="Delete all Entries"> ! <br> ! <br> ! <br> ! <br> ! </p> ! </form></p> ! <?php include("$footer"); ?> --- 26,50 ---- * */ ! include("../config/globals.php"); ! include("$header"); ! ! if (isset($_POST['confirm'])) { if(isset($user->user) == true && $user->membertype == 'administrator') { ! mysql_query("DELETE FROM ofirst_logger"); ! echo "<p>Logger system has been reset</p>"; } else { ! echo("You are not logged in, or do not have sufficient permission to reset the logger."); ! showlogin(); } ! } ! ! ?> ! <h1>View Log Information</h1> ! <form action="reset.php" method="POST"> ! <p>Are you sure that you want to reset the entire logger system?<br /> ! <input name="confirm" type="submit" id="confirm" value="Delete all Entries"> ! </p> ! </form> ! <?php ! include("$footer"); ! ?> \ No newline at end of file Index: track.php =================================================================== RCS file: /cvsroot/openfirst/logger/track.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** track.php 21 Jun 2003 12:42:44 -0000 1.5 --- track.php 28 Jun 2003 15:23:48 -0000 1.6 *************** *** 1,54 **** ! <?php ! include("../config/globals.php"); ! include("$header"); ! mysql_select_db($sqldatabase,$sqlconnection); ! ! if (ISSET($_GET['DELETE'])){ ! mysql_query("DELETE FROM ofirst_logger WHERE IPAddress = '".$_GET['DELETE']."'") or die(mysql_error()); ! } ! ! $query = mysql_query("SELECT * FROM ofirst_logger WHERE IPAddress='".$_GET['ID']."'"); ! $amount = mysql_num_rows($query); ! ?> ! <h1>View Log Information</h1> ! <p>[ <a href="./">Track User Movement </a>] [<a href="rawdata.php"> View ! Raw Hits</a> ] [ <a href="reset.php">Reset Logger</a> ]</p> ! <p> ! <p><center> ! You are tracking the hits by: <strong><?php print $_GET['ID']; ?></strong>, ! who a total of <strong><?php echo $amount; ?></strong> pages. <br> ! <br>[ <a href='track.php?DELETE=<?php print $_GET['ID']; ?>'>Delete all hits by this user ]</a></center></p> ! <table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#999999"> ! <tr bgcolor="#999999"> ! <td width="6%"> ! <div align="center">ID</div></td> ! <td width="20%"> ! <div align="center">Date</div></td> ! <td width="20%"> ! <div align="center">IP Address</div></td> ! <td width="30%"> ! <div align="center">Host Lookup</div></td> ! <td width="18%"> ! <div align="center">Location</div></td> ! <td width="26%"> ! <div align="center">Query String</div></td> ! <td width="26%"> ! <div align="center">Options</div></td> ! </tr> ! <? ! while($log = mysql_fetch_object($query)){ ! echo "<tr>"; ! echo " <td>$log->ID</td>"; ! echo " <td>$log->Date</td>"; ! echo " <td>$log->IPAddress</td>"; ! echo " <td>$log->HostLookup</td>"; ! echo " <td>$log->Location</td>"; ! echo " <td>$log->QueryString</td>"; ! echo " <td>[ <a href='./?DELETE=$log->ID'>Delete</a> ]</td>"; ! echo "</tr>"; ! } ! ?> ! </tr> ! </table> ! <p> ! <?php include("$footer"); ?> --- 1,69 ---- ! <?php ! /* ! * openFIRST.logger - track.php ! * ! * Copyright (C) 2003, ! * openFIRST Project ! * Original Author: David Di Biase <dav...@ea...> ! * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! */ ! include("../config/globals.php"); ! include("$header"); ! ! if (isset($_GET['DELETE'])) { ! mysql_query("DELETE FROM ofirst_logger WHERE IPAddress = '".$_GET['DELETE']."'") or die(mysql_error()); ! } ! ! $query = mysql_query("SELECT * FROM ofirst_logger WHERE IPAddress='".$_GET['ID']."'"); ! $amount = mysql_num_rows($query); ! ?> ! <h1>View Log Information</h1> ! <p>You are tracking the hits by: <strong><?php print $_GET['ID']; ?></strong>, ! who a total of <strong><?php echo $amount; ?></strong> pages. <br> ! <br>[ <a href='track.php?DELETE=<?php print $_GET['ID']; ?>'>Delete all hits by this user ]</a></p> ! <table> ! <tr> ! <th>ID</th> ! <th>Date</th> ! <th>IP Address</th> ! <th>Host Lookup</th> ! <th>Location</th> ! <th>Query String</th> ! <th>Options</th> ! </tr> ! <? ! while($log = mysql_fetch_object($query)) { ! echo "<tr>"; ! echo " <td>$log->ID</td>"; ! echo " <td>$log->Date</td>"; ! echo " <td>$log->IPAddress</td>"; ! echo " <td>$log->HostLookup</td>"; ! echo " <td>$log->Location</td>"; ! echo " <td>$log->QueryString</td>"; ! echo " <td>[ <a href='./?DELETE=$log->ID'>Delete</a> ]</td>"; ! echo "</tr>"; ! } ! ?> ! </tr> ! </table> ! <?php ! include("$footer"); ! ?> \ No newline at end of file |