forked from leonardoxc/leonardoxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUI_EXT_airspace_update_comment.php
100 lines (85 loc) · 3.4 KB
/
GUI_EXT_airspace_update_comment.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
<?
//************************************************************************
// Leonardo XC Server, http://www.leonardoxc.net
//
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// 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.
//
// $Id: GUI_EXT_airspace_update_comment.php,v 1.9 2010/03/14 20:56:10 manolis Exp $
//
//************************************************************************
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/".CONF_LANG_ENCODING_TYPE."/lang-".$currentlang.".php";
require_once dirname(__FILE__)."/language/".CONF_LANG_ENCODING_TYPE."/countries-".$currentlang.".php";
// echo "# $userID #";
if (! L_auth::isAdmin($userID)) {
return;
}
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$CONF_ENCODING?>">
<style type="text/css">
body, p, table,tr,td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
body {margin:0px}
</style>
</head>
<?
$area_id=makeSane($_REQUEST['area_id'],1);
// echo $area_id;
if ( $_POST['updateComment']==1 ) { // CHANGE waypoint
$Comments=prep_for_DB($_POST['Comments']);
$disabled=makeSane($_POST['disabled'],1);
$query="UPDATE $airspaceTable SET Comments='$Comments' , disabled=$disabled WHERE id=$area_id";
// echo $query;
$res= $db->sql_query($query);
# Error checking
if ( $res > 0) {
?>
<script language="javascript">
function refreshParent() {
topWinRef=top.location.href;
top.window.location.href=topWinRef;
}
</script>
<?
echo "<center>"._THE_CHANGES_HAVE_BEEN_APPLIED."<br><br>";
echo "<a href='javascript:refreshParent();'>RETURN </a>";
echo "<br></center>";
} else {
echo("<H3> Error in updating comment for airspace! </H3>\n");
}
} else {
$query="SELECT Comments, disabled FROM $airspaceTable WHERE id=$area_id";
$res= $db->sql_query($query);
# Error checking
if($res <= 0){
echo("<H3> Error in getting Comment for airspace from DB! $query</H3>\n");
exit();
}
if (! $row = $db->sql_fetchrow($res) ) {
echo("<H3> Error #2 in getting Comment for airspace from DB! $query</H3><BR> The area that is referenced as violated is no longer in the DB\n");
exit();
}
?>
<form name="form1" method="post" action="">
<textarea name="Comments" cols="27" rows="3" id="description"><? echo $row['Comments'] ?></textarea>
<br />
Disable Area
<input type="checkbox" name="disabled" value="1" <? if ($row['disabled']) echo 'checked="checked"'; ?> />
<input type="hidden" name="updateComment" value="1" />
<input type="submit" value="Update" />
</form>
<? } ?>