Catalogus
Je kan inloggen met: user: test
pass: test
Iedereen kan vliegtuigen toevoegen, de admin moet deze dan activeren, de admin kan verwijderen, aanpassen, en natuurlijk uitloggen.
link: Mijn catalogus
Reacties zijn welkom, maar dit is mijn EERSTE ECHT WERKENDE SCRIPT!
Quote:
Topic verplaatst naar site reviews.
SanThe.
SanThe.
Gewijzigd op 01/01/1970 01:00:00 door Youri van Weegberg
Ik zou persoonlijk het ontwerp en functionaliteit wat aanpassen..
bijvoorbeeld: waarom gebeurd de Admin login in een new venster en met je eerst op F5 (vernieuwen) voordat je het menu te zien krijgt...
Greets...
PHPGast
Kreeg je misschien een foutmelding te zien bij de sessies ???
Wat betreft de vormgeving kan er wat mij betreft nog wel het een en ander veranderd worden. Plaats bijvoorbeeld elk vliegtuig in een apart kader.
Ook zou ik 'extra informatie' weghalen als er geen extra informatie beschikbaar is.
@Bart: Het staat in een website in een frame, het is voor informatie, met extra informatie bedoel ik dat met die knop 'More information' dat er dan pas meer info over dat vliegtuig word opgevraagt. Hoe maak je zoon kader?
Je zou er een <div></div> omheen kunnen plaatsen en er dan d.m.v. css een aantal stijlen aan kunnen geven zoals achtergrondkleur en borders.
Paar dingen: Geen enkele knop werkt hier, behalve de zoek knop. Dit komt omdat je overal 'location.href("")' gebruikt, maak daar 'window.location.href = ""' van, en het zou in elke browser (die javascript ondersteund) moeten werken.
@Willemjan z: Dat klopt, dat heb ik zo gedaan, ik zal het veranderen. Ik heb mijn script niet gepost, want het is heeel erg rommelig, en het is erg lang.
Misschien moet je het dan juist hier op het forum plaatsen om er tips voor te krijgen. Anders blijf je hangen in die rommelige en veel te lange scripts.
--- date.php ---
Code (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
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
<head>
<script language="javascript">
function datum(d,m,j) {
parent.date1.value = d;
parent.date2.value = m;
parent.date3.value = j;
parent.hideboxcal();
}
</script>
<style src='calender.css'></style>
</head>
<body bgcolor="#E6ECFF">
<?php
//Allereerst gaan we alle maanden defineren
$maanden = array(1 => 'Januari', 2 => 'Februari', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
//De dagen in een week
$weekdagen = array('monday','tuesday','wednesday','thursday','friday','saturday','sunday');
//En de jaren die we willen toestaan, in dit geval van 2006 tot 2010.
$jaren = range(1903,date('Y'));
//Wat als er een maand in de url staat?
if(isset($_GET['maand']))
{
//Eerst kijken we of die maand wel bestaat
if(array_key_exists($_GET['maand'], $maanden))
{
$maand = $_GET['maand'];
}else{
$maand = date('n');
}
}else{
$maand = date('n');
}
//Wat als er een jaar in de url staat?
if(isset($_GET['jaar']))
{
//Eerst kijken we of we dat jaar wel goedkeuren
if(in_array($_GET['jaar'],$jaren))
{
$jaar = htmlentities($_GET['jaar']);
}else{
$jaar = date('Y');
}
}else{
$jaar = date('Y');
}
//Omdat we nu het jaar en de maand weten kunnen we vaststellen welke dagen zijn toegestaan
$dagen = range(1,date('t', mktime(0,0,0,$maand,1,$jaar)));
//Wat als er een dag in de url staat?
if(isset($_GET['dag']))
{
//Bestaat deze dag wel?
if(in_array($_GET['dag'], $dagen))
{
$dag = htmlentities($_GET['dag']);
}else{
$dag = 1;
}
}else{
//Wat als er geen dag is geselecteerd? Dan kijken we of het vandaag dezelfde maand is als wat er is opgevraagd en selecteren we vandaag!
if($maand == date('n'))
{
$dag = date('j');
}else{
$dag = 1;
}
}
//Tijd voor een formuliertje!
echo '<form action="" method="GET"><table style="border: 3px solid gray;" bgcolor="#E6ECFF" width="217">';
//We maken een selectbox met daarin een foreach met alle maanden
echo '<tr><td><select name="maand" onchange="this.form.submit()">';
foreach($maanden as $maandnummer => $maandnaam)
{
if($maandnummer == $maand)
{
echo '<option selected value="'.$maandnummer.'">'.$maandnaam.'</option>';
}else{
echo '<option value="'.$maandnummer.'">'.$maandnaam.'</option>';
}
}
echo '</select></td>';
//Vervolgens maken we een selectbox voor alle jaren
echo '<td><select name="jaar" onchange="this.form.submit()">';
foreach($jaren as $jaarnummer)
{
if($jaarnummer == $jaar)
{
echo '<option selected value="'.$jaarnummer.'">'.$jaarnummer.'</option>';
}else{
echo '<option value="'.$jaarnummer.'">'.$jaarnummer.'</option>';
}
}
echo '</td></tr></select></form></table>';
//Nu word het tijd om een mooi tabelletje te maken
echo '<table bgcolor="#E6ECFF" style="border:3px solid gray;">';
//We echoén alvast de bovenste rij
echo '<tr><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th></tr><tr>';
//Wat is de eerste dag van de maand?
$eerstedag = date('w', mktime(0,0,0,$maand,1,$jaar));
//Deze hebben we nodig om wat lege ruimte te vullen als de week niet begint op maandag.
for($nummer = 1; $nummer <= 6; $nummer += 1)
{
if($nummer != $eerstedag)
{
echo '<td></td>';
}else{
$nummer = 7;
}
}
//Voor iedere dag in de week gaan we nu een loopje beginnen!
foreach($dagen as $dag2)
{
//Welke weegdag is het?
$dagindeweek = date('w', mktime(0,0,0,$maand,$dag2,$jaar));
//Als het 1 is (maandag) begint er een nieuwe rij!
if($dagindeweek == 1)
{
echo '<tr>';
}
//Stel dat het toevallig dezelfde datum als vandaag is? Dan willen we een rood randje!
if(($dag2 == date('j')) && ($maand == date('n')) && ($jaar == date('Y')))
{
?><td style="border: 1px solid red;" align="center" onclick="javascript:datum('<?= $dag2 ?>','<?= $maand ?>','<?= $jaar ?>')"><?
}else{
?><td align="center" onclick="javascript:datum('<?= $dag2 ?>','<?= $maand ?>','<?= $jaar ?>')" style="cursor:hand;"><?
}
//Stel dat het toevallig dezelfde dag is als de dag die we geselecteerd hebbeb? Dan willen we bold!
if($dag2 == $dag)
{
echo '<b><font color="blue">'.$dag2.'</font></b></td>';
}else{
echo '<font color="blue">'.$dag2.'</font></td>';
}
//Als het dag 0 is (zondag) willen we de rij eindigen!
if($dagindeweek == 0)
{
echo '</tr>';
}
}
//Sluiten die handel! Huppakee!
echo '</table>';
?>
</body>
<script language="javascript">
function datum(d,m,j) {
parent.date1.value = d;
parent.date2.value = m;
parent.date3.value = j;
parent.hideboxcal();
}
</script>
<style src='calender.css'></style>
</head>
<body bgcolor="#E6ECFF">
<?php
//Allereerst gaan we alle maanden defineren
$maanden = array(1 => 'Januari', 2 => 'Februari', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
//De dagen in een week
$weekdagen = array('monday','tuesday','wednesday','thursday','friday','saturday','sunday');
//En de jaren die we willen toestaan, in dit geval van 2006 tot 2010.
$jaren = range(1903,date('Y'));
//Wat als er een maand in de url staat?
if(isset($_GET['maand']))
{
//Eerst kijken we of die maand wel bestaat
if(array_key_exists($_GET['maand'], $maanden))
{
$maand = $_GET['maand'];
}else{
$maand = date('n');
}
}else{
$maand = date('n');
}
//Wat als er een jaar in de url staat?
if(isset($_GET['jaar']))
{
//Eerst kijken we of we dat jaar wel goedkeuren
if(in_array($_GET['jaar'],$jaren))
{
$jaar = htmlentities($_GET['jaar']);
}else{
$jaar = date('Y');
}
}else{
$jaar = date('Y');
}
//Omdat we nu het jaar en de maand weten kunnen we vaststellen welke dagen zijn toegestaan
$dagen = range(1,date('t', mktime(0,0,0,$maand,1,$jaar)));
//Wat als er een dag in de url staat?
if(isset($_GET['dag']))
{
//Bestaat deze dag wel?
if(in_array($_GET['dag'], $dagen))
{
$dag = htmlentities($_GET['dag']);
}else{
$dag = 1;
}
}else{
//Wat als er geen dag is geselecteerd? Dan kijken we of het vandaag dezelfde maand is als wat er is opgevraagd en selecteren we vandaag!
if($maand == date('n'))
{
$dag = date('j');
}else{
$dag = 1;
}
}
//Tijd voor een formuliertje!
echo '<form action="" method="GET"><table style="border: 3px solid gray;" bgcolor="#E6ECFF" width="217">';
//We maken een selectbox met daarin een foreach met alle maanden
echo '<tr><td><select name="maand" onchange="this.form.submit()">';
foreach($maanden as $maandnummer => $maandnaam)
{
if($maandnummer == $maand)
{
echo '<option selected value="'.$maandnummer.'">'.$maandnaam.'</option>';
}else{
echo '<option value="'.$maandnummer.'">'.$maandnaam.'</option>';
}
}
echo '</select></td>';
//Vervolgens maken we een selectbox voor alle jaren
echo '<td><select name="jaar" onchange="this.form.submit()">';
foreach($jaren as $jaarnummer)
{
if($jaarnummer == $jaar)
{
echo '<option selected value="'.$jaarnummer.'">'.$jaarnummer.'</option>';
}else{
echo '<option value="'.$jaarnummer.'">'.$jaarnummer.'</option>';
}
}
echo '</td></tr></select></form></table>';
//Nu word het tijd om een mooi tabelletje te maken
echo '<table bgcolor="#E6ECFF" style="border:3px solid gray;">';
//We echoén alvast de bovenste rij
echo '<tr><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th></tr><tr>';
//Wat is de eerste dag van de maand?
$eerstedag = date('w', mktime(0,0,0,$maand,1,$jaar));
//Deze hebben we nodig om wat lege ruimte te vullen als de week niet begint op maandag.
for($nummer = 1; $nummer <= 6; $nummer += 1)
{
if($nummer != $eerstedag)
{
echo '<td></td>';
}else{
$nummer = 7;
}
}
//Voor iedere dag in de week gaan we nu een loopje beginnen!
foreach($dagen as $dag2)
{
//Welke weegdag is het?
$dagindeweek = date('w', mktime(0,0,0,$maand,$dag2,$jaar));
//Als het 1 is (maandag) begint er een nieuwe rij!
if($dagindeweek == 1)
{
echo '<tr>';
}
//Stel dat het toevallig dezelfde datum als vandaag is? Dan willen we een rood randje!
if(($dag2 == date('j')) && ($maand == date('n')) && ($jaar == date('Y')))
{
?><td style="border: 1px solid red;" align="center" onclick="javascript:datum('<?= $dag2 ?>','<?= $maand ?>','<?= $jaar ?>')"><?
}else{
?><td align="center" onclick="javascript:datum('<?= $dag2 ?>','<?= $maand ?>','<?= $jaar ?>')" style="cursor:hand;"><?
}
//Stel dat het toevallig dezelfde dag is als de dag die we geselecteerd hebbeb? Dan willen we bold!
if($dag2 == $dag)
{
echo '<b><font color="blue">'.$dag2.'</font></b></td>';
}else{
echo '<font color="blue">'.$dag2.'</font></td>';
}
//Als het dag 0 is (zondag) willen we de rij eindigen!
if($dagindeweek == 0)
{
echo '</tr>';
}
}
//Sluiten die handel! Huppakee!
echo '</table>';
?>
</body>
--- addplane.php ---
Code (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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<html>
<head>
<title>Yourifs! Flight simulator</title>
<style>
a {
color:#FF0000;
}
</style>
</head>
<body bgcolor="#0099FF">
<?php
include("settings.php");
$ftp_server = "*****";
$ftp_user = "*****";
$ftp_pass = "*****";
$conn_id = ftp_connect($ftp_server);
ftp_pasv($conn_id,TRUE);
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);
if($_GET['type'] == "1") {
if(isset($_SESSION['admin'])) {
header("Location: addplane.php?type=2");
exit();
}
echo "<center><h3>User add plane</h3><br><b><a href='planes.php'>Back to planes</a></b></center>";
if($_POST['action'] == "add") {
if($_POST['img'] == "" OR $_POST['fabrikant'] == "" OR $_POST['type'] == "" OR $_POST['speed'] == "" OR $_POST['passagiers'] == "" OR $_POST['lengte'] == "" OR $_POST['hoogte'] == "" OR $_POST['span'] == "" OR $_POST['dag'] == "" OR $_POST['maand'] == "" OR $_POST['jaar'] == "" OR $_POST['afstand'] == "" OR $_POST['gewicht'] == "" OR $_POST['motoren'] == "" OR $_POST['aantal'] == "" OR $_POST['email'] == "") {
echo "<center>You haven't filled in all!<br><a href='#' onclick='javascript:history.back(1)'>Back</a></center>";
}else{
if($_POST['img'] == "file") {
$remote_file = "/public_html/catalogus/images/";
$remote_file .= $_FILES['file']['name'];
$file = $_FILES['file']['tmp_name'];
$upload = ftp_put($conn_id, $remote_file, $file, FTP_BINARY);
$url = "http://yourivw.site90.net/catalogus/images/".$_FILES['file']['name'];
}else{
$url = $_POST['img1'];
}
$datum = $_POST['jaar']."-".$_POST['maand']."-".$_POST['dag'];
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "INSERT INTO planes (fabrikant,type,passagiers,snelheid,afstand,lengte,hoogte,spanwijdte,cockpit,datum,img,aantal,motoren,status,gewicht,actief,ip,naam,email) VALUES ('".$_POST['fabrikant']."','".$_POST['type']."','".$_POST['passagiers']."','".$_POST['speed']."','".$_POST['afstand']."','".$_POST['lengte']."','".$_POST['hoogte']."','".$_POST['span']."','".$_POST['cockpit']."','".$datum."','".$url."','".$_POST['aantal']."','".$_POST['motoren']."','".$_POST['status']."','".$_POST['gewicht']."','0','".$ip."','".$_POST['naam']."','".$_POST['email']."')";
$query = mysql_query($sql);
if($_POST['img'] == "url") {
if($query == TRUE) {
echo "<br><br><center>The airplane is succesfull added.<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}else{
echo "<br><br><center>The airplane is not added!<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}
}else{
if($query == TRUE AND $upload == TRUE) {
echo "<br><br><center>The airplane is succesfull added.<br><a href='planes.php'>Back to the planes</a></center>";
}else{
echo "<br><br><center>The airplane is not added!<br><a href='planes.php'>Back to the planes</a></center>";
}
}
}
}else{
?>
<form action="addplane.php?type=1" method="post" enctype="multipart/form-data" name="form">
<table border="0" align="center">
<tr>
<td>Image:</td><td><input type="radio" name="img" value="url" checked></td><td>Url: <input type="text" name="img1" value="http://"></td>
</tr>
<tr>
<td></td><td><input type="radio" name="img" value="file"></td><td>File: <input type="file" name="file"></td>
</tr>
<tr>
<td>Producer:</td><td></td><td><input type="text" name="fabrikant"></td>
</tr>
<tr>
<td>Type:</td><td></td><td><input type="text" name="type"></td>
</tr>
<tr>
<td>Cruise speed:</td><td></td><td><input type="text" name="speed" size="6" maxlength="4"> km/h</td>
</tr>
<tr>
<td>Max passengers:</td><td></td><td><input type="text" name="passagiers" size="6" maxlength="4"></td>
</tr>
<tr>
<td>Cockpit:</td><td></td><td><select name="cockpit"><option value="0">Traditional cockpit</option><option value="1">Glass cockpit</option></select></td>
</tr>
<tr>
<td>Length:</td><td></td><td><input type="text" name="lengte" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>Height (from ground):</td><td></td><td><input type="text" name="hoogte" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>Wingspan:</td><td></td><td><input type="text" name="span" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>First flight:</td><td></td><td><input type="text" name="date1" id="date1" maxlength="2" size="1" readonly>-<input type="text" id="maand" name="date2" maxlength="2" size="1" readonly>-<input type="text" id="jaar" name="date3" maxlength="4" size="2" readonly><img src="calendar.png" alt="Open calender to select a date" onclick="showimage.style.visibility = '';" style="cursor:hand;"> <img src="ico_large_question.png" alt="How does it work?" height="16" width="16" onmouseover="info.style.visibility = '';" onmouseout="info.style.visibility = 'hidden';"></td>
</tr>
<tr>
<td>Max range:</td><td></td><td><input type="text" name="afstand" size="10" maxlength="10"> km</td>
</tr>
<tr>
<td>Weight:</td><td></td><td><input type="text" name="gewicht" size="10" maxlength="10"> kg</td>
</tr>
<tr>
<td>Engines:</td><td></td><td><input type="text" name="motoren" size="2" maxlength="2" value="2"></td>
</tr>
<tr>
<td>Amount produced:</td><td></td><td><input type="text" name="aantal" size="8" maxlength="6"> planes</td>
</tr>
<tr>
<td>Status:</td><td></td><td><select name="status"><option value="1">Flying</option><option value="0">Not flying</option></select></td>
</tr>
<tr>
<td>Name:</td><td></td><td><input type="text" name="naam" maxlength="30"></td>
</tr>
<tr>
<td>Email:</td><td></td><td><input type="text" name="email"></td>
</tr>
<tr>
<td></td><td></td><td><input type="submit" name="submit" value="Add airplane"></td>
</tr>
</table>
<input type="hidden" name="action" value="add">
</form>
<?
}
}elseif($_GET['type'] == "2") {
if(!isset($_SESSION['admin'])) {
header("Location: addplane.php?type=1");
exit();
}
echo "<center><h3>Admin add plane</h3><b><a href='planes.php'>Back to planes</a></b></center>";
if($_POST['action'] == "add") {
if($_POST['img'] == "" OR $_POST['fabrikant'] == "" OR $_POST['type'] == "" OR $_POST['speed'] == "" OR $_POST['passagiers'] == "" OR $_POST['lengte'] == "" OR $_POST['hoogte'] == "" OR $_POST['span'] == "" OR $_POST['dag'] == "" OR $_POST['maand'] == "" OR $_POST['jaar'] == "" OR $_POST['afstand'] == "" OR $_POST['gewicht'] == "" OR $_POST['motoren'] == "" OR $_POST['aantal'] == "") {
echo "<center>You haven't filled in all!<br><a href='#' onclick='javascript:history.back(1)'>Back</a></center>";
}else{
if($_POST['img'] == "file") {
$remote_file = "/public_html/catalogus/images/";
$remote_file .= $_FILES['file']['name'];
$file = $_FILES['file']['tmp_name'];
$upload = ftp_put($conn_id, $remote_file, $file, FTP_BINARY);
$url = "http://yourivw.site90.net/catalogus/images/".$_FILES['file']['name'];
}else{
$url = $_POST['img1'];
}
$datum = $_POST['jaar']."-".$_POST['maand']."-".$_POST['dag'];
$ip = $_SERVER['REMOTE_ADDR'];
$gbnaam = htmlspecialchars(mysql_fetch_object(mysql_query("SELECT naam FROM gastenboek WHERE ip = '".$ip."'"))->naam);
$sql = "INSERT INTO planes (fabrikant,type,passagiers,snelheid,afstand,lengte,hoogte,spanwijdte,cockpit,datum,img,aantal,motoren,status,gewicht) VALUES ('".$_POST['fabrikant']."','".$_POST['type']."','".$_POST['passagiers']."','".$_POST['speed']."','".$_POST['afstand']."','".$_POST['lengte']."','".$_POST['hoogte']."','".$_POST['span']."','".$_POST['cockpit']."','".$datum."','".$url."','".$_POST['aantal']."','".$_POST['motoren']."','".$_POST['status']."','".$_POST['gewicht']."')";
$query = mysql_query($sql);
if($_POST['img'] == "url") {
if($query == TRUE) {
echo "<br><br><center>The airplane is succesfull added.<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}else{
echo "<br><br><center>The airplane is not added!<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}
}else{
if($query == TRUE AND $upload == TRUE) {
echo "<br><br><center>The airplane is succesfull added.<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}else{
echo "<br><br><center>The airplane is not added!<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}
}
}
}else{
?>
<form action="addplane.php?type=2" method="post" enctype="multipart/form-data" name="form">
<table border="0" align="center">
<tr>
<td>Image:</td><td><input type="radio" name="img" value="url" checked></td><td>Url: <input type="text" name="img1" value="http://"></td>
</tr>
<tr>
<td></td><td><input type="radio" name="img" value="file"></td><td>File: <input type="file" name="file"></td>
</tr>
<tr>
<td>Producer:</td><td></td><td><input type="text" name="fabrikant"></td>
</tr>
<tr>
<td>Type:</td><td></td><td><input type="text" name="type"></td>
</tr>
<tr>
<td>Cruise speed:</td><td></td><td><input type="text" name="speed" size="6" maxlength="4"> km/h</td>
</tr>
<tr>
<td>Max passengers:</td><td></td><td><input type="text" name="passagiers" size="6" maxlength="4"></td>
</tr>
<tr>
<td>Cockpit:</td><td></td><td><select name="cockpit"><option value="0">Traditional cockpit</option><option value="1">Glass cockpit</option></select></td>
</tr>
<tr>
<td>Length:</td><td></td><td><input type="text" name="lengte" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>Height (from ground):</td><td></td><td><input type="text" name="hoogte" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>Wingspan:</td><td></td><td><input type="text" name="span" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>First flight:</td><td></td><td><input type="text" name="date1" id="date1" maxlength="2" size="1" readonly>-<input type="text" id="maand" name="date2" maxlength="2" size="1" readonly>-<input type="text" id="jaar" name="date3" maxlength="4" size="2" readonly><img src="calendar.png" alt="Open calender to select a date" onclick="showimage.style.visibility = '';" style="cursor:hand;"> <img src="ico_large_question.png" alt="How does it work?" height="16" width="16" onmouseover="info.style.visibility = '';" onmouseout="info.style.visibility = 'hidden';"></td>
</tr>
<tr>
<td>Max range:</td><td></td><td><input type="text" name="afstand" size="10" maxlength="10"> km</td>
</tr>
<tr>
<td>Weight:</td><td></td><td><input type="text" name="gewicht" size="10" maxlength="10"> kg</td>
</tr>
<tr>
<td>Engines:</td><td></td><td><input type="text" name="motoren" size="2" maxlength="2" value="2"></td>
</tr>
<tr>
<td>Amount produced:</td><td></td><td><input type="text" name="aantal" size="8" maxlength="6"> planes</td>
</tr>
<tr>
<td>Status:</td><td></td><td><select name="status"><option value="1">Flying</option><option value="0">Not flying</option></select></td>
</tr>
<tr>
<td></td><td></td><td><input type="submit" name="submit" value="Add airplane"></td>
</tr>
</table>
<input type="hidden" name="action" value="add">
</form>
<?
}
}else{
if(isset($_SESSION['admin'])) {
header("Location: addplane.php?type=2");
}else{
header("Location: addplane.php?type=1");
}
}
?>
<script language="JavaScript1.2">
var dragswitch=0
var nsx
var nsy
var nstemp
function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
//drag drop function for IE 4+////
/////////////////////////////////
var dragapproved=false
function drag_dropie(){
if (dragapproved==true){
document.all.showimage.style.pixelLeft=tempx+event.clientX-iex
document.all.showimage.style.pixelTop=tempy+event.clientY-iey
return false
}
}
function initializedragie(){
iex=event.clientX
iey=event.clientY
tempx=showimage.style.pixelLeft
tempy=showimage.style.pixelTop
dragapproved=true
document.onmousemove=drag_dropie
}
if (document.all){
document.onmouseup=new Function("dragapproved=false")
}
function hideboxcal(){
if (document.all)
showimage.style.visibility="hidden"
else if (document.layers)
document.showimage.visibility="hide"
}
function hideboxinfo(){
if (document.all)
info.style.visibility="hidden"
else if (document.layers)
document.info.visibility="hide"
}
function start() {
showimage.style.visibility = "hidden";
}
</script>
<div id="showimage" style="visibility: hidden; position: absolute; width: 250; left: 284; top: 55; height: 118;">
<table border="0" width="250" bgcolor="#E6ECFF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="36" bordercolor="#E6ECFF" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bgcolor="#E6ECFF">
<tr>
<td width="100%" bgcolor="#E6ECFF">
<p align="center"><font color="#000000">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onMouseOver="dragswitch=1;drag_dropns(showimage)" onMouseOut="dragswitch=0"><font face="Verdana"><strong><small>
Calender</small></strong></font></layer>
</ilayer>
</font></p></td>
<td></td><td style="cursor:hand" bgcolor="#E6ECFF"><a href="#" onClick="hideboxcal();return false"><font size="2" color="#000000"><img src="delete.png" border="0"></font></a></td>
</tr>
<tr>
<td width="100%" bgcolor="#E6ECFF" style="padding:4px" colspan="2" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bordercolor="#E6ECFF">
<font color="#00FF00"><small><iframe src="date.php" name="dateselect" height="230" width="240" frameborder="0" scrolling="no"></iframe></small></font> </td>
</tr>
</table></td>
</tr>
</table>
</div>
<div id="info" style="visibility: hidden; position: absolute; width: 250; left: 590; top: 392; height: 118;">
<table border="0" width="250" bgcolor="#E6ECFF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="36" bordercolor="#E6ECFF" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bgcolor="#E6ECFF">
<tr>
<td width="100%" bgcolor="#E6ECFF">
<p align="center"><font color="#000000">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onMouseOver="dragswitch=1;drag_dropns(showimage)" onMouseOut="dragswitch=0"><font face="Verdana"><strong><small>
Calender</small></strong></font></layer>
</ilayer>
</font></p></td>
<td></td>
</tr>
<tr>
<td width="100%" bgcolor="#E6ECFF" style="padding:4px" colspan="2" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bordercolor="#E6ECFF">
<font color="#00FF00"><small><table border"0"><tr><td>Click on the calendar picture next to the boxes to open te calendar.</td></tr></table></small></font> </td>
</tr>
</table></td>
</tr>
</table>
</div>
</body>
</html>
<head>
<title>Yourifs! Flight simulator</title>
<style>
a {
color:#FF0000;
}
</style>
</head>
<body bgcolor="#0099FF">
<?php
include("settings.php");
$ftp_server = "*****";
$ftp_user = "*****";
$ftp_pass = "*****";
$conn_id = ftp_connect($ftp_server);
ftp_pasv($conn_id,TRUE);
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);
if($_GET['type'] == "1") {
if(isset($_SESSION['admin'])) {
header("Location: addplane.php?type=2");
exit();
}
echo "<center><h3>User add plane</h3><br><b><a href='planes.php'>Back to planes</a></b></center>";
if($_POST['action'] == "add") {
if($_POST['img'] == "" OR $_POST['fabrikant'] == "" OR $_POST['type'] == "" OR $_POST['speed'] == "" OR $_POST['passagiers'] == "" OR $_POST['lengte'] == "" OR $_POST['hoogte'] == "" OR $_POST['span'] == "" OR $_POST['dag'] == "" OR $_POST['maand'] == "" OR $_POST['jaar'] == "" OR $_POST['afstand'] == "" OR $_POST['gewicht'] == "" OR $_POST['motoren'] == "" OR $_POST['aantal'] == "" OR $_POST['email'] == "") {
echo "<center>You haven't filled in all!<br><a href='#' onclick='javascript:history.back(1)'>Back</a></center>";
}else{
if($_POST['img'] == "file") {
$remote_file = "/public_html/catalogus/images/";
$remote_file .= $_FILES['file']['name'];
$file = $_FILES['file']['tmp_name'];
$upload = ftp_put($conn_id, $remote_file, $file, FTP_BINARY);
$url = "http://yourivw.site90.net/catalogus/images/".$_FILES['file']['name'];
}else{
$url = $_POST['img1'];
}
$datum = $_POST['jaar']."-".$_POST['maand']."-".$_POST['dag'];
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "INSERT INTO planes (fabrikant,type,passagiers,snelheid,afstand,lengte,hoogte,spanwijdte,cockpit,datum,img,aantal,motoren,status,gewicht,actief,ip,naam,email) VALUES ('".$_POST['fabrikant']."','".$_POST['type']."','".$_POST['passagiers']."','".$_POST['speed']."','".$_POST['afstand']."','".$_POST['lengte']."','".$_POST['hoogte']."','".$_POST['span']."','".$_POST['cockpit']."','".$datum."','".$url."','".$_POST['aantal']."','".$_POST['motoren']."','".$_POST['status']."','".$_POST['gewicht']."','0','".$ip."','".$_POST['naam']."','".$_POST['email']."')";
$query = mysql_query($sql);
if($_POST['img'] == "url") {
if($query == TRUE) {
echo "<br><br><center>The airplane is succesfull added.<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}else{
echo "<br><br><center>The airplane is not added!<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}
}else{
if($query == TRUE AND $upload == TRUE) {
echo "<br><br><center>The airplane is succesfull added.<br><a href='planes.php'>Back to the planes</a></center>";
}else{
echo "<br><br><center>The airplane is not added!<br><a href='planes.php'>Back to the planes</a></center>";
}
}
}
}else{
?>
<form action="addplane.php?type=1" method="post" enctype="multipart/form-data" name="form">
<table border="0" align="center">
<tr>
<td>Image:</td><td><input type="radio" name="img" value="url" checked></td><td>Url: <input type="text" name="img1" value="http://"></td>
</tr>
<tr>
<td></td><td><input type="radio" name="img" value="file"></td><td>File: <input type="file" name="file"></td>
</tr>
<tr>
<td>Producer:</td><td></td><td><input type="text" name="fabrikant"></td>
</tr>
<tr>
<td>Type:</td><td></td><td><input type="text" name="type"></td>
</tr>
<tr>
<td>Cruise speed:</td><td></td><td><input type="text" name="speed" size="6" maxlength="4"> km/h</td>
</tr>
<tr>
<td>Max passengers:</td><td></td><td><input type="text" name="passagiers" size="6" maxlength="4"></td>
</tr>
<tr>
<td>Cockpit:</td><td></td><td><select name="cockpit"><option value="0">Traditional cockpit</option><option value="1">Glass cockpit</option></select></td>
</tr>
<tr>
<td>Length:</td><td></td><td><input type="text" name="lengte" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>Height (from ground):</td><td></td><td><input type="text" name="hoogte" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>Wingspan:</td><td></td><td><input type="text" name="span" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>First flight:</td><td></td><td><input type="text" name="date1" id="date1" maxlength="2" size="1" readonly>-<input type="text" id="maand" name="date2" maxlength="2" size="1" readonly>-<input type="text" id="jaar" name="date3" maxlength="4" size="2" readonly><img src="calendar.png" alt="Open calender to select a date" onclick="showimage.style.visibility = '';" style="cursor:hand;"> <img src="ico_large_question.png" alt="How does it work?" height="16" width="16" onmouseover="info.style.visibility = '';" onmouseout="info.style.visibility = 'hidden';"></td>
</tr>
<tr>
<td>Max range:</td><td></td><td><input type="text" name="afstand" size="10" maxlength="10"> km</td>
</tr>
<tr>
<td>Weight:</td><td></td><td><input type="text" name="gewicht" size="10" maxlength="10"> kg</td>
</tr>
<tr>
<td>Engines:</td><td></td><td><input type="text" name="motoren" size="2" maxlength="2" value="2"></td>
</tr>
<tr>
<td>Amount produced:</td><td></td><td><input type="text" name="aantal" size="8" maxlength="6"> planes</td>
</tr>
<tr>
<td>Status:</td><td></td><td><select name="status"><option value="1">Flying</option><option value="0">Not flying</option></select></td>
</tr>
<tr>
<td>Name:</td><td></td><td><input type="text" name="naam" maxlength="30"></td>
</tr>
<tr>
<td>Email:</td><td></td><td><input type="text" name="email"></td>
</tr>
<tr>
<td></td><td></td><td><input type="submit" name="submit" value="Add airplane"></td>
</tr>
</table>
<input type="hidden" name="action" value="add">
</form>
<?
}
}elseif($_GET['type'] == "2") {
if(!isset($_SESSION['admin'])) {
header("Location: addplane.php?type=1");
exit();
}
echo "<center><h3>Admin add plane</h3><b><a href='planes.php'>Back to planes</a></b></center>";
if($_POST['action'] == "add") {
if($_POST['img'] == "" OR $_POST['fabrikant'] == "" OR $_POST['type'] == "" OR $_POST['speed'] == "" OR $_POST['passagiers'] == "" OR $_POST['lengte'] == "" OR $_POST['hoogte'] == "" OR $_POST['span'] == "" OR $_POST['dag'] == "" OR $_POST['maand'] == "" OR $_POST['jaar'] == "" OR $_POST['afstand'] == "" OR $_POST['gewicht'] == "" OR $_POST['motoren'] == "" OR $_POST['aantal'] == "") {
echo "<center>You haven't filled in all!<br><a href='#' onclick='javascript:history.back(1)'>Back</a></center>";
}else{
if($_POST['img'] == "file") {
$remote_file = "/public_html/catalogus/images/";
$remote_file .= $_FILES['file']['name'];
$file = $_FILES['file']['tmp_name'];
$upload = ftp_put($conn_id, $remote_file, $file, FTP_BINARY);
$url = "http://yourivw.site90.net/catalogus/images/".$_FILES['file']['name'];
}else{
$url = $_POST['img1'];
}
$datum = $_POST['jaar']."-".$_POST['maand']."-".$_POST['dag'];
$ip = $_SERVER['REMOTE_ADDR'];
$gbnaam = htmlspecialchars(mysql_fetch_object(mysql_query("SELECT naam FROM gastenboek WHERE ip = '".$ip."'"))->naam);
$sql = "INSERT INTO planes (fabrikant,type,passagiers,snelheid,afstand,lengte,hoogte,spanwijdte,cockpit,datum,img,aantal,motoren,status,gewicht) VALUES ('".$_POST['fabrikant']."','".$_POST['type']."','".$_POST['passagiers']."','".$_POST['speed']."','".$_POST['afstand']."','".$_POST['lengte']."','".$_POST['hoogte']."','".$_POST['span']."','".$_POST['cockpit']."','".$datum."','".$url."','".$_POST['aantal']."','".$_POST['motoren']."','".$_POST['status']."','".$_POST['gewicht']."')";
$query = mysql_query($sql);
if($_POST['img'] == "url") {
if($query == TRUE) {
echo "<br><br><center>The airplane is succesfull added.<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}else{
echo "<br><br><center>The airplane is not added!<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}
}else{
if($query == TRUE AND $upload == TRUE) {
echo "<br><br><center>The airplane is succesfull added.<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}else{
echo "<br><br><center>The airplane is not added!<br><b><a href='planes.php'>Back to the planes</a></b></center>";
}
}
}
}else{
?>
<form action="addplane.php?type=2" method="post" enctype="multipart/form-data" name="form">
<table border="0" align="center">
<tr>
<td>Image:</td><td><input type="radio" name="img" value="url" checked></td><td>Url: <input type="text" name="img1" value="http://"></td>
</tr>
<tr>
<td></td><td><input type="radio" name="img" value="file"></td><td>File: <input type="file" name="file"></td>
</tr>
<tr>
<td>Producer:</td><td></td><td><input type="text" name="fabrikant"></td>
</tr>
<tr>
<td>Type:</td><td></td><td><input type="text" name="type"></td>
</tr>
<tr>
<td>Cruise speed:</td><td></td><td><input type="text" name="speed" size="6" maxlength="4"> km/h</td>
</tr>
<tr>
<td>Max passengers:</td><td></td><td><input type="text" name="passagiers" size="6" maxlength="4"></td>
</tr>
<tr>
<td>Cockpit:</td><td></td><td><select name="cockpit"><option value="0">Traditional cockpit</option><option value="1">Glass cockpit</option></select></td>
</tr>
<tr>
<td>Length:</td><td></td><td><input type="text" name="lengte" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>Height (from ground):</td><td></td><td><input type="text" name="hoogte" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>Wingspan:</td><td></td><td><input type="text" name="span" size="8" maxlength="6"> meters</td>
</tr>
<tr>
<td>First flight:</td><td></td><td><input type="text" name="date1" id="date1" maxlength="2" size="1" readonly>-<input type="text" id="maand" name="date2" maxlength="2" size="1" readonly>-<input type="text" id="jaar" name="date3" maxlength="4" size="2" readonly><img src="calendar.png" alt="Open calender to select a date" onclick="showimage.style.visibility = '';" style="cursor:hand;"> <img src="ico_large_question.png" alt="How does it work?" height="16" width="16" onmouseover="info.style.visibility = '';" onmouseout="info.style.visibility = 'hidden';"></td>
</tr>
<tr>
<td>Max range:</td><td></td><td><input type="text" name="afstand" size="10" maxlength="10"> km</td>
</tr>
<tr>
<td>Weight:</td><td></td><td><input type="text" name="gewicht" size="10" maxlength="10"> kg</td>
</tr>
<tr>
<td>Engines:</td><td></td><td><input type="text" name="motoren" size="2" maxlength="2" value="2"></td>
</tr>
<tr>
<td>Amount produced:</td><td></td><td><input type="text" name="aantal" size="8" maxlength="6"> planes</td>
</tr>
<tr>
<td>Status:</td><td></td><td><select name="status"><option value="1">Flying</option><option value="0">Not flying</option></select></td>
</tr>
<tr>
<td></td><td></td><td><input type="submit" name="submit" value="Add airplane"></td>
</tr>
</table>
<input type="hidden" name="action" value="add">
</form>
<?
}
}else{
if(isset($_SESSION['admin'])) {
header("Location: addplane.php?type=2");
}else{
header("Location: addplane.php?type=1");
}
}
?>
<script language="JavaScript1.2">
var dragswitch=0
var nsx
var nsy
var nstemp
function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
//drag drop function for IE 4+////
/////////////////////////////////
var dragapproved=false
function drag_dropie(){
if (dragapproved==true){
document.all.showimage.style.pixelLeft=tempx+event.clientX-iex
document.all.showimage.style.pixelTop=tempy+event.clientY-iey
return false
}
}
function initializedragie(){
iex=event.clientX
iey=event.clientY
tempx=showimage.style.pixelLeft
tempy=showimage.style.pixelTop
dragapproved=true
document.onmousemove=drag_dropie
}
if (document.all){
document.onmouseup=new Function("dragapproved=false")
}
function hideboxcal(){
if (document.all)
showimage.style.visibility="hidden"
else if (document.layers)
document.showimage.visibility="hide"
}
function hideboxinfo(){
if (document.all)
info.style.visibility="hidden"
else if (document.layers)
document.info.visibility="hide"
}
function start() {
showimage.style.visibility = "hidden";
}
</script>
<div id="showimage" style="visibility: hidden; position: absolute; width: 250; left: 284; top: 55; height: 118;">
<table border="0" width="250" bgcolor="#E6ECFF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="36" bordercolor="#E6ECFF" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bgcolor="#E6ECFF">
<tr>
<td width="100%" bgcolor="#E6ECFF">
<p align="center"><font color="#000000">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onMouseOver="dragswitch=1;drag_dropns(showimage)" onMouseOut="dragswitch=0"><font face="Verdana"><strong><small>
Calender</small></strong></font></layer>
</ilayer>
</font></p></td>
<td></td><td style="cursor:hand" bgcolor="#E6ECFF"><a href="#" onClick="hideboxcal();return false"><font size="2" color="#000000"><img src="delete.png" border="0"></font></a></td>
</tr>
<tr>
<td width="100%" bgcolor="#E6ECFF" style="padding:4px" colspan="2" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bordercolor="#E6ECFF">
<font color="#00FF00"><small><iframe src="date.php" name="dateselect" height="230" width="240" frameborder="0" scrolling="no"></iframe></small></font> </td>
</tr>
</table></td>
</tr>
</table>
</div>
<div id="info" style="visibility: hidden; position: absolute; width: 250; left: 590; top: 392; height: 118;">
<table border="0" width="250" bgcolor="#E6ECFF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="36" bordercolor="#E6ECFF" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bgcolor="#E6ECFF">
<tr>
<td width="100%" bgcolor="#E6ECFF">
<p align="center"><font color="#000000">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onMouseOver="dragswitch=1;drag_dropns(showimage)" onMouseOut="dragswitch=0"><font face="Verdana"><strong><small>
Calender</small></strong></font></layer>
</ilayer>
</font></p></td>
<td></td>
</tr>
<tr>
<td width="100%" bgcolor="#E6ECFF" style="padding:4px" colspan="2" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bordercolor="#E6ECFF">
<font color="#00FF00"><small><table border"0"><tr><td>Click on the calendar picture next to the boxes to open te calendar.</td></tr></table></small></font> </td>
</tr>
</table></td>
</tr>
</table>
</div>
</body>
</html>
ik weet dat de date1,2,3 velden niet goed staan met database query, maak ik later wel goed.
--- date.inc.php (oorspronkelijke pagina waar het wel werkte) ---
Code (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
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
<html>
<body bgcolor="#0099FF">
<script language="JavaScript1.2">
var dragswitch=0
var nsx
var nsy
var nstemp
function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
//drag drop function for IE 4+////
/////////////////////////////////
var dragapproved=false
function drag_dropie(){
if (dragapproved==true){
document.all.showimage.style.pixelLeft=tempx+event.clientX-iex
document.all.showimage.style.pixelTop=tempy+event.clientY-iey
return false
}
}
function initializedragie(){
iex=event.clientX
iey=event.clientY
tempx=showimage.style.pixelLeft
tempy=showimage.style.pixelTop
dragapproved=true
document.onmousemove=drag_dropie
}
if (document.all){
document.onmouseup=new Function("dragapproved=false")
}
function hideboxcal(){
if (document.all)
showimage.style.visibility="hidden"
else if (document.layers)
document.showimage.visibility="hide"
}
function hideboxinfo(){
if (document.all)
info.style.visibility="hidden"
else if (document.layers)
document.info.visibility="hide"
}
function start() {
showimage.style.visibility = "hidden";
}
</script>
<div id="showimage" style="visibility: hidden; position: absolute; width: 250; left: 284; top: 55; height: 118;">
<table border="0" width="250" bgcolor="#E6ECFF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="36" bordercolor="#E6ECFF" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bgcolor="#E6ECFF">
<tr>
<td width="100%" bgcolor="#E6ECFF">
<p align="center"><font color="#000000">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onMouseOver="dragswitch=1;drag_dropns(showimage)" onMouseOut="dragswitch=0"><font face="Verdana"><strong><small>
Calender</small></strong></font></layer>
</ilayer>
</font></p></td>
<td></td><td style="cursor:hand" bgcolor="#E6ECFF"><a href="#" onClick="hideboxcal();return false"><font size="2" color="#000000"><img src="delete.png" border="0"></font></a></td>
</tr>
<tr>
<td width="100%" bgcolor="#E6ECFF" style="padding:4px" colspan="2" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bordercolor="#E6ECFF">
<font color="#00FF00"><small><iframe src="date.php" height="230" width="240" frameborder="0" scrolling="no"></iframe></small></font> </td>
</tr>
</table></td>
</tr>
</table>
</div>
<div id="info" style="visibility: hidden; position: absolute; width: 250; left: 284; top: 55; height: 118;">
<table border="0" width="250" bgcolor="#E6ECFF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="36" bordercolor="#E6ECFF" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bgcolor="#E6ECFF">
<tr>
<td width="100%" bgcolor="#E6ECFF">
<p align="center"><font color="#000000">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onMouseOver="dragswitch=1;drag_dropns(showimage)" onMouseOut="dragswitch=0"><font face="Verdana"><strong><small>
Calender</small></strong></font></layer>
</ilayer>
</font></p></td>
<td></td>
</tr>
<tr>
<td width="100%" bgcolor="#E6ECFF" style="padding:4px" colspan="2" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bordercolor="#E6ECFF">
<font color="#00FF00"><small><table border"0"><tr><td>Click on the calendar picture next to the boxes to open te calendar.</td></tr></table></small></font> </td>
</tr>
</table></td>
</tr>
</table>
</div>
<input type="text" name="date1" size="1" id="date1" readonly>-<input type="text" name="date2" size="1" id="date2" readonly>-<input type="text" name="date3" size="3" id="date3" readonly> <img src="calendar.png" alt="Open calender to select a date" onclick="showimage.style.visibility = '';" style="cursor:hand;"> <img src="ico_large_question.png" alt="How does it work?" height="16" width="16" onmouseover="info.style.visibility = '';" onmouseout="info.style.visibility = 'hidden';">
</body>
</html>
<body bgcolor="#0099FF">
<script language="JavaScript1.2">
var dragswitch=0
var nsx
var nsy
var nstemp
function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
//drag drop function for IE 4+////
/////////////////////////////////
var dragapproved=false
function drag_dropie(){
if (dragapproved==true){
document.all.showimage.style.pixelLeft=tempx+event.clientX-iex
document.all.showimage.style.pixelTop=tempy+event.clientY-iey
return false
}
}
function initializedragie(){
iex=event.clientX
iey=event.clientY
tempx=showimage.style.pixelLeft
tempy=showimage.style.pixelTop
dragapproved=true
document.onmousemove=drag_dropie
}
if (document.all){
document.onmouseup=new Function("dragapproved=false")
}
function hideboxcal(){
if (document.all)
showimage.style.visibility="hidden"
else if (document.layers)
document.showimage.visibility="hide"
}
function hideboxinfo(){
if (document.all)
info.style.visibility="hidden"
else if (document.layers)
document.info.visibility="hide"
}
function start() {
showimage.style.visibility = "hidden";
}
</script>
<div id="showimage" style="visibility: hidden; position: absolute; width: 250; left: 284; top: 55; height: 118;">
<table border="0" width="250" bgcolor="#E6ECFF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="36" bordercolor="#E6ECFF" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bgcolor="#E6ECFF">
<tr>
<td width="100%" bgcolor="#E6ECFF">
<p align="center"><font color="#000000">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onMouseOver="dragswitch=1;drag_dropns(showimage)" onMouseOut="dragswitch=0"><font face="Verdana"><strong><small>
Calender</small></strong></font></layer>
</ilayer>
</font></p></td>
<td></td><td style="cursor:hand" bgcolor="#E6ECFF"><a href="#" onClick="hideboxcal();return false"><font size="2" color="#000000"><img src="delete.png" border="0"></font></a></td>
</tr>
<tr>
<td width="100%" bgcolor="#E6ECFF" style="padding:4px" colspan="2" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bordercolor="#E6ECFF">
<font color="#00FF00"><small><iframe src="date.php" height="230" width="240" frameborder="0" scrolling="no"></iframe></small></font> </td>
</tr>
</table></td>
</tr>
</table>
</div>
<div id="info" style="visibility: hidden; position: absolute; width: 250; left: 284; top: 55; height: 118;">
<table border="0" width="250" bgcolor="#E6ECFF" cellspacing="0" cellpadding="2">
<tr>
<td width="100%"><table border="1" width="100%" cellspacing="0" cellpadding="0"
height="36" bordercolor="#E6ECFF" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bgcolor="#E6ECFF">
<tr>
<td width="100%" bgcolor="#E6ECFF">
<p align="center"><font color="#000000">
<ilayer width="100%" onselectstart="return false">
<layer width="100%" onMouseOver="dragswitch=1;drag_dropns(showimage)" onMouseOut="dragswitch=0"><font face="Verdana"><strong><small>
Calender</small></strong></font></layer>
</ilayer>
</font></p></td>
<td></td>
</tr>
<tr>
<td width="100%" bgcolor="#E6ECFF" style="padding:4px" colspan="2" bordercolorlight="#E6ECFF" bordercolordark="#E6ECFF" bordercolor="#E6ECFF">
<font color="#00FF00"><small><table border"0"><tr><td>Click on the calendar picture next to the boxes to open te calendar.</td></tr></table></small></font> </td>
</tr>
</table></td>
</tr>
</table>
</div>
<input type="text" name="date1" size="1" id="date1" readonly>-<input type="text" name="date2" size="1" id="date2" readonly>-<input type="text" name="date3" size="3" id="date3" readonly> <img src="calendar.png" alt="Open calender to select a date" onclick="showimage.style.visibility = '';" style="cursor:hand;"> <img src="ico_large_question.png" alt="How does it work?" height="16" width="16" onmouseover="info.style.visibility = '';" onmouseout="info.style.visibility = 'hidden';">
</body>
</html>
Gewijzigd op 01/01/1970 01:00:00 door Youri van Weegberg
Ik heb het verder niet getest, maar om toch wat kritiek te geven, Wijzig de rode links in wit. Dat zal een stukje minder koppijn opleveren, want wit op blauw leest een stuk prettiger.
En probeer ook zo snel mogelijk te leren om sites te gaan bouwen met nette html en css. Tenminste als je dit leuk vindt om te doen en te leren.
oke, dankje, maar kan iemand mij helpen met mijn probleem???