コード例 #1
0
ファイル: meal.php プロジェクト: rectus29/mealBooker
/*     |  _  // _ \/ __| __| | | / __|   / / \__, |    */
/*     | | \ \  __/ (__| |_| |_| \__ \  / /_   / /     */
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                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;
コード例 #2
0
ファイル: cart.php プロジェクト: rectus29/mealBooker
/*     | |__) |___  ___| |_ _   _ ___     ) | (_) |    */
/*     |  _  // _ \/ __| __| | | / __|   / / \__, |    */
/*     | | \ \  __/ (__| |_| |_| \__ \  / /_   / /     */
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                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) {
コード例 #3
0
ファイル: drink.php プロジェクト: rectus29/mealBooker
<?php

/*-----------------------------------------------------*/
/*      _____           _               ___   ___      */
/*     |  __ \         | |             |__ \ / _ \     */
/*     | |__) |___  ___| |_ _   _ ___     ) | (_) |    */
/*     |  _  // _ \/ __| __| | | / __|   / / \__, |    */
/*     | | \ \  __/ (__| |_| |_| \__ \  / /_   / /     */
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                Date: 15/10/2015 23:55               */
/*                 All right reserved                  */
/*-----------------------------------------------------*/
use MealBooker\models\dao\DrinkDao;
use MealBooker\utils\Utils;
$drinkDao = new DrinkDao($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 
コード例 #4
0
ファイル: drinkEdit.php プロジェクト: rectus29/mealBooker
/*     | |__) |___  ___| |_ _   _ ___     ) | (_) |    */
/*     |  _  // _ \/ __| __| | | / __|   / / \__, |    */
/*     | | \ \  __/ (__| |_| |_| \__ \  / /_   / /     */
/*     |_|  \_\___|\___|\__|\__,_|___/ |____| /_/      */
/*                                                     */
/*                Date: 15/10/2015 23:55               */
/*                 All right reserved                  */
/*-----------------------------------------------------*/
use MealBooker\manager\SecurityManager;
use MealBooker\model\Course;
use MealBooker\model\Drink;
use MealBooker\models\dao\DrinkDao;
if (!SecurityManager::get()->getCurrentUser($_SESSION)->isAdmin()) {
    header('Location:' . WEB_PATH);
}
$drinkDao = new DrinkDao($em);
//save mode
if (isset($_POST['name']) && isset($_POST['desc']) && isset($_POST['id']) && isset($_POST['state'])) {
    $drink = $drinkDao->getByPrimaryKey($_POST['id']);
    if ($drink == null) {
        $drink = new Drink();
    }
    $drink->setName($_POST['name']);
    $drink->setDescription($_POST['desc']);
    $drink->setStatus($_POST['state']);
    $drinkDao->save($drink);
    header('Location:' . WEB_PATH . '?page=admin&tab=drink');
}
//view Mode
if (isset($_GET['id'])) {
    $drink = $drinkDao->getByPrimaryKey($_GET['id']);
コード例 #5
0
ファイル: dash.php プロジェクト: rectus29/mealBooker
/*                                                     */
/*                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