Kalender (datum probleem)
Nu wil de datum naar 01-01-2001 hebben want mijn database is zo ingericht.
Ik heb de maand al goed gekregen maar de dag nog niet.
En de link naar de volgende pagina krijg ik ook niet werkend.
Kan iemand mij helpen?
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
<?PHP>
<HTML>
<HEAD>
<TITLE>Agenda</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body,td,p,select,input,textarea {
color: #333333;
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
margin:0,0,0,0;
}
a{
color: #333333;
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-decoration:underline;
}
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #0D4E95;
font-weight: bold;
padding-bottom:0px;
padding-top:0px;
}
a.topnav {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
font-weight: bold;
text-decoration:none;
}
a.topnav:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
font-weight: bold;
text-decoration:underline;
}
.sidered {color: #0D4E95; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;}
.side {color: #333333; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;}
a.sideredlinks{color: #0D4E95; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold;text-decoration:underline; }
h1 {
font-size: 18px;
color: #0D4E95;
}
.base {font-size: 10px;margin-left:28px;}
td.kalalg { padding: 0px; margin: 0px; center: top; font: 11px Verdana, Arial; font-weight: bold; background-color: #FFFFFF; color: #0000CC; line-height: 16px; }
td.kaltit { padding: 0px; margin: 0px; center: top; font: 11px Verdana, Arial; font-weight: normal; background-color: #FFFFFF; color: #AAAAAA; border-bottom: solid 1px #AAAAAA;}
td.kaltexr { width: 117px; padding: 0px; height: 100px; cursor: hand; margin: 0px; font: 11px Verdana, Arial; font-weight: normal; color: #0D4E95; }
-->
</style>
</HEAD>
<body>
<center>
<?php
// Connection mysql
include ('con.php');
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $dbpass)))
{
echo "Connectie met de database mislukt.";
exit();
}
echo "<table width=\"200\">\n";
echo "<tr><td class=\"kalalg\">";
if($_GET['thismonth'] != "" and $_GET['thisyear'] != "") {
$this_month = $_GET['thismonth'];
$this_year = $_GET['thisyear'];
if ($this_month == 13) {
$this_month = 01;
$this_year = $this_year + 1;
}
elseif ($this_month == 0)
{
$this_month = 12;
$this_year = $this_year - 1;
}
else
{
$this_month = $this_month;
}
}
else {
$this_month = date("m");
$this_year = date("Y");
}
$arraymonth = array(
"Januari",
"Februari",
"Maart",
"April",
"Mei",
"Juni",
"Juli",
"Augustus",
"September",
"Oktober",
"November",
"December"
);
$month_name = $arraymonth[$this_month-1];
/* Navigation */
$last_month = $this_month - 01;
$next_month = $this_month + 01;
echo "<center>";
echo "<table width=\"800\"><tr><td align=\"left\" width=\"200\">\n";
echo "<a href=\"agenda.php?thismonth=$last_month&thisyear=$this_year\" style=\"color:#0D4E95; font-family: Verdana, Arial, Helvetica, sans-serif;\"><b>« Vorige</b></a>";
echo "</td><td align=\"center\" width=\"400\">";
echo "<h1>$month_name $this_year</h1>";
echo "</td><td align=\"right\" width=\"200\">";
echo "<a href=\"agenda.php?thismonth=$next_month&thisyear=$this_year\" style=\"color:#0D4E95; font-family: Verdana, Arial, Helvetica, sans-serif;\"><b>Volgende »</b></a>";
echo "</td></tr></table>";
echo "</center>";
/* Titels van de kalender */
echo "<table width=\"820\" cellspacing=\"1\" cellpadding=\"0\" style=\"border: solid #AAAAAA 1px;\">\n";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Maandag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Dinsdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Woensdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Donderdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Vrijdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Zaterdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center;\">Zondag</td>";
echo "</td></tr>";
/* De maand berekenen */
$first_day = date("w", mktime(0, 0, 0, $this_month, 1, $this_year));
$total_days = date("t", mktime(0, 0, 0, $this_month, 1, $this_year));
$week_num = 1;
$day_num = 1;
$the_day = " ";
/* Het aantal weken overlopen (primaire teller in het proces) */
while ($week_num <= 6) {
echo "<tr>\n";
/* Het aantal weken overlopen (secundaire teller) */
for ( $i = 1; $i <= 6; $i++ ) {
if ($week_num == 1) {
if ($i < $first_day)
$the_day = " ";
else if ($i == $first_day) {
$the_day = 1;
}
} else {
if ($the_day > $total_days)
$the_day = " ";
}
/* De dagen weergeven */
if ($the_day != " ")
{
if ($the_day == date("d") and $this_month == date("m") and $this_year == date("Y"))
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#FEFFBF';\" onMouseOut=\"this.style.backgroundColor='#FEFF97'\" bgcolor=#FEFF97><b>$the_day</b><br>";
}
else
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#E9ECEF';\" onMouseOut=\"this.style.backgroundColor='#CDD2D9'\" bgcolor=#CDD2D9><b>$the_day</b><br>";
}
$querytris="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' ORDER BY id";
$resulttris=mysql_query($querytris) or die(mysql_error());
if (mysql_num_rows($resulttris) >= 1)
{
echo "<font style=\"color:#404040; font-size:90%;\"><center><b>";
while ($rowtris = mysql_fetch_array($resulttris))
{
echo "".$rowtris['titre']."";
}
echo "</b></center></font><br>";
}
$queryquattro="SELECT titre FROM agenda WHERE date='$the_day/$this_month' ORDER BY id";
$resultquattro=mysql_query($queryquattro) or die(mysql_error());
if (mysql_num_rows($resultquattro) >= 1)
{
echo "<font style=\"color:#404040;font-size:90%;\"><center><b>";
while ($rowquattro = mysql_fetch_array($resultquattro))
{
echo "".$rowquattro['titre']."";
}
echo "</b></center></font><br>";
}
$query="SELECT login FROM members WHERE annif='$the_day/$this_month' ORDER BY id";
$result=mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Verjaardag:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($row = mysql_fetch_array($result))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$row['login']."</font></td></tr>";
}
echo "</table>";
}
$querybis="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='activit�' ORDER BY id";
$resultbis=mysql_query($querybis) or die(mysql_error());
if (mysql_num_rows($resultbis) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Activiteiten:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($rowbis = mysql_fetch_array($resultbis))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$rowbis['titre']."</font></td></tr>";
}
echo "</table>";
}
echo "</td>";
}
else
{
echo "<td valign=\"top\" bgcolor=\"#DFDFDF\"></td>";
}
/* De volgende dag berekenen */
if ($the_day != " ")
$the_day++;
}
if ($week_num == 1) {
if ($first_day == 0) {
$the_day = 1;
if ($the_day == date("d") and $this_month == date("m") and $this_year == date("Y"))
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#FEFFBF';\" onMouseOut=\"this.style.backgroundColor='#FEFF97'\" bgcolor=#FEFF97><b>$the_day</b><br>";
}
else
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#E9ECEF';\" onMouseOut=\"this.style.backgroundColor='#C3C3C3'\" bgcolor=#C3C3C3><b>$the_day</b><br>";
}
$querytris="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='jour f�ri�' ORDER BY id";
$resulttris=mysql_query($querytris) or die(mysql_error());
if (mysql_num_rows($resulttris) >= 1)
{
echo "<font style=\"color:#404040; font-size:90%;\"><center><b>";
while ($rowtris = mysql_fetch_array($resulttris))
{
echo "".$rowtris['titre']."";
}
echo "</b></center></font><br>";
}
$queryquattro="SELECT titre FROM agenda WHERE date='$the_day/$this_month' and genre='jour f�ri�' ORDER BY id";
$resultquattro=mysql_query($queryquattro) or die(mysql_error());
if (mysql_num_rows($resultquattro) >= 1)
{
echo "<font style=\"color:#404040;font-size:90%;\"><center><b>";
while ($rowquattro = mysql_fetch_array($resultquattro))
{
echo "".$rowquattro['titre']."";
}
echo "</b></center></font><br>";
}
$query="SELECT login FROM members WHERE annif='$the_day/$this_month' ORDER BY id";
$result=mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Verjaardag:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($row = mysql_fetch_array($result))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$row['login']."</font></td></tr>";
}
echo "</table>";
}
$querybis="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='activit�' ORDER BY id";
$resultbis=mysql_query($querybis) or die(mysql_error());
if (mysql_num_rows($resultbis) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Activiteiten:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($rowbis = mysql_fetch_array($resultbis))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$rowbis['titre']."</font></td></tr>";
}
echo "</table>";
}
echo "</td>";
echo "</tr>";
$the_day++;
}
else {
if ($the_day == date("d") and $this_month == date("m") and $this_year == date("Y"))
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#FEFFBF';\" onMouseOut=\"this.style.backgroundColor='#FEFF97'\" bgcolor=#FEFF97><b>$the_day</b><br>";
}
else
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#E9ECEF';\" onMouseOut=\"this.style.backgroundColor='#C3C3C3'\" bgcolor=#C3C3C3><b>$the_day</b><br>";
}
$querytris="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='jour f�ri�' ORDER BY id";
$resulttris=mysql_query($querytris) or die(mysql_error());
if (mysql_num_rows($resulttris) >= 1)
{
echo "<font style=\"color:#404040; font-size:90%;\"><center><b>";
while ($rowtris = mysql_fetch_array($resulttris))
{
echo "".$rowtris['titre']."";
}
echo "</b></center></font><br>";
}
$queryquattro="SELECT titre FROM agenda WHERE date='$the_day/$this_month' ORDER BY id";
$resultquattro=mysql_query($queryquattro) or die(mysql_error());
if (mysql_num_rows($resultquattro) >= 1)
{
echo "<font style=\"color:#404040;font-size:90%;\"><center><b>";
while ($rowquattro = mysql_fetch_array($resultquattro))
{
echo "".$rowquattro['titre']."";
}
echo "</b></center></font><br>";
}
$query="SELECT login FROM members WHERE annif='$the_day/$this_month' ORDER BY id";
$result=mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Verjaardag:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($row = mysql_fetch_array($result))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$row['login']."</font></td></tr>";
}
echo "</table>";
}
$querybis="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' ORDER BY id";
$resultbis=mysql_query($querybis) or die(mysql_error());
if (mysql_num_rows($resultbis) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Activiteiten:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($rowbis = mysql_fetch_array($resultbis))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$rowbis['titre']."</font></td></tr>";
}
echo "</table>";
}
echo "</td>";
echo "</tr>";
$the_day++;
}
}
elseif ($the_day > $total_days) {
$the_day = " ";
echo "<td valign=\"top\" bgcolor=\"#DFDFDF\"></td>";
echo "</tr>";
}
elseif ($the_day != " ") {
if ($the_day == date("d") and $this_month == date("m") and $this_year == date("Y"))
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#FEFFBF';\" onMouseOut=\"this.style.backgroundColor='#FEFF97'\" bgcolor=#FEFF97><b>$the_day</b><br>";
}
else
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#E9ECEF';\" onMouseOut=\"this.style.backgroundColor='#C3C3C3'\" bgcolor=#C3C3C3><b>$the_day</b><br>";
}
$querytris="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='jour f�ri�' ORDER BY id";
$resulttris=mysql_query($querytris) or die(mysql_error());
if (mysql_num_rows($resulttris) >= 1)
{
echo "<font style=\"color:#404040; font-size:90%;\"><center><b>";
while ($rowtris = mysql_fetch_array($resulttris))
{
echo "".$rowtris['titre']."";
}
echo "</b></center></font><br>";
}
$queryquattro="SELECT titre FROM agenda WHERE date='$the_day/$this_month' ORDER BY id";
$resultquattro=mysql_query($queryquattro) or die(mysql_error());
if (mysql_num_rows($resultquattro) >= 1)
{
echo "<font style=\"color:#404040;font-size:90%;\"><center><b>";
while ($rowquattro = mysql_fetch_array($resultquattro))
{
echo "".$rowquattro['titre']."";
}
echo "</b></center></font><br>";
}
$query="SELECT login FROM members WHERE annif='$the_day/$this_month' ORDER BY id";
$result=mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Verjaardag:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($row = mysql_fetch_array($result))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$row['login']."</font></td></tr>";
}
echo "</table>";
}
$querybis="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' ORDER BY id";
$resultbis=mysql_query($querybis) or die(mysql_error());
if (mysql_num_rows($resultbis) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Activiteiten:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($rowbis = mysql_fetch_array($resultbis))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$rowbis['titre']."</font></td></tr>";
}
echo "</table>";
}
echo "</td>";
echo "</tr>";
$the_day++;
}
else {
$the_day = " ";
echo "<td valign=\"top\" bgcolor=\"#DFDFDF\"></td>";
echo "</tr>";
}
$week_num++;
}
echo "</table>";
echo "</td></tr>";
echo "</table>";
?>
<br>
</center>
</body>
</html>
<?>
<HTML>
<HEAD>
<TITLE>Agenda</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body,td,p,select,input,textarea {
color: #333333;
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
margin:0,0,0,0;
}
a{
color: #333333;
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-decoration:underline;
}
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #0D4E95;
font-weight: bold;
padding-bottom:0px;
padding-top:0px;
}
a.topnav {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
font-weight: bold;
text-decoration:none;
}
a.topnav:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
font-weight: bold;
text-decoration:underline;
}
.sidered {color: #0D4E95; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;}
.side {color: #333333; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;}
a.sideredlinks{color: #0D4E95; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold;text-decoration:underline; }
h1 {
font-size: 18px;
color: #0D4E95;
}
.base {font-size: 10px;margin-left:28px;}
td.kalalg { padding: 0px; margin: 0px; center: top; font: 11px Verdana, Arial; font-weight: bold; background-color: #FFFFFF; color: #0000CC; line-height: 16px; }
td.kaltit { padding: 0px; margin: 0px; center: top; font: 11px Verdana, Arial; font-weight: normal; background-color: #FFFFFF; color: #AAAAAA; border-bottom: solid 1px #AAAAAA;}
td.kaltexr { width: 117px; padding: 0px; height: 100px; cursor: hand; margin: 0px; font: 11px Verdana, Arial; font-weight: normal; color: #0D4E95; }
-->
</style>
</HEAD>
<body>
<center>
<?php
// Connection mysql
include ('con.php');
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $dbpass)))
{
echo "Connectie met de database mislukt.";
exit();
}
echo "<table width=\"200\">\n";
echo "<tr><td class=\"kalalg\">";
if($_GET['thismonth'] != "" and $_GET['thisyear'] != "") {
$this_month = $_GET['thismonth'];
$this_year = $_GET['thisyear'];
if ($this_month == 13) {
$this_month = 01;
$this_year = $this_year + 1;
}
elseif ($this_month == 0)
{
$this_month = 12;
$this_year = $this_year - 1;
}
else
{
$this_month = $this_month;
}
}
else {
$this_month = date("m");
$this_year = date("Y");
}
$arraymonth = array(
"Januari",
"Februari",
"Maart",
"April",
"Mei",
"Juni",
"Juli",
"Augustus",
"September",
"Oktober",
"November",
"December"
);
$month_name = $arraymonth[$this_month-1];
/* Navigation */
$last_month = $this_month - 01;
$next_month = $this_month + 01;
echo "<center>";
echo "<table width=\"800\"><tr><td align=\"left\" width=\"200\">\n";
echo "<a href=\"agenda.php?thismonth=$last_month&thisyear=$this_year\" style=\"color:#0D4E95; font-family: Verdana, Arial, Helvetica, sans-serif;\"><b>« Vorige</b></a>";
echo "</td><td align=\"center\" width=\"400\">";
echo "<h1>$month_name $this_year</h1>";
echo "</td><td align=\"right\" width=\"200\">";
echo "<a href=\"agenda.php?thismonth=$next_month&thisyear=$this_year\" style=\"color:#0D4E95; font-family: Verdana, Arial, Helvetica, sans-serif;\"><b>Volgende »</b></a>";
echo "</td></tr></table>";
echo "</center>";
/* Titels van de kalender */
echo "<table width=\"820\" cellspacing=\"1\" cellpadding=\"0\" style=\"border: solid #AAAAAA 1px;\">\n";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Maandag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Dinsdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Woensdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Donderdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Vrijdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center; border-right: solid #AAAAAA 1px;\">Zaterdag</td>";
echo "<td class=\"kaltit\" height=\"5\" style=\"text-align: center;\">Zondag</td>";
echo "</td></tr>";
/* De maand berekenen */
$first_day = date("w", mktime(0, 0, 0, $this_month, 1, $this_year));
$total_days = date("t", mktime(0, 0, 0, $this_month, 1, $this_year));
$week_num = 1;
$day_num = 1;
$the_day = " ";
/* Het aantal weken overlopen (primaire teller in het proces) */
while ($week_num <= 6) {
echo "<tr>\n";
/* Het aantal weken overlopen (secundaire teller) */
for ( $i = 1; $i <= 6; $i++ ) {
if ($week_num == 1) {
if ($i < $first_day)
$the_day = " ";
else if ($i == $first_day) {
$the_day = 1;
}
} else {
if ($the_day > $total_days)
$the_day = " ";
}
/* De dagen weergeven */
if ($the_day != " ")
{
if ($the_day == date("d") and $this_month == date("m") and $this_year == date("Y"))
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#FEFFBF';\" onMouseOut=\"this.style.backgroundColor='#FEFF97'\" bgcolor=#FEFF97><b>$the_day</b><br>";
}
else
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#E9ECEF';\" onMouseOut=\"this.style.backgroundColor='#CDD2D9'\" bgcolor=#CDD2D9><b>$the_day</b><br>";
}
$querytris="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' ORDER BY id";
$resulttris=mysql_query($querytris) or die(mysql_error());
if (mysql_num_rows($resulttris) >= 1)
{
echo "<font style=\"color:#404040; font-size:90%;\"><center><b>";
while ($rowtris = mysql_fetch_array($resulttris))
{
echo "".$rowtris['titre']."";
}
echo "</b></center></font><br>";
}
$queryquattro="SELECT titre FROM agenda WHERE date='$the_day/$this_month' ORDER BY id";
$resultquattro=mysql_query($queryquattro) or die(mysql_error());
if (mysql_num_rows($resultquattro) >= 1)
{
echo "<font style=\"color:#404040;font-size:90%;\"><center><b>";
while ($rowquattro = mysql_fetch_array($resultquattro))
{
echo "".$rowquattro['titre']."";
}
echo "</b></center></font><br>";
}
$query="SELECT login FROM members WHERE annif='$the_day/$this_month' ORDER BY id";
$result=mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Verjaardag:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($row = mysql_fetch_array($result))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$row['login']."</font></td></tr>";
}
echo "</table>";
}
$querybis="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='activit�' ORDER BY id";
$resultbis=mysql_query($querybis) or die(mysql_error());
if (mysql_num_rows($resultbis) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Activiteiten:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($rowbis = mysql_fetch_array($resultbis))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$rowbis['titre']."</font></td></tr>";
}
echo "</table>";
}
echo "</td>";
}
else
{
echo "<td valign=\"top\" bgcolor=\"#DFDFDF\"></td>";
}
/* De volgende dag berekenen */
if ($the_day != " ")
$the_day++;
}
if ($week_num == 1) {
if ($first_day == 0) {
$the_day = 1;
if ($the_day == date("d") and $this_month == date("m") and $this_year == date("Y"))
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#FEFFBF';\" onMouseOut=\"this.style.backgroundColor='#FEFF97'\" bgcolor=#FEFF97><b>$the_day</b><br>";
}
else
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#E9ECEF';\" onMouseOut=\"this.style.backgroundColor='#C3C3C3'\" bgcolor=#C3C3C3><b>$the_day</b><br>";
}
$querytris="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='jour f�ri�' ORDER BY id";
$resulttris=mysql_query($querytris) or die(mysql_error());
if (mysql_num_rows($resulttris) >= 1)
{
echo "<font style=\"color:#404040; font-size:90%;\"><center><b>";
while ($rowtris = mysql_fetch_array($resulttris))
{
echo "".$rowtris['titre']."";
}
echo "</b></center></font><br>";
}
$queryquattro="SELECT titre FROM agenda WHERE date='$the_day/$this_month' and genre='jour f�ri�' ORDER BY id";
$resultquattro=mysql_query($queryquattro) or die(mysql_error());
if (mysql_num_rows($resultquattro) >= 1)
{
echo "<font style=\"color:#404040;font-size:90%;\"><center><b>";
while ($rowquattro = mysql_fetch_array($resultquattro))
{
echo "".$rowquattro['titre']."";
}
echo "</b></center></font><br>";
}
$query="SELECT login FROM members WHERE annif='$the_day/$this_month' ORDER BY id";
$result=mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Verjaardag:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($row = mysql_fetch_array($result))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$row['login']."</font></td></tr>";
}
echo "</table>";
}
$querybis="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='activit�' ORDER BY id";
$resultbis=mysql_query($querybis) or die(mysql_error());
if (mysql_num_rows($resultbis) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Activiteiten:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($rowbis = mysql_fetch_array($resultbis))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$rowbis['titre']."</font></td></tr>";
}
echo "</table>";
}
echo "</td>";
echo "</tr>";
$the_day++;
}
else {
if ($the_day == date("d") and $this_month == date("m") and $this_year == date("Y"))
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#FEFFBF';\" onMouseOut=\"this.style.backgroundColor='#FEFF97'\" bgcolor=#FEFF97><b>$the_day</b><br>";
}
else
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#E9ECEF';\" onMouseOut=\"this.style.backgroundColor='#C3C3C3'\" bgcolor=#C3C3C3><b>$the_day</b><br>";
}
$querytris="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='jour f�ri�' ORDER BY id";
$resulttris=mysql_query($querytris) or die(mysql_error());
if (mysql_num_rows($resulttris) >= 1)
{
echo "<font style=\"color:#404040; font-size:90%;\"><center><b>";
while ($rowtris = mysql_fetch_array($resulttris))
{
echo "".$rowtris['titre']."";
}
echo "</b></center></font><br>";
}
$queryquattro="SELECT titre FROM agenda WHERE date='$the_day/$this_month' ORDER BY id";
$resultquattro=mysql_query($queryquattro) or die(mysql_error());
if (mysql_num_rows($resultquattro) >= 1)
{
echo "<font style=\"color:#404040;font-size:90%;\"><center><b>";
while ($rowquattro = mysql_fetch_array($resultquattro))
{
echo "".$rowquattro['titre']."";
}
echo "</b></center></font><br>";
}
$query="SELECT login FROM members WHERE annif='$the_day/$this_month' ORDER BY id";
$result=mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Verjaardag:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($row = mysql_fetch_array($result))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$row['login']."</font></td></tr>";
}
echo "</table>";
}
$querybis="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' ORDER BY id";
$resultbis=mysql_query($querybis) or die(mysql_error());
if (mysql_num_rows($resultbis) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Activiteiten:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($rowbis = mysql_fetch_array($resultbis))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$rowbis['titre']."</font></td></tr>";
}
echo "</table>";
}
echo "</td>";
echo "</tr>";
$the_day++;
}
}
elseif ($the_day > $total_days) {
$the_day = " ";
echo "<td valign=\"top\" bgcolor=\"#DFDFDF\"></td>";
echo "</tr>";
}
elseif ($the_day != " ") {
if ($the_day == date("d") and $this_month == date("m") and $this_year == date("Y"))
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#FEFFBF';\" onMouseOut=\"this.style.backgroundColor='#FEFF97'\" bgcolor=#FEFF97><b>$the_day</b><br>";
}
else
{
echo "<td valign=\"top\" class=\"kaltexr\" onclick=\"window.location.href='jour.php?jour=$the_day&mois=$this_month&annee=$this_year'\" onMouseOver=\"this.style.backgroundColor='#E9ECEF';\" onMouseOut=\"this.style.backgroundColor='#C3C3C3'\" bgcolor=#C3C3C3><b>$the_day</b><br>";
}
$querytris="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' and genre='jour f�ri�' ORDER BY id";
$resulttris=mysql_query($querytris) or die(mysql_error());
if (mysql_num_rows($resulttris) >= 1)
{
echo "<font style=\"color:#404040; font-size:90%;\"><center><b>";
while ($rowtris = mysql_fetch_array($resulttris))
{
echo "".$rowtris['titre']."";
}
echo "</b></center></font><br>";
}
$queryquattro="SELECT titre FROM agenda WHERE date='$the_day/$this_month' ORDER BY id";
$resultquattro=mysql_query($queryquattro) or die(mysql_error());
if (mysql_num_rows($resultquattro) >= 1)
{
echo "<font style=\"color:#404040;font-size:90%;\"><center><b>";
while ($rowquattro = mysql_fetch_array($resultquattro))
{
echo "".$rowquattro['titre']."";
}
echo "</b></center></font><br>";
}
$query="SELECT login FROM members WHERE annif='$the_day/$this_month' ORDER BY id";
$result=mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Verjaardag:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($row = mysql_fetch_array($result))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$row['login']."</font></td></tr>";
}
echo "</table>";
}
$querybis="SELECT titre FROM agenda WHERE date='$the_day/$this_month/$this_year' ORDER BY id";
$resultbis=mysql_query($querybis) or die(mysql_error());
if (mysql_num_rows($resultbis) >= 1)
{
echo "<font style=\"sidered\" style=\"font-size:90%;\">Activiteiten:</font>";
echo "<br><table padding=\"0\" spacing=\"0\" style=\"margin-left: 2px; line-height: 60% ;\">";
while ($rowbis = mysql_fetch_array($resultbis))
{
echo "<tr><td><font style=\"color: black; font-size:90%;\">» ".$rowbis['titre']."</font></td></tr>";
}
echo "</table>";
}
echo "</td>";
echo "</tr>";
$the_day++;
}
else {
$the_day = " ";
echo "<td valign=\"top\" bgcolor=\"#DFDFDF\"></td>";
echo "</tr>";
}
$week_num++;
}
echo "</table>";
echo "</td></tr>";
echo "</table>";
?>
<br>
</center>
</body>
</html>
<?>
Gewijzigd op 16/07/2014 19:07:46 door Jurgen de Brouwer
Code (php)
1
2
3
4
2
3
4
<?php
$datum = new DateTime('2010-01-01');
echo $datum->format('d-m-Y'); // voor alle geldige karakters zie: http://php.net/manual/en/function.date.php
?>
$datum = new DateTime('2010-01-01');
echo $datum->format('d-m-Y'); // voor alle geldige karakters zie: http://php.net/manual/en/function.date.php
?>
Je post hier 464 regels code en zegt er niet bij waar je problemen zitten. Geef dus nog even aan waar we moeten kijken in de code.
Want hij post bv 7 ipv 07
Maar ik kan er niet van maken:
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
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
<?php
$this_month = date("m");
$this_year = date("Y");
}
$arraymonth = array(
"Januari",
"Februari",
"Maart",
"April",
"Mei",
"Juni",
"Juli",
"Augustus",
"September",
"Oktober",
"November",
"December"
);
$month_name = $arraymonth[$this_month-1];
/* Navigation */
$last_month = $this_month - 01;
$next_month = $this_month + 01;
echo "<center>";
echo "<table width=\"800\"><tr><td align=\"left\" width=\"200\">\n";
echo "<a href=\"agenda.php?thismonth=$last_month&thisyear=$this_year\" style=\"color:#0D4E95; font-family: Verdana, Arial, Helvetica, sans-serif;\"><b>« Vorige</b></a>";
echo "</td><td align=\"center\" width=\"400\">";
echo "<h1>$month_name $this_year</h1>";
echo "</td><td align=\"right\" width=\"200\">";
echo "<a href=\"agenda.php?thismonth=$next_month&thisyear=$this_year\" style=\"color:#0D4E95; font-family: Verdana, Arial, Helvetica, sans-serif;\"><b>Volgende »</b></a>";
echo "</td></tr></table>";
echo "</center>";
?>
$this_month = date("m");
$this_year = date("Y");
}
$arraymonth = array(
"Januari",
"Februari",
"Maart",
"April",
"Mei",
"Juni",
"Juli",
"Augustus",
"September",
"Oktober",
"November",
"December"
);
$month_name = $arraymonth[$this_month-1];
/* Navigation */
$last_month = $this_month - 01;
$next_month = $this_month + 01;
echo "<center>";
echo "<table width=\"800\"><tr><td align=\"left\" width=\"200\">\n";
echo "<a href=\"agenda.php?thismonth=$last_month&thisyear=$this_year\" style=\"color:#0D4E95; font-family: Verdana, Arial, Helvetica, sans-serif;\"><b>« Vorige</b></a>";
echo "</td><td align=\"center\" width=\"400\">";
echo "<h1>$month_name $this_year</h1>";
echo "</td><td align=\"right\" width=\"200\">";
echo "<a href=\"agenda.php?thismonth=$next_month&thisyear=$this_year\" style=\"color:#0D4E95; font-family: Verdana, Arial, Helvetica, sans-serif;\"><b>Volgende »</b></a>";
echo "</td></tr></table>";
echo "</center>";
?>
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<?php
// hier ga je met de waardes rekenen waardoor PHP de tekst '01' zal omzetten naar het getal 1 en dus raak je altijd je voorloop nul kwijt.
$last_month = $this_month - 01;
$next_month = $this_month + 01;
// Maar met str_pad() kun je weer voorloop-nullen genereren. Verander bovenstaande regels dus voor deze
$last_month = str_pad($this_month -1, 2, '0', STR_PAD_LEFT);
$next_month = str_pad($this_month +1, 2, '0', STR_PAD_LEFT);
?>
// hier ga je met de waardes rekenen waardoor PHP de tekst '01' zal omzetten naar het getal 1 en dus raak je altijd je voorloop nul kwijt.
$last_month = $this_month - 01;
$next_month = $this_month + 01;
// Maar met str_pad() kun je weer voorloop-nullen genereren. Verander bovenstaande regels dus voor deze
$last_month = str_pad($this_month -1, 2, '0', STR_PAD_LEFT);
$next_month = str_pad($this_month +1, 2, '0', STR_PAD_LEFT);
?>
Jurgen de Brouwer op 16/07/2014 19:07:10:
Nu wil de datum naar 01-01-2001 hebben want mijn database is zo ingericht.
Dan ben je dus fout begonnen.
Een datum is DATE of DATETIME.
Zoals je het nu hebt kun je nooit sorteren en de vele datumfunctions niet gebruiken.
En andersom ook: van maand 1 naar maand 0, -1, -2 enz.
Frank:
Dit word al opgelost:
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php>
if($_GET['thismonth'] != "" and $_GET['thisyear'] != "") {
$this_month = $_GET['thismonth'];
$this_year = $_GET['thisyear'];
if ($this_month == 13) {
$this_month = 01;
$this_year = $this_year + 1;
}
elseif ($this_month == 0)
{
$this_month = 12;
$this_year = $this_year - 1;
}
else
{
$this_month = $this_month;
}
}
else {
$this_month = date("m");
$this_year = date("Y");
}
?>
if($_GET['thismonth'] != "" and $_GET['thisyear'] != "") {
$this_month = $_GET['thismonth'];
$this_year = $_GET['thisyear'];
if ($this_month == 13) {
$this_month = 01;
$this_year = $this_year + 1;
}
elseif ($this_month == 0)
{
$this_month = 12;
$this_year = $this_year - 1;
}
else
{
$this_month = $this_month;
}
}
else {
$this_month = date("m");
$this_year = date("Y");
}
?>
Jurgen de Brouwer op 16/07/2014 19:07:10:
Nu wil de datum naar 01-01-2001 hebben want mijn database is zo ingericht.
Wil je daarmee zeggen dat je een datum opslaat in de database als string? Dan zou ik heel erg snel opnieuw beginnen als ik jou was. Elk database systeem (MySQL ook) heeft speciale datatypes om datums in op te slaan en die zijn er niet voor niets. Zo kan je er tenminste correct mee sorteren, selecteren, berekenen etc. Sla je het op als string dan kan je al dat soort acties genoegelijk vaarwel zeggen.
Edit: te lang open laten staan, was inmiddels al aangekaart door anderen....
Gewijzigd op 16/07/2014 19:59:53 door Erwin H
- SanThe - op 16/07/2014 19:54:21:
Dan ben je dus fout begonnen.
Of een fout script gekopieerd.
Het handigste is inderdaad om gewoon met het object DateTime te werken en daarmee dus ook te gaan rekenen met datums: http://php.net/manual/en/class.datetime.php
Let vooral op de functies
add()
sub()
format()