/* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* Date: 04/10/2015 17:41 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\model\Course; use MealBooker\models\dao\CourseDao; use MealBooker\models\dao\DessertDao; use MealBooker\models\dao\DrinkDao; use MealBooker\models\dao\OrderDao; use MealBooker\models\dao\TimeFrameDao; use MealBooker\utils\Utils; $courseDao = new CourseDao($em); $drinkDao = new DrinkDao($em); $dessertDao = new DessertDao($em); $timeFrameDao = new TimeFrameDao($em); $MealOrderDao = new OrderDao($em); //if no ID go to home if (!isset($_GET['courseID'])) { header("location:" . WEB_PATH); } /** @var $course Course */ $course = $courseDao->getByPrimaryKey($_GET['courseID']); $message = null; //if no course found go to home if ($course == null) { header("location:" . WEB_PATH); } $orderEnable = true; if (!Utils::isOrderEnable()) {
/* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* Date: 04/10/2015 17:41 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\model\Location; use MealBooker\models\dao\CourseDao; use MealBooker\models\dao\DessertDao; use MealBooker\models\dao\DrinkDao; use MealBooker\models\dao\LocationDao; 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); //prepare new value $mealCart = new stdClass(); $mealCart->cart = []; //get value from cookie if cookie already set if (isset($_SESSION['mealCart'])) { $mealCart = json_decode($_SESSION['mealCart']); } //add new value in cookie if ($_POST && isset($_POST['course']) && isset($_POST['ts'])) { //search for doubloon $found = false; foreach ($mealCart->cart as $stockedMeal) { if ($stockedMeal->id == $_POST['ts']) {
<?php /*-----------------------------------------------------*/ /* _____ _ ___ ___ */ /* | __ \ | | |__ \ / _ \ */ /* | |__) |___ ___| |_ _ _ ___ ) | (_) | */ /* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* Date: 15/10/2015 23:55 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\models\dao\DessertDao; use MealBooker\utils\Utils; $dessertDao = new DessertDao($em); ?> <div class="row"> <table class="table table-striped"> <thead> <tr> <th>#</th> <th>Nom</th> <th>Créé le</th> <th>Statut</th> <th>Action</th> </tr> </thead> <tbody> <?php
/* | __ \ | | |__ \ / _ \ */ /* | |__) |___ ___| |_ _ _ ___ ) | (_) | */ /* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* Date: 15/10/2015 23:55 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\manager\SecurityManager; use MealBooker\model\Dessert; use MealBooker\models\dao\DessertDao; if (!SecurityManager::get()->getCurrentUser($_SESSION)->isAdmin()) { header('Location:' . WEB_PATH); } $dessertDao = new DessertDao($em); //save mode if (isset($_POST['name']) && isset($_POST['desc']) && isset($_POST['id']) && isset($_POST['state'])) { $dessert = $dessertDao->getByPrimaryKey($_POST['id']); if ($dessert == null) { $dessert = new Dessert(); } $dessert->setName($_POST['name']); $dessert->setDescription($_POST['desc']); $dessert->setStatus($_POST['state']); $dessertDao->save($dessert); header('Location:' . WEB_PATH . '?page=admin&tab=dessert'); } //view Mode if (isset($_GET['id'])) { $dessert = $dessertDao->getByPrimaryKey($_GET['id']);
/* 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(); } //set ref date for display $refDate = new DateTime();