helpdesk
=-=-=-=-=-=-=-=-=-=-=-=-=-=
********** CONFIG *********
=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- top.php --
<HTML>
<HEAD>
<TITLE>Helpdesk</TITLE>
<style>
body { background-color: #ffffff; font-family: verdana, arial, helvetica; font-size: 12px; color: #000000 }
.tdbold { font-weight: bold; font-size: 12px }
.header { font-weight: bold; font-size: 14px }
</style>
</HEAD>
<BODY>
-- mkcon.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
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
<?
if (!mysql_select_db("databasenaam", mysql_connect("localhost", "databaseuser", "databasepass")))
{
$dbmail = "[email protected]";
$dbsub = "[database connectie mislukt]";
$dbdat = date("d.m.Y H:i");
$dbmsg = "===========================================\n";
$dbmsg .= "AUTOMATISCH E-MAIL BERICHT\n";
$dbmsg .= "===========================================\n\n";
$dbmsg .= "Op: $dbdat kon er geen connectie worden gemaakt\n";
$dbmsg .= "met de database.\n\n";
$dbmsg .= "Het ip adres: $REMOTE_ADDR benaderde de pagina:\n";
$dbmsg .= "$PHP_SELF\n\n";
$dbmsg .= "===========================================\n";
$dbmsg .= "EINDE AUTOMATISCHE E-MAIL BERICHT\n";
$dbmsg .= "===========================================\n";
@mail($dbmail, $dbsub, $dbmsg, "From: <noreply@localhost>");
echo "<p>";
echo "Sorry, er kan geen database connectie gemaakt worden.<br />";
echo "De webmaster is op de hoogte gebracht. Probeert u het later nog eens.</p>";
exit();
}
?>
if (!mysql_select_db("databasenaam", mysql_connect("localhost", "databaseuser", "databasepass")))
{
$dbmail = "[email protected]";
$dbsub = "[database connectie mislukt]";
$dbdat = date("d.m.Y H:i");
$dbmsg = "===========================================\n";
$dbmsg .= "AUTOMATISCH E-MAIL BERICHT\n";
$dbmsg .= "===========================================\n\n";
$dbmsg .= "Op: $dbdat kon er geen connectie worden gemaakt\n";
$dbmsg .= "met de database.\n\n";
$dbmsg .= "Het ip adres: $REMOTE_ADDR benaderde de pagina:\n";
$dbmsg .= "$PHP_SELF\n\n";
$dbmsg .= "===========================================\n";
$dbmsg .= "EINDE AUTOMATISCHE E-MAIL BERICHT\n";
$dbmsg .= "===========================================\n";
@mail($dbmail, $dbsub, $dbmsg, "From: <noreply@localhost>");
echo "<p>";
echo "Sorry, er kan geen database connectie gemaakt worden.<br />";
echo "De webmaster is op de hoogte gebracht. Probeert u het later nog eens.</p>";
exit();
}
?>
-- sesscheck.php --
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
<?
session_start();
if (!session_is_registered("usrlevl") && !$HTTP_SESSION_VARS["usrlevl"])
{
echo "<p>";
echo "Sorry, u heeft geen toegang tot deze pagina.<br />";
echo "Om toegang te krijgen zult u moeten <a href=\"index.php\" title=\"inloggen\">inloggen</a>.</p>";
exit();
}
?>
session_start();
if (!session_is_registered("usrlevl") && !$HTTP_SESSION_VARS["usrlevl"])
{
echo "<p>";
echo "Sorry, u heeft geen toegang tot deze pagina.<br />";
echo "Om toegang te krijgen zult u moeten <a href=\"index.php\" title=\"inloggen\">inloggen</a>.</p>";
exit();
}
?>
-- bot.php --
</BODY>
</HTML>
=================
DIT IN DE ROOT!!!!!!!!!!!!!
=================
-- addprob.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
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
<?
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_klanten";
$tablehis = "hd_geschiedenis";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if ($HTTP_POST_VARS["submit"] && $HTTP_POST_VARS["zoekterm"])
{
$sql = "INSERT INTO $tablehis (id, probleem, oplossing) VALUES ('', '$HTTP_POST_VARS[probleem]', '$HTTP_POST_VARS[oplossing]')";
$res = mysql_query($sql);
if ($res)
{
echo "<p>De probleem + oplossing is toegevoegd in de database.</p>";
echo "<p>Ga terug naar de <a href=\"$PHP_SELF\" title=\"klant gegevens\">klant gegevens</a>.</p>";
}
else
{
echo "<p>De probleem + oplossing is niet toegevoegd aan de database.</p>";
echo "<p>Ga terug naar de <a href=\"$PHP_SELF\" title=\"klant gegevens\">klant gegevens</a>.</p>";
}
}
else
{
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\" width=\"500\">\n";
echo "<tr><td>\n\n";
//-- begin table
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
//-- add problem
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td colspan=\"2\" class=\"header\">Voeg een probleem + oplossing toe</td></tr>";
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td class=\"tdbold\">Probleem</td><td><input type=\"text\" name=\"probleem\" size=\"30\" maxlength=\"100\" /></td></tr>";
echo "<tr><td class=\"tdbold\">Oplossing</td><td><textarea name=\"oplossing\" cols=\"40\" rows=\"6\"></textarea></td></tr>";
echo "<tr><td colspan=\"2\"><input type=\"submit\" name=\"submit_probleem\" value=\"probleem toevoegen\" /></td></tr>";
//-- end table
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
require("config/bot.php"); ?>
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_klanten";
$tablehis = "hd_geschiedenis";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if ($HTTP_POST_VARS["submit"] && $HTTP_POST_VARS["zoekterm"])
{
$sql = "INSERT INTO $tablehis (id, probleem, oplossing) VALUES ('', '$HTTP_POST_VARS[probleem]', '$HTTP_POST_VARS[oplossing]')";
$res = mysql_query($sql);
if ($res)
{
echo "<p>De probleem + oplossing is toegevoegd in de database.</p>";
echo "<p>Ga terug naar de <a href=\"$PHP_SELF\" title=\"klant gegevens\">klant gegevens</a>.</p>";
}
else
{
echo "<p>De probleem + oplossing is niet toegevoegd aan de database.</p>";
echo "<p>Ga terug naar de <a href=\"$PHP_SELF\" title=\"klant gegevens\">klant gegevens</a>.</p>";
}
}
else
{
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\" width=\"500\">\n";
echo "<tr><td>\n\n";
//-- begin table
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
//-- add problem
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td colspan=\"2\" class=\"header\">Voeg een probleem + oplossing toe</td></tr>";
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td class=\"tdbold\">Probleem</td><td><input type=\"text\" name=\"probleem\" size=\"30\" maxlength=\"100\" /></td></tr>";
echo "<tr><td class=\"tdbold\">Oplossing</td><td><textarea name=\"oplossing\" cols=\"40\" rows=\"6\"></textarea></td></tr>";
echo "<tr><td colspan=\"2\"><input type=\"submit\" name=\"submit_probleem\" value=\"probleem toevoegen\" /></td></tr>";
//-- end table
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
require("config/bot.php"); ?>
-- uitloggen.php --
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<?
session_start();
session_unregister(usrlevl);
echo "uitgelogd.<p>";
echo "<a href=index.php>inloggen</a>";
require("config/bot.php"); ?>
session_start();
session_unregister(usrlevl);
echo "uitgelogd.<p>";
echo "<a href=index.php>inloggen</a>";
require("config/bot.php"); ?>
-- showklant.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
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
<?
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_klanten";
$tablehis = "hd_geschiedenis";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if (($HTTP_POST_VARS["id"] && is_numeric($HTTP_POST_VARS["id"])) || ($HTTP_GET_VARS["id"] && is_numeric($HTTP_GET_VARS["id"])))
{
if ($HTTP_POST_VARS["id"])
$sql = "SELECT id, aanhef, naam, adres, postcode, woonplaats, telefoon FROM $tablecus WHERE id = $HTTP_POST_VARS[id]";
else
$sql = "SELECT id, aanhef, naam, adres, postcode, woonplaats, telefoon FROM $tablecus WHERE id = $HTTP_GET_VARS[id]";
$res = mysql_query($sql);
// customer found
if (mysql_num_rows($res) >= 1)
{
if ($HTTP_POST_VARS["klant_wijzig"] && is_numeric($HTTP_POST_VARS[id]) && $HTTP_POST_VARS["id"] && $HTTP_POST_VARS["aanhef"] && $HTTP_POST_VARS["naam"] && $HTTP_POST_VARS["adres"] && $HTTP_POST_VARS["postcode"] && $HTTP_POST_VARS["woonplaats"] && $HTTP_POST_VARS["telefoon"])
{
$sql = "UPDATE $tablecus SET ";
$sql .= "aanhef = '$HTTP_POST_VARS[aanhef]'";
$sql .= ", naam = '$HTTP_POST_VARS[naam]'";
$sql .= ", adres = '$HTTP_POST_VARS[adres]'";
$sql .= ", postcode = '$HTTP_POST_VARS[postcode]'";
$sql .= ", woonplaats = '$HTTP_POST_VARS[woonplaats]'";
$sql .= ", telefoon = '$HTTP_POST_VARS[telefoon]'";
$sql .= "WHERE id = $HTTP_POST_VARS[id]";
$res = mysql_query($sql) or die(mysql_error());
if ($res)
{
echo "<p>De klant met het id nummer: <b>$HTTP_POST_VARS[id]</b> is gewijzigd.</p>";
echo "<p>Bekijk de <a href=\"showklant.php?id=$HTTP_POST_VARS[id]\">gewijzigde gegevens</a>.</p>";
}
else
{
echo "<p>De klant met het id nummer: <b>$HTTP_POST_VARS[id]</b> kon niet gewijzigd worden.</p>";
}
}
elseif ($HTTP_POST_VARS["submit_probleem"] && $HTTP_POST_VARS["oplossing"] && $HTTP_POST_VARS["probleem"] && $HTTP_POST_VARS["id"] && is_numeric($HTTP_POST_VARS[id]))
{
$sql = "INSERT INTO $tablehis (id, probleem, oplossing, tid) VALUES ('', '$HTTP_POST_VARS[probleem]', '$HTTP_POST_VARS[oplossing]', '$HTTP_POST_VARS[id]')";
$res = mysql_query($sql);
if ($res)
{
echo "<p>De probleem + oplossing is toegevoegd in de database.</p>";
echo "<p>Ga terug naar de <a href=\"$PHP_SELF?id=$HTTP_POST_VARS[id]\" title=\"klant gegevens\">klant gegevens</a>.</p>";
}
else
{
echo "<p>De probleem + oplossing is niet toegevoegd aan de database.</p>";
echo "<p>Ga terug naar de <a href=\"$PHP_SELF?id=$HTTP_POST_VARS[id]\" title=\"klant gegevens\">klant gegevens</a>.</p>";
}
}
else
{
$row = mysql_fetch_array($res);
echo "<form method=\"POST\" action=\"$PHP_SELF\">\n";
echo "<input type=\"hidden\" name=\"id\" value=\"$row[id]\">";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\" width=\"500\">\n";
echo "<tr><td>\n\n";
//-- begin table
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
//-- text
echo "<tr><td colspan=\"2\">Selecteer een andere <a href=\"enterid.php\" title=\"klant\">klant</a>.</td></tr>";
//-- start form
echo "<tr><td class=\"tdbold\">Klant nummer</td>\n";
if ($HTTP_POST_VARS["id"])
echo "<td>$HTTP_POST_VARS[id]</td></tr>\n";
else
echo "<td>$HTTP_GET_VARS[id]</td></tr>\n";
echo "<tr><td class=\"tdbold\">Aanhef</td>\n";
echo "<td>\n";
echo "<select name=\"aanhef\">";
echo "<option value=\"Mr\" $sel_aanhef[1]>Mr</option>\n";
echo "<option value=\"Mv\" $sel_aanhef[2]>Mv</option>\n";
echo "</td></tr>\n";
echo "<tr><td class=\"tdbold\">Volledige naam</td>\n";
echo "<td><input type=\"text\" name=\"naam\" maxlength=\"100\" size=\"30\" value=\"$row[naam]\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Adres</td>\n";
echo "<td><input type=\"text\" name=\"adres\" maxlength=\"100\" size=\"30\" value=\"$row[adres]\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Postcode</td>\n";
echo "<td><input type=\"text\" name=\"postcode\" maxlength=\"6\" size=\"6\" value=\"$row[postcode]\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Woonplaats</td>\n";
echo "<td><input type=\"text\" name=\"woonplaats\" maxlength=\"100\" size=\"30\" value=\"$row[woonplaats]\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Telefoon nummer</td>\n";
echo "<td><input type=\"text\" name=\"telefoon\" maxlength=\"10\" size=\"10\" value=\"$row[telefoon]\" /></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"klant_wijzig\" value=\"wijzigen\" /></td></tr>";
//-- earlier problems
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td colspan=\"2\" class=\"header\">Eerder voorgekomen problemen</td></tr>";
echo "<tr><td colspan=\"2\"> </td></tr>";
$probsql = "SELECT id,probleem,oplossing FROM $tablehis WHERE tid = '$row[id]'";
$probres = mysql_query($probsql);
echo "<tr><td valign=\"top\" class=\"tdbold\">Probleem nummer</td><td valign=\"top\" class=\"tdbold\">Omschrijving + oplossing</td></tr>";
if (mysql_num_rows($probres) >= 1)
{
$i = 1;
while ($prow = mysql_fetch_array($probres))
{
$prow[oplossing] = nl2br(htmlentities($prow[oplossing]));
$prow[probleem] = htmlentities($prow[probleem]);
echo "<tr><td valign=\"top\">$i</td><td valign=\"top\"><b>$prow[probleem]</b><br>$prow[oplossing]</td></tr>";
$i++;
}
unset($i);
}
else
{
echo "<tr><td colspan=\"2\">Geen eerdere problemen.</td></tr>";
}
//-- add problem
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td colspan=\"2\" class=\"header\">Voeg een probleem + oplossing toe</td></tr>";
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td class=\"tdbold\">Probleem</td><td><input type=\"text\" name=\"probleem\" size=\"30\" maxlength=\"100\" /></td></tr>";
echo "<tr><td class=\"tdbold\">Oplossing</td><td><textarea name=\"oplossing\" cols=\"40\" rows=\"6\"></textarea></td></tr>";
echo "<tr><td colspan=\"2\"><input type=\"submit\" name=\"submit_probleem\" value=\"probleem toevoegen\" /></td></tr>";
//-- end table
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
}
// no customer
else
{
echo "<p>Er is geen klant gevonden met dit klanten nummer.</p>";
echo "<p>Voer een ander <a href=\"enterid.php\" title=\"klant nummer\">klant nummer</a> in.</p>";
}
}
else
{
echo "<p>Er is geen geldig klant nummer opgegeven.</p>";
echo "<p>Voer een ander <a href=\"enterid.php\" title=\"klant nummer\">klant nummer</a> in.</p>";
}
require("config/bot.php"); ?>
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_klanten";
$tablehis = "hd_geschiedenis";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if (($HTTP_POST_VARS["id"] && is_numeric($HTTP_POST_VARS["id"])) || ($HTTP_GET_VARS["id"] && is_numeric($HTTP_GET_VARS["id"])))
{
if ($HTTP_POST_VARS["id"])
$sql = "SELECT id, aanhef, naam, adres, postcode, woonplaats, telefoon FROM $tablecus WHERE id = $HTTP_POST_VARS[id]";
else
$sql = "SELECT id, aanhef, naam, adres, postcode, woonplaats, telefoon FROM $tablecus WHERE id = $HTTP_GET_VARS[id]";
$res = mysql_query($sql);
// customer found
if (mysql_num_rows($res) >= 1)
{
if ($HTTP_POST_VARS["klant_wijzig"] && is_numeric($HTTP_POST_VARS[id]) && $HTTP_POST_VARS["id"] && $HTTP_POST_VARS["aanhef"] && $HTTP_POST_VARS["naam"] && $HTTP_POST_VARS["adres"] && $HTTP_POST_VARS["postcode"] && $HTTP_POST_VARS["woonplaats"] && $HTTP_POST_VARS["telefoon"])
{
$sql = "UPDATE $tablecus SET ";
$sql .= "aanhef = '$HTTP_POST_VARS[aanhef]'";
$sql .= ", naam = '$HTTP_POST_VARS[naam]'";
$sql .= ", adres = '$HTTP_POST_VARS[adres]'";
$sql .= ", postcode = '$HTTP_POST_VARS[postcode]'";
$sql .= ", woonplaats = '$HTTP_POST_VARS[woonplaats]'";
$sql .= ", telefoon = '$HTTP_POST_VARS[telefoon]'";
$sql .= "WHERE id = $HTTP_POST_VARS[id]";
$res = mysql_query($sql) or die(mysql_error());
if ($res)
{
echo "<p>De klant met het id nummer: <b>$HTTP_POST_VARS[id]</b> is gewijzigd.</p>";
echo "<p>Bekijk de <a href=\"showklant.php?id=$HTTP_POST_VARS[id]\">gewijzigde gegevens</a>.</p>";
}
else
{
echo "<p>De klant met het id nummer: <b>$HTTP_POST_VARS[id]</b> kon niet gewijzigd worden.</p>";
}
}
elseif ($HTTP_POST_VARS["submit_probleem"] && $HTTP_POST_VARS["oplossing"] && $HTTP_POST_VARS["probleem"] && $HTTP_POST_VARS["id"] && is_numeric($HTTP_POST_VARS[id]))
{
$sql = "INSERT INTO $tablehis (id, probleem, oplossing, tid) VALUES ('', '$HTTP_POST_VARS[probleem]', '$HTTP_POST_VARS[oplossing]', '$HTTP_POST_VARS[id]')";
$res = mysql_query($sql);
if ($res)
{
echo "<p>De probleem + oplossing is toegevoegd in de database.</p>";
echo "<p>Ga terug naar de <a href=\"$PHP_SELF?id=$HTTP_POST_VARS[id]\" title=\"klant gegevens\">klant gegevens</a>.</p>";
}
else
{
echo "<p>De probleem + oplossing is niet toegevoegd aan de database.</p>";
echo "<p>Ga terug naar de <a href=\"$PHP_SELF?id=$HTTP_POST_VARS[id]\" title=\"klant gegevens\">klant gegevens</a>.</p>";
}
}
else
{
$row = mysql_fetch_array($res);
echo "<form method=\"POST\" action=\"$PHP_SELF\">\n";
echo "<input type=\"hidden\" name=\"id\" value=\"$row[id]\">";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\" width=\"500\">\n";
echo "<tr><td>\n\n";
//-- begin table
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
//-- text
echo "<tr><td colspan=\"2\">Selecteer een andere <a href=\"enterid.php\" title=\"klant\">klant</a>.</td></tr>";
//-- start form
echo "<tr><td class=\"tdbold\">Klant nummer</td>\n";
if ($HTTP_POST_VARS["id"])
echo "<td>$HTTP_POST_VARS[id]</td></tr>\n";
else
echo "<td>$HTTP_GET_VARS[id]</td></tr>\n";
echo "<tr><td class=\"tdbold\">Aanhef</td>\n";
echo "<td>\n";
echo "<select name=\"aanhef\">";
echo "<option value=\"Mr\" $sel_aanhef[1]>Mr</option>\n";
echo "<option value=\"Mv\" $sel_aanhef[2]>Mv</option>\n";
echo "</td></tr>\n";
echo "<tr><td class=\"tdbold\">Volledige naam</td>\n";
echo "<td><input type=\"text\" name=\"naam\" maxlength=\"100\" size=\"30\" value=\"$row[naam]\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Adres</td>\n";
echo "<td><input type=\"text\" name=\"adres\" maxlength=\"100\" size=\"30\" value=\"$row[adres]\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Postcode</td>\n";
echo "<td><input type=\"text\" name=\"postcode\" maxlength=\"6\" size=\"6\" value=\"$row[postcode]\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Woonplaats</td>\n";
echo "<td><input type=\"text\" name=\"woonplaats\" maxlength=\"100\" size=\"30\" value=\"$row[woonplaats]\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Telefoon nummer</td>\n";
echo "<td><input type=\"text\" name=\"telefoon\" maxlength=\"10\" size=\"10\" value=\"$row[telefoon]\" /></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"klant_wijzig\" value=\"wijzigen\" /></td></tr>";
//-- earlier problems
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td colspan=\"2\" class=\"header\">Eerder voorgekomen problemen</td></tr>";
echo "<tr><td colspan=\"2\"> </td></tr>";
$probsql = "SELECT id,probleem,oplossing FROM $tablehis WHERE tid = '$row[id]'";
$probres = mysql_query($probsql);
echo "<tr><td valign=\"top\" class=\"tdbold\">Probleem nummer</td><td valign=\"top\" class=\"tdbold\">Omschrijving + oplossing</td></tr>";
if (mysql_num_rows($probres) >= 1)
{
$i = 1;
while ($prow = mysql_fetch_array($probres))
{
$prow[oplossing] = nl2br(htmlentities($prow[oplossing]));
$prow[probleem] = htmlentities($prow[probleem]);
echo "<tr><td valign=\"top\">$i</td><td valign=\"top\"><b>$prow[probleem]</b><br>$prow[oplossing]</td></tr>";
$i++;
}
unset($i);
}
else
{
echo "<tr><td colspan=\"2\">Geen eerdere problemen.</td></tr>";
}
//-- add problem
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td colspan=\"2\" class=\"header\">Voeg een probleem + oplossing toe</td></tr>";
echo "<tr><td colspan=\"2\"> </td></tr>";
echo "<tr><td class=\"tdbold\">Probleem</td><td><input type=\"text\" name=\"probleem\" size=\"30\" maxlength=\"100\" /></td></tr>";
echo "<tr><td class=\"tdbold\">Oplossing</td><td><textarea name=\"oplossing\" cols=\"40\" rows=\"6\"></textarea></td></tr>";
echo "<tr><td colspan=\"2\"><input type=\"submit\" name=\"submit_probleem\" value=\"probleem toevoegen\" /></td></tr>";
//-- end table
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
}
// no customer
else
{
echo "<p>Er is geen klant gevonden met dit klanten nummer.</p>";
echo "<p>Voer een ander <a href=\"enterid.php\" title=\"klant nummer\">klant nummer</a> in.</p>";
}
}
else
{
echo "<p>Er is geen geldig klant nummer opgegeven.</p>";
echo "<p>Voer een ander <a href=\"enterid.php\" title=\"klant nummer\">klant nummer</a> in.</p>";
}
require("config/bot.php"); ?>
-- klanten.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
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
<?
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_klanten";
$tablehis = "hd_geschiedenis";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if ($HTTP_POST_VARS["submit"])
{
$sql = "INSERT INTO $tablecus (id, naam, adres, postcode, woonplaats, telefoon) VALUES ";
$sql .= "('', '$HTTP_POST_VARS[naam]', '$HTTP_POST_VARS[adres]', '$HTTP_POST_VARS[postcode]', '$HTTP_POST_VARS[woonplaats]', '$HTTP_POST_VARS[telefoon]')";
$res = mysql_query($sql);
if ($res)
echo "<p>De klant is aangemaakt en heeft de klanten nummer: <b>" . mysql_insert_id() ."</b> gekregen.</p>";
else
echo "<p>De klant kon <b>niet</b> worden aangemaakt.";
}
else
{
echo "<form method=\"POST\" action=\"$PHP_SELF\">\n";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">\n";
echo "<tr><td>\n\n";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo "<tr><td class=\"tdbold\">Aanhef</td></tr>\n";
echo "<tr><td>";
echo "<select name=\"aanhef\">\n";
echo "<option value=\"Mr\">Mr</option>";
echo "<option value=\"Mv\">Mv</option>";
echo "</select>";
echo "</td></tr>\n";
echo "<tr><td class=\"tdbold\">Volledige naam</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"naam\" maxlength=\"100\" size=\"30\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Adres</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"adres\" maxlength=\"100\" size=\"30\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Postcode</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"postcode\" maxlength=\"6\" size=\"6\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Woonplaats</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"woonplaats\" maxlength=\"100\" size=\"30\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Telefoon nummer</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"telefoon\" maxlength=\"10\" size=\"10\" /></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"submit\" value=\"klant aanmaken\" /></td></tr>";
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
require("config/bot.php"); ?>
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_klanten";
$tablehis = "hd_geschiedenis";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if ($HTTP_POST_VARS["submit"])
{
$sql = "INSERT INTO $tablecus (id, naam, adres, postcode, woonplaats, telefoon) VALUES ";
$sql .= "('', '$HTTP_POST_VARS[naam]', '$HTTP_POST_VARS[adres]', '$HTTP_POST_VARS[postcode]', '$HTTP_POST_VARS[woonplaats]', '$HTTP_POST_VARS[telefoon]')";
$res = mysql_query($sql);
if ($res)
echo "<p>De klant is aangemaakt en heeft de klanten nummer: <b>" . mysql_insert_id() ."</b> gekregen.</p>";
else
echo "<p>De klant kon <b>niet</b> worden aangemaakt.";
}
else
{
echo "<form method=\"POST\" action=\"$PHP_SELF\">\n";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">\n";
echo "<tr><td>\n\n";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo "<tr><td class=\"tdbold\">Aanhef</td></tr>\n";
echo "<tr><td>";
echo "<select name=\"aanhef\">\n";
echo "<option value=\"Mr\">Mr</option>";
echo "<option value=\"Mv\">Mv</option>";
echo "</select>";
echo "</td></tr>\n";
echo "<tr><td class=\"tdbold\">Volledige naam</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"naam\" maxlength=\"100\" size=\"30\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Adres</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"adres\" maxlength=\"100\" size=\"30\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Postcode</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"postcode\" maxlength=\"6\" size=\"6\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Woonplaats</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"woonplaats\" maxlength=\"100\" size=\"30\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Telefoon nummer</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"telefoon\" maxlength=\"10\" size=\"10\" /></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"submit\" value=\"klant aanmaken\" /></td></tr>";
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
require("config/bot.php"); ?>
-- index.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
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
<?
session_start();
// make db connection
require("config/mkcon.php"); require("config/top.php");
// set tables
$tabusrs = "hd_gebruikers";
// check if user is logged in
if (session_is_registered("usrlevl") && $HTTP_SESSION_VARS["usrlevl"])
{
echo "<script language=\"javascript\">window.location='enterid.php'</script>";
}
else
{
$submit = $HTTP_POST_VARS["submit"];
$login = htmlentities(($HTTP_POST_VARS["loginnaam"]));
$paswd = htmlentities((md5($HTTP_POST_VARS["wachtwoord"])));
// check for required fields
if ($submit && $login && $paswd)
{
$sql = "SELECT level FROM $tabusrs WHERE login = '$login' AND pass = '$paswd' AND actief = 1";
$res = mysql_query($sql);
// check for result
if (mysql_num_rows($res) >= 1)
{
// set session
$usrlevl = mysql_result($res, 0);
session_register(usrlevl);
echo "<script language=\"javascript\">window.location='enterid.php'</script>";
}
else
{
echo "<p>U heeft een ongeldige gebruikersnaam of wachtwoord ingevuld.</p>";
echo "<p>U kunt het <a href=\"$PHP_SELF\" title=\"opnieuw\">opnieuw</a> proberen.</p>";
}
}
// show login form
else
{
echo "<form method=\"POST\" action=\"$PHP_SELF\">\n";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">\n";
echo "<tr><td>\n\n";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo "<tr><td class=\"tdbold\">Login naam</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"loginnaam\" maxlength=\"15\" size=\"15\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Wachtwoord</td></tr>\n";
echo "<tr><td><input type=\"password\" name=\"wachtwoord\" maxlength=\"15\" size=\"15\" /></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"submit\" value=\"inloggen\" /></td></tr>";
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
}
require("config/bot.php"); ?>
session_start();
// make db connection
require("config/mkcon.php"); require("config/top.php");
// set tables
$tabusrs = "hd_gebruikers";
// check if user is logged in
if (session_is_registered("usrlevl") && $HTTP_SESSION_VARS["usrlevl"])
{
echo "<script language=\"javascript\">window.location='enterid.php'</script>";
}
else
{
$submit = $HTTP_POST_VARS["submit"];
$login = htmlentities(($HTTP_POST_VARS["loginnaam"]));
$paswd = htmlentities((md5($HTTP_POST_VARS["wachtwoord"])));
// check for required fields
if ($submit && $login && $paswd)
{
$sql = "SELECT level FROM $tabusrs WHERE login = '$login' AND pass = '$paswd' AND actief = 1";
$res = mysql_query($sql);
// check for result
if (mysql_num_rows($res) >= 1)
{
// set session
$usrlevl = mysql_result($res, 0);
session_register(usrlevl);
echo "<script language=\"javascript\">window.location='enterid.php'</script>";
}
else
{
echo "<p>U heeft een ongeldige gebruikersnaam of wachtwoord ingevuld.</p>";
echo "<p>U kunt het <a href=\"$PHP_SELF\" title=\"opnieuw\">opnieuw</a> proberen.</p>";
}
}
// show login form
else
{
echo "<form method=\"POST\" action=\"$PHP_SELF\">\n";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">\n";
echo "<tr><td>\n\n";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo "<tr><td class=\"tdbold\">Login naam</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"loginnaam\" maxlength=\"15\" size=\"15\" /></td></tr>\n";
echo "<tr><td class=\"tdbold\">Wachtwoord</td></tr>\n";
echo "<tr><td><input type=\"password\" name=\"wachtwoord\" maxlength=\"15\" size=\"15\" /></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"submit\" value=\"inloggen\" /></td></tr>";
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
}
require("config/bot.php"); ?>
-- gebruikers.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
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
<?
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_gebruikers";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if ($HTTP_GET_VARS["id"] && is_numeric($HTTP_GET_VARS[id]))
{
if ($HTTP_GET_VARS["confirm"] == "yes")
{
$sql = "DELETE FROM $tablecus WHERE id = $HTTP_GET_VARS[id]";
$res = mysql_query($sql);
if ($res)
{
echo "<p>De gebruiker is verwijderd.</p>";
echo "<p>U kunt ook een <a href=\"$PHP_SELF\" title=\"gebruiker aanmaken\">gebruiker aanmaken</a>.</p>";
}
else
{
echo "<p>De gebruiker is niet verwijderd.</p>";
echo "<p>U kunt ook een <a href=\"$PHP_SELF\" title=\"gebruiker aanmaken\">gebruiker aanmaken</a>.</p>";
}
}
else
{
echo "Weet u zeker dat u deze gebruiker wilt verwijderen?<p>";
echo "<a href=\"$PHP_SELF?id=$HTTP_GET_VARS[id]&confirm=yes\">ja</a> | <a href=\"$PHP_SELF\">nee</a>";
}
}
elseif ($HTTP_POST_VARS["submit"] && !$HTTP_GET_VARS["id"])
{
$encrypted_pass = md5($HTTP_POST_VARS[pass]);
$sql = "INSERT INTO $tablecus (id, login, pass) VALUES ('', '$HTTP_POST_VARS[login]', '$encrypted_pass')";
$res = mysql_query($sql);
if ($res)
{
echo "<p>Gebruiker aangemaakt.</p>";
}
else
{
echo "<p>Gebruiker niet aangemaakt.</p>";
}
}
else
{
echo "<p class=\"tdbold\">Gebruikers overzicht</p>";
$sql = "SELECT id,login FROM $tablecus";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
echo "<p>";
while ($row = mysql_fetch_array($res))
{
echo "[<a href=\"$PHP_SELF?id=$row[id]\" title=\"verwijderen\">verwijderen</a>] $row[login]<br />";
}
echo "</p>";
}
else
{
echo "<p>Er bestaan nog geen gebruikers.</p>";
}
echo "<p class=\"tdbold\">Gebruiker aanmaken</p>";
echo "<p>";
echo "<form method=\"POST\" action=\"$PHP_SELF\">";
echo "Login naam:<br />";
echo "<input type=\"text\" name=\"login\" maxlength=\"15\" /><br />";
echo "Wachtwoord:<br />";
echo "<input type=\"password\" name=\"pass\" maxlength=\"15\" /><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Gebruiker aanmaken\">";
echo "</p>";
}
require("config/bot.php"); ?>
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_gebruikers";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if ($HTTP_GET_VARS["id"] && is_numeric($HTTP_GET_VARS[id]))
{
if ($HTTP_GET_VARS["confirm"] == "yes")
{
$sql = "DELETE FROM $tablecus WHERE id = $HTTP_GET_VARS[id]";
$res = mysql_query($sql);
if ($res)
{
echo "<p>De gebruiker is verwijderd.</p>";
echo "<p>U kunt ook een <a href=\"$PHP_SELF\" title=\"gebruiker aanmaken\">gebruiker aanmaken</a>.</p>";
}
else
{
echo "<p>De gebruiker is niet verwijderd.</p>";
echo "<p>U kunt ook een <a href=\"$PHP_SELF\" title=\"gebruiker aanmaken\">gebruiker aanmaken</a>.</p>";
}
}
else
{
echo "Weet u zeker dat u deze gebruiker wilt verwijderen?<p>";
echo "<a href=\"$PHP_SELF?id=$HTTP_GET_VARS[id]&confirm=yes\">ja</a> | <a href=\"$PHP_SELF\">nee</a>";
}
}
elseif ($HTTP_POST_VARS["submit"] && !$HTTP_GET_VARS["id"])
{
$encrypted_pass = md5($HTTP_POST_VARS[pass]);
$sql = "INSERT INTO $tablecus (id, login, pass) VALUES ('', '$HTTP_POST_VARS[login]', '$encrypted_pass')";
$res = mysql_query($sql);
if ($res)
{
echo "<p>Gebruiker aangemaakt.</p>";
}
else
{
echo "<p>Gebruiker niet aangemaakt.</p>";
}
}
else
{
echo "<p class=\"tdbold\">Gebruikers overzicht</p>";
$sql = "SELECT id,login FROM $tablecus";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
echo "<p>";
while ($row = mysql_fetch_array($res))
{
echo "[<a href=\"$PHP_SELF?id=$row[id]\" title=\"verwijderen\">verwijderen</a>] $row[login]<br />";
}
echo "</p>";
}
else
{
echo "<p>Er bestaan nog geen gebruikers.</p>";
}
echo "<p class=\"tdbold\">Gebruiker aanmaken</p>";
echo "<p>";
echo "<form method=\"POST\" action=\"$PHP_SELF\">";
echo "Login naam:<br />";
echo "<input type=\"text\" name=\"login\" maxlength=\"15\" /><br />";
echo "Wachtwoord:<br />";
echo "<input type=\"password\" name=\"pass\" maxlength=\"15\" /><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Gebruiker aanmaken\">";
echo "</p>";
}
require("config/bot.php"); ?>
-- enterid.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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
echo "<form method=\"POST\" action=\"showklant.php\">\n";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">\n";
echo "<tr><td>\n\n";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo "<tr><td class=\"tdbold\">Klanten nummer</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"id\" maxlength=\"11\" size=\"11\" /></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"submit\" value=\"doorgaan\" /></td></tr>";
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
require("config/bot.php"); ?>
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
echo "<form method=\"POST\" action=\"showklant.php\">\n";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">\n";
echo "<tr><td>\n\n";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo "<tr><td class=\"tdbold\">Klanten nummer</td></tr>\n";
echo "<tr><td><input type=\"text\" name=\"id\" maxlength=\"11\" size=\"11\" /></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"submit\" value=\"doorgaan\" /></td></tr>";
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
require("config/bot.php"); ?>
-- zoekprobleem.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
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
<?
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_klanten";
$tablehis = "hd_geschiedenis";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if ($HTTP_POST_VARS["submit"] && $HTTP_POST_VARS["zoekterm"])
{
$sql = "SELECT probleem,oplossing FROM $tablehis WHERE probleem LIKE '%$HTTP_POST_VARS[zoekterm]%' OR oplossing LIKE '%$HTTP_POST_VARS[zoekterm]%'";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
while ($row = mysql_fetch_array($res))
{
echo "<p>";
echo "<b>$row[probleem]</b><br />";
echo "$row[oplossing]</p>";
}
echo "<p>U kunt ook <a href=\"zoekprobleem.php\" title=\"opnieuw zoeken\">opnieuw zoeken</a>.</p>";
}
else
{
echo "<p>Er is niets gevonden op deze zoekterm.</p>";
echo "U kunt <a href=\"zoekprobleem.php\" title=\"opnieuw zoeken\">opnieuw zoeken</a> of dit <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a>.</p>";
}
}
else
{
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\" width=\"500\">\n";
echo "<tr><td>\n\n";
//-- begin table
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo "<tr><td class=\"tdbold\">Zoekterm</td><td><input type=\"text\" name=\"zoekterm\" size=\"30\" maxlength=\"100\" /></td></tr>";
echo "<tr><td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"probleem zoeken\" /></td></tr>";
//-- end table
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
require("config/bot.php"); ?>
// check if user is logged in
require("config/sesscheck.php");
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_klanten";
$tablehis = "hd_geschiedenis";
// show navigation if admin's logged in
if ($HTTP_SESSION_VARS["usrlevl"])
echo "<p><a href=\"zoekprobleem.php\" title=\"zoek probleem\">zoek probleem</a> | <a href=\"gebruikers.php\" title=\"gebruikers beheer\">gebruikers beheer</a> | <a href=\"enterid.php\" title=\"selecteer klant\">selecteer klant</a> | <a href=\"klanten.php\" title=\"klant aanmaken\">klant aanmaken</a> | <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a> | <a href=\"uitloggen.php\" title=\"uitloggen\">uitloggen</a></p>\n\n";
if ($HTTP_POST_VARS["submit"] && $HTTP_POST_VARS["zoekterm"])
{
$sql = "SELECT probleem,oplossing FROM $tablehis WHERE probleem LIKE '%$HTTP_POST_VARS[zoekterm]%' OR oplossing LIKE '%$HTTP_POST_VARS[zoekterm]%'";
$res = mysql_query($sql);
if (mysql_num_rows($res) >= 1)
{
while ($row = mysql_fetch_array($res))
{
echo "<p>";
echo "<b>$row[probleem]</b><br />";
echo "$row[oplossing]</p>";
}
echo "<p>U kunt ook <a href=\"zoekprobleem.php\" title=\"opnieuw zoeken\">opnieuw zoeken</a>.</p>";
}
else
{
echo "<p>Er is niets gevonden op deze zoekterm.</p>";
echo "U kunt <a href=\"zoekprobleem.php\" title=\"opnieuw zoeken\">opnieuw zoeken</a> of dit <a href=\"addprob.php\" title=\"probleem toevoegen\">probleem toevoegen</a>.</p>";
}
}
else
{
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\" width=\"500\">\n";
echo "<tr><td>\n\n";
//-- begin table
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
echo "<tr><td class=\"tdbold\">Zoekterm</td><td><input type=\"text\" name=\"zoekterm\" size=\"30\" maxlength=\"100\" /></td></tr>";
echo "<tr><td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"probleem zoeken\" /></td></tr>";
//-- end table
echo "</table>\n\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
require("config/bot.php"); ?>
-- eerstegebruiker.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
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
<?
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_gebruikers";
if ($HTTP_POST_VARS["submit"])
{
$encrypted_pass = md5($HTTP_POST_VARS[pass]);
$sql = "INSERT INTO $tablecus (id, login, pass) VALUES ('', '$HTTP_POST_VARS[login]', '$encrypted_pass')";
$res = mysql_query($sql);
if ($res)
{
echo "<p>Gebruiker aangemaakt.</p>";
}
else
{
echo "<p>Gebruiker niet aangemaakt.</p>";
}
}
else
{
echo "<p class=\"tdbold\">Gebruiker aanmaken</p>";
echo "<p>";
echo "<form method=\"POST\" action=\"$PHP_SELF\">";
echo "Login naam:<br />";
echo "<input type=\"text\" name=\"login\" maxlength=\"15\" /><br />";
echo "Wachtwoord:<br />";
echo "<input type=\"password\" name=\"pass\" maxlength=\"15\" /><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Gebruiker aanmaken\">";
echo "</p>";
}
require("config/bot.php"); ?>
// make database connection
require("config/mkcon.php"); require("config/top.php");
// define tables
$tablecus = "hd_gebruikers";
if ($HTTP_POST_VARS["submit"])
{
$encrypted_pass = md5($HTTP_POST_VARS[pass]);
$sql = "INSERT INTO $tablecus (id, login, pass) VALUES ('', '$HTTP_POST_VARS[login]', '$encrypted_pass')";
$res = mysql_query($sql);
if ($res)
{
echo "<p>Gebruiker aangemaakt.</p>";
}
else
{
echo "<p>Gebruiker niet aangemaakt.</p>";
}
}
else
{
echo "<p class=\"tdbold\">Gebruiker aanmaken</p>";
echo "<p>";
echo "<form method=\"POST\" action=\"$PHP_SELF\">";
echo "Login naam:<br />";
echo "<input type=\"text\" name=\"login\" maxlength=\"15\" /><br />";
echo "Wachtwoord:<br />";
echo "<input type=\"password\" name=\"pass\" maxlength=\"15\" /><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Gebruiker aanmaken\">";
echo "</p>";
}
require("config/bot.php"); ?>