use WijnshopTest\Business\VerpakkingService;
require_once "Bootstrap.php";
require_once "Libraries/Twig/AutoLoader.php";
//error_reporting(0); // Of php.ini aanpassen : error_reporting
session_start();
if (isset($_GET["action"])) {
    if (!isset($_SESSION["mandje"])) {
        $_SESSION["mandje"] = array();
        $_SESSION["mandjeVerpak"] = array();
        $_SESSION["totaal"] = 0;
        $_SESSION["aantal"] = 0;
        $_SESSION["aantalVerpak"] = 0;
        $aantal = 0;
        $wijnArray = array();
    }
    $wijnService = new WijnService();
    $wijn = $wijnService->getSelectWijn($_GET["id"]);
    $verpakService = new VerpakkingService();
    $verpak = $verpakService->getVerpakOverzicht();
    $idWijn = $_GET["id"];
    if ($_GET["action"] == "select") {
        if ($_POST["aantal"] > 0) {
            $wijnId = $_GET["id"];
            $wijnselect = $wijnService->getIdOfWijn($wijnId);
            $aantal = $_POST["aantal"];
            $prijs = $wijnselect->getPrijs();
            $naamWijn = $wijnselect->getNaam();
            $artcode = $wijnService->getArtcodeById($wijnId);
            $subtotaal = $aantal * $prijs;
            $wijnArray["id"] = $wijnId;
            $wijnArray["artcode"] = $artcode;
Example #2
0
<?php

//use \Exceptions\;
//use \Business\Service;
use WijnshopTest\Business\WijnService;
//use WijnshopTest\Data\KlantDAO;
require_once "Bootstrap.php";
require_once "Libraries/Twig/AutoLoader.php";
//$klantDAO = new KlantDAO();
//$klanten = $klantDAO->getAll();
//print_r ($klanten);
session_start();
if (isset($_GET["action"]) && $_GET["action"] == "test") {
    $wijnService = new WijnService();
    $wijn = $wijnService->newWijn($_POST["naam"], $_POST["jaartal"], $_POST["land"], $_POST["cat"], $_POST["image"], $_POST["artcode"], $_POST["prijs"]);
    exit(0);
    if ($wijn) {
        header("location: test.php");
    } else {
        print "ok";
        header("location: test.php");
    }
}
$view = $twig->render("Test.twig", array());
print $view;
Example #3
0
<?php

session_start();
use WijnshopTest\Business\WijnService;
require_once "Bootstrap.php";
require_once "Libraries/Twig/AutoLoader.php";
if (!isset($_SESSION["winkelmandje"])) {
    $_SESSION["winkelmandje"] = array();
    $_SESSION["totaalFles"] = 0;
}
$wijnService = new WijnService();
$wijnen = "";
$prijsfles = 0;
//&& $_GET["action"] == "keuze")
if (isset($_GET["action"])) {
    $wijnen = $wijnService->getSelectWijn($_GET["id"]);
    if (isset($_POST["submit"])) {
        $wijnen = $wijnService->getIdOfWijn($_GET["id"]);
        $_SESSION["winkelmandje"] = $wijnen;
        $prijsfles = $_GET["name"];
        $aantalfles = $_POST["aantal"];
        $wijn = $wijnen;
        if ($aantalfles <= 0) {
            print "geen negatief";
            print " of geen invoer";
        } else {
            $prijswijn = $aantalfles * $prijsfles;
            $_SESSION["totaalFles"] += $prijswijn;
            $_SESSION["winkelmandje"] = $wijnService->insertwinkelmandje($wijn, $aantalfles, $_SESSION["winkelmandje"]);
            print_r($_SESSION["winkelmandje"]);
            //header("location:");
Example #4
0
<?php

//WijnProject/index.php
use WijnshopTest\Business\WijnService;
require_once "Bootstrap.php";
require_once "Libraries/Twig/AutoLoader.php";
//error_reporting(0); // Of php.ini aanpassen : error_reporting
session_start();
$wijnService = new WijnService();
$wijnen = $wijnService->getWijnOverzicht();
if (isset($_GET["action"]) && $_GET["action"] == "select") {
    $keuze = $_GET["keuze"];
    header("location: product.php?action=select&keuze={$keuze}");
    exit(0);
}
$view = $twig->render("Home.twig", array("wijnen" => $wijnen));
print $view;
Example #5
0
<?php

use WijnshopTest\Business\WijnService;
use WijnshopTest\Data\WijnDAO;
require_once "Bootstrap.php";
require_once "Libraries/Twig/AutoLoader.php";
session_start();
$winDao = new WijnDAO();
$wijnService = new WijnService();
$wijnen = "";
$titel = "";
if (isset($_GET["action"]) && $_GET["action"] == "select") {
    if (isset($_GET["wijn"])) {
        $wijn = $_GET["wijn"];
        $wijnen = $wijnService->getOverzichtByCat($wijn);
        $titel = $wijn;
    } else {
        $titel = "";
    }
    if (isset($_GET["land"])) {
        $land = $_GET["land"];
        $wijnen = $wijnService->getOverzichtByLand($land);
        $titel = $land;
    } else {
        if (isset($_GET["jaar"])) {
            $jaartal = $_GET["jaar"];
            $wijnen = $wijnService->getOverzichtByJaar($jaartal);
            $titel = $jaartal;
        }
    }
}