phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file userreport.php

Documentation is available at userreport.php

  1. <?php
  2. require_once './include/version.php';
  3. require_once './lib/core.php';
  4.  
  5. require('smarty/libs/Smarty.class.php');
  6. $smarty = new Smarty();
  7.  
  8. $smarty->plugins_dir[] = 'include';
  9. require_once $smarty->_get_plugin_filepath('function', 'html_doctype');
  10.  
  11. try {
  12.     $login = new login(true);
  13.     $smarty->assign('login', $login);
  14. } catch (LoginException $e) {
  15.     header( 'Location: login.php' ) ;
  16. } 
  17.  
  18. $db = new phpusertrack_db();
  19.  
  20. $sql = 'select * from phpusertrack_ip where ip=\'' . $_GET['ip'] . '\' order by timestamp desc limit 1';
  21. $visits = $db->_query($sql);
  22.  
  23. //$smarty->assign('pageTitle', 'phpUserTrack - ' . $_GET['ip'] );
  24.  
  25. $smarty->assign('mysqlQueryTime', (getmicrotime() - $time));
  26.  
  27. $smarty->assign('visits', $visits);
  28. $smarty->assign('ip', $_GET['ip']);
  29. $smarty->assign('hostname', gethostbyaddr($_GET['ip']));
  30.  
  31. if ($geoIP) {
  32.     $geoip = Net_GeoIP::getInstance('./include/GeoLiteCity.dat',
  33.     Net_GeoIP::STANDARD);
  34.     $ip = $_GET['ip'];
  35.     $location = $geoip->lookupLocation($ip);
  36.     $smarty->assign('location', $location);
  37. }
  38.  
  39. $smarty->assign('notifMsg', $notify);
  40.  
  41. $smarty->display('header.tpl');
  42. $smarty->display('userreport.tpl');
  43.  
  44. $smarty->assign('pageRenderTime', (getmicrotime() - $time));
  45.  
  46. $smarty->display('footer.tpl');
  47. ?>

Documentation generated on Tue, 06 Nov 2007 09:22:15 -0800 by phpDocumentor 1.4.0a2