123 lines
4.3 KiB
PHP
123 lines
4.3 KiB
PHP
|
<? /*
|
||
|
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.
|
||
|
*/ ?>
|
||
|
<?
|
||
|
$town = mysql_escape_string(stripslashes($_GET['town']));
|
||
|
$start = intval($_GET['start']);
|
||
|
$limit = 25;
|
||
|
|
||
|
echo "<div id='listshow'><ul class='top'>\n<li>";
|
||
|
echo "<a href='account.php?id=53'>"._("Home")."</a>\n";
|
||
|
|
||
|
$display = "";
|
||
|
if(intval($_GET['locid']) > 0)
|
||
|
{
|
||
|
$loc = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='".$_GET['locid']."'"));
|
||
|
$display = "<ul class='top'>\n<li>\n".
|
||
|
"<a href='account.php?id=53&locid=".$_GET['locid']."'>$loc[name]</a> - Add\n".
|
||
|
$display;
|
||
|
$_GET['regid'] = $loc['regid'];
|
||
|
}
|
||
|
|
||
|
if(intval($_GET['regid']) > 0)
|
||
|
{
|
||
|
$reg = mysql_fetch_assoc(mysql_query("select * from `regions` where `id`='".$_GET['regid']."'"));
|
||
|
$display = "<ul class='top'>\n<li>\n".
|
||
|
"<a href='account.php?id=53®id=".$_GET['regid']."'>$reg[name]</a> - Add\n".
|
||
|
$display;
|
||
|
$_GET['ccid'] = $reg['ccid'];
|
||
|
}
|
||
|
|
||
|
if(intval($_GET['ccid']) > 0)
|
||
|
{
|
||
|
$cnt = mysql_fetch_assoc(mysql_query("select * from `countries` where `id`='".$_GET['ccid']."'"));
|
||
|
$display = "<ul class='top'>\n<li>\n".
|
||
|
"<a href='account.php?id=53&ccid=".$_GET['ccid']."'>$cnt[name]</a> - Add\n".
|
||
|
$display;
|
||
|
}
|
||
|
|
||
|
if($display)
|
||
|
echo $display;
|
||
|
|
||
|
if(intval($_GET['ccid']) <= 0)
|
||
|
{
|
||
|
echo "<ul>\n";
|
||
|
$query = "select * from `countries` order by `name`";
|
||
|
$res = mysql_query($query);
|
||
|
while($row = mysql_fetch_assoc($res))
|
||
|
echo "<li><a href='account.php?id=53&ccid=$row[id]'>$row[name]</a></li>\n";
|
||
|
|
||
|
echo "</ul>\n</li>\n</ul></div>\n<br>\n";
|
||
|
} elseif(intval($_GET['regid']) <= 0) {
|
||
|
echo "<ul>\n";
|
||
|
$query = "select * from `regions` where `ccid`='".$_GET['ccid']."' order by `name`";
|
||
|
$res = mysql_query($query);
|
||
|
while($row = mysql_fetch_assoc($res))
|
||
|
echo "<li>( edit | delete ) <a href='account.php?id=53®id=$row[id]'>$row[name]</a></li>\n";
|
||
|
|
||
|
echo "</ul>\n</li>\n</ul>\n</li>\n</ul></div>\n<br>\n";
|
||
|
} elseif(intval($_GET['locid']) <= 0) {
|
||
|
echo "<ul>\n";
|
||
|
if($town != "")
|
||
|
{
|
||
|
$query = "select * from `locations` where `regid`='".$_GET['regid']."' and `name` < '$town'";
|
||
|
$start = mysql_num_rows(mysql_query($query));
|
||
|
}
|
||
|
$query = "select * from `locations` where `regid`='".$_GET['regid']."' order by `name` limit $start, $limit";
|
||
|
$res = mysql_query($query);
|
||
|
while($row = mysql_fetch_assoc($res))
|
||
|
echo "<li>( edit | delete ) <a href='account.php?id=53&locid=$row[id]'>$row[name]</a></li>\n";
|
||
|
|
||
|
echo "</ul>\n</li>\n</ul>\n</li>\n</ul></div>\n<br>\n";
|
||
|
$rc = mysql_num_rows(mysql_query("select * from `locations` where `regid`='".$_GET['regid']."'"));
|
||
|
if($start > 0)
|
||
|
{
|
||
|
$prev = $start - $limit;
|
||
|
if($prev < 0)
|
||
|
$prev = 0;
|
||
|
|
||
|
$st = "[ <a href='account.php?id=53®id=".$_GET['regid']."'><< Start</a> ] ";
|
||
|
$prev = "[ <a href='account.php?id=53®id=".$_GET['regid']."&start=$prev'>< Previous $limit</a> ] ";
|
||
|
}
|
||
|
if($start < $rc - $limit)
|
||
|
{
|
||
|
$next = $start + $limit;
|
||
|
$last = $rc - $limit;
|
||
|
|
||
|
$next = "[ <a href='account.php?id=53®id=".$_GET['regid']."&start=$next'>Next $limit ></a> ] ";
|
||
|
$end = "[ <a href='account.php?id=53®id=".$_GET['regid']."&start=$last'>End >></a> ]";
|
||
|
}
|
||
|
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="account.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>
|
||
|
<td class="DataTD" width="125"><input type="text" name="town" value="<?=$_GET['town']?>" size="10"></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Search")?>"></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<input type="hidden" name="regid" value="<?=$_GET['regid']?>">
|
||
|
<input type="hidden" name="id" value="53">
|
||
|
</form>
|
||
|
</div>
|
||
|
<? } ?>
|