forked from leonardoxc/leonardoxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI_user_prefs.php
154 lines (137 loc) · 5.16 KB
/
GUI_user_prefs.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
143
144
145
146
147
148
149
150
151
152
153
154
<?
/************************************************************************/
/* 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. */
/************************************************************************/
if (isset($_REQUEST['updatePrefs'])) {// submit form
$PREFS->themeName= $_POST['PREFS_themeName'];
$PREFS->itemsPerPage=$_POST['PREFS_itemsPerPage'];
$PREFS->metricSystem=$_POST['PREFS_metricSystem'];
$PREFS->language=$_POST['PREFS_language'];
$_SESSION["lng"]= $PREFS->language;
$PREFS->viewCat=$_POST['PREFS_viewCat'];
$_SESSION["cat"]= $PREFS->viewCat;
$PREFS->viewCountry=$_POST['PREFS_viewCountry'];
$_SESSION["country"]= $PREFS->viewCountry;
echo "<div align=center>"._Your_settings_have_been_updated."<br><br><a href='?name=$module_name&op=list_flights'>"._RETURN_TO_FLIGHTS."</a><br><br></div>";
}
?>
<form name=userPrefs method="POST" action="?name=<? echo $module_name ?>&op=user_prefs" >
<?
open_inner_table(_MENU_MY_SETTINGS,500,"icon_profile.png");
open_tr();
echo "<td bgcolor='#EEF3E9'>";
?>
<table width="100%" border="0" bgcolor="#EEF3E9" class=main_text>
<tr>
<td colspan="3" bgcolor="006699" height=3></td>
</tr>
<tr>
<td colspan="3" > </td>
</tr>
<tr>
<td width="284" bgcolor="#F8F8E4"><div align="right"><? echo _THEME ?></div></td>
<td width="236"><select name="PREFS_themeName">
<?
$themes=getAvailableThemes();
foreach ($themes as $tmpTheme) {
if ($tmpTheme!= $PREFS->themeName )
echo '<option value="'.$tmpTheme.'">'.$tmpTheme.'</option>';
else
echo '<option value="'.$tmpTheme.'" selected>'.$tmpTheme.'</option>';
}
?>
</select>
</td>
<td width="1"> </td>
</tr>
<tr>
<td width="284" bgcolor="#F8F8E4"><div align="right"><? echo _LANGUAGE ?></div></td>
<td width="236"> <select name="PREFS_language">
<? foreach ($availableLanguages as $tmpLang ) {
if ($tmpLang!= $PREFS->language )
echo '<option value="'.$tmpLang.'">'.$tmpLang.'</option>';
else
echo '<option value="'.$tmpLang.'" selected>'.$tmpLang.'</option>';
}
?>
</select></td>
<td width="1"> </td>
</tr>
<tr>
<td bgcolor="#F8F8E4"><div align="right"><? echo _VIEW_CATEGORY ?></div></td>
<td>
<select name="PREFS_viewCat">
<?
if ($PREFS->viewCat==0) $is_type_sel ="selected";
else $is_type_sel ="";
echo "<option $is_type_sel value=0>"._ALL."</option>\n";
foreach ( $CONF_glider_types as $gl_id=>$gl_type) {
if ($PREFS->viewCat==$gl_id) $is_type_sel ="selected";
else $is_type_sel ="";
echo "<option $is_type_sel value=$gl_id>".$gliderCatList[$gl_id]."</option>\n";
}
?>
</select>
</td>
<td> </td>
</tr>
<tr>
<td bgcolor="#F8F8E4"><div align="right"><? echo _VIEW_COUNTRY ?></div></td>
<td> <select name="PREFS_viewCountry">
<?
//list($countriesCodes,$countriesNames,$countriesFlightsNum)=getCountriesList();
//$countriesNum=count($countriesNames);
if (! $PREFS->viewCountry) $is_type_sel ="selected";
else $is_type_sel ="";
echo "<option $is_type_sel value=0>"._ALL."</option>\n";
$i=0;
foreach($countriesNames as $countryName) {
if ("$PREFS->viewCountry"=="$countriesCodes[$i]")
echo '<option value="'.$countriesCodes[$i++].'" selected>'.$countryName.'</option>';
else
echo '<option value="'.$countriesCodes[$i++].'">'.$countryName.'</option>';
}
?>
</select> </td>
<td> </td>
</tr>
<tr>
<td bgcolor="#F8F8E4"><div align="right"><? echo _UNITS_SYSTEM ?></div></td>
<td>
<select name="PREFS_metricSystem">
<option value="1" <? echo ($PREFS->metricSystem==1)?"selected":"" ?>><? echo _METRIC_SYSTEM ?></option>
<option value="2" <? echo ($PREFS->metricSystem==2)?"selected":"" ?>><? echo _IMPERIAL_SYSTEM ?></option>
</select></td>
<td> </td>
</tr>
<tr>
<td bgcolor="#F8F8E4"><div align="right"><? echo _ITEMS_PER_PAGE ?></div></td>
<td> <input name="PREFS_itemsPerPage" type="text" value="<? echo $PREFS->itemsPerPage ?>" size="5" maxlength="120"></td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
<input type="submit" name="Submit" value="<? echo _Submit_Change_Data ?>">
</div></td>
</tr>
<tr>
<td colspan="3" > </td>
</tr>
<tr>
<td colspan="3" bgcolor="006699" height=3></td>
</tr>
</table>
<input type=hidden name=updatePrefs value=1>
</form>
<?
echo "</td></tr>";
close_inner_table();
?>