Exemple #1
0
 */
$totaalBestellingPrijs = 0;
if (!empty($_SESSION['bestelling'])) {
    $totaalBestellingPrijs = 0;
    foreach ($_SESSION['bestelling'] as $key => $bestelling) {
        /**
         * Array where all orders are stored
         */
        $overzicht[$key]['aantal'] = $bestelling['aantal'];
        foreach ($bestelling as $bestelKey => $bestelRegel) {
            /**
             * Getting 'Brood' list
             */
            if (is_int($bestelKey)) {
                $overzicht[$key]['broodsoort'] = $bestelKey;
                $objBrood = new BroodBusiness();
                //                $bestelKey++;
                $broden = $objBrood->overzichtBroodById($bestelKey);
                $overzicht[$key]['brood_id'] = $broden->getId();
                $overzicht[$key]['brood_naam'] = $broden->getNaam();
                $overzicht[$key]['brood_prijs'] = $broden->getPrijs();
                $overzicht[$key]['brood_image'] = $broden->getImage();
                $overzicht[$key]['totaalBroodPrijs'] = $_SESSION['bestelling'][$key][$broden->getId()]['broodPrijs'];
                //                echo "<pre>";
                //                print_r($_SESSION['bestelling'][$key][$bestelKey]);
                //                echo "</pre>";
            }
            /**
             * Getting 'Beleg' list
             */
            if (is_array($bestelRegel)) {
Exemple #2
0
<?php

session_start();
use src\ProjectBrood\business\BroodBusiness;
use Doctrine\Common\ClassLoader;
require 'head.php';
require_once 'Doctrine/Common/ClassLoader.php';
$classLoader = new ClassLoader("src");
$classLoader->register();
$obj = new BroodBusiness();
$broden = $obj->overzichtBrood();
require_once "lib/Twig/Autoloader.php";
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem("src/ProjectBrood/presentation");
$twig = new Twig_Environment($loader);
$view = $twig->render("brood.twig", array("broden" => $broden, "authorized" => $_SESSION['user']['authorized'], "totaalBestellingPrijs" => $_SESSION['totaalBestellingPrijs']));
print $view;
Exemple #3
0
 */
if (!empty($_GET['id'])) {
    /**
     * Connect with Doctrine.
     * Load ClassLoader to autoload classes.
     */
    require_once 'Doctrine/Common/ClassLoader.php';
    $classLoader = new ClassLoader("src");
    $classLoader->register();
    /**
     * Create 'Beleg' object from BelegBusiness class.
     * Get all 'Beleg' records from database.
     */
    $obj = new BelegBusiness();
    $belegen = $obj->overzichtBeleg();
    $objBrood = new BroodBusiness();
    $broden = $objBrood->overzichtBroodById($_GET['id']);
    /**
     * Connect to Twig.
     * Load beleg.twig file.
     * Send array $belegen and $_GET variable to beleg.twig.
     */
    require_once "lib/Twig/Autoloader.php";
    Twig_Autoloader::register();
    $loader = new Twig_Loader_Filesystem("src/ProjectBrood/presentation");
    $twig = new Twig_Environment($loader);
    $view = $twig->render("beleg.twig", array("self" => $_SERVER['REQUEST_URI'], "belegen" => $belegen, "brood_id" => $_GET['id'], "authorized" => $_SESSION['user']['authorized'], "brood_prijs" => $broden->getPrijs(), "totaalBestellingPrijs" => $_SESSION['totaalBestellingPrijs']));
    print $view;
} else {
    header("Location: index.php");
}