$tfDao = new TimeFrameDao($em); ?> <div class="row"> <table class="table table-striped"> <thead> <tr> <th>#</th> <th>Début</th> <th>Statut</th> <th>Action</th> </tr> </thead> <tbody> <?php foreach ($tfDao->getAll() as $tf) { ?> <tr> <td><?php echo $tf->getId(); ?> </td> <td><?php echo $tf->getStart(); ?> </td> <td><?php echo $tf->getStatus() == 1 ? 'Actif' : 'Inactif'; ?> </td> <td>
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(); if ($refDate > (new DateTime())->setTime(STARTBOOKINGHOUR, STARTBOOKINGMINUTE)) { $refDate->add(new DateInterval('P1D')); } //get all order in time window $todayMealOrder = $MealOrderDao->getCurrentMealOrder();