158 lines
5.8 KiB
PHP
158 lines
5.8 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.
|
|
*/ ?>
|
|
<? if($_REQUEST['ccid'] > 0 && $_REQUEST['action'] == "add") { ?>
|
|
<form method="post" action="account.php">
|
|
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
|
|
<tr>
|
|
<td colspan="2" class="title"><?=_("Add Region")?></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Region")?>:</td>
|
|
<td class="DataTD"><input type="text" name="name" value="<?=$_REQUEST['name']?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Add")?>"></td>
|
|
</tr>
|
|
</table>
|
|
<input type="hidden" name="action" value="add">
|
|
<input type="hidden" name="ccid" value="<?=$_REQUEST['ccid']?>">
|
|
<input type="hidden" name="oldid" value="54">
|
|
</form>
|
|
<? } if($_REQUEST['regid'] > 0 && $_REQUEST['action'] == "edit") {
|
|
$query = "select * from `regions` where `id`='$_REQUEST[regid]' order by `name`";
|
|
$row = mysql_fetch_assoc(mysql_query($query));
|
|
$_REQUEST['name'] = $row['name'];
|
|
?>
|
|
<form method="post" action="account.php">
|
|
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
|
|
<tr>
|
|
<td colspan="2" class="title"><?=_("Edit Region")?></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Region")?>:</td>
|
|
<td class="DataTD"><input type="text" name="name" value="<?=$_REQUEST['name']?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Update")?>"></td>
|
|
</tr>
|
|
</table>
|
|
<input type="hidden" name="action" value="edit">
|
|
<input type="hidden" name="regid" value="<?=$_REQUEST['regid']?>">
|
|
<input type="hidden" name="oldid" value="54">
|
|
</form>
|
|
<? } if($_REQUEST['regid'] > 0 && $_REQUEST['action'] == "add") { ?>
|
|
<form method="post" action="account.php">
|
|
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
|
|
<tr>
|
|
<td colspan="2" class="title"><?=_("Add Location")?></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Location")?>:</td>
|
|
<td class="DataTD"><input type="text" name="name" value="<?=$_REQUEST['name']?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Longitude")?>:</td>
|
|
<td class="DataTD"><input type="text" name="longitude" value="<?=$_REQUEST['longitude']?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Latitude")?>:</td>
|
|
<td class="DataTD"><input type="text" name="latitude" value="<?=$_REQUEST['latitude']?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Add")?>"></td>
|
|
</tr>
|
|
</table>
|
|
<input type="hidden" name="action" value="add">
|
|
<input type="hidden" name="regid" value="<?=$_REQUEST['regid']?>">
|
|
<input type="hidden" name="oldid" value="54">
|
|
</form>
|
|
<? } if($_REQUEST['locid'] > 0 && $_REQUEST['action'] == "edit") {
|
|
$locid = intval($_REQUEST['locid']);
|
|
$query = "select * from `locations` where `id`='$locid'";
|
|
$row = mysql_fetch_assoc(mysql_query($query));
|
|
|
|
if($_REQUEST['name'] == "")
|
|
$_REQUEST['name'] = $row['name'];
|
|
if($_REQUEST['longitude'] == "")
|
|
$_REQUEST['longitude'] = $row['long'];
|
|
if($_REQUEST['latitude'] == "")
|
|
$_REQUEST['latitude'] = $row['lat'];
|
|
?>
|
|
<form method="post" action="account.php">
|
|
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
|
|
<tr>
|
|
<td colspan="2" class="title"><?=_("Edit Location")?></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Location")?>:</td>
|
|
<td class="DataTD"><input type="text" name="name" value="<?=$_REQUEST['name']?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Longitude")?>:</td>
|
|
<td class="DataTD"><input type="text" name="longitude" value="<?=$_REQUEST['longitude']?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Latitude")?>:</td>
|
|
<td class="DataTD"><input type="text" name="latitude" value="<?=$_REQUEST['latitude']?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Update")?>"></td>
|
|
</tr>
|
|
</table>
|
|
<input type="hidden" name="action" value="edit">
|
|
<input type="hidden" name="locid" value="<?=$_REQUEST['locid']?>">
|
|
<input type="hidden" name="oldid" value="54">
|
|
</form>
|
|
<? } if($_REQUEST['locid'] > 0 && $_REQUEST['action'] == "move") {
|
|
$locid = intval($_REQUEST['locid']);
|
|
$query = "select * from `locations` where `id`='$locid'";
|
|
$row = mysql_fetch_assoc(mysql_query($query));
|
|
$_REQUEST['newreg'] = $row['regid'];
|
|
?>
|
|
<form method="post" action="account.php">
|
|
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
|
|
<tr>
|
|
<td colspan="2" class="title"><?=_("Move Location")?></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Location")?>:</td>
|
|
<td class="DataTD"><?=$row['name']?></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD"><?=_("Set Region")?>:</td>
|
|
<td class="DataTD"><select name="newreg">
|
|
<?
|
|
$query = "select * from `regions` where `ccid`='$row[ccid]'";
|
|
$res = mysql_query($query);
|
|
while($row = mysql_fetch_assoc($res))
|
|
{
|
|
echo "<option value='$row[id]'";
|
|
if($_REQUEST['newreg'] == $row['id'])
|
|
echo " selected";
|
|
echo ">$row[name]</option>\n";
|
|
}
|
|
?>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Update")?>"></td>
|
|
</tr>
|
|
</table>
|
|
<input type="hidden" name="action" value="move">
|
|
<input type="hidden" name="locid" value="<?=$_REQUEST['locid']?>">
|
|
<input type="hidden" name="oldid" value="54">
|
|
</form>
|
|
<? } ?>
|
|
|