Exemplo n.º 1
0
use MealBooker\model\Location;
use MealBooker\model\Meal;
use MealBooker\model\MealOrder;
use MealBooker\models\dao\CourseDao;
use MealBooker\models\dao\DessertDao;
use MealBooker\models\dao\DrinkDao;
use MealBooker\models\dao\LocationDao;
use MealBooker\models\dao\MealDao;
use MealBooker\models\dao\OrderDao;
use MealBooker\models\dao\TimeFrameDao;
$courseDao = new CourseDao($em);
$drinkDao = new DrinkDao($em);
$dessertDao = new DessertDao($em);
$timeFrameDao = new TimeFrameDao($em);
$locationDao = new LocationDao($em);
$orderDao = new OrderDao($em);
$mealDao = new MealDao($em);
//if no cart or not logged in
if (!isset($_SESSION['mealCart']) || !isset($_POST['location'])) {
    header('Location : ' . WEB_PATH);
    exit;
}
$mealCart = json_decode($_SESSION['mealCart']);
if (sizeof($mealCart->cart) > 0) {
    $order = new MealOrder();
    $order->setUser(SecurityManager::get()->getCurrentUser($_SESSION));
    //set time fram if provide
    //$timeframe = $timeFrameDao->getByPrimaryKey($_POST['timeframe']);
    //if ($timeframe != null)
    //    $order->setTimeFrame($timeframe);
    //set location
Exemplo n.º 2
0
<?php

/*-----------------------------------------------------*/
/*      _____           _               ___   ___      */
/*     |  __ \         | |             |__ \ / _ \     */
/*     | |__) |___  ___| |_ _   _ ___     ) | (_) |    */
/*     |  _  // _ \/ __| __| | | / __|   / / \__, |    */
/*     | | \ \  __/ (__| |_| |_| \__ \  / /_   / /     */
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                Date: 15/10/2015 23:55               */
/*                 All right reserved                  */
/*-----------------------------------------------------*/
use MealBooker\models\dao\OrderDao;
use MealBooker\utils\Utils;
$orderDao = new OrderDao($em);
?>
<div class="row">
    <table class="table table-striped">
        <thead>
        <tr>
            <th>#</th>
            <th>Date de réservation</th>
            <!--<th>Horaire</th>-->
            <th>Lieu de livraison</th>
            <th>Composition</th>
            <th>Utilisateur</th>
        </tr>
        </thead>
        <tbody>
        <?php 
Exemplo n.º 3
0
/*     | | \ \  __/ (__| |_| |_| \__ \  / /_   / /     */
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                Date: 15/10/2015 23:55               */
/*                 All right reserved                  */
/*-----------------------------------------------------*/
use MealBooker\model\TimeFrame;
use MealBooker\models\dao\ConfigDao;
use MealBooker\models\dao\CourseDao;
use MealBooker\models\dao\DrinkDao;
use MealBooker\models\dao\OrderDao;
use MealBooker\models\dao\DessertDao;
use MealBooker\models\dao\TimeFrameDao;
use MealBooker\utils\Utils;
$configDao = new ConfigDao($em);
$MealOrderDao = new OrderDao($em);
$courseDao = new CourseDao($em);
$drinkDao = new DrinkDao($em);
$dessertDao = new DessertDao($em);
$timeFrameDao = new TimeFrameDao($em);
$mealPerDay = 40;
/** @var TimeFrame[] $timeFrames */
$timeFrames = [];
foreach ($timeFrameDao->getAll() as $tf) {
    if ($tf->getStatus() == 1) {
        array_push($timeFrames, $tf);
    }
}
$config = $configDao->getByKey('mealPerDay');
if (isset($config)) {
    $mealPerDay = $config->getValue();