Added CATS statistics

This commit is contained in:
root 2008-04-08 20:16:47 +00:00
parent eaac83d9ec
commit 4b3ff10393

View file

@ -59,7 +59,12 @@
$certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `expire`<=NOW()")); $certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `expire`<=NOW()"));
$certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `revoked`=0 and `expire`>NOW()")); $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `revoked`=0 and `expire`>NOW()"));
$certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `revoked`=0 and `expire`>NOW()")); $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `revoked`=0 and `expire`>NOW()"));
$totalassurers = mysql_num_rows(mysql_query("select `to` from notary group by `to` having sum(`points`) >= 100")); $assurercandidates = tc(mysql_query("select count(*) as `count` from `users` where ".
"not exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` where `cp`.`user_id`=`users`.`id` and `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id`=1) and ".
"(select sum(`points`) from `notary` where `to`=`users`.`id`) >= 100"));
$realassurers = tc(mysql_query("select count(*) as `count` from `users` where ".
"exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` where `cp`.`user_id`=`users`.`id` and `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id`=1) and ".
"(select sum(`points`) from `notary` where `to`=`users`.`id`) >= 100"));
?> ?>
<tr> <tr>
<td class="DataTD"><?=_("Valid Certificates")?>:</td> <td class="DataTD"><?=_("Valid Certificates")?>:</td>
@ -78,8 +83,12 @@
<td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")))?></td> <td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")))?></td>
</tr> </tr>
<tr> <tr>
<td class="DataTD"><?=_("Assurers")?>:</td> <td class="DataTD"><?=_("Assurer Candidates")?>:</td>
<td class="DataTD"><?=number_format($totalassurers)?></td> <td class="DataTD"><?=number_format($assurercandidates)?></td>
</tr>
<tr>
<td class="DataTD"><?=_("Assurers with test")?>:</td>
<td class="DataTD"><?=number_format($realassurers)?></td>
</tr> </tr>
<tr><? $drow = mysql_fetch_assoc(mysql_query("select sum(`points`) as `points` from `notary`")); ?> <tr><? $drow = mysql_fetch_assoc(mysql_query("select sum(`points`) as `points` from `notary`")); ?>
<td class="DataTD"><?=_("Points Issued")?>:</td> <td class="DataTD"><?=_("Points Issued")?>:</td>