cacert-webdb/pages/wot/10.php

107 lines
4.1 KiB
PHP
Raw Normal View History

2004-10-16 16:51:44 +00:00
<? /*
Copyright (C) 2004 by Duane Groth <duane_at_CAcert_dot_org>
This file is part of CAcert.
CAcert has been released under the CAcert Source License
which can be found included with these source files or can
be downloaded from the internet from the following address:
http://www.cacert.org/src-lic.php
CAcert is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the License for more details.
*/ ?>
<?
?>
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>
<?
$query = "SELECT `users`. *, count(*) AS `list` FROM `users`, `notary`
WHERE `users`.`id` = `notary`.`from` AND `notary`.`from` != `notary`.`to`
AND `from`='".$_SESSION['profile']['id']."' GROUP BY `notary`.`from`";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$rc = $row['list'];
$query = "SELECT `users`. *, count(*) AS `list` FROM `users`, `notary`
WHERE `users`.`id` = `notary`.`from` AND `notary`.`from` != `notary`.`to`
GROUP BY `notary`.`from` HAVING count(*) > '$rc' ORDER BY `list` DESC";
$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>
2004-10-24 01:46:49 +00:00
<td colspan="5" class="title"><?=_("Your Assurance Points")?></td>
2004-10-16 16:51:44 +00:00
</tr>
<tr>
<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>
<?
$query = "select * from `notary` where `to`='".$_SESSION['profile']['id']."'";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
$fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$row['from']."'"));
?>
<tr>
<td class="DataTD"><?=$row['date']?></td>
<td class="DataTD"><a href="wot.php?id=9&userid=<?=$row['from']?>"><?=$fromuser['fname']." ".$fromuser['lname']?></td>
<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>
<td class="DataTD" colspan="2"><b><?=_("Total Points")?>:</b></td>
<td class="DataTD"><?=$_SESSION['profile']['points']?></td>
<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>
2004-10-24 01:46:49 +00:00
<td colspan="5" class="title"><?=_("Assurance Points You Issued")?></td>
2004-10-21 04:22:14 +00:00
</tr>
<tr>
<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;
$query = "select * from `notary` where `from`='".$_SESSION['profile']['id']."' and `to`!='".$_SESSION['profile']['id']."'";
2004-10-21 04:22:14 +00:00
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
$fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$row['to']."'"));
2004-12-30 22:16:58 +00:00
$points += $row['points'];
2004-10-21 04:22:14 +00:00
?>
<tr>
<td class="DataTD"><?=$row['date']?></td>
2004-10-31 07:08:42 +00:00
<td class="DataTD"><a href="wot.php?id=9&userid=<?=$row['to']?>"><?=$fromuser['fname']." ".$fromuser['lname']?></td>
2004-10-21 04:22:14 +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-21 04:22:14 +00:00
</tr>
<? } ?>
<tr>
2004-12-30 22:16:58 +00:00
<td class="DataTD" colspan="2"><b><?=_("Total Points Issued")?>:</b></td>
<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