cacert-webdb/pages/wot/10.php

119 lines
4.7 KiB
PHP
Raw Normal View History

2004-10-16 16:51:44 +00:00
<? /*
2008-04-06 19:45:09 +00:00
LibreSSL - CAcert web application
Copyright (C) 2004-2008 CAcert Inc.
2004-10-16 16:51:44 +00:00
2008-04-06 19:45:09 +00:00
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.
2004-10-16 16:51:44 +00:00
2008-04-06 19:45:09 +00:00
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.
2004-10-16 16:51:44 +00:00
2008-04-06 19:45:09 +00:00
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
2004-10-16 16:51:44 +00:00
*/ ?>
<?
?>
2005-05-13 15:34:39 +00:00
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
<td colspan="5" class="title"><?=_("Assurer Ranking")?></td>
</tr>
<tr>
<?
2009-04-25 22:59:31 +00:00
$query = "SELECT `users`. *, count(*) AS `list` FROM users inner join notary on users.id=notary.`from`
AND `notary`.`from` != `notary`.`to`
2008-09-03 18:25:00 +00:00
AND `from`='".intval($_SESSION['profile']['id'])."' GROUP BY `notary`.`from`";
2005-05-13 15:34:39 +00:00
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
2008-09-03 18:25:00 +00:00
$rc = intval($row['list']);
2009-04-25 22:59:31 +00:00
$query = "SELECT `users`. *, count(*) AS `list` FROM `users` inner join `notary` on
`users`.`id` = `notary`.`from` AND `notary`.`from` != `notary`.`to`
2006-08-14 08:19:38 +00:00
GROUP BY `notary`.`from` HAVING count(*) > '$rc' ORDER BY `notary`.`when` DESC";
2005-05-13 15:34:39 +00:00
$rank = mysql_num_rows(mysql_query($query)) + 1;
?>
<td class="DataTD"><?=sprintf(_("You have made %s assurances which ranks you as the #%s top assurer."), intval($rc), intval($rank))?></td>
</tr>
</table>
<br>
2004-10-16 16:51:44 +00:00
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
2006-08-16 03:56:07 +00:00
<td colspan="6" class="title"><?=_("Your Assurance Points")?></td>
2004-10-16 16:51:44 +00:00
</tr>
<tr>
2006-08-16 03:56:07 +00:00
<td class="DataTD"><b><?=_("ID")?></b></td>
2004-10-16 16:51:44 +00:00
<td class="DataTD"><b><?=_("Date")?></b></td>
<td class="DataTD"><b><?=_("Who")?></b></td>
<td class="DataTD"><b><?=_("Points")?></b></td>
<td class="DataTD"><b><?=_("Location")?></b></td>
<td class="DataTD"><b><?=_("Method")?></b></td>
</tr>
<?
2008-09-03 18:25:00 +00:00
$query = "select * from `notary` where `to`='".intval($_SESSION['profile']['id'])."'";
2004-10-16 16:51:44 +00:00
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
2008-09-03 18:25:00 +00:00
$fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['from'])."'"));
2004-10-16 16:51:44 +00:00
?>
<tr>
2006-08-16 03:56:07 +00:00
<td class="DataTD"><?=$row['id']?></td>
2004-10-16 16:51:44 +00:00
<td class="DataTD"><?=$row['date']?></td>
2008-09-03 18:25:00 +00:00
<td class="DataTD"><a href="wot.php?id=9&amp;userid=<?=intval($row['from'])?>"><?=$fromuser['fname']." ".$fromuser['lname']?></td>
2004-10-16 16:51:44 +00:00
<td class="DataTD"><?=$row['points']?></td>
<td class="DataTD"><?=$row['location']?></td>
2005-07-01 13:12:14 +00:00
<td class="DataTD"><?=_(sprintf("%s", $row['method']))?></td>
2004-10-16 16:51:44 +00:00
</tr>
<? } ?>
<tr>
2006-08-16 03:56:07 +00:00
<td class="DataTD" colspan="3"><b><?=_("Total Points")?>:</b></td>
2008-09-03 18:25:00 +00:00
<td class="DataTD"><?=intval($_SESSION['profile']['points'])?></td>
2004-10-16 16:51:44 +00:00
<td class="DataTD" colspan="2">&nbsp;</td>
</tr>
</table>
2004-10-21 04:22:14 +00:00
<br>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
2006-08-16 03:56:07 +00:00
<td colspan="6" class="title"><?=_("Assurance Points You Issued")?></td>
2004-10-21 04:22:14 +00:00
</tr>
<tr>
2006-08-16 03:56:07 +00:00
<td class="DataTD"><b><?=_("ID")?></b></td>
2004-10-21 04:22:14 +00:00
<td class="DataTD"><b><?=_("Date")?></b></td>
<td class="DataTD"><b><?=_("Who")?></b></td>
<td class="DataTD"><b><?=_("Points")?></b></td>
<td class="DataTD"><b><?=_("Location")?></b></td>
<td class="DataTD"><b><?=_("Method")?></b></td>
</tr>
<?
2004-12-30 22:16:58 +00:00
$points = 0;
2008-09-03 18:25:00 +00:00
$query = "select * from `notary` where `from`='".intval($_SESSION['profile']['id'])."' and `to`!='".intval($_SESSION['profile']['id'])."'";
2004-10-21 04:22:14 +00:00
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
2008-09-03 18:25:00 +00:00
$fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['to'])."'"));
2004-12-30 22:16:58 +00:00
$points += $row['points'];
2005-11-08 10:06:04 +00:00
$name = trim($fromuser['fname']." ".$fromuser['lname']);
if($name == "")
$name = _("Deleted before Verification");
else
2008-09-03 18:25:00 +00:00
$name = "<a href='wot.php?id=9&amp;userid=".intval($row['to'])."'>$name</a>";
2004-10-21 04:22:14 +00:00
?>
<tr>
2008-09-03 18:25:00 +00:00
<td class="DataTD"><?=intval($row['id'])?></td>
2004-10-21 04:22:14 +00:00
<td class="DataTD"><?=$row['date']?></td>
2005-11-08 10:06:04 +00:00
<td class="DataTD"><?=$name?></td>
2008-09-03 18:25:00 +00:00
<td class="DataTD"><?=intval($row['points'])?></td>
2004-10-21 04:22:14 +00:00
<td class="DataTD"><?=$row['location']?></td>
<td class="DataTD"><?=$row['method']==""?"":_(sprintf("%s", $row['method']))?></td>
2004-10-21 04:22:14 +00:00
</tr>
<? } ?>
<tr>
2006-08-16 03:56:07 +00:00
<td class="DataTD" colspan="3"><b><?=_("Total Points Issued")?>:</b></td>
2004-12-30 22:16:58 +00:00
<td class="DataTD"><?=$points?></td>
2004-10-21 04:22:14 +00:00
<td class="DataTD" colspan="2">&nbsp;</td>
</tr>
</table>
2005-07-01 13:12:14 +00:00
<p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p>
2004-10-16 16:51:44 +00:00