forked from leonardoxc/leonardoxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI_pilot_profile.php
289 lines (280 loc) · 13.2 KB
/
GUI_pilot_profile.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?
/************************************************************************/
/* 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. */
/************************************************************************/
// edit function
if ( $pilotIDview == $userID || auth::isAdmin($userID) ) {
}
if (!$pilotIDview && $userID>0) $pilotIDview=$userID;
$res= $db->sql_query("SELECT * FROM $pilotsTable, ".$CONF['userdb']['users_table'].
" WHERE pilotID=".$pilotIDview ." AND serverID=$serverID AND pilotID=".$CONF['userdb']['user_id_field'] );
if($res <= 0){
echo("<H3>Error in pilot query</H3>\n");
return;
} else if ( mysql_num_rows($res)==0){
$res= $db->sql_query("INSERT INTO $pilotsTable (pilotID,serverID) VALUES($pilotIDview,$serverID)" );
//echo("<H3>No info for this pilot</H3>\n");
//return;
// $res= $db->sql_query("SELECT * FROM $pilotsTable WHERE pilotID=".$pilotIDview );
$res= $db->sql_query("SELECT * FROM $pilotsTable, ".$CONF['userdb']['users_table'].
" WHERE pilotID=".$pilotIDview ." AND serverID=$serverID AND pilotID=".$CONF['userdb']['user_id_field'] );
}
$pilot = mysql_fetch_assoc($res);
$pilotName=getPilotRealName($pilotIDview,$serverID,1);
$legend=_Pilot_Profile.": <b>$pilotName</b>";
$legendRight="<a href='".CONF_MODULE_ARG."&op=list_flights&pilotID=".$serverID."_$pilotIDview&year=0&country='>"._PILOT_FLIGHTS."</a>";
$legendRight.=" | <a href='".CONF_MODULE_ARG."&op=pilot_profile_stats&pilotIDview=".$serverID."_$pilotIDview'>"._pilot_stats."</a>";
if ( $pilotIDview == $userID || auth::isAdmin($userID) && $serverID==0 ) {
$legendRight.=" | <a href='".CONF_MODULE_ARG."&op=pilot_profile_edit&pilotIDview=$pilotIDview'>"._edit_profile."</a>";
if ($enableOLCsubmission) $legendRight.=" | <a href='".CONF_MODULE_ARG."&op=pilot_olc_profile_edit&pilotIDview=$pilotIDview'>"._edit_OLC_info."</a>";
}
else $legendRight.="";
open_inner_table("<table class=main_text width=100%><tr><td>$legend</td><td width=380 align=right bgcolor=#eeeeee>$legendRight</td></tr></table>",720,"icon_profile.png");
open_tr();
echo "<td>";
?>
<table class=main_text width="100%" border="0">
<tr>
<td colspan="5" bgcolor="006699"><strong><font color="#FFA34F"><? echo _Personal_Stuff ?></font></strong></td>
</tr>
<tr>
<td width=150 valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _First_Name ?></div></td>
<td width=150 valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FirstName'] ?></td>
<td width =3> </td>
<td colspan="2" valign="top" bgcolor="#F5F2EB"> <div align="left">
<? if ($CONF_use_NAC) {
require_once dirname(__FILE__)."/CL_NACclub.php";
echo "<strong>"._MEMBER_OF.":</strong> ";
echo $CONF_NAC_list[$pilot['NACid']] ['name'];
if ($pilot['NACid']) {
echo " [ "._MemberID.": ";
if ($CONF_NAC_list[$pilot['NACid']]['memberIDpublic']) echo $pilot['NACmemberID']." ]";
else echo "***** ]";
}
} ?></div></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Last_Name ?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['LastName'] ?> </td>
<td> </td>
<td colspan="2" valign="top" bgcolor="#F5F2EB"><div align="left">
<? if ($CONF_use_NAC) {
echo "<strong>"._Club.":</strong> ".NACclub::getClubName( $pilot['NACid'], $pilot['NACclubID']) ;
} ?></div></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _COUNTRY ?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo getNationalityDescription($pilot['countryCode']); ?> </td>
<td> </td>
<td colspan="2" rowspan="7" valign="top"><?
if ($pilot['PilotPhoto']>0) {
?>
<div align="center"><strong><? echo _Photo ?> </strong><br>
<?
echo "<a href='".getPilotPhotoRelFilename($pilotIDview)."' target='_blank'><img src='".getPilotPhotoRelFilename($pilotIDview,1)."' border=0></a>";
?>
</div> <?
}
?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5">
<div align="right"><? echo _Sponsor ?></div></td>
<td valign="top" bgcolor="#F5F5F5"><? echo $pilot['sponsor'] ?> </td>
<td> </td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"> <? echo _Birthdate ?>
(<? echo _dd_mm_yy ?>) </div></td>
<td valign="top" bgcolor="#F5F5F5"><? echo $pilot['Birthdate'] ?> </td>
<td> </td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Sign ?></div></td>
<td valign="top" bgcolor="#F5F5F5"><? echo $pilot['Sign'] ?></td>
<td> </td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Marital_Status ?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['MartialStatus'] ?></td>
<td> </td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Occupation?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Occupation'] ?> </td>
<td> </td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Web_Page ?></div></td>
<td valign="top" bgcolor="#F5F5F5"><?
if ($pilot['PersonalWebPage']!='') {
if ( substr($pilot['PersonalWebPage'],0,4)!='http' ) $link="http://".$pilot['PersonalWebPage'];
else $link=$pilot['PersonalWebPage'];
echo "<a href='".$link."' target=_blank>".$pilot['PersonalWebPage']."</a>";
}
else echo _N_A; ?></td>
<td> </td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Other_Interests ?></div></td>
<td colspan="4" valign="bottom" bgcolor="#F5F5F5"><? echo $pilot['OtherInterests'] ?></td>
</tr>
<tr>
<td colspan="5" valign="top" bgcolor="006699"> <div align="left"><strong><font color="#FFA34F"><? echo _Flying_Stuff ?>
(<? echo _note_place_and_date ?>)</font></strong></div></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Flying_Since ?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FlyingSince'] ?> </td>
<td> </td>
<td width="150" valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Personal_Distance_Record?></div></td>
<td width="150" valign="top" bgcolor="#F5F5F5"><? echo $pilot['personalDistance'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Pilot_Licence?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['PilotLicence'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Personal_Height_Record?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['personalHeight'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Paragliding_training?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Training'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Hours_Flown?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['HoursFlown'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Favorite_Location?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FavoriteLocation'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Hours_Per_Year?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['HoursPerYear'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Usual_Location?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['UsualLocation'] ?> </td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"></div></td>
<td> </td>
</tr>
<tr valign="top">
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Best_Flying_Memory ?>
</div></td>
<td colspan="4" bgcolor="#F5F5F5"><? echo $pilot['BestMemory'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"> <div align="right"><? echo _Worst_Flying_Memory ?>
</div></td>
<td colspan="4" valign="top" bgcolor="#F5F5F5"><? echo $pilot['WorstMemory'] ?></td>
</tr>
<tr>
<td valign="top"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="5" bgcolor="006699"><strong><font color="#FFA34F"><? echo _Equipment_Stuff?></font></strong></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Glider?></div></td>
<td valign="top" bgcolor="#F5F5F5"><? echo $pilot['glider'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Vario?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Vario'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Harness?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Harness'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _GPS?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['GPS'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Reserve_chute?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Reserve'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Helmet?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Helmet'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Camera?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['camera'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Camcorder?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['camcorder'] ?></td>
</tr>
<tr>
<td colspan="5" bgcolor="006699"><strong><font color="#FFA34F"><? echo _Manouveur_Stuff ?>
(<? echo _note_max_descent_rate?>)</font></strong></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Spiral?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Spiral'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Sat?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Sat'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Bline?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['Bline'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Asymmetric_Spiral?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['AsymmetricSpiral'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Full_Stall?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FullStall'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Spin?></div></td>
<td valign="top" bgcolor="#F5F5F5"><? echo $pilot['Spin'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Other_Manouveurs_Acro?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['OtherAcro'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"></div></td>
<td valign="top" bgcolor="#F5F5F5"> </td>
</tr>
<tr>
<td colspan="5" bgcolor="006699"><strong><font color="#FFA34F"><? echo _General_Stuff?></font></strong></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Favorite_Singer?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FavoriteSingers'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Favorite_Book?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FavoriteBooks'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Favorite_Movie?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FavoriteMovies'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Favorite_Actor?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FavoriteActors'] ?></td>
</tr>
<tr>
<td valign="top" bgcolor="#E9EDF5"><div align="right"><? echo _Favorite_Internet_Site?></div></td>
<td valign="top" bgcolor="#F5F5F5"> <? echo $pilot['FavoriteSite'] ?></td>
<td> </td>
<td valign="top" bgcolor="#E9EDF5"><div align="right"></div></td>
<td valign="top" bgcolor="#F5F5F5"></td>
</tr>
<tr>
<td colspan="5"> <hr> </td>
</tr>
</table>
<?
echo "</td></tr>";
close_inner_table();
?>