/* | |__) |___ ___| |_ _ _ ___ ) | (_) | */ /* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* 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); }
/*-----------------------------------------------------*/ /* _____ _ ___ ___ */ /* | __ \ | | |__ \ / _ \ */ /* | |__) |___ ___| |_ _ _ ___ ) | (_) | */ /* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* Date: 04/10/2015 17:41 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\model\Course; use MealBooker\models\dao\CourseDao; use MealBooker\models\dao\OrderDao; $courseDao = new CourseDao($em); $MealOrderDao = new OrderDao($em); ?> <article class="course"> <?php /** * @var $course Course **/ $courses = $courseDao->getAllEnabled(); for ($i = 0; $i < sizeof($courses); $i++) { $course = $courses[$i]; if ($i % 2 == 0) { if ($i > 0) { echo '</div>'; } if ($i < sizeof($courses)) {
/* | __ \ | | |__ \ / _ \ */ /* | |__) |___ ___| |_ _ _ ___ ) | (_) | */ /* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* 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;
<?php /*-----------------------------------------------------*/ /* _____ _ ___ ___ */ /* | __ \ | | |__ \ / _ \ */ /* | |__) |___ ___| |_ _ _ ___ ) | (_) | */ /* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* Date: 15/10/2015 23:55 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\models\dao\CourseDao; use MealBooker\utils\Utils; $courseDao = new CourseDao($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 foreach ($courseDao->getAll() as $course) {
/* | __ \ | | |__ \ / _ \ */ /* | |__) |___ ___| |_ _ _ ___ ) | (_) | */ /* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* Date: 15/10/2015 23:55 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\manager\SecurityManager; use MealBooker\model\Course; use MealBooker\models\dao\CourseDao; if (!SecurityManager::get()->getCurrentUser($_SESSION)->isAdmin()) { header('Location:' . WEB_PATH); } $courseDao = new CourseDao($em); $error = null; $info = null; //save mode if (isset($_POST['name']) && isset($_POST['desc']) && isset($_POST['shortDesc']) && isset($_POST['id']) && isset($_POST['state'])) { $course = $courseDao->getByPrimaryKey($_POST['id']); if ($course == null) { $course = new Course(); } $course->setName($_POST['name']); $course->setShortDescription($_POST['shortDesc']); $course->setDescription($_POST['desc']); $course->setStatus($_POST['state']); if (isset($_POST['nb'])) { $course->setNbPerDay($_POST['nb']); }
/* Date: 04/10/2015 17:41 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\manager\MailManager; use MealBooker\manager\SecurityManager; 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));
/* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* 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(); }
<?php /*-----------------------------------------------------*/ /* _____ _ ___ ___ */ /* | __ \ | | |__ \ / _ \ */ /* | |__) |___ ___| |_ _ _ ___ ) | (_) | */ /* | _ // _ \/ __| __| | | / __| / / \__, | */ /* | | \ \ __/ (__| |_| |_| \__ \ / /_ / / */ /* |_| \_\___|\___|\__|\__,_|___/ |____| /_/ */ /* */ /* Date: 02/05/2016 23:10 */ /* All right reserved */ /*-----------------------------------------------------*/ use MealBooker\model\Course; use MealBooker\models\dao\CourseDao; $courseDao = new CourseDao($em); ?> <div class="row courseGallery"> <?php /** * @var $courseArray Course[] */ $courseArray = $courseDao->getAllEnabled(); if (sizeof($courseArray) > 0) { ?> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <?php