Esempio n. 1
0
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();
$timeFramesOrder = [];
foreach ($timeFrames as $tf) {
    $timeFramesOrder[$tf->getStart()] = [];
}
$drinks = [];
Esempio n. 2
0
/*-----------------------------------------------------*/
/*      _____           _               ___   ___      */
/*     |  __ \         | |             |__ \ / _ \     */
/*     | |__) |___  ___| |_ _   _ ___     ) | (_) |    */
/*     |  _  // _ \/ __| __| | | / __|   / / \__, |    */
/*     | | \ \  __/ (__| |_| |_| \__ \  / /_   / /     */
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                Date: 15/10/2015 23:55               */
/*                 All right reserved                  */
/*-----------------------------------------------------*/
use MealBooker\models\dao\ConfigDao;
$configDao = new ConfigDao($em);
if (isset($_POST['state'])) {
    $state = $configDao->getByKey('serverstate');
    $state->setValue($_POST['state']);
    $configDao->save($state);
}
?>
<div class="row">
    <?php 
$state = $configDao->getByKey('serverstate');
if ($state != null) {
    $state = $state->getValue();
}
?>
    <form action="#" method="post">
        Etat de la boutique :
        <select name="state">
            <option value="0" <?php 
Esempio n. 3
0
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                Date: 23/09/2015                     */
/*                 All right reserved                  */
/*-----------------------------------------------------*/
use MealBooker\manager\SecurityManager;
use MealBooker\model;
use MealBooker\models\dao\ConfigDao;
error_reporting(E_ALL);
require_once '../config/global.php';
require_once '../vendor/phpmailer/phpmailer/PHPMailerAutoload.php';
$configDao = new ConfigDao($em);
//here check connection to dbserver
$maintenance = !$em->getConnection()->ping();
//check maintenance mod
if ($configDao->getByKey('serverState') != null && $configDao->getByKey('serverState')->getValue() == '0' && !SecurityManager::get()->isAdmin($_SESSION)) {
    $maintenance = true;
}
?>
    <!DOCTYPE html>
    <html>
    <?php 
include 'head.php';
?>
    <body>
    <?php 
include 'header.php';
?>
    <div class="main container">
        <div class="row">
            <?php