59 lines
2.0 KiB
PHP
59 lines
2.0 KiB
PHP
<section>
|
|
<div class="title"><img src="/img/button_location.gif" alt="Location" title="Location"></div>
|
|
Currently: <?= user()->currentaction ?><br>
|
|
<?php
|
|
$lat = user()->latitude;
|
|
$lon = user()->longitude;
|
|
if ($lat < 0) { $lat = ($lat * -1) . "S"; } else { $lat .= "N"; }
|
|
if ($lon < 0) { $lon = ($lon * -1) . "W"; } else { $lon .= "E"; }
|
|
?>
|
|
Latitude: <?= $lat ?><br>
|
|
Longitude: <?= $lon ?><br>
|
|
<a href="javascript:openmappopup()">View Map</a><br>
|
|
<form action="/move" method="post" hx-post="/move" hx-target="#middle" class="move-compass">
|
|
<button name="direction" value="north" class="north">North</button>
|
|
<div class="mid">
|
|
<button name="direction" value="west" class="west">West</button>
|
|
<button name="direction" value="east" class="east">East</button>
|
|
</div>
|
|
<button name="direction" value="south" class="south">South</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section>
|
|
<div class="title"><img src="/img/button_towns.gif" alt="Towns" title="Towns"></div>
|
|
<?php
|
|
if (user()->currentaction == 'In Town') {
|
|
$town = get_town_by_xy((int) user()->latitude, (int) user()->longitude);
|
|
echo "Welcome to <b>{$town['name']}</b>.<br><br>";
|
|
}
|
|
?>
|
|
Travel To:<br>
|
|
<?php
|
|
$town_list = explode(",", user()->towns);
|
|
$towns = db()->query('SELECT * FROM towns ORDER BY id;');
|
|
$mapped = false;
|
|
while ($row = $towns->fetchArray(SQLITE3_ASSOC)) {
|
|
$mapped = true;
|
|
if (in_array($row['id'], $town_list)) {
|
|
echo <<<HTML
|
|
<a href="/gotown/{$row['id']}" hx-get="/gotown/{$row['id']}" hx-target="#middle">{$row['name']}</a><br>
|
|
HTML;
|
|
}
|
|
}
|
|
if (!$mapped) echo 'You have no towns mapped.';
|
|
?>
|
|
</section>
|
|
|
|
<section>
|
|
<div class="title"><img src="/img/button_functions.gif" alt="Functions" title="Functions"></div>
|
|
<a href="/" hx-get="/" hx-target="#middle">Home</a><br>
|
|
<a href="/forum" hx-get="/forum" hx-target="#middle">Forum</a><br>
|
|
<a href="/settings">Settings</a><br>
|
|
<?php if (user()->authlevel === 1): ?>
|
|
<a href="/admin">Admin</a><br>
|
|
<?php endif; ?>
|
|
<a href="/help">Help</a><br>
|
|
<a href="/logout">Log Out</a>
|
|
</section>
|