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

Source for file report.php

Documentation is available at report.php

  1. <?php
  2. require_once './include/version.php';
  3. require_once './lib/core.php';
  4. require_once './lib/freqmatrix.php';
  5. require_once './conf/conf.php';
  6.  
  7. require('smarty/libs/Smarty.class.php');
  8. $smarty new Smarty();
  9.  
  10. $smarty->plugins_dir['include';
  11. require_once $smarty->_get_plugin_filepath('function''html_doctype');
  12. require_once $smarty->_get_plugin_filepath('function''geoIP');
  13.  
  14. try {
  15.     $login new login(true);
  16.     $smarty->assign('login'$login);
  17. catch (LoginException $e{
  18.     header'Location: login.php' ;
  19.  
  20. $db new phpusertrack_db();
  21. $sql 'select phpusertrack_data.*, phpusertrack_ip.ip from phpusertrack_data Inner Join phpusertrack_ip ON phpusertrack_data.ip_id = phpusertrack_ip.id where site_id=' $_GET['id'' order by timestamp desc limit 10';
  22. $recent $db->_query($sql);
  23.  
  24. $sql 'select *, (select count(*) from phpusertrack_data as tmpdata where tmpdata.site_id=phpusertrack_sites.id) as pageviews,    
  25.     (select count(distinct tmpdata.ip_id) as visits from phpusertrack_data as tmpdata where tmpdata.site_id=phpusertrack_sites.id) as visits,
  26.     (select count(distinct tmpip.ip) as uniqueVisitors from phpusertrack_ip as tmpip, phpusertrack_data as tmpdata where tmpdata.ip_id=tmpip.id and tmpdata.site_id=phpusertrack_sites.id) as visitors from phpusertrack_sites where id=' $_GET['id'' limit 1';
  27. $info $db->_query($sql);
  28. $smarty->assign('info'$info[0]);
  29.  
  30. $sql "Select Count(phpusertrack_data.path) AS `count`, phpusertrack_data.path, phpusertrack_sites.url, phpusertrack_data.site_id From phpusertrack_data Inner Join phpusertrack_sites ON phpusertrack_data.site_id = phpusertrack_sites.id where site_id=" $_GET['id'" Group By phpusertrack_data.path, phpusertrack_sites.id Order By `count` Desc Limit 10";
  31. $paths $db->_query($sql);
  32. $smarty->assign('paths'$paths);
  33.  
  34. $sql "select (select count(*) from phpusertrack_ip as newtempip where newtempip.ip=phpusertrack_ip.ip) as count, (select count(tmpdata.id) from phpusertrack_data as tmpdata, phpusertrack_ip as tmpip where tmpdata.ip_id=tmpip.id and tmpdata.site_id=" $_GET['id'" and tmpip.ip=phpusertrack_ip.ip) as pages, phpusertrack_ip.ip, phpusertrack_ip.timestamp from phpusertrack_ip Inner Join phpusertrack_data ON phpusertrack_ip.id = phpusertrack_data.ip_id where site_id=" $_GET['id'" group by phpusertrack_ip.ip order by pages desc limit 10;";
  35. $sessions $db->_query($sql);
  36. $smarty->assign('sessions'$sessions);
  37.  
  38. $sql 'select browser, count(id)*100/(select count(*) from phpusertrack_ip) as percent from phpusertrack_ip group by browser order by percent desc limit 10';
  39. $avgs $db->_query($sql);
  40. $smarty->assign('browseravgs'$avgs);
  41.  
  42. $smarty->assign('mysqlQueryTime'(getmicrotime($time));
  43.  
  44. //$matrix = new freqMatrix($_GET['id']);
  45. //$smarty->assign('matrix', $matrix->_matrix->_nodes);
  46.  
  47. $smarty->assign('recent'$recent);
  48. $smarty->assign('id'$_GET['id']);
  49.  
  50. $smarty->assign('notifMsg'$notify);
  51.  
  52. $breadcrumbs array(array('title' => 'Site Report (' $info[0]['name'')''url' => 'report.php?id=' $_GET['id']));
  53. $smarty->assign('breadcrumbs'$breadcrumbs);
  54.  
  55. $smarty->assign('pageTitle''phpUserTrack Report Page - ' $info[0]['name']);
  56.  
  57. $smarty->assign('serverPath'$_SERVER['SERVER_NAME'$conf['installpath''javascript/phpusertrack.js.php?site=' $_GET['id']);
  58.  
  59. $smarty->display('header.tpl');
  60. $smarty->display('report.tpl');
  61.  
  62. $smarty->assign('pageRenderTime'(getmicrotime($time));
  63.  
  64. //print_r($matrix->_matrix->_nodes);
  65. $smarty->display('footer.tpl');
  66. ?>

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