cacert-webdb/pages/wot/1.php

117 lines
4.4 KiB
PHP
Raw Normal View History

2007-04-04 12:27:19 +00:00
<? /*
2008-04-06 19:45:09 +00:00
LibreSSL - CAcert web application
Copyright (C) 2004-2008 CAcert Inc.
2007-04-04 12:27:19 +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.
2007-04-04 12:27:19 +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.
2007-04-04 12:27:19 +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
2007-04-04 12:27:19 +00:00
*/ ?>
<?
2008-01-18 22:55:35 +00:00
$res=mysql_fetch_assoc(mysql_query("select sum(acount) as summe from countries"));
$total1 =$res['summe'];
2007-04-04 12:27:19 +00:00
2009-04-25 23:11:46 +00:00
$locid=array_key_exists('locid',$_REQUEST)?intval($_REQUEST['locid']):0;
$regid=array_key_exists('regid',$_REQUEST)?intval($_REQUEST['regid']):0;
$ccid=array_key_exists('ccid',$_REQUEST)?intval($_REQUEST['ccid']):0;
2007-04-04 12:27:19 +00:00
echo "<ul class='top'>\n<li>";
echo "<a href='wot.php?id=1'>"._("Home")." ("._("Listed").": $total1)</a>\n";
$display = "";
2009-04-25 23:11:46 +00:00
if($locid > 0)
2007-04-04 12:27:19 +00:00
{
2009-04-25 23:11:46 +00:00
$loc = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='".$locid."'"));
2007-04-04 12:27:19 +00:00
$display = "<ul class='top'>\n<li>\n".
2009-04-25 23:11:46 +00:00
"<a href='wot.php?id=1&locid=".$locid."'>".$loc['name']." ("._("Listed").": ".$loc['acount'].")</a>\n".
2007-04-04 12:27:19 +00:00
$display;
2009-04-25 23:11:46 +00:00
$regid = $loc['regid'];
2007-04-04 12:27:19 +00:00
}
2009-04-25 23:11:46 +00:00
if($regid > 0)
2007-04-04 12:27:19 +00:00
{
2009-04-25 23:11:46 +00:00
$reg = mysql_fetch_assoc(mysql_query("select * from `regions` where `id`='".$regid."'"));
2007-04-04 12:27:19 +00:00
$display = "<ul class='top'>\n<li>\n".
2009-04-25 23:11:46 +00:00
"<a href='wot.php?id=1&regid=".$regid."'>".$reg['name']." ("._("Listed").": ".$reg['acount'].")</a>\n".
2007-04-04 12:27:19 +00:00
$display;
2009-04-25 23:11:46 +00:00
$ccid = $reg['ccid'];
2007-04-04 12:27:19 +00:00
}
2009-04-25 23:11:46 +00:00
if($ccid > 0)
2007-04-04 12:27:19 +00:00
{
2009-04-25 23:11:46 +00:00
$cnt = mysql_fetch_assoc(mysql_query("select * from `countries` where `id`='".$ccid."'"));
2007-04-04 12:27:19 +00:00
$display = "<ul class='top'>\n<li>\n".
2009-04-25 23:11:46 +00:00
"<a href='wot.php?id=1&ccid=".$ccid."'>".$cnt['name']." ("._("Listed").": ".$cnt['acount'].")</a>\n".
2007-04-04 12:27:19 +00:00
$display;
}
if($display)
echo $display;
2009-04-25 23:11:46 +00:00
if($ccid <= 0)
2007-04-04 12:27:19 +00:00
{
echo "<ul>\n";
2008-01-23 15:05:27 +00:00
$query = "select * from countries where acount>0 order by `name`";
$res = mysql_query($query);
2007-04-04 12:27:19 +00:00
while($row = mysql_fetch_assoc($res))
{
2009-04-25 23:11:46 +00:00
echo "<li><a href='wot.php?id=1&ccid=".$row['id']."'>".$row['name']." ("._("Listed").": ".$row['acount'].")</a></li>\n";
2007-04-04 12:27:19 +00:00
}
echo "</ul>\n</li>\n</ul>\n<br>\n";
2009-04-25 23:11:46 +00:00
} elseif($ccid > 0 && $regid <= 0 && $locid <= 0) {
2007-04-04 12:27:19 +00:00
echo "<ul>\n";
2009-04-25 23:11:46 +00:00
$query = "select * from regions where ccid='".$ccid."' and acount>0 order by `name`";
2007-04-04 12:27:19 +00:00
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
2009-04-25 23:11:46 +00:00
echo "<li><a href='wot.php?id=1&regid=".$row['id']."'>".$row['name']." ("._("Listed").": ".$row['acount'].")</a></li>\n";
2007-04-04 12:27:19 +00:00
}
echo "</ul>\n</li>\n</ul>\n</li>\n</ul>\n<br>\n";
2009-04-25 23:11:46 +00:00
} elseif($regid > 0 && $locid <= 0) {
2007-04-04 12:27:19 +00:00
echo "<ul>\n";
2009-04-25 23:11:46 +00:00
$query = "select * from locations where regid='".$regid."' and acount>0 order by `name`";
2007-04-04 12:27:19 +00:00
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
2009-04-25 23:11:46 +00:00
echo "<li><a href='wot.php?id=1&locid=".$row['id']."'>".$row['name']." ("._("Listed").": ".$row['acount'].")</a></li>\n";
2007-04-04 12:27:19 +00:00
}
echo "</ul>\n</li>\n</ul>\n</li>\n</ul>\n<br>\n";
2009-04-25 23:11:46 +00:00
} elseif($locid > 0){
2007-04-04 12:27:19 +00:00
echo "</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<br>\n";
}
$query = "select *, `users`.`id` as `id` from `users`,`notary` where `listme`='1' and
2009-04-25 23:11:46 +00:00
`ccid`='".$ccid."' and `regid`='".$regid."' and
`locid`='".$locid."' and `users`.`id`=`notary`.`to`
2007-04-04 12:27:19 +00:00
group by `notary`.`to` HAVING SUM(`points`) >= 100 order by `points` desc";
$list = mysql_query($query);
if(mysql_num_rows($list) > 0)
{
?>
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="550">
<tr>
<td class="title"><?=_("Name")?></td>
<td class="title"><?=_("Max Points")?></td>
<td class="title"><?=_("Contact Details")?></td>
<td class="title"><?=_("Email Assurer")?></td>
</tr>
<? while($row = mysql_fetch_assoc($list)) { ?>
<tr>
<td class="DataTD" width="100"><nobr><?=$row['fname']?> <?=substr($row['lname'], 0, 1)?></nobr></td>
<td class="DataTD"><?=maxpoints($row['id'])?></td>
<td class="DataTD"><?=$row['contactinfo']?></td>
2008-09-03 18:25:00 +00:00
<td class="DataTD"><a href="wot.php?id=9&amp;userid=<?=intval($row['id'])?>"><?=_("Email Me")?></a></td>
2007-04-04 12:27:19 +00:00
</tr>
<? } ?>
</table>
<br>
<? } ?>