agenda-met-beheer-functie

Gesponsorde koppelingen

PHP script bestanden

  1. agenda-met-beheer-functie

« Lees de omschrijving en reacties

Show agenda (agenda.php)

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
<?
include('config.php');
?>

<html>
<head>
<style TYPE="text/css">
body    {
overflow : scroll;
overflow-x : hidden;}
.popper {
position : absolute;
visibility : hidden;}
</style>
</head>

<body bgcolor="#000000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<font color="#00FF00" size="2" face="Verdana">
<script language='javascript'>
var frame_width        = 200;
var frame_headerbcolor = "#D8D8D8";
var frame_headerfcolor = "#000000";
var frame_headertext   = "Agenda item uitleg:";

document.write("<div id='framelayer' class='popper'> </div>");

var ns = (document.layers);
var ie = (document.all);


if (ns) {
  popup = document.framelayer;
  document.captureEvents(Event.MOUSEMOVE);}
else {
  popup = framelayer.style;}

document.onmousemove = get_mouse;

function displaylayer(html) {
  if (ns) {
    popup.document.write(html);
    popup.document.close();
    popup.visibility = "visible";}
  else if (ie) {
    document.all("framelayer").innerHTML = html;
    popup.visibility = "visible";}}
function pop(message,bcolor,fcolor) {

  var htmlcode = "<table width=" + frame_width + " border=0 " +
                 "cellpadding=1 cellspacing=0 bgcolor=" +
                 frame_headerbcolor + "><tr><td><table " +
                 "width=100% border=0 cellpadding=0 " +
                 "cellspacing=0><tr><td align='center'>" +
                 "<font color=" + frame_headerfcolor +
                 " size=2 face='arial'><b>" + frame_headertext +
                 "</b></font></td></tr></table>" +
                 "<table width=100% border=0 cellpadding=2 " +
                 "cellspacing=0 bgcolor=" + bcolor + ">" +
                 "<tr><td align='center'><font color=" + fcolor +
                 " size=2 face='arial'>" + message + "</font>" +
                 "</td></tr></table></td></tr></table>"

  displaylayer(htmlcode);}

function get_mouse(e) {
  var x = (ns) ? e.pageX : event.x + document.body.scrollLeft;
  var y = (ns) ? e.pageY : event.y + document.body.scrollTop;

  popup.left = x - 2;
  popup.top  = y + 18;}

function kill()
{
  popup.visibility = "hidden";}
</script>
<?
$query
= "SELECT * FROM agenda ORDER BY datum2 ASC";
$result = mysql_query($query);

while($record = mysql_fetch_array($result)) {
?>

<font color="#FFFFFF"><a href=""
ONMOUSEOVER="pop('<b><? echo $record['naam']; ?> <br></b> '+
                  '<b>Datum:</b> <? echo $record['datum']; ?>-<? echo $record['datum1']; ?>-<? echo $record['datum2']; ?> <br> '+
                  '<b>Tijd:</b> <? echo $record['tijd']; ?> <br> ' +
                  '<b>Locatie:</b> <? echo $record['locatie']; ?> ', '#000000', '#FFFFFF')"

ONMOUSEOUT="kill()" target="_blank" style="text-decoration: none"><font size="2" face="Verdana" color="#1CC7F8"><? echo $record['datum']; ?>-<? echo $record['datum1']; ?>-<? echo $record['datum2']; ?></font><font color="#FFFFFF" size="2" face="Verdana"><br><? echo $record['naam']; ?></font></a><br>

<?
}
?>


</body>
</html>


Verwijder agenda item PART 1 (Del_agenda.php)
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
<?php
include('config.php'); // db openen

$query = "SELECT * FROM agenda ORDER BY datum2 ASC";
$result = mysql_query($query);

while($record = mysql_fetch_array($result)) { // While loop openen
 ?>

    <table cellpadding="0" cellspacing="0" width="244" height="95">
    <tr>
    <td valign="top">Naam</td>
    <td height="19" valign="top"><? echo $record['naam']; ?></td>
    </tr>
    <tr>
    <td valign="top">Datum</td>
    <td height="19" valign="top"><? echo $record['datum']; ?>-<? echo $record['datum1']; ?>-<? echo $record['datum2']; ?></td>
    </tr>
    <tr>
    <td valign="top">Tijd</td>
    <td height="19" valign="top"><? echo $record['tijd']; ?></td>
    </tr>
    <tr>
    <td valign="top" width="88">Locatie</td>
    <td height="19" width="156" valign="top"><? echo $record['locatie']; ?></td>
    </tr>
    <tr>
    <td valign="top" colspan="2"><hr color="#FFFFFF" size="1"></td>
    <td valign="top" height="19">
    <p align="right"><? echo "<a href='delete_agenda_item.php?id=".$record['id']."'>X</a>"; ?></td>
    </tr>
    <tr>
    <td width="88"></td>
    <td width="143"></td>
    <td height="1" width="13"></td>
    </tr>
    </table>
<?    
} // While loop sluiten en alles loopen wat in de loop zit

?>

<body style="font-family: Verdana; font-size: 10pt; color: #FFFFFF" bgcolor="#000000">
</body>


Verwijder agenda item PART 2 (delete_agenda_item.php)
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
<?
include('config.php');
// haal de doorgegeven GET-variabele op
   $id = $_GET["id"];

// verwijderd de betreffende rij uit tabel 'foto'
   $actie = mysql_query("DELETE FROM agenda WHERE id = $id") or die ("Foutje bij verwijderen");


echo "Het agenda item is verwijderd";

?>

<body style="font-family: Verdana; font-size: 10pt; color: #FFFFFF" bgcolor="#000000">
</body>


Plaats agenda item (Drop_agenda.php)
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
<?php
include('config.php');

$sql = "INSERT INTO agenda (naam, datum, datum1, datum2, tijd, locatie) VALUES ('".$_POST['naam']."', '".$_POST['datum']."',  '".$_POST['datum1']."', '".$_POST['datum2']."', '".$_POST['tijd']."', '".$_POST['locatie']."')";
$query = mysql_query($sql);

?>

<body style="font-family: Verdana; font-size: 10pt; color: #FFFFFF" bgcolor="#000000">

<form action="" method="POST" name="agenda">

        <table cellpadding="0" cellspacing="0" width="280" height="88">
        <tr>
        <td>Naam</td>
        <td valign="top" height="22">
        <input type="text" name="naam" size="20"></td>
        </tr>
        <tr>
        <td>Datum</td>
        <td valign="top" height="22">
        <select size="1" name="datum">
            <option value="01">01</option>
            <option value="02">02</option>
            <option value="03">03</option>
            <option value="05">05</option>
            <option value="06">06</option>
            <option value="07">07</option>
            <option value="08">08</option>
            <option value="09">09</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
            <option value="16">16</option>
            <option value="17">17</option>
            <option value="18">18</option>
            <option value="19">19</option>
            <option value="20">20</option>
            <option value="21">21</option>
            <option value="22">22</option>
            <option value="23">23</option>
            <option value="24">24</option>
            <option value="25">25</option>
            <option value="26">26</option>
            <option value="27">27</option>
            <option value="28">28</option>
            <option value="29">29</option>
            <option value="30">30</option>
            <option value="31">31</option>
        </select>
        <select size="1" name="datum1">
            <option value="01">01</option>
            <option value="02">02</option>
            <option value="03">03</option>
            <option value="04">04</option>
            <option value="05">05</option>
            <option value="06">06</option>
            <option value="07">07</option>
            <option value="08">08</option>
            <option value="09">09</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
        </select>
        <select size="1" name="datum2">
            <option value="2009">2009</option>
            <option value="2010">2010</option>
            <option value="2011">2011</option>
            <option value="2012">2012</option>
        </select></td>
        </tr>
        <tr>
        <td>Tijd</td>
        <td valign="top" height="22">
        <input type="text" name="tijd" size="20"></td>
        </tr>
        <tr>
        <td width="121">Locatie</td>
        <td valign="top" height="22" width="159">
        <input type="text" name="locatie" size="20"></td>
        </tr>
        </table>
<input type="submit" value="Verzenden" name="submit">
</form>
</body>


Configuratie pagina (config.php)
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
mysql_connect("localhost", "Uw db inlog naam", "w8 woord");
mysql_select_db(" db naam");
?>



Mysql tabel
CREATE TABLE `agenda` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`naam` VARCHAR( 50 ) NOT NULL ,
`tijd` VARCHAR( 50 ) NOT NULL ,
`locatie` VARCHAR( 50 ) NOT NULL ,
`datum` INT NOT NULL ,
`datum1` INT NOT NULL ,
`datum2` INT NOT NULL ) ENGINE = MYISAM ;

 
 

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.