cacert-webdb/www/stats.php

139 lines
6.4 KiB
PHP
Raw Normal View History

2004-12-02 11:34:07 +00:00
<?
loadem("index");
showheader(_("Welcome to CAcert.org"));
?>
<h1>CAcert.org <?=_("Statistics")?></h1>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
<td colspan="2" class="title">CAcert.org <?=_("Statistics")?></td>
</tr>
<tr>
2004-12-02 13:46:06 +00:00
<td class="DataTD"><?=_("Verified Users")?>:</td>
2004-12-02 11:34:07 +00:00
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `users` where `verified`=1")))?></td>
</tr>
<tr>
<td class="DataTD"><?=_("Verified Emails")?>:</td>
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `email` where `hash`='' and `deleted`=0")))?></td>
</tr>
<tr>
<td class="DataTD"><?=_("Verified Domains")?>:</td>
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `domains` where `hash`='' and `deleted`=0")))?></td>
</tr>
<?
$certs = mysql_num_rows(mysql_query("select * from `domaincerts`"));
$certs += mysql_num_rows(mysql_query("select * from `emailcerts`"));
$certs += mysql_num_rows(mysql_query("select * from `gpg`"));
$certs += mysql_num_rows(mysql_query("select * from `orgdomaincerts`"));
$certs += mysql_num_rows(mysql_query("select * from `orgemailcerts`"));
?>
<tr>
<td class="DataTD"><?=_("Certificates Issued")?>:</td>
<td class="DataTD"><?=number_format($certs)?></td>
</tr>
<?
$certs = mysql_num_rows(mysql_query("select * from `domaincerts` where `revoked`=0 and `expire`>NOW()"));
$certs += mysql_num_rows(mysql_query("select * from `emailcerts` where `revoked`=0 and `expire`>NOW()"));
$certs += mysql_num_rows(mysql_query("select * from `gpg` where `expire`<=NOW()"));
$certs += mysql_num_rows(mysql_query("select * from `orgdomaincerts` where `revoked`=0 and `expire`>NOW()"));
$certs += mysql_num_rows(mysql_query("select * from `orgemailcerts` where `revoked`=0 and `expire`>NOW()"));
2004-12-02 13:46:06 +00:00
$totalassurers = mysql_num_rows(mysql_query("select * from notary group by `to` having sum(`points`) >= 100"));
2004-12-02 11:34:07 +00:00
?>
<tr>
<td class="DataTD"><?=_("Valid Certificates")?>:</td>
<td class="DataTD"><?=number_format($certs)?></td>
</tr>
<tr>
<td class="DataTD"><?=_("Assurers")?>:</td>
2004-12-02 13:46:06 +00:00
<td class="DataTD"><?=number_format($totalassurers)?></td>
2004-12-02 11:34:07 +00:00
</tr>
2004-12-02 11:42:34 +00:00
<tr>
<td class="DataTD"><?=_("Assurances Made")?>:</td>
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `notary`")))?></td>
</tr>
2004-12-02 22:35:23 +00:00
<tr>
<td class="DataTD"><?=_("Users with Points")?>:</td>
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `notary` group by `to`")))?></td>
</tr>
<tr><? $drow = mysql_fetch_assoc(mysql_query("select sum(`points`) as `points` from `notary`")); ?>
<td class="DataTD"><?=_("Points Issued")?>:</td>
<td class="DataTD"><?=number_format($drow['points'])?></td>
</tr>
2004-12-02 11:34:07 +00:00
</table>
2004-12-02 13:46:06 +00:00
<br>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
2004-12-02 22:35:23 +00:00
<td colspan="4" class="title">CAcert.org <?=_("Growth in the last 12 months")?></td>
2004-12-02 13:46:06 +00:00
</tr>
<tr>
<td class="DataTD"><b><?=_("Date")?></b>
<td class="DataTD"><b><?=_("New Users")?></b>
<td class="DataTD"><b><?=_("New Assurers")?></b>
2004-12-02 22:35:23 +00:00
<td class="DataTD"><b><?=_("New Certificates")?></b>
2004-12-02 13:46:06 +00:00
</tr>
<? for($i = 0; $i < 12; $i++) {
$date = date("Y-m", mktime(0,0,0,date("m") - $i,1,date("Y")));
$totalusers += $users = mysql_num_rows(mysql_query("select * from `users` where `created` like '$date%' and `verified`=1"));
$totassurers += $assurers = mysql_num_rows(mysql_query("select * from `notary` where `when` like '$date%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100"));
2004-12-02 22:35:23 +00:00
$certs = mysql_num_rows(mysql_query("select * from `domaincerts` where `created` like '$date%'"));
$certs += mysql_num_rows(mysql_query("select * from `emailcerts` where `created` like '$date%'"));
$certs += mysql_num_rows(mysql_query("select * from `gpg` where `issued` like '$date%'"));
$certs += mysql_num_rows(mysql_query("select * from `orgdomaincerts` where `created` like '$date%'"));
$certs += mysql_num_rows(mysql_query("select * from `orgemailcerts` where `created` like '$date%'"));
$totalcerts += $certs;
2004-12-02 13:46:06 +00:00
?>
<tr>
<td class="DataTD"><?=$date?></td>
<td class="DataTD"><?=number_format($users)?></td>
<td class="DataTD"><?=number_format($assurers)?></td>
2004-12-02 22:35:23 +00:00
<td class="DataTD"><?=number_format($certs)?></td>
2004-12-02 13:46:06 +00:00
</tr>
<? } ?>
<tr>
<td class="DataTD">N/A</td>
<td class="DataTD"><?=number_format($totalusers)?></td>
<td class="DataTD"><?=number_format($totassurers)?></td>
2004-12-02 22:35:23 +00:00
<td class="DataTD"><?=number_format($totalcerts)?></td>
2004-12-02 13:46:06 +00:00
</tr>
</table>
<br>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
2004-12-02 22:35:23 +00:00
<td colspan="4" class="title">CAcert.org <?=_("Growth by year")?></td>
2004-12-02 13:46:06 +00:00
</tr>
<tr>
<td class="DataTD"><b><?=_("Date")?></b>
<td class="DataTD"><b><?=_("New Users")?></b>
<td class="DataTD"><b><?=_("New Assurers")?></b>
2004-12-02 22:35:23 +00:00
<td class="DataTD"><b><?=_("New Certificates")?></b>
2004-12-02 13:46:06 +00:00
</tr>
<?
2004-12-02 22:35:23 +00:00
$totalcerts = $totalusers = $totassurers = 0;
2004-12-02 13:46:06 +00:00
for($i = date("Y"); $i >= 2002; $i--) {
$totalusers += $users = mysql_num_rows(mysql_query("select * from `users` where `created` like '$i%' and `verified`=1"));
$totassurers += $assurers = mysql_num_rows(mysql_query("select * from `notary` where `when` like '$i%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100"));
2004-12-02 22:35:23 +00:00
$certs = mysql_num_rows(mysql_query("select * from `domaincerts` where `created` like '$i%'"));
$certs += mysql_num_rows(mysql_query("select * from `emailcerts` where `created` like '$i%'"));
$certs += mysql_num_rows(mysql_query("select * from `gpg` where `issued` like '$i%'"));
$certs += mysql_num_rows(mysql_query("select * from `orgdomaincerts` where `created` like '$i%'"));
$certs += mysql_num_rows(mysql_query("select * from `orgemailcerts` where `created` like '$i%'"));
$totalcerts += $certs;
2004-12-02 13:46:06 +00:00
?>
<tr>
<td class="DataTD"><?=$i?></td>
<td class="DataTD"><?=number_format($users)?></td>
<td class="DataTD"><?=number_format($assurers)?></td>
2004-12-02 22:35:23 +00:00
<td class="DataTD"><?=number_format($certs)?></td>
2004-12-02 13:46:06 +00:00
</tr>
<? } ?>
<tr>
<td class="DataTD">N/A</td>
<td class="DataTD"><?=number_format($totalusers)?></td>
<td class="DataTD"><?=number_format($totassurers)?></td>
2004-12-02 22:35:23 +00:00
<td class="DataTD"><?=number_format($totalcerts)?></td>
2004-12-02 13:46:06 +00:00
</tr>
</table>
<br>
2004-12-02 11:34:07 +00:00
<? showfooter(); ?>