forked from leonardoxc/leonardoxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI_EXT_waypoint_edit.php
142 lines (128 loc) · 6.29 KB
/
GUI_EXT_waypoint_edit.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?
/************************************************************************/
/* Leonardo: Gliding XC Server */
/* ============================================ */
/* */
/* Copyright (c) 2004-5 by Andreadakis Manolis */
/* http://sourceforge.net/projects/leonardoserver */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
require_once dirname(__FILE__)."/EXT_config_pre.php";
require_once dirname(__FILE__)."/config.php";
require_once dirname(__FILE__)."/EXT_config.php";
require_once dirname(__FILE__)."/CL_flightData.php";
require_once dirname(__FILE__)."/FN_functions.php";
require_once dirname(__FILE__)."/FN_UTM.php";
require_once dirname(__FILE__)."/FN_waypoint.php";
require_once dirname(__FILE__)."/FN_output.php";
require_once dirname(__FILE__)."/FN_pilot.php";
require_once dirname(__FILE__)."/FN_flight.php";
require_once dirname(__FILE__)."/templates/".$PREFS->themeName."/theme.php";
setDEBUGfromGET();
require_once dirname(__FILE__)."/language/lang-".$currentlang.".php";
require_once dirname(__FILE__)."/language/countries-".$currentlang.".php";
if (! in_array($userID,$admin_users)) {
// return;
}
?>
<style type="text/css">
body, p, table,tr,td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
body {margin:0px}
</style>
<?
$waypointIDedit=$_REQUEST['waypointIDedit'];
if ( $_POST['editWaypoint']==1 ) { // CHANGE waypoint
$waypt=new waypoint($waypointIDedit);
$waypt->name=$_POST['wname'];
$waypt->intName=$_POST['intName'];
$waypt->type=$_POST['type'];
$waypt->lat=$_POST['lat'];
$waypt->lon=$_POST['lon'];
$waypt->location=$_POST['location'];
$waypt->intLocation=$_POST['intLocation'];
$waypt->countryCode=$_POST['countryCode'];
$waypt->link=$_POST['link'];
$waypt->description=$_POST['description'];
if ( $waypt->putToDB(1) ) {
echo "<center>"._THE_CHANGES_HAVE_BEEN_APPLIED."<br><br>";
echo "<a href='javascript:parent.window.location.reload(true);'>RETURN </a>";
echo "<br></center>";
} else echo("<H3> Error in puting waypoint info into DB! </H3>\n");
} else {
$waypt=new waypoint($waypointIDedit);
$waypt->getFromDB();
?>
<form name="form1" method="post" action="">
<table width="350" border="0" align="center" cellpadding="2" class="shadowBox main_text">
<tr>
<td width="80" bgcolor="#CFE2CF"><div align="right"><font color="#003366">Name</font></div></td>
<td width="150" bgcolor="#E3E7F2"><font color="#003366">
<input name="wname" type="text" id="wname" size="25" value="<? echo $waypt->name ?>" >
<input name="waypointIDedit " type="hidden" id="waypointIDedit " value="<? echo $waypointIDedit ?>" >
<input name="type" type="hidden" id="type" value="<? echo $waypt->type ?>" >
</font></td>
<td colspan="2" bgcolor="#E3E7F2"><input type="submit" name="Submit" value="<? echo "Apply changes" ?>" /></td>
</tr>
<tr>
<td bgcolor="#CFE2CF"><div align="right"><font color="#003366">International
Name</font></div></td>
<td bgcolor="#E3E7F2"><font color="#003366">
<input name="intName" type="text" id="intName" size="25" value="<? echo $waypt->intName ?>" >
</font></td>
<td width="21" bgcolor="#E3E7F2"> </td>
<td width="120" bgcolor="#E3E7F2"><input type="hidden" name="editWaypoint" value="1" /></td>
</tr>
<tr>
<td bgcolor="#CFE2CF"><div align="right"><font color="#003366">Region</font></div></td>
<td bgcolor="#E3E7F2"><font color="#003366">
<input name="location" type="text" id="Location" size="25" value="<? echo $waypt->location ?>" >
</font></td>
<td bgcolor="#CFE2CF"><font color="#003366">lat</font></td>
<td bgcolor="#E3E7F2"><font color="#003366">
<input name="lat" type="text" id="lat" value="<? echo $waypt->lat ?>" size="10" />
</font></td>
</tr>
<tr>
<td bgcolor="#CFE2CF"><div align="right"><font color="#003366">International
Region</font></div></td>
<td bgcolor="#E3E7F2"><font color="#003366">
<input name="intLocation" type="text" id="intLocation" size="25" value="<? echo $waypt->intLocation ?>" >
</font></td>
<td bgcolor="#CFE2CF"><font color="#003366">lon</font></td>
<td bgcolor="#E3E7F2"><font color="#003366">
<input name="lon" type="text" id="lon" value="<? echo $waypt->lon ?>" size="10" />
</font></td>
</tr>
<tr>
<td bgcolor="#CFE2CF"><div align="right"><font color="#003366">Country
Code</font></div></td>
<td colspan="3" bgcolor="#E3E7F2"><font color="#003366">
<select name="countryCode">
<?
foreach ($countries as $key => $value) {
if ($waypt->countryCode==$key) $sel=" selected ";
else $sel="";
echo '<option value="'.$key.'" '.$sel.' >'.$key.' - '.$value.'</option>';
}
?>
</select>
</font></td>
</tr>
<tr>
<td bgcolor="#CFE2CF"><div align="right"><font color="#003366">Relevant URL</font></div></td>
<td colspan="3" bgcolor="#E3E7F2"><font color="#003366">
<input name="link" type="text" id="link" value="<? echo $waypt->link ?>" size="45" >
</font></td>
</tr>
<tr>
<td valign="top" bgcolor="#CFE2CF"><div align="right"><font color="#003366">Description</font></div></td>
<td colspan="3" bgcolor="#E3E7F2"><font color="#003366">
<textarea name="description" cols="35" rows="5" id="description"><? echo $waypt->description ?></textarea>
</font></td>
</tr>
</table>
</form>
<? } ?>