$at){ if (file_exists("WSFILES/" . $prodID . "_n")){ $totaal = $totaal + $at; } } echo "

Winkelwagen

"; echo 'Terug naar de index...'; if ($totaal == "1"){ $hv = "artikel"; } else{ $hv = "artikelen"; } echo "

U heeft op dit moment " . $totaal . " " . $hv . " in uw winkelwagen."; echo "

"; if (!$totaal == "0"){ //Laat de tabel met artikelen zien... ?> $aantal){ if((!$aantal == "" || !$aantal == "0") && file_exists("WSFILES/" . $prodID . "_n")){ $file = fopen("WSFILES/" . $prodID . "_n", "r"); $q = ""; while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); echo ""; echo ""; echo ""; echo ""; echo ""; } } echo ""; $prijs = $prijs + $verzend; echo ""; echo "

Procuct

Prijs per stuk

Aantal

Bedrag

" . $q . "

"; $file = fopen("WSFILES/" . $prodID . "_p", "r"); $q = ""; while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); $prijs = $prijs + ($aantal * $q); echo "

"; echo "

" . number_format($q, 2, ",", ".") . "   

"; echo "
"; echo "  "; echo "   "; echo ""; echo "Verwijderen"; echo "

"; echo "

" . number_format(($aantal * $q), 2, ",", "."); echo "

Verzendkosten binnen Nederland

"; echo "

"; $file = fopen("config.php", "r"); $string = fgets($file, 1024); list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string); fclose($file); echo "

" . number_format($verzend, 2, ",", ".") . "

Totaal

"; echo "
"; echo ""; echo ""; echo "

"; echo "

" . number_format($prijs, 2, ",", ".") . "

"; ?>
Bestelling afhandelen Bestelling afhandelen Winkelwagen leegmaken Winkelwagen leegmaken Pagina afdrukken Pagina afdrukken
Winkelwagen"; echo "

Er is een fout opgetreden, er bestaat geen product met artikelnummer "; echo $_GET['prodID']; echo ".

"; } else{ $_SESSION['winkelwagen'][$_GET['prodID']] = $_GET['aantal']; showcart(); } } if($_GET['q'] == "del"){ $_SESSION['winkelwagen'][$_GET['prodID']] = 0; showcart(); } if($_GET['q'] == "emp"){ //Winkelwagen leegmaken... foreach($_SESSION['winkelwagen'] as $prod => $aantal){ $_SESSION['winkelwagen'][$prod] = ""; } showcart(); } if($_GET['q'] == "shw"){ showcart(); } if($_GET['q'] == "bfr"){ echo "

Bestelling afhandelen

"; echo ''; echo 'Terug naar de winkelwagen...
'; ?>
Uw naam:  

Uw e-mailadres:  

Uw adres:  

Uw postcode:  

Uw woonplaats:  

Bestelling controleren"; echo ''; echo 'Terug naar de winkelwagen...'; if (!$_GET['naam'] || !valid_mail($_GET['mail']) || !$_GET['adres'] || !$_GET['post'] || !$_GET['wnpl']){ //Formulier fout ingevuld! echo "

Het formuler is niet correct ingevuld!

"; }else{ //Formulier goed ingevuld! echo "

Controleer de onderstaande gegevens, zijn deze correct? Klik dan op 'Bestellen'.

"; echo "

"; echo "Uw naam: " . $_GET['naam'] . "
"; echo "Uw e-mailadres: " . $_GET['mail'] . "
"; echo "Uw adres: " . $_GET['adres'] . "
"; echo "Uw postcode: " . $_GET['post'] . "
"; echo "Uw woonplaats: " . $_GET['wnpl'] . "

"; echo "Uw bestelling:
"; $totaal = ""; foreach($_SESSION['winkelwagen'] as $prodID => $aantal){ if (!$aantal == "0"){ $file = fopen("WSFILES/" . $prodID . "_n", "r"); $q = ""; while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); $file = fopen("WSFILES/" . $prodID . "_p", "r"); $p = ""; while (!feof($file)){ $p .= fgets($file, 1024); } fclose($file); $p = $aantal * $p; $totaal = $totaal + $p; echo $aantal . " x " . $q . " = € " . number_format($p, 2, ",", ".") . "
"; }} echo "Verzendkosten = "; echo "€ "; $file = fopen("config.php", "r"); $string = fgets($file, 1024); list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string); fclose($file); echo number_format($verzend, 2, ",", ".") . "
"; $totaal = $totaal + $verzend; echo "Totaal: € " . number_format($totaal, 2, ",", ".") . ""; echo "

"; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ""; echo "
"; } } if($_GET['q'] == "abe"){ $bericht = ""; $bericht .= "Naam:\n" . $_GET['naam'] . "\n"; $bericht .= "E-mailadres:\n" . $_GET['mail'] . "\n"; $bericht .= "Adres:\n" . $_GET['adres'] . "\n"; $bericht .= "Postcode:\n" . $_GET['post'] . "\n"; $bericht .= "Woonplaats:\n" . $_GET['wnpl'] . "\n\n"; $bericht .= "Bestelling:\n\n"; foreach($_SESSION['winkelwagen'] as $prodID => $aantal){ if (!$aantal == "0"){ $file = fopen("WSFILES/" . $prodID . "_n", "r"); $q = ""; while (!feof($file)){ $q .= fgets($file, 1024); } fclose($file); $file = fopen("WSFILES/" . $prodID . "_p", "r"); $p = ""; while (!feof($file)){ $p .= fgets($file, 1024); } fclose($file); $p = $aantal * $p; $totaal = $totaal + $p; $bericht .= $aantal . " x " . $q . " = € " . number_format($p, 2, ",", ".") . "\n"; }} $bericht .= "Verzendkosten = "; $bericht .= "€ "; $file = fopen("config.php", "r"); $string = fgets($file, 1024); list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string); fclose($file); $bericht .= number_format($verzend, 2, ",", "."); $totaal = $totaal + $verzend; $bericht .= "\n\nTotaal: € " . number_format($totaal, 2, ",", "."); if (!mail($_GET['mail'], "Uw bestelling", "De volgende bestelling is ingevoerd bij " . $webshopnaam . "\n\n" . $bericht) || !mail($mail, "Bestelling van " . $webshopnaam, "De volgende bestelling is ingevoerd bij " . $webshopnaam . "\n\n" . $bericht)){ //Bestelling niet verstuurd... echo "

Bestelling afhandelen

"; echo ''; echo 'Terug naar de winkelwagen...'; echo "

De bestelling kon niet worden verzonden!

"; } else{ foreach($_SESSION['winkelwagen'] as $x => $q){ $_SESSION['winkelwagen'][$x] = "0"; } echo "

Bestelling afhandelen

"; echo ''; echo 'Terug naar de winkelwagen...'; echo "

Uw bestelling is met succes verstuurd!"; echo "

Uw winkelwagen is automatisch leeg gemaakt!

"; } } include("footer.inc"); ?>