2004-10-16 00:28:17 +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.
|
|
|
|
*/ ?>
|
|
|
|
<?
|
2006-03-05 11:18:16 +00:00
|
|
|
exit;
|
2004-10-16 00:28:17 +00:00
|
|
|
if($_GET['action'] != "update")
|
|
|
|
{
|
|
|
|
$total1 = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and `users`.`id`=`notary`.`to`
|
|
|
|
group by `notary`.`to` HAVING SUM(`points`) >= 100"));
|
|
|
|
|
2004-11-03 01:45:21 +00:00
|
|
|
$town = mysql_escape_string(stripslashes($_GET['town']));
|
2004-10-16 00:28:17 +00:00
|
|
|
$start = intval($_GET['start']);
|
|
|
|
$limit = 25;
|
|
|
|
|
|
|
|
echo "<div id='listshow'><ul class='top'>\n<li>";
|
|
|
|
echo "<a href='wot.php?id=7'>"._("Home")." ("._("Listed").": $total1)</a>\n";
|
|
|
|
|
|
|
|
$display = "";
|
2007-07-03 20:00:18 +00:00
|
|
|
$ccid=intval($_GET['ccid']);
|
|
|
|
$locid=intval($_GET['locid']);
|
|
|
|
$regid=intval($_GET['regid']);
|
|
|
|
|
|
|
|
if($locid > 0)
|
2004-10-16 00:28:17 +00:00
|
|
|
{
|
2007-07-03 20:00:18 +00:00
|
|
|
$total4 = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and `locid`='".$locid."' and
|
2004-10-16 00:28:17 +00:00
|
|
|
`users`.`id`=`notary`.`to` group by `notary`.`to` HAVING SUM(`points`) >= 100"));
|
2007-07-03 20:00:18 +00:00
|
|
|
$loc = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='".$locid."'"));
|
2004-10-16 00:28:17 +00:00
|
|
|
$display = "<ul class='top'>\n<li>\n".
|
2007-07-03 20:00:18 +00:00
|
|
|
"<a href='wot.php?id=7&locid=".$locid."'>$loc[name] ("._("Listed").": $total4)</a>\n".
|
2004-10-16 00:28:17 +00:00
|
|
|
$display;
|
2007-07-03 20:00:18 +00:00
|
|
|
$regid = $loc['regid'];
|
2004-10-16 00:28:17 +00:00
|
|
|
}
|
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
if($regid > 0)
|
2004-10-16 00:28:17 +00:00
|
|
|
{
|
2007-07-03 20:00:18 +00:00
|
|
|
$total3 = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and `regid`='".$regid."' and
|
2004-10-16 00:28:17 +00:00
|
|
|
`users`.`id`=`notary`.`to` group by `notary`.`to` HAVING SUM(`points`) >= 100"));
|
2007-07-03 20:00:18 +00:00
|
|
|
$reg = mysql_fetch_assoc(mysql_query("select * from `regions` where `id`='".$regid."'"));
|
2004-10-16 00:28:17 +00:00
|
|
|
$display = "<ul class='top'>\n<li>\n".
|
2007-07-03 20:00:18 +00:00
|
|
|
"<a href='wot.php?id=7®id=".$regid."'>$reg[name] ("._("Listed").": $total3)</a>\n".
|
2004-10-16 00:28:17 +00:00
|
|
|
$display;
|
2007-07-03 20:00:18 +00:00
|
|
|
$ccid = $reg['ccid'];
|
2004-10-16 00:28:17 +00:00
|
|
|
}
|
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
if($ccid > 0)
|
2004-10-16 00:28:17 +00:00
|
|
|
{
|
|
|
|
$total2 = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and
|
2007-07-03 20:00:18 +00:00
|
|
|
`ccid`='".$ccid."' and `users`.`id`=`notary`.`to`
|
2004-10-16 00:28:17 +00:00
|
|
|
group by `notary`.`to` HAVING SUM(`points`) >= 100"));
|
2007-07-03 20:00:18 +00:00
|
|
|
$cnt = mysql_fetch_assoc(mysql_query("select * from `countries` where `id`='".$ccid."'"));
|
2004-10-16 00:28:17 +00:00
|
|
|
$display = "<ul class='top'>\n<li>\n".
|
2007-07-03 20:00:18 +00:00
|
|
|
"<a href='wot.php?id=7&ccid=".$ccid."'>$cnt[name] ("._("Listed").": $total2)</a>\n".
|
2004-10-16 00:28:17 +00:00
|
|
|
$display;
|
|
|
|
}
|
|
|
|
|
|
|
|
if($display)
|
|
|
|
echo $display;
|
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
if($ccid <= 0)
|
2004-10-16 00:28:17 +00:00
|
|
|
{
|
|
|
|
echo "<ul>\n";
|
2005-11-08 10:06:04 +00:00
|
|
|
$query = "select * from `countries` order by `name`";
|
2004-10-16 00:28:17 +00:00
|
|
|
$res = mysql_query($query);
|
|
|
|
while($row = mysql_fetch_assoc($res))
|
2005-11-08 10:06:04 +00:00
|
|
|
echo "<li><a href='wot.php?id=7&ccid=$row[id]'>$row[name]</a></li>\n";
|
2004-10-16 00:28:17 +00:00
|
|
|
|
|
|
|
echo "</ul>\n</li>\n</ul></div>\n<br>\n";
|
2007-07-03 20:00:18 +00:00
|
|
|
} elseif($regid <= 0) {
|
2004-10-16 00:28:17 +00:00
|
|
|
echo "<ul>\n";
|
2007-07-03 20:00:18 +00:00
|
|
|
$query = "select * from `regions` where `ccid`='".$ccid."' order by `name`";
|
2004-10-16 00:28:17 +00:00
|
|
|
$res = mysql_query($query);
|
|
|
|
while($row = mysql_fetch_assoc($res))
|
2005-11-08 10:06:04 +00:00
|
|
|
echo "<li><a href='wot.php?id=7®id=$row[id]'>$row[name]</a></li>\n";
|
2004-10-16 00:28:17 +00:00
|
|
|
|
|
|
|
echo "</ul>\n</li>\n</ul>\n</li>\n</ul></div>\n<br>\n";
|
2007-07-03 20:00:18 +00:00
|
|
|
} elseif($locid <= 0) {
|
2004-10-16 00:28:17 +00:00
|
|
|
echo "<ul>\n";
|
|
|
|
if($town != "")
|
|
|
|
{
|
2007-07-03 20:00:18 +00:00
|
|
|
$query = "select * from `locations` where `regid`='".$regid."' and `name` < '$town'";
|
2004-10-16 00:28:17 +00:00
|
|
|
$start = mysql_num_rows(mysql_query($query));
|
|
|
|
}
|
2007-07-03 20:00:18 +00:00
|
|
|
$query = "select * from `locations` where `regid`='".$regid."' order by `name` limit $start, $limit";
|
2004-10-16 00:28:17 +00:00
|
|
|
$res = mysql_query($query);
|
|
|
|
while($row = mysql_fetch_assoc($res))
|
2005-11-08 10:06:04 +00:00
|
|
|
echo "<li><a href='wot.php?id=7&locid=$row[id]'>$row[name]</a></li>\n";
|
2004-10-16 00:28:17 +00:00
|
|
|
|
|
|
|
echo "</ul>\n</li>\n</ul>\n</li>\n</ul></div>\n<br>\n";
|
2007-07-03 20:00:18 +00:00
|
|
|
$rc = mysql_num_rows(mysql_query("select * from `locations` where `regid`='".$regid."'"));
|
2004-10-16 00:28:17 +00:00
|
|
|
if($start > 0)
|
|
|
|
{
|
|
|
|
$prev = $start - $limit;
|
|
|
|
if($prev < 0)
|
|
|
|
$prev = 0;
|
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
$st = "[ <a href='wot.php?id=7®id=".$regid."'><< Start</a> ] ";
|
|
|
|
$prev = "[ <a href='wot.php?id=7®id=".$regid."&start=$prev'>< Previous $limit</a> ] ";
|
2004-10-16 00:28:17 +00:00
|
|
|
}
|
|
|
|
if($start < $rc - $limit)
|
|
|
|
{
|
|
|
|
$next = $start + $limit;
|
|
|
|
$last = $rc - $limit;
|
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
$next = "[ <a href='wot.php?id=7®id=".$regid."&start=$next'>Next $limit ></a> ] ";
|
|
|
|
$end = "[ <a href='wot.php?id=7®id=".$regid."&start=$last'>End >></a> ]";
|
2004-10-16 00:28:17 +00:00
|
|
|
}
|
|
|
|
echo "<div id='search1'>$st</div><div id='search3'>$end</div>\n";
|
|
|
|
echo "<div id='search2'>$prev</div><div id='search4'>$next</div>\n";
|
|
|
|
?>
|
|
|
|
<div align="left">
|
|
|
|
<form method="get" action="wot.php">
|
|
|
|
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="200">
|
|
|
|
<tr>
|
|
|
|
<td colspan="2" class="title"><?=_("Search this region")?></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="DataTD" width="125"><?=_("Location Name")?>: </td>
|
2007-07-03 20:00:18 +00:00
|
|
|
<td class="DataTD" width="125"><input type="text" name="town" value="<?=sanitizeHTML($_GET['town'])?>" size="10"></td>
|
2004-10-16 00:28:17 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Search")?>"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2007-07-03 20:00:18 +00:00
|
|
|
<input type="hidden" name="regid" value="<?=$regid?>">
|
2004-10-16 00:28:17 +00:00
|
|
|
<input type="hidden" name="id" value="7">
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<?
|
|
|
|
} else {
|
|
|
|
echo "</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<br>\n";
|
2007-07-03 20:00:18 +00:00
|
|
|
echo "<p><a href='wot.php?id=7&action=update&locid=".$locid."'>";
|
2004-10-16 00:28:17 +00:00
|
|
|
echo _("Make my location here");
|
|
|
|
echo "</a></p>\n";
|
|
|
|
echo "<p>"._("If you are happy with this location, click 'Make my location here' to update your location details.")."</p><br>\n";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$total1 = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and `users`.`id`=`notary`.`to`
|
|
|
|
group by `notary`.`to` HAVING SUM(`points`) >= 100"));
|
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
if($locid > 0)
|
2004-10-16 00:28:17 +00:00
|
|
|
{
|
2007-07-03 20:00:18 +00:00
|
|
|
$total4 = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and `locid`='".$locid."' and
|
2004-10-16 00:28:17 +00:00
|
|
|
`users`.`id`=`notary`.`to` group by `notary`.`to` HAVING SUM(`points`) >= 100"));
|
2007-07-03 20:00:18 +00:00
|
|
|
$loc = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='".$locid."'"));
|
|
|
|
$regid = $loc['regid'];
|
2004-10-16 00:28:17 +00:00
|
|
|
}
|
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
if($regid) > 0)
|
2004-10-16 00:28:17 +00:00
|
|
|
{
|
2007-07-03 20:00:18 +00:00
|
|
|
$total3 = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and `regid`='".$regid."' and
|
2004-10-16 00:28:17 +00:00
|
|
|
`users`.`id`=`notary`.`to` group by `notary`.`to` HAVING SUM(`points`) >= 100"));
|
2007-07-03 20:00:18 +00:00
|
|
|
$reg = mysql_fetch_assoc(mysql_query("select * from `regions` where `id`='".$regid."'"));
|
|
|
|
$ccid = $reg['ccid'];
|
2004-10-16 00:28:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$total2 = mysql_num_rows(mysql_query("select * from `users`,`notary` where `listme`='1' and
|
2007-07-03 20:00:18 +00:00
|
|
|
`ccid`='".$ccid."' and `users`.`id`=`notary`.`to`
|
2004-10-16 00:28:17 +00:00
|
|
|
group by `notary`.`to` HAVING SUM(`points`) >= 100"));
|
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
$_SESSION['profile']['ccid'] = $ccid;
|
|
|
|
$_SESSION['profile']['regid'] = $regid;
|
|
|
|
$_SESSION['profile']['locid'] = $locid;
|
2004-10-16 00:28:17 +00:00
|
|
|
|
2007-07-03 20:00:18 +00:00
|
|
|
mysql_query("update `users` set `ccid`='".$ccid."',`regid`='".$regid."',`locid`='".$locid."'
|
2004-10-16 00:28:17 +00:00
|
|
|
where `id`='".$_SESSION['profile']['id']."'");
|
|
|
|
|
|
|
|
echo _("Your details have been updated.");
|
|
|
|
}
|
|
|
|
?>
|