summaryrefslogtreecommitdiff
path: root/pages/wot/10.php
blob: 51ed0190502a34e3e50008cb5668b82038737d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<? /*
    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
*/ ?>
<?
?>
<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`='".intval($_SESSION['profile']['id'])."' GROUP BY `notary`.`from`";
	$res = mysql_query($query);
	$row = mysql_fetch_assoc($res);
	$rc = intval($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 `notary`.`when` DESC";
*/
	$query = "SELECT count(*) AS `list` FROM `users` 
			inner join `notary` on `users`.`id` = `notary`.`from` 
			GROUP BY `notary`.`from` HAVING count(*) > '$rc'";

	$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>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
  <tr>
    <td colspan="6" class="title"><?=_("Your Assurance Points")?></td>
  </tr>
  <tr>
    <td class="DataTD"><b><?=_("ID")?></b></td>
    <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`='".intval($_SESSION['profile']['id'])."'";
	$res = mysql_query($query);
	while($row = mysql_fetch_assoc($res))
	{
		$fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['from'])."'"));
?>
  <tr>
    <td class="DataTD"><?=$row['id']?></td>
    <td class="DataTD"><?=$row['date']?></td>
    <td class="DataTD"><a href="wot.php?id=9&amp;userid=<?=intval($row['from'])?>"><?=$fromuser['fname']." ".$fromuser['lname']?></td>
    <td class="DataTD"><?=$row['points']?></td>
    <td class="DataTD"><?=$row['location']?></td>
    <td class="DataTD"><?=_(sprintf("%s", $row['method']))?></td>
  </tr>
<? } ?>
  <tr>
    <td class="DataTD" colspan="3"><b><?=_("Total Points")?>:</b></td>
    <td class="DataTD"><?=intval($_SESSION['profile']['points'])?></td>
    <td class="DataTD" colspan="2">&nbsp;</td>
  </tr>
</table>
<br>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
  <tr>
    <td colspan="6" class="title"><?=_("Assurance Points You Issued")?></td>
  </tr>
  <tr>
    <td class="DataTD"><b><?=_("ID")?></b></td>
    <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>
<?
	$points = 0;
	$query = "select * from `notary` where `from`='".intval($_SESSION['profile']['id'])."' and `to`!='".intval($_SESSION['profile']['id'])."'";
	$res = mysql_query($query);
	while($row = mysql_fetch_assoc($res))
	{
		$fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['to'])."'"));
		$points += $row['points'];
		$name = trim($fromuser['fname']." ".$fromuser['lname']);
		if($name == "")
			$name = _("Deleted before Verification");
		else
			$name = "<a href='wot.php?id=9&amp;userid=".intval($row['to'])."'>$name</a>";
?>
  <tr>
    <td class="DataTD"><?=intval($row['id'])?></td>
    <td class="DataTD"><?=$row['date']?></td>
    <td class="DataTD"><?=$name?></td>
    <td class="DataTD"><?=intval($row['points'])?></td>
    <td class="DataTD"><?=$row['location']?></td>
    <td class="DataTD"><?=$row['method']==""?"":_(sprintf("%s", $row['method']))?></td>
  </tr>
<? } ?>
  <tr>
    <td class="DataTD" colspan="3"><b><?=_("Total Points Issued")?>:</b></td>
    <td class="DataTD"><?=$points?></td>
    <td class="DataTD" colspan="2">&nbsp;</td>
  </tr>
</table>
<p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p>