/*
LibreSSL - CAcert web application
Copyright (C) 2004-2008 CAcert Inc.
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; version 2 of the License.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
loadem("index");
showheader(_("Welcome to CAcert.org"));
/**
* get statistics data from current cache, return result of getDataFromLive if no cache file exists
* @return array
*/
function getData() {
$sql = 'select * from `statscache` order by `timestamp` desc limit 1';
$res = mysql_query($sql);
if ($res && mysql_numrows($res) > 0) {
$ar = mysql_fetch_assoc($res);
$stats = unserialize($ar['cache']);
$stats['timestamp'] = $ar['timestamp'];
return $stats;
}
return null;
}
$stats = getData();
if ($stats === null) {
echo '
', _("Error while retrieving the statistics!"), '
';
showfooter();
die();
}
?>
CAcert.org =_("Statistics")?>
CAcert.org =_("Statistics")?> |
=_("Verified Users")?>: |
=$stats['verified_users'];?> |
=_("Verified Emails")?>: |
=$stats['verified_emails'];?> |
=_("Verified Domains")?>: |
=$stats['verified_domains'];?> |
=_("Certificates Issued")?>: |
=$stats['verified_certificates'];?> |
=_("Valid Certificates")?>: |
=$stats['valid_certificates'];?> |
=_("Assurances Made")?>: |
=$stats['assurances_made'];?> |
=_("Users with 1-49 Points")?>: |
=$stats['users_1to49'];?> |
=_("Users with 50-99 Points")?>: |
=$stats['users_50to99'];?> |
=_("Assurer Candidates")?>: |
=$stats['assurer_candidates'];?> |
=_("Assurers with test")?>: |
=$stats['aussurers_with_test'];?> |
=_("Points Issued")?>: |
=$stats['points_issued'];?> |
CAcert.org =_("Growth in the last 12 months")?> |
=_("Date")?>
| =_("New Users")?>
| =_("New Assurers")?>
| =_("New Certificates")?>
|
for($i = 0; $i < 12; $i++) {
?>
=$stats['growth_last_12m'][$i]['date'];?> |
=$stats['growth_last_12m'][$i]['new_users'];?> |
=$stats['growth_last_12m'][$i]['new_assurers'];?> |
=$stats['growth_last_12m'][$i]['new_certificates'];?> |
} ?>
=_("Total")?> |
=$stats['growth_last_12m_total']['new_users'];?> |
=$stats['growth_last_12m_total']['new_assurers'];?> |
=$stats['growth_last_12m_total']['new_certificates'];?> |
CAcert.org =_("Growth by year")?> |
=_("Date")?>
| =_("New Users")?>
| =_("New Assurers")?>
| =_("New Certificates")?>
|
for($i = 0; $i < count($stats['growth_last_years']); $i++) {
?>
=$stats['growth_last_years'][$i]['date'];?> |
=$stats['growth_last_years'][$i]['new_users'];?> |
=$stats['growth_last_years'][$i]['new_assurers'];?> |
=$stats['growth_last_years'][$i]['new_certificates'];?> |
} ?>
=_("Total")?> |
=$stats['growth_last_years_total']['new_users'];?> |
=$stats['growth_last_years_total']['new_assurers'];?> |
=$stats['growth_last_years_total']['new_certificates'];?> |
printf(_("Last updated: %s"), date('Y-m-d H:i:s', $stats['timestamp']));?>
showfooter(); ?>