remove cacert/ prefix
[cacert-devel.git] / pages / wot / 10.php
1 <? /*
2 LibreSSL - CAcert web application
3 Copyright (C) 2004-2008 CAcert Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */ ?>
18 <?
19 ?>
20 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
21 <tr>
22 <td colspan="5" class="title"><?=_("Assurer Ranking")?></td>
23 </tr>
24 <tr>
25 <?
26 $query = "SELECT `users`. *, count(*) AS `list` FROM `users`, `notary`
27 WHERE `users`.`id` = `notary`.`from` AND `notary`.`from` != `notary`.`to`
28 AND `from`='".intval($_SESSION['profile']['id'])."' GROUP BY `notary`.`from`";
29 $res = mysql_query($query);
30 $row = mysql_fetch_assoc($res);
31 $rc = intval($row['list']);
32 /*
33 $query = "SELECT `users`. *, count(*) AS `list` FROM `users`, `notary`
34 WHERE `users`.`id` = `notary`.`from` AND `notary`.`from` != `notary`.`to`
35 GROUP BY `notary`.`from` HAVING count(*) > '$rc' ORDER BY `notary`.`when` DESC";
36 */
37 $query = "SELECT count(*) AS `list` FROM `users`
38 inner join `notary` on `users`.`id` = `notary`.`from`
39 GROUP BY `notary`.`from` HAVING count(*) > '$rc'";
40
41 $rank = mysql_num_rows(mysql_query($query)) + 1;
42 ?>
43 <td class="DataTD"><?=sprintf(_("You have made %s assurances which ranks you as the #%s top assurer."), intval($rc), intval($rank))?></td>
44 </tr>
45 </table>
46 <br>
47 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
48 <tr>
49 <td colspan="6" class="title"><?=_("Your Assurance Points")?></td>
50 </tr>
51 <tr>
52 <td class="DataTD"><b><?=_("ID")?></b></td>
53 <td class="DataTD"><b><?=_("Date")?></b></td>
54 <td class="DataTD"><b><?=_("Who")?></b></td>
55 <td class="DataTD"><b><?=_("Points")?></b></td>
56 <td class="DataTD"><b><?=_("Location")?></b></td>
57 <td class="DataTD"><b><?=_("Method")?></b></td>
58 </tr>
59 <?
60 $query = "select * from `notary` where `to`='".intval($_SESSION['profile']['id'])."'";
61 $res = mysql_query($query);
62 while($row = mysql_fetch_assoc($res))
63 {
64 $fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['from'])."'"));
65 ?>
66 <tr>
67 <td class="DataTD"><?=$row['id']?></td>
68 <td class="DataTD"><?=$row['date']?></td>
69 <td class="DataTD"><a href="wot.php?id=9&amp;userid=<?=intval($row['from'])?>"><?=$fromuser['fname']." ".$fromuser['lname']?></td>
70 <td class="DataTD"><?=$row['points']?></td>
71 <td class="DataTD"><?=$row['location']?></td>
72 <td class="DataTD"><?=_(sprintf("%s", $row['method']))?></td>
73 </tr>
74 <? } ?>
75 <tr>
76 <td class="DataTD" colspan="3"><b><?=_("Total Points")?>:</b></td>
77 <td class="DataTD"><?=intval($_SESSION['profile']['points'])?></td>
78 <td class="DataTD" colspan="2">&nbsp;</td>
79 </tr>
80 </table>
81 <br>
82 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
83 <tr>
84 <td colspan="6" class="title"><?=_("Assurance Points You Issued")?></td>
85 </tr>
86 <tr>
87 <td class="DataTD"><b><?=_("ID")?></b></td>
88 <td class="DataTD"><b><?=_("Date")?></b></td>
89 <td class="DataTD"><b><?=_("Who")?></b></td>
90 <td class="DataTD"><b><?=_("Points")?></b></td>
91 <td class="DataTD"><b><?=_("Location")?></b></td>
92 <td class="DataTD"><b><?=_("Method")?></b></td>
93 </tr>
94 <?
95 $points = 0;
96 $query = "select * from `notary` where `from`='".intval($_SESSION['profile']['id'])."' and `to`!='".intval($_SESSION['profile']['id'])."'";
97 $res = mysql_query($query);
98 while($row = mysql_fetch_assoc($res))
99 {
100 $fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['to'])."'"));
101 $points += $row['points'];
102 $name = trim($fromuser['fname']." ".$fromuser['lname']);
103 if($name == "")
104 $name = _("Deleted before Verification");
105 else
106 $name = "<a href='wot.php?id=9&amp;userid=".intval($row['to'])."'>$name</a>";
107 ?>
108 <tr>
109 <td class="DataTD"><?=intval($row['id'])?></td>
110 <td class="DataTD"><?=$row['date']?></td>
111 <td class="DataTD"><?=$name?></td>
112 <td class="DataTD"><?=intval($row['points'])?></td>
113 <td class="DataTD"><?=$row['location']?></td>
114 <td class="DataTD"><?=$row['method']==""?"":_(sprintf("%s", $row['method']))?></td>
115 </tr>
116 <? } ?>
117 <tr>
118 <td class="DataTD" colspan="3"><b><?=_("Total Points Issued")?>:</b></td>
119 <td class="DataTD"><?=$points?></td>
120 <td class="DataTD" colspan="2">&nbsp;</td>
121 </tr>
122 </table>
123 <p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p>
124