diff --git a/htdocs/lib/CrashStats.php b/htdocs/lib/CrashStats.php index d5f6117..0c4a91d 100644 --- a/htdocs/lib/CrashStats.php +++ b/htdocs/lib/CrashStats.php @@ -13,6 +13,36 @@ class CrashStats { $this->filter = $filter; } + + function getOSStats() + { + $ret = array(); + $where = $this->filter->getWhere(); + if ($where) + { + $where .= " and "; + } + else + { + $where = "where "; + } + $where .= "os_type is not null"; + $q = "select count(id) as nr, os_type from reports $where group by os_type order by nr desc"; + $q .= kl_str_sql(" limit !i", $this->filter->limit); + if (false !== $cached = Memc::getq($q)) return $cached; + + if (!$res = DBH::$db->query($q)) return $ret; + + while ($row = DBH::$db->fetchRow($res)) + { + $o = new stdClass; + DBH::$db->loadFromDbRow($o, $res, $row); + $ret[] = $o; + } + + Memc::setq($q, $ret); + return $ret; + } function getRegionStats() { diff --git a/htdocs/statistics.php b/htdocs/statistics.php index 97cfd78..c0bd2fe 100644 --- a/htdocs/statistics.php +++ b/htdocs/statistics.php @@ -40,6 +40,30 @@ $filter->render();
| Nr. reports | +Operating System Type | +
|---|---|
| nr) ?> | +os_type) ?> | +