Verwijderen lukt niet
Het gaat om het laatste stukje script:
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
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
<?php
session_start();
if ($_SESSION['valid'] == woongaardvalidlogin) {
echo "<html>\n";
echo "<head>\n";
echo "<title>Lederland woongaard klanten beheer</title>\n";
echo "</head>\n";
echo "<body bgcolor=\"#E0F5BF\">\n";
require("mysql.php");
echo "<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\">
<tr>
<td rowspan=\"2\">
<img height=\"89\" src=\"logo.jpg\" width=\"94\" border=\"0\"></td>
<td colspan=\"2\"> </td>
</tr>
<tr>
<td><font size=\"5\"><p align=\"left\"><b>klanten
woongaard-meubelen:</b></p></font></td>
<td><p align=\"right\">| <a href=\"klanten.php\" ><span style=\"text-decoration: none\"><font color=\"black\">overzicht</font></span></a> | <a href=\"klant_toevoegen_form.php\">
<span style=\"text-decoration: none\"><font color=\"black\">klant toevoegen</font></span></a> | <a href=\"zoeken.php\"><span style=\"text-decoration: none\"><font color=\"black\">zoeken</font></span></a> |
<a href=\"uitloggen.php\"><span style=\"text-decoration: none\"><font color=\"black\">log uit |</font></span></a></p></td>
</tr>
</table>";
$sql = "SELECT id,datum,filiaal,naam,straatnr,postcode,woonplaats,telnr,mobnr,mail,modelop,leer,kleur,prijs,afspraken FROM klanten WHERE id = $HTTP_GET_VARS[id]";
$res = mysql_query($sql);
$row = mysql_fetch_array($res);
echo"<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" bgcolor=\"#FFFFFF\">
<tr>
<td width=\"100%\" bgcolor=\"#E1E4DD\" style=\"border-left-width: 1px; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px\" bordercolor=\"#000000\">
<b>Datum:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[datum]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-width: 1px; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px\" bgcolor=\"#E1E4DD\" bordercolor=\"#000000\">
<b>Filiaal:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\" bordercolor=\"#000000\">$row[filiaal]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Naam:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[naam]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Adres:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[straatnr]</td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[postcode] $row[woonplaats]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Telefoonnummer:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[telnr]</td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[mobnr]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>E-mail:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[mail]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Model en opstelling:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[modelop]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Leer:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[leer]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Kleur:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[kleur]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Prijs:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">
<p class=\"MsoNormal\"><span lang=\"NL\">€$row[prijs]</span></td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Afspraken:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[afspraken]</td>
</tr>
<tr>
<form method=\"POST\" action=\"" . $_SERVER['PHP_SELF'] . "\">
<td width=\"100%\" bgcolor=\"#F4F5F1\"><p align=\"center\"><input type=\"submit\" name=\"verwijder\" style=\"background-color:#F4F5F1\" style=\"border-color:#E1E4DD\" style=\"border:1px solid\" value=\"Offerte verwijderen\"></td>
</form>
</tr>
</table>";
$vorige = $row[id] - 1;
$volgende = $row[id] + 1;
echo "<p align=\"center\"><a href=\"klant.php?id=$vorige\"><span style=\"text-decoration: none\"><<vorige</span></a>
<a href=\"klanten.php\"><span style=\"text-decoration: none\">overzicht</span></a>
<a href=\"klant.php?id=$volgende\"><span style=\"text-decoration: none\">volgende>></span></a></p>";
$id = $row[id];
if (isset($_POST['verwijder'])) {
$sql2 = "DELETE FROM klanten WHERE id = $id";
$res = mysql_query($sql2);
if ($res) {
echo "Offerte is verwijdert."; }
else {
echo "<font color=\"red\">Fout tijdens verwijderen offerte!</font>"; }
}else{}
//don't delete copyright>>>>>
echo "<br><br><br><br><p align=\"center\"><font size=\"1px\">copyright © 2005 <a href=\"http://www.maschel.nl\">www.maschel.nl</a></font></p>";
//don't delete copyright>>>>>
echo "</body>\n";
echo "</html>\n";
}else{
echo "<font color=\"red\">Je bent niet ingelogd!</font>"; }
?>
session_start();
if ($_SESSION['valid'] == woongaardvalidlogin) {
echo "<html>\n";
echo "<head>\n";
echo "<title>Lederland woongaard klanten beheer</title>\n";
echo "</head>\n";
echo "<body bgcolor=\"#E0F5BF\">\n";
require("mysql.php");
echo "<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\">
<tr>
<td rowspan=\"2\">
<img height=\"89\" src=\"logo.jpg\" width=\"94\" border=\"0\"></td>
<td colspan=\"2\"> </td>
</tr>
<tr>
<td><font size=\"5\"><p align=\"left\"><b>klanten
woongaard-meubelen:</b></p></font></td>
<td><p align=\"right\">| <a href=\"klanten.php\" ><span style=\"text-decoration: none\"><font color=\"black\">overzicht</font></span></a> | <a href=\"klant_toevoegen_form.php\">
<span style=\"text-decoration: none\"><font color=\"black\">klant toevoegen</font></span></a> | <a href=\"zoeken.php\"><span style=\"text-decoration: none\"><font color=\"black\">zoeken</font></span></a> |
<a href=\"uitloggen.php\"><span style=\"text-decoration: none\"><font color=\"black\">log uit |</font></span></a></p></td>
</tr>
</table>";
$sql = "SELECT id,datum,filiaal,naam,straatnr,postcode,woonplaats,telnr,mobnr,mail,modelop,leer,kleur,prijs,afspraken FROM klanten WHERE id = $HTTP_GET_VARS[id]";
$res = mysql_query($sql);
$row = mysql_fetch_array($res);
echo"<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" bgcolor=\"#FFFFFF\">
<tr>
<td width=\"100%\" bgcolor=\"#E1E4DD\" style=\"border-left-width: 1px; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px\" bordercolor=\"#000000\">
<b>Datum:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[datum]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-width: 1px; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px\" bgcolor=\"#E1E4DD\" bordercolor=\"#000000\">
<b>Filiaal:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\" bordercolor=\"#000000\">$row[filiaal]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Naam:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[naam]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Adres:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[straatnr]</td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[postcode] $row[woonplaats]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Telefoonnummer:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[telnr]</td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[mobnr]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>E-mail:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[mail]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Model en opstelling:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[modelop]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Leer:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[leer]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Kleur:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[kleur]</td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Prijs:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">
<p class=\"MsoNormal\"><span lang=\"NL\">€$row[prijs]</span></td>
</tr>
<tr>
<td width=\"100%\" style=\"border-left-color: #000000; border-left-width: 1px; border-right-color: #000000; border-right-width: 1px; border-top: 1px solid #000000; border-bottom: 1px solid #000000\" bgcolor=\"#E1E4DD\">
<b>Afspraken:</b></td>
</tr>
<tr>
<td width=\"100%\" bgcolor=\"#F4F5F1\">$row[afspraken]</td>
</tr>
<tr>
<form method=\"POST\" action=\"" . $_SERVER['PHP_SELF'] . "\">
<td width=\"100%\" bgcolor=\"#F4F5F1\"><p align=\"center\"><input type=\"submit\" name=\"verwijder\" style=\"background-color:#F4F5F1\" style=\"border-color:#E1E4DD\" style=\"border:1px solid\" value=\"Offerte verwijderen\"></td>
</form>
</tr>
</table>";
$vorige = $row[id] - 1;
$volgende = $row[id] + 1;
echo "<p align=\"center\"><a href=\"klant.php?id=$vorige\"><span style=\"text-decoration: none\"><<vorige</span></a>
<a href=\"klanten.php\"><span style=\"text-decoration: none\">overzicht</span></a>
<a href=\"klant.php?id=$volgende\"><span style=\"text-decoration: none\">volgende>></span></a></p>";
$id = $row[id];
if (isset($_POST['verwijder'])) {
$sql2 = "DELETE FROM klanten WHERE id = $id";
$res = mysql_query($sql2);
if ($res) {
echo "Offerte is verwijdert."; }
else {
echo "<font color=\"red\">Fout tijdens verwijderen offerte!</font>"; }
}else{}
//don't delete copyright>>>>>
echo "<br><br><br><br><p align=\"center\"><font size=\"1px\">copyright © 2005 <a href=\"http://www.maschel.nl\">www.maschel.nl</a></font></p>";
//don't delete copyright>>>>>
echo "</body>\n";
echo "</html>\n";
}else{
echo "<font color=\"red\">Je bent niet ingelogd!</font>"; }
?>
Wat is het probleem?
Gewijzigd op 20/01/2005 20:22:00 door Geoffrey Mastenbroek
Gewijzigd op 20/01/2005 20:35:00 door Geoffrey Mastenbroek
Heb het zelf al voor elkaar gekregen bedantk ;)