/*
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"));
function tc($sql)
{
$row = mysql_fetch_assoc($sql);
return($row['count']);
}
?>
CAcert.org =_("Statistics")?> |
=_("Verified Users")?>: |
=number_format(tc(mysql_query("select count(`id`) as `count` from `users` where `verified`=1")))?> |
=_("Verified Emails")?>: |
=number_format(tc(mysql_query("select count(`id`) as `count` from `email` where `hash`='' and `deleted`=0")))?> |
=_("Verified Domains")?>: |
=number_format(tc(mysql_query("select count(`id`) as `count` from `domains` where `hash`='' and `deleted`=0")))?> |
$certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts`"));
$certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts`"));
$certs += tc(mysql_query("select count(`id`) as `count` from `gpg`"));
$certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts`"));
$certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts`"));
?>
=_("Certificates Issued")?>: |
=number_format($certs)?> |
$certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `revoked`=0 and `expire`>NOW()"));
$certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `revoked`=0 and `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 `orgemailcerts` where `revoked`=0 and `expire`>NOW()"));
$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"));
?>
=_("Valid Certificates")?>: |
=number_format($certs)?> |
=_("Assurances Made")?>: |
=number_format(tc(mysql_query("select count(`id`) as `count` from `notary`")))?> |
=_("Users with 1-49 Points")?>: |
=number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) > 0 and sum(`points`) < 50")))?> |
=_("Users with 50-99 Points")?>: |
=number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")))?> |
=_("Assurer Candidates")?>: |
=number_format($assurercandidates)?> |
=_("Assurers with test")?>: |
=number_format($realassurers)?> |
$drow = mysql_fetch_assoc(mysql_query("select sum(`points`) as `points` from `notary`")); ?>
=_("Points Issued")?>: |
=number_format($drow['points'])?> |