bug fixes

This commit is contained in:
root 2004-12-02 13:46:06 +00:00
parent 539b8479b7
commit 92ac6c9a79

View file

@ -9,7 +9,7 @@
<td colspan="2" class="title">CAcert.org <?=_("Statistics")?></td> <td colspan="2" class="title">CAcert.org <?=_("Statistics")?></td>
</tr> </tr>
<tr> <tr>
<td class="DataTD"><?=_("Users")?>:</td> <td class="DataTD"><?=_("Verified Users")?>:</td>
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `users` where `verified`=1")))?></td> <td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `users` where `verified`=1")))?></td>
</tr> </tr>
<tr> <tr>
@ -37,6 +37,7 @@
$certs += mysql_num_rows(mysql_query("select * from `gpg` where `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 `orgdomaincerts` where `revoked`=0 and `expire`>NOW()"));
$certs += mysql_num_rows(mysql_query("select * from `orgemailcerts` where `revoked`=0 and `expire`>NOW()")); $certs += mysql_num_rows(mysql_query("select * from `orgemailcerts` where `revoked`=0 and `expire`>NOW()"));
$totalassurers = mysql_num_rows(mysql_query("select * from notary group by `to` having sum(`points`) >= 100"));
?> ?>
<tr> <tr>
<td class="DataTD"><?=_("Valid Certificates")?>:</td> <td class="DataTD"><?=_("Valid Certificates")?>:</td>
@ -44,12 +45,68 @@
</tr> </tr>
<tr> <tr>
<td class="DataTD"><?=_("Assurers")?>:</td> <td class="DataTD"><?=_("Assurers")?>:</td>
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from notary group by `to` having sum(`points`) >= 100")))?></td> <td class="DataTD"><?=number_format($totalassurers)?></td>
</tr> </tr>
<tr> <tr>
<td class="DataTD"><?=_("Assurances Made")?>:</td> <td class="DataTD"><?=_("Assurances Made")?>:</td>
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `notary`")))?></td> <td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select * from `notary`")))?></td>
</tr> </tr>
</table> </table>
<br>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
<td colspan="3" class="title">CAcert.org <?=_("Growth in the last 12 months")?></td>
</tr>
<tr>
<td class="DataTD"><b><?=_("Date")?></b>
<td class="DataTD"><b><?=_("New Users")?></b>
<td class="DataTD"><b><?=_("New Assurers")?></b>
</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"));
?>
<tr>
<td class="DataTD"><?=$date?></td>
<td class="DataTD"><?=number_format($users)?></td>
<td class="DataTD"><?=number_format($assurers)?></td>
</tr>
<? } ?>
<tr>
<td class="DataTD">N/A</td>
<td class="DataTD"><?=number_format($totalusers)?></td>
<td class="DataTD"><?=number_format($totassurers)?></td>
</tr>
</table>
<br>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
<td colspan="3" class="title">CAcert.org <?=_("Growth by year")?></td>
</tr>
<tr>
<td class="DataTD"><b><?=_("Date")?></b>
<td class="DataTD"><b><?=_("New Users")?></b>
<td class="DataTD"><b><?=_("New Assurers")?></b>
</tr>
<?
$totalusers = $totassurers = 0;
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"));
?>
<tr>
<td class="DataTD"><?=$i?></td>
<td class="DataTD"><?=number_format($users)?></td>
<td class="DataTD"><?=number_format($assurers)?></td>
</tr>
<? } ?>
<tr>
<td class="DataTD">N/A</td>
<td class="DataTD"><?=number_format($totalusers)?></td>
<td class="DataTD"><?=number_format($totassurers)?></td>
</tr>
</table>
<br>
<? showfooter(); ?> <? showfooter(); ?>