Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Update webstatistics.php
Browse files Browse the repository at this point in the history
  • Loading branch information
beranek1 committed Jul 29, 2019
1 parent f9c0eea commit 936ee8f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions webstatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
}
$total_visitors = $web_analytics_db->count("wa_browsers");
$total_networks = $web_analytics_db->count("wa_ips");
$total_isps = $web_analytics_db->count("wa_isps");
$top_countries = array();
$top_continents = array();
$total_continents = 0;
Expand Down Expand Up @@ -63,7 +62,7 @@
$top_languages = array();
$total_languages = 0;
foreach($tplngsr = $web_analytics_db->query("SELECT `language`, COUNT(*) FROM wa_browsers GROUP BY `language` ORDER BY COUNT(*) DESC;") as $language) {
if($language != "" && $language != null) {
if($language[0] != "" && $language[0] != null) {
$top_languages[$language[0]] = $language[1];
$total_languages = $total_languages + 1;
} else {
Expand All @@ -74,9 +73,15 @@
foreach($web_analytics_db->query("SELECT `user_agent`, COUNT(*) FROM wa_browsers GROUP BY `user_agent` ORDER BY COUNT(*) DESC;") as $useragent) {
$top_useragents[$useragent[0]] = $useragent[1];
}
$total_isps = 0;
$top_isps = array();
foreach($web_analytics_db->query("SELECT `isp_id`, COUNT(*) FROM wa_ips GROUP BY `isp_id` ORDER BY COUNT(*) DESC;") as $isp) {
$top_isps[$isp[0]] = $isp[1];
foreach($web_analytics_db->query("SELECT `isp`, COUNT(*) FROM wa_ips GROUP BY `isp` ORDER BY COUNT(*) DESC;") as $isp) {
if($isp[0] != "" && $isp[0] != null) {
$top_isps[$isp[0]] = $isp[1];
$total_isps++;
} else {
$top_isps["?"] = $isp[1];
}
}
$top_uris = array();
foreach($web_analytics_db->query("SELECT `uri`, COUNT(*) FROM wa_requests GROUP BY `uri` ORDER BY COUNT(*) DESC;") as $uri) {
Expand Down

0 comments on commit 936ee8f

Please sign in to comment.