/*
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
*/ ?>
?>
=_("Assurer Ranking")?> |
$query = "SELECT COUNT(1) as `assurances` FROM `notary` WHERE `from`=".intval($_SESSION['profile']['id'])." AND `from` != `to`";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$rc = intval($row['assurances']);
$query = "SELECT COUNT(1) FROM `notary` GROUP BY `from` HAVING COUNT(1) > {$rc}";
$rank = mysql_num_rows(mysql_query($query)) + 1;
?>
=sprintf(_("You have made %s assurances which ranks you as the #%s top assurer."), intval($rc), intval($rank))?> |
=_("Your Assurance Points")?> |
=_("ID")?> |
=_("Date")?> |
=_("Who")?> |
=_("Points")?> |
=_("Location")?> |
=_("Method")?> |
$points = 0;
$query = "select sum(points) as apoints from `notary` where `from`='".intval($_SESSION['profile']['id'])."' and `from`=`to` ";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$maxpoints=intval($_SESSION['profile']['points'])-$row['apoints'];
$points = 0;
$query = "SELECT n.`id`, n.`date`, n.`awarded`, n.`from` as `from_id`, u.`fname` AS `from_fname`, u.`lname` AS `from_lname`, n.`location`, n.`method` FROM `notary` n LEFT JOIN `users` u ON n.`from`=u.`id` WHERE n.`to`=".intval($_SESSION['profile']['id'])." ORDER BY n.`when` DESC, n.`id` DESC";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
$awarded = $row['awarded'];
if ($points+$awarded > $maxpoints)
$awarded = $maxpoints-$points;
$points = $points + $awarded;
?>
=$row['id']?> |
=$row['date']?> |
=$row['from_fname']." ".$row['from_lname']?> |
=$awarded?> |
=$row['location']?> |
=_(sprintf("%s", $row['method']))?> |
} ?>
=_("Total Points")?>: |
=intval($_SESSION['profile']['points'])?> |
|
=_("Assurance Points You Issued")?> |
=_("ID")?> |
=_("Date")?> |
=_("Who")?> |
=_("Points")?> |
=_("Location")?> |
=_("Method")?> |
$points = 0;
$query = "SELECT n.`id`, n.`date`, n.`awarded`, n.`location`, n.`method`, n.`to` AS `to_id`, u.`fname` AS `to_fname`, u.`lname` AS `to_lname` FROM `notary` n LEFT JOIN `users` u ON n.`to`=u.`id` WHERE n.`from`=".intval($_SESSION['profile']['id'])." AND n.`to`!=".intval($_SESSION['profile']['id'])." ORDER BY n.`when` DESC, n.`id` DESC";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
$points += $row['awarded'];
$name = trim($row['to_fname']." ".$row['to_lname']);
if($name == "")
$name = ''._("Deleted before Verification").'';
else
$name = "$name";
?>
=intval($row['id'])?> |
=$row['date']?> |
=$name?> |
=intval($row['awarded'])?> |
=$row['location']?> |
=$row['method']==""?"":_(sprintf("%s", $row['method']))?> |
} ?>
=_("Total Points Issued")?>: |
=$points?> |
|
[ =_("Go Back")?> ]