Status pagina

[insert_php] // define variables and set to empty values
$klantcodeErr = $bonnummerErr = “”;
$klantcode = $bonnummer = “”;

if ($_SERVER[“REQUEST_METHOD”] == “POST”) {
if (empty($_POST[“klantcode”])) {
$klantcodeErr = “De klantcode is vereist”;
} else {
$klantcode = test_input($_POST[“klantcode”]);
if (!preg_match(“/^[a-zA-Z0-9]*$/”,$klantcode)) {
$klantcodeErr = “Klantcode fout”;
}
}

if (empty($_POST[“bonnummer”])) {
$bonnummerErr = “Het bonnummer is vereist”;
} else {
$bonnummer = test_input($_POST[“bonnummer”]);
}
}

function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>

De status van uw herstelling of bestelling opvragen

* verplicht veld.

Klantcode:
* [insert_php] echo $klantcodeErr;[/insert_php]

Bonnummer:
* [insert_php] echo $bonnummerErr;[/insert_php]

[insert_php] function getStatus($klantcode,$bonnummer) {
$xml=simplexml_load_file(“http://www.burmexcomputers.be/agenda.xml”) or die(“Er is een fout opgetreden”);
foreach($xml->children() as $agenda) {
if ($agenda->klantcode==strtoupper($klantcode) and $agenda->bonnummer==strtoupper($bonnummer)) {
echo “

“;
echo “


“;
echo “Klantcode: ” . $agenda->klantcode . “
“;
echo “Naam: ” . $agenda->omschrijving . “
“;
echo “Bonnummer: ” . $agenda->bonnummer . “

“;
if ($agenda->soort==”1”) {
echo “Soort: herstelling” . “
“;
echo “Datum binnengebracht: ” . $agenda->datumaangenomen . “
“;
} else {
echo “Soort: bestelling” . “
“;
echo “Datum besteld: ” . $agenda->datumaangenomen . “
“;
}
echo “Aangenomen door: ” . $agenda->aannemer . “

“;
echo “Verwachte afhaaldatum: ” . $agenda->afhaaldatum . “
“;
echo “Technieker: ” . $agenda->technieker . “
“;
if ($agenda->info!=””) {
echo “Extra informatie: ” . $agenda->info . “

“;
} else {
echo “
“;
}
echo “Huidige status: ” . $agenda->status . “
“;
echo “


“;
echo “

“;
}
}
}

getStatus($klantcode,$bonnummer)

// if (!getStatus($klantcode,$bonnummer)) {echo “

Geen resultaat gevonden

“;}
[/insert_php]