/
coordinates.php
48 lines (40 loc) · 1.52 KB
/
coordinates.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
require_once('./lib2/logic/coordinate.class.php');
$tpl->name = 'coordinates';
$tpl->popup = true;
$lat_float = 0;
if (isset($_REQUEST['lat']))
$lat_float += $_REQUEST['lat'];
$lon_float = 0;
if (isset($_REQUEST['lon']))
$lon_float += $_REQUEST['lon'];
$coord = new coordinate($lat_float, $lon_float);
$tpl->assign('coordDeg', $coord->getDecimal());
$tpl->assign('coordDegMin', $coord->getDecimalMinutes());
$tpl->assign('coordDegMinSec', $coord->getDecimalMinutesSeconds());
$tpl->assign('coordUTM', $coord->getUTM());
$tpl->assign('coordGK', $coord->getGK());
$tpl->assign('coordRD', $coord->getRD());
$tpl->assign('coordQTH', $coord->getQTH());
$tpl->assign('coordSwissGrid', $coord->getSwissGrid());
// wp gesetzt?
$wp = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : '';
if ($wp != '')
{
$rs = sql("SELECT `caches`.`name`, `user`.`username` FROM `caches` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` INNER JOIN `user` ON `user`.`user_id`=`caches`.`user_id` WHERE `cache_status`.`allow_user_view`=1 AND `caches`.`wp_oc`='&1'", $wp);
if ($r = sql_fetch_array($rs))
{
$tpl->assign('owner', $r['username']);
$tpl->assign('cachename', $r['name']);
}
sql_free_result($rs);
}
$tpl->assign('wp', $wp);
$tpl->display();
?>