示例#1
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)) {
示例#2
0
<?php

/*-----------------------------------------------------*/
/*      _____           _               ___   ___      */
/*     |  __ \         | |             |__ \ / _ \     */
/*     | |__) |___  ___| |_ _   _ ___     ) | (_) |    */
/*     |  _  // _ \/ __| __| | | / __|   / / \__, |    */
/*     | | \ \  __/ (__| |_| |_| \__ \  / /_   / /     */
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                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">
示例#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';