fuivenkalender-v2

Gesponsorde koppelingen

PHP script bestanden

  1. fuivenkalender-v2

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
----------database.php----------
<?php
$hostname
= "localhost";
$username = "usernaam";
$password = "pass";
$db = "database";

$fout = "Er kan geen database connectie gemaakt worden..<br>Probeer het na enkele minuten opnieuw. Wil het dan nog niet, neem dan contact met mij op.";

mysql_connect($hostname,$username,$password);

mysql_select_db($db) or die ($fout);

?>


Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
----------fuiven.php----------
<?php
error_reporting(E_ALL);

include_once "database.php";

if(isset($_GET['mode']) == "toevoegen")

            {


            // Verander hier die +5 naar hoeveel jaar je wilt bijtellen bij het jaar van vandaag

            $jaarnu = date ("Y");

            $jaar = range( $jaarnu, $jaarnu+5 );    // Voorbeeld 2006+5 = 2011

                        

            // Array met de namen van de maanden


            $maand = array( "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December");

            

            $countm = count($maand);

            $countj = count($jaar);

 

            $formulier = '<form method="post" target="_self" action="home.php?menu=fuiven&mode=toevoegen">

            <table border="0">

            <tr><td>Fuifnaam: </td><td><input type="text" name="Fuifnaam" '
;

            if (isset($_POST['Fuifnaam']))

                        {


                        $Fuifnaam1 = $_POST['Fuifnaam'];

                        }


            else

                        {

                        $Fuifnaam1 = "";

                        }


            $formulier.= 'value="' . $Fuifnaam1 . '" size="30" /></td></tr>

            <tr><td>Commentaar:  </td><td><textarea name="Commentaar" '
;

            if (isset($_POST['Commentaar']))

                        {


                        $Commentaar1 = $_POST['Commentaar'];

                        }


            else

                        {

                        $Commentaar1 = "";

                        }


            $formulier.= 'rows="5" cols="30">' . $Commentaar1 . '</textarea></td></tr>

            <tr><td>Organisator: </td><td><input type="text" name="Organisator" '
;

            if (isset($_POST['Organisator']))

                        {


                        $Organisator1 = $_POST['Organisator'];

                        }


            else

                        {

                        $Organisator1 = "";

                        }


            $formulier.= 'value="' . $Organisator1 . '" size="30" /></td></tr>

            <tr><td>Plaats:  </td><td><input type="text" name="Plaats" '
;

            if (isset($_POST['Plaats']))

                        {


                        $Plaats1 = $_POST['Plaats'];

                        }


            else

                        {

                        $Plaats1 = "";

                        }


            $formulier.= 'value="' . $Plaats1 . '" size="30" /></td></tr>

            <tr><td>ADK:  </td><td>&euro;&nbsp;<input type="text" name="ADK" '
;

            if (isset($_POST['ADK']))

                        {


                        $ADK1 = $_POST['ADK'];

                        }


            else

                        {

                        $ADK1 = "";

                        }


            $formulier.= 'value="' . $ADK1 . '" size="5" /></td></tr>

            <tr><td>VVK: </td><td>&euro;&nbsp;<input type="text" name="VVK" '
;

            if (isset($_POST['VVK']))

                        {


                        $VVK1 = $_POST['VVK'];

                        }


            else

                        {

                        $VVK1 = "";

                        }


            $formulier.= 'value="' . $VVK1 . '" size="5" /></td></tr>

            <tr><td>Contact:  </td><td><input type="text" name="Contact" '
;

            if (isset($_POST['Contact']))

                        {


                        $Contact1 = $_POST['Contact'];

                        }


            else

                        {

                        $Contact1 = "";

                        }


            $formulier.= 'value="' . $Contact1 . '" size="30" /></td></tr>

            <tr><td>Datum:</td><td>

            Dag&nbsp;<select name="Dag"><option selected="selected">Selecteer iets</option>'
;

                        for($i=01; $i<=31; $i++)

                                   {


                                   $formulier.= '<option value="' . $i . '">' . $i . '</option>';

                                   }


                        $formulier.= '</select>

                        Maand&nbsp;<select name="Maand"><option selected="selected">Selecteer iets</option>'
;

                        for($i=01; $i<=$countm; $i++)

                                   {


                                   $formulier.= '<option value="' . $i . '">' . $maand[$i-1] . '</option>';

                                   }


                        $formulier.= '</select>

                        Jaar&nbsp;<select name="Jaar"><option selected="selected">Selecteer iets</option>'
;

                        for($i=1; $i<=$countj; $i++)

                                   {


                                   $formulier.='<option value="' . $jaar[$i-1] . '">' . $jaar[$i-1] . '</option>';

                                   }


                        $formulier.= '</select>

                        </td></tr>

                                               <tr><td>Tijd:</td><td>

                        Uur&nbsp;<select name="Uur"><option selected="selected">Selecteer iets</option>'
;

                        for($i=00; $i<=23; $i++)

                                   {


                                   $formulier.= '<option value="' . $i . '">' . $i . '</option>';

                                   }


                        $formulier.= '</select>

                        Minuten&nbsp;<select name="Minuut"><option selected="selected">Selecteer iets</option>'
;

                        for($i=00; $i<=59; $i++)

                                   {


                                   $formulier.= '<option value="' . $i . '">' . $i . '</option>';

                                   }


                        $formulier.= '</select>

                        </td></tr>

            <tr><td>Flyer: </td><td><input type="text" name="Flyer" '
;

            if (isset($_POST['Flyer']))

                        {


                        $Flyer1 = $_POST['Flyer'];

                        }


            else

                        {

                        $Flyer1 = "";

                        }


            $formulier.= 'value="' . $Flyer1 . '" size="30" /></td></tr>

            <tr><td><input type="submit" name="Invoegen" value="Invoegen" /></td></tr>

            </table></form>'
;

 

            if(isset($_POST['Invoegen']))

                        {


                        if(!$_POST['Fuifnaam'])

                                   {


                                   echo 'Er is een fout opgetreden.<li class="list">Je hebt geen Fuifnaam ingevuld.<BR>';

                                   echo $formulier;

                                   }


                        elseif(!$_POST['Organisator'])

                                   {


                                   echo 'Er is een fout opgetreden.<li class="list">Je hebt geen Organisator ingevuld.<BR>';

                                   echo $formulier;

                                   }


                        elseif(!$_POST['Plaats'])

                                   {


                                   echo 'Er is een fout opgetreden.<li class="list">Je hebt geen Plaats ingevuld.<BR>';

                                   echo $formulier;

                                   }


                        elseif(!$_POST['ADK'])

                                   {


                                   echo 'Er is een fout opgetreden.<li class="list">Je hebt geen ADK ingevuld.<BR>';

                                   echo $formulier;

                                   }


                        elseif(!$_POST['VVK'])

                                   {


                                   echo 'Er is een fout opgetreden.<li class="list">Je hebt geen VVK ingevuld.<BR>';

                                   echo $formulier;

                                   }


                        elseif(!$_POST['Contact'])

                                   {


                                   echo 'Er is een fout opgetreden.<li class="list">Je hebt geen Contact ingevuld.<BR>';

                                   echo $formulier;

                                   }


                        elseif(($_POST['Jaar'] == 00) || ($_POST['Maand'] == 00) || ($_POST['Dag'] == 00))

                                   {


                                   echo 'Er is een fout opgetreden.<li class="list">Je hebt geen Datum ingevuld.<BR>';

                                   echo $formulier;

                                   }


                        else

                                   {

                                   // Kijken of in Contact veld wel een email is ingevuld

                                   $adk = htmlspecialchars($_POST["ADK"]);

                                   $adk = str_replace('€','', $adk);

                                  

                                   $vvk = htmlspecialchars($_POST["VVK"]);

                                   $vvk = str_replace('€','', $vvk);

                                  

                                   $Fuifnaam = htmlspecialchars($_POST["Fuifnaam"]);

                                   $Organisator = htmlspecialchars($_POST["Organisator"]);

                                   $Plaats = htmlspecialchars($_POST["Plaats"]);

                                   $ADK = "€ ".$adk;

                                   $VVK = "€ ".$vvk;

                                   if(checkmail($_POST['Contact']) == "true")

                                               {


                                               $email = $_POST['Contact'];

                                               }


                                   else

                                               {

                                               echo "Je hebt een vals email adres ingevuld!";

                                               echo $formulier;

                                               }


                                   $Datum = $_POST["Jaar"]."-".$_POST["Maand"]."-".$_POST["Dag"]." ".$_POST["Uur"].":".$_POST["Minuut"].":00";

                                   $Flyer = htmlspecialchars($_POST["Flyer"]);

                                   $Commentaar = htmlspecialchars($_POST["Commentaar"]);

                                   $Gecontroleerd = "Nee";

                                                                      

                                   // Query opbouwen met variabelen

                                   $query="INSERT INTO fuiven (Fuifnaam, Organisator, Plaats, ADK, VVK, Contact, Datum, Flyer, Commentaar, Gecontroleerd) ";

                                   $query .= "VALUES ('"; // let op positie van de enkele aanhalingstekens

                                   $query .= $Fuifnaam ."', '" ;

                                   $query .= $Organisator ."', '" ;

                                   $query .= $Plaats ."', '" ;

                                   $query .= $ADK ."', '" ;

                                   $query .= $VVK ."', '" ;

                                   $query .= $email ."', '" ;

                                   $query .= $Datum. "', '" ;

                                   $query .= $Flyer ."', '" ;

                                   $query .= $Commentaar ."', '" ;

                                   $query .= $Gecontroleerd ."');" ;

                                   $result = mysql_query($query) or die ("FOUT: " . mysql_error());

                                   echo 'Je fuif is toegevoegd. Het moet eerst door een admin gecontroleerd worden en dan pas komt het tussen de fuivenkalender te staan.';

                                   }

                        }
          

            else

                        {

                        echo $formulier;

                        }                      

                                              

                                  

            }



else
    {

    echo 'Hieronder staat de fuivenkalender. Jullie fuif hierbij? Klik <a href="fuiven.php?mode=toevoegen" target="_self">HIER</a>.<br>';
    // maak lijst van komende fuiven aan        
    echo '<br>::&nbsp;<b><u>Komende fuiven.</u></b><br><br>';  
    
    $query = mysql_query("SELECT * FROM fuiven WHERE Datum >= NOW() ORDER BY Datum ASC");  
    while ($list = mysql_fetch_object($query))  
        {
  
        if ($list->Gecontroleerd == "Ja")
            {

            $unixtime = strtotime($list->Datum);
                    
            echo '&nbsp;&nbsp;<img src="images/bullet.gif" alt="Bullet" />&nbsp;&nbsp;<a href="home.php?menu=fuiven&amp;komende='.$list->Fuifnaam.'" target="_self" class="text">';  
            $fuif = "&nbsp;/&nbsp;".$list->Fuifnaam;  
            echo date("d-m-Y H:i:s",$unixtime).$fuif.'<br />';
            }

        echo '</a>';  
        
        // als er op komende fuiven is geklikt  
        if(isset($_GET['komende']))
            {

            if ($_GET['komende'] == $list->Fuifnaam)
                {
  
                $query1 = mysql_query("SELECT * FROM fuiven WHERE Fuifnaam='".$_GET['komende']."' AND Gecontroleerd='Ja' ");  
                while ($list1 = mysql_fetch_object($query1))  
                    {

                    $unixtime = strtotime($list1->Datum);
                    
                    echo '<table align="center">
                    <tr><TD><b>Fuifnaam:</td><TD>'
.$list1->Fuifnaam.'</td></TR>  
                    <tr><TD><b>Commentaar:</td><TD>'
.$list1->Commentaar.'</td></TR>
                    <tr><TD><b>Organisator:</td><TD>'
.$list1->Organisator.'</td></TR>
                    <tr><TD><b>Plaats:</td><TD>'
.$list1->Plaats.'</td></TR>
                    <tr><TD><b>ADK:</td><TD>'
.$list1->ADK.'</td></TR>
                    <tr><TD><b>VVK:</td><TD>'
.$list1->VVK.'</td></TR>  
                    <tr><TD><b>Contact:</td><TD><a href="mailto:'
.$list1->Contact.'" class="text">'.$list1->Contact.'</a></td></TR>
                    <tr><TD><b>Datum:</td><TD>'
.date("d-m-Y H:i:s",$unixtime).'</td></TR>
                    <tr><TD><b>Flyer:</td><TD><a href="'
.$list1->Flyer.'" target="_blank" class="text">'.$list1->Flyer.'</a></td></TR>  
                    </table>'
;  
                    }      
                }
            }
                 }

          
    // maak lijst van gepasseerde fuiven aan      
    echo '<br>::&nbsp;<b><u>Fuiven die al gepasseerd zijn.</u></b><br><br>';

    $query2 = mysql_query("SELECT * FROM fuiven WHERE Datum < NOW() ORDER BY Datum ASC");
    while ($list2 = mysql_fetch_object($query2))  
        {
  
        if ($list2->Gecontroleerd == "Ja")
            {

            $unixtime = strtotime($list2->Datum);
                    
            echo '&nbsp;&nbsp;<img src="images/bullet.gif" alt="Bullet" />&nbsp;&nbsp;<a href="home.php?menu=fuiven&amp;voorbij='.$list2->Fuifnaam.'" target="_self" class="text">';  
            $fuif = " &nbsp;/&nbsp;".$list2->Fuifnaam;  
            echo ''.date("d-m-Y H:i:s",$unixtime).''.$fuif.'<br />';  
            }

        echo '</a>';  
                            
        // als er op fuiven die voorbij zijn is geklikt  
        if(isset($_GET['voorbij']))
            {

            if($_GET['voorbij'] == $list2->Fuifnaam)
                {
  
                $query3 = mysql_query("SELECT * FROM fuiven WHERE fuifnaam='".$_GET['voorbij']."' AND Gecontroleerd='Ja'");
                while ($list3 = mysql_fetch_object($query3))
                    {

                    $unixtime = strtotime($list3->Datum);
                    
                    echo '<table align="center">
                    <tr><TD><b>Fuifnaam:</td><TD>'
.$list3->Fuifnaam.'</td></TR>
                    <tr><TD><b>Commentaar:</td><TD>'
.$list3->Commentaar.'</td></TR>
                    <tr><TD><b>Organisator:</td><TD>'
.$list3->Organisator.'</td></TR>
                    <tr><TD><b>Plaats:</td><TD>'
.$list3->Plaats.'</td></TR>
                    <tr><TD><b>ADK:</td><TD>'
.$list3->ADK.'</td></TR>
                    <tr><TD><b>VVK:</td><TD>'
.$list3->VVK.'</td></TR>
                    <tr><TD><b>Contact:</td><TD><a href="mailto:'
.$list3->Contact.'" class="text">'.$list3->Contact.'</a></td></TR>
                    <tr><TD><b>Datum:</td><TD>'
.date("d-m-Y H:i:s",$unixtime).'</td></TR>
                    <tr><TD><b>Flyer:</td><TD><a href="'
.$list3->Flyer.'" target="_blank" class="text">'.$list3->Flyer.'</a></td></TR>
                    </table>'
;
                    }
                }
            }
             }
         }

?>



Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
----------admin.php----------
<?php
include_once "database.php";

    echo '::&nbsp;Fuiven<br>
    &nbsp;&nbsp;::&nbsp;<a href="admin.php?actie=fuiven&actie2=controle" target="_self">Fuiven die tusen de fuivenkalender willen staan.</a><br>
    &nbsp;&nbsp;::&nbsp;<a href="admin.php?actie=fuiven&actie2=delete" target="_self>Gepasseerde fuiven wissen.</a><br><br>'
;


if($_GET['actie'] == "fuiven")
    {

    if($_GET['actie2'] == "controle")
        {

        echo '<br><table width="100%"><TD width=20%><b>Fuifnaam<TD width="20%"><b>Datum<TD width="20%"><b>Organisator<TD width="20%"><b>Contact<TD width="20%"><b>Toestaan<TR>';
        $select = "SELECT * FROM fuiven WHERE Gecontroleerd!='Ja' ORDER by Datum DESC";
        $query = mysql_query($select);
        while ($list = mysql_fetch_object($query))
            {

            echo '<td>';
            $fuif = "<font color=red><b>$list->Fuifnaam</b></font>";
            echo '$fuif<TD>';
            echo '$list->Datum<TD>$list->Organisator<TD>$list->Contact<TD><a href="admin.php?actie=fuiven&ja='.$list->id.'" target="_self">Ja</a>&nbsp;&nbsp;<a href="admin.php?actie=fuiven&wis='.$list->id.'" target="_self">Nee</a><TR>';
            }

        echo '</table>';
        }

    if($_GET['actie2'] == "delete")
        {

        echo '<br><table width="100%"><TD width="20%"><b>Fuifnaam<TD width="20%"><b>Datum<TD width="20%"><b>Organisator<TD width="20%"><b>Contact<TD width="20%"><b>Delete<TR>';
        $select = "SELECT * FROM fuiven WHERE Datum < NOW() ORDER by Datum DESC";
        $query = mysql_query($select);
        while ($list = mysql_fetch_object($query))
            {

            echo '<td>';
            $fuif = "<font color=red><b>$list->Fuifnaam</b></font>";
            echo '$fuif<TD>';
            echo '$list->Datum<TD>$list->Organisator<TD>$list->Contact<TD><a href="admin.php?actie=fuiven&fdelete='.$list->id.'" target="_self">Delete</a><TR>';
            }

        echo '</table>';
        }
  
    elseif($_GET['wis'])
        {

        mysql_query("DELETE FROM fuiven WHERE id='".$_GET['wis']."'");
        echo '<META HTTP-EQUIV="refresh" CONTENT="0; URL=admin.php?actie=fuiven&actie2=controle" target="_self">';
        }

    elseif($_GET['ja'])
        {

        mysql_query(" UPDATE fuiven SET Gecontroleerd='Ja' WHERE id='".$_GET['ja']."'");
        echo '<META HTTP-EQUIV="refresh" CONTENT="0; URL=admin.php?actie=fuiven&actie2=controle" target="_self">';
        }

    elseif($_GET['fdelete'])
        {

        mysql_query("DELETE FROM fuiven WHERE id='".$_GET['fdelete']."'");
        echo '<META HTTP-EQUIV="refresh" CONTENT="0; URL=admin.php?actie=fuiven&actie2=delete" target="_self">';
        }
    }

?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.