コード例 #1
0
 public static function bestelregelToevoegen($arrBestelRegel, $productID, $aantal)
 {
     /* returnt arrBestelRegel met toegevoegd of updated regel.*/
     $dubbel = bestelRegelService::checkAlBesteld($arrBestelRegel, $productID, $aantal);
     if (!$dubbel) {
         $objRegel = new Bestelregel($productID, $aantal);
         array_push($arrBestelRegel, $objRegel);
         return $arrBestelRegel;
         die;
     }
     return $dubbel;
 }
コード例 #2
0
ファイル: wijzigen.php プロジェクト: vdabely/vdabphpbakker
<?php

if (isset($_GET['product']) && isset($_GET['aantal'])) {
    $_SESSION['bestelregelarray'] = bestelRegelService::bestelregelAanpassen($_SESSION['bestelregelarray'], $_GET['product'], $_GET['aantal']);
}
$arrBestelRegel = $_SESSION['bestelregelarray'];
$karNietLeeg = bestelRegelService::winkelkarNietLeeg($arrBestelRegel);
if (!$karNietLeeg) {
    header("Location: index.php?page=bestelling");
    die;
}
?>
        <div class="wrapper clearfix">
            <div class="txtC">
                <h1>Uw bestelling wijzigen.</h1> 
                - <a href="?page=bestelling&winkelkar=leeg">Anuleren</a>
                - <a href="?page=bestelling">Verder winkelen</a> 
                - <a href="?page=afrekenen&winkelkar=afrekenen">Afrekenen</a> -
            </div>
            <div class="innercontainer">
                <dl>
                    <dt>Winkelmandje aanpassen</dt>
                <?php 
$totprijs = 0;
foreach ($arrBestelRegel as $regel) {
    $productID = $regel->productID;
    $aantal = $regel->aantal;
    $product = productService::getProductFromId($productID);
    $productPrijs = $product->prijs;
    $prijs = $aantal * $productPrijs;
    if ($aantal) {
コード例 #3
0
ファイル: overzicht.php プロジェクト: vdabely/vdabphpbakker
    $klant = klantService::getKlantFromId($klantID);
    $dbDatum = $bestelling->Besteldatum;
    $datum = date('d-m-Y', strtotime($dbDatum));
    $BestelID = $bestelling->BestelID;
    $klantnaam = $klant->Naam . " " . $klant->VNaam;
    if ($nextdatum == "") {
        print $datum . "<hr/>";
    } else {
        if ($nextdatum != $dbDatum) {
            print "<hr/>" . $datum . "<hr/>";
        }
    }
    print "<div class='innercontainer txtL'>&nbsp;";
    print "<dl><dt>Bestelling voor " . $klantnaam . " op " . $datum . "</dt>";
    $totPrijs = $bestelling->Prijs;
    $arrBestelRegel = bestelRegelService::getBestelRegelsFromId($BestelID);
    foreach ($arrBestelRegel as $regel) {
        $productID = $regel->productID;
        $aantal = $regel->aantal;
        $product = productService::getProductFromId($productID);
        $productPrijs = $product->prijs;
        $prijs = $aantal * $productPrijs;
        if ($aantal) {
            print "<dd>" . $aantal . " x " . $product->product . " <strong>&euro; " . $productPrijs . "</strong> = &euro; " . $prijs . "</dd>";
        }
    }
    print "<dt>Totaalprijs = &euro; " . $totPrijs . "</dt>";
    print "</dl><a href='?page=overzicht&verwijder=" . $BestelID . "'>bestelling verwijderen</a>";
    print "</div>";
    $nextdatum = $dbDatum;
}
コード例 #4
0
ファイル: bestelling.php プロジェクト: vdabely/vdabphpbakker
<?php

if (isset($_GET['winkelkar']) && $_GET['winkelkar'] == 'leeg') {
    unset($_SESSION['bestelregelarray']);
    header("Location: index.php?page=bestel");
    die;
}
if (!isset($_GET['product']) && !isset($_SESSION['bestelregelarray'])) {
    header("Location: index.php?page=bestel");
    die;
}
if (isset($_GET['product']) && $_GET['page'] == 'bestelling') {
    $IDproduct = productService::getProductFromId($_GET['product']);
    if (isset($_GET['aantal'])) {
        $_SESSION['bestelregelarray'] = bestelRegelService::bestelregelToevoegen($_SESSION['bestelregelarray'], $_GET['product'], $_GET['aantal'], '1');
    }
}
if (isset($_SESSION['bestelregelarray']) && !empty($_SESSION['bestelregelarray']) || isset($_GET['product']) && $_GET['page'] == 'bestelling') {
    if (!isset($_GET['aantal']) && isset($_GET['product'])) {
        ?>
        <div class="wrapper clearfix">
            <div class="txtC">
                <h1>Hoeveel <?php 
        print $IDproduct->categorie;
        ?>
 had u gewenst?</h1>
                <form action="index.php" method="get">
                    <input type="hidden" name="page" value="bestelling">
                    <input type="hidden" name="product" value="<?php 
        print $IDproduct->id;
        ?>