Example #1
0
}
?>
            </tbody>
        </table>

        <div class="timeOptions">
            <?php 
$date = new DateTime();
$after = new DateTime();
$after->setTime(STARTBOOKINGHOUR, STARTBOOKINGMINUTE);
if ($date > $after) {
    $date->add(new DateInterval('P1D'));
}
?>
            <h4>Livraison demain (<?php 
echo \MealBooker\utils\Utils::formatDate($date);
?>
) entre 9h et 11h </h4>

            <!--<select name="timeframe" id="tf" class="required">
                <?php 
foreach ($timeFrameDao->getAllEnabled() as $timeFrame) {
    ?>
                    <option value="<?php 
    echo $timeFrame->getId();
    ?>
"><?php 
    echo $timeFrame->getStart();
    ?>
</option>
                    <?php 
Example #2
0
$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;
if (!Utils::isOrderEnable()) {
    //check time
    $message = "Réservations non disponibles de 18h à 7h du matin";
    $orderEnable = false;
}
?>
<script type="text/javascript">
    $(document).on('click', '#mealForm input[type="submit"]', function (e) {
        e.preventDefault();
        $('#feedback').html('');
        $('#feedback').hide();
        var requiredFree = true;
        var drinkSelected = false;
        var dessertSelected = false;
        if ($('input[name="drink"]:checked').length > 0)
            drinkSelected = true;
Example #3
0
        </thead>
        <tbody>
        <?php 
foreach ($courseDao->getAll() as $course) {
    ?>
            <tr>
                <td><?php 
    echo $course->getId();
    ?>
</td>
                <td><?php 
    echo $course->getName();
    ?>
</td>
                <td><?php 
    echo Utils::formatDate($course->getCreated());
    ?>
</td>
                <td><?php 
    echo $course->getStatus() == 1 ? 'Actif' : 'Inactif';
    ?>
</td>
                <td>
                    <a href="<?php 
    echo WEB_PATH;
    ?>
?page=admin&tab=courseedit&id=<?php 
    echo $course->getId();
    ?>
"><i class="fa fa-edit"></i></a>
                </td>
Example #4
0
            <th>Lieu de livraison</th>
            <th>Composition</th>
            <th>Utilisateur</th>
        </tr>
        </thead>
        <tbody>
        <?php 
foreach ($orderDao->getAll() as $order) {
    ?>
            <tr>
                <td><?php 
    echo sprintf("%04s", $order->getId());
    ?>
</td>
                <td><?php 
    echo Utils::formatDate($order->getCreated(), "d/m/Y H:m");
    ?>
</td>
                <!--<td><?php 
    echo $order->getTimeFrame() != null ? $order->getTimeFrame()->__toString() : "-";
    ?>
</td>-->
                <td><?php 
    echo $order->getLocation() != null ? $order->getLocation()->getName() : "-";
    ?>
</td>
                <td>
                    <ul>
                        <?php 
    foreach ($order->getMeals() as $meal) {
        echo "<li>" . $meal->getCourse()->getName();
Example #5
0
        if ($role == null) {
            throw new Exception("une erreur est survenue");
        }
        $user->setRole($role);
        //set company with validation code
        $company = $companyDao->getByValidationCode($_POST['idEntreprise']);
        if ($company == null) {
            throw new Exception("Code de validation inconnu");
        }
        $user->setCompany($company);
        //set optIn
        if (isset($_POST['optIn'])) {
            $user->setOptIn($_POST['optIn']);
        }
        //use session field to put authToken
        $user->setSession(Utils::generateStringCode());
        $user->setStatus(0);
        //save user
        $userDao->save($user);
        MailManager::get()->sendSignUpMail($user);
        $info = "Un mail vous a été envoyé pour confirmer votre inscription.";
    } catch (Exception $ex) {
        $error = $ex->getMessage();
    }
}
?>
<div class="col-md-6 col-md-offset-3">

    <h2>Bienvenue</h2>

    <p>
Example #6
0
            <th>Date de commande</th>
            <th>Commande</th>
            <th>Lieu</th>
        </tr>
        </thead>
        <tbody>
        <?php 
foreach ($user->getOrders() as $mealOrder) {
    ?>
            <tr>
                <td><?php 
    echo $mealOrder->getId();
    ?>
</td>
                <td><?php 
    echo Utils::formatDate($mealOrder->getCreated());
    ?>
</td>
                <td>
                    <ul>
                        <?php 
    foreach ($mealOrder->getMeals() as $meal) {
        echo "<li>" . $meal->getCourse()->getName();
        if ($meal->getDrink() != null) {
            echo " - " . $meal->getDrink()->getName();
        }
        if ($meal->getDessert() != null) {
            echo " - " . $meal->getDessert()->getName();
        }
        echo " </li>";
    }
Example #7
0
        </thead>
        <tbody>
        <?php 
foreach ($dessertDao->getAll() as $dessert) {
    ?>
            <tr>
                <td><?php 
    echo $dessert->getId();
    ?>
</td>
                <td><?php 
    echo $dessert->getName();
    ?>
</td>
                <td><?php 
    echo Utils::formatDate($dessert->getCreated());
    ?>
</td>
                <td><?php 
    echo $dessert->getStatus() == 1 ? 'Actif' : 'Inactif';
    ?>
</td>
                <td>
                    <a href="<?php 
    echo WEB_PATH;
    ?>
?page=admin&tab=dessertedit&id=<?php 
    echo $dessert->getId();
    ?>
"><i class="fa fa-edit"></i></a>
                </td>
Example #8
0
        </thead>
        <tbody>
        <?php 
foreach ($drinkDao->getAll() as $drink) {
    ?>
            <tr>
                <td><?php 
    echo $drink->getId();
    ?>
</td>
                <td><?php 
    echo $drink->getName();
    ?>
</td>
                <td><?php 
    echo Utils::formatDate($drink->getCreated());
    ?>
</td>
                <td><?php 
    echo $drink->getStatus() == 1 ? 'Actif' : 'Inactif';
    ?>
</td>
                <td>
                    <a href="<?php 
    echo WEB_PATH;
    ?>
?page=admin&tab=drinkedit&id=<?php 
    echo $drink->getId();
    ?>
"><i class="fa fa-edit"></i></a>
                </td>
Example #9
0
            foreach ($timeFrames as $tf) {
                $var = $order->getTimeFrame() == $tf ? 1 : 0;
                $courses[$meal->getCourse()->getId()][$tf->getStart()] = $var;
            }
        }
    }
    array_push($timeFramesOrder[$order->getTimeFrame()->getStart()], $order);
}
?>

<h3>
    <!--Commande du jour --><?php 
/*echo sizeof($todayMealOrder) . "/" . $mealPerDay */
?>
    <small class="pull-right"><?php 
echo Utils::formatDate($refDate);
?>
</small>
</h3>
<div class="clearfix"></div>
<div class="table-responsive">
    <table class="table table-striped">
        <thead>
        <tr>
            <th>#</th>
            <th>Utilisateur</th>
            <th>Composition</th>
            <th>Livraison</th>
        </tr>
        </thead>
        <tbody>
Example #10
0
    ?>
</td>
                <td><?php 
    echo $user->getFormattedName();
    ?>
</td>
                <td><?php 
    echo $user->getMail();
    ?>
</td>
                <td><?php 
    echo $user->getPhoneNumber();
    ?>
</td>
                <td><?php 
    echo Utils::formatDate($user->getCreated());
    ?>
</td>
                <td><?php 
    echo $user->getCompany();
    ?>
</td>
                <td><?php 
    echo $user->isOptIn() ? "Oui" : "Non";
    ?>
</td>
                <td><?php 
    echo $user->getRole()->getName();
    ?>
</td>
                <td><?php 
Example #11
0
/*                 All right reserved                  */
/*-----------------------------------------------------*/
use MealBooker\manager\MailManager;
use MealBooker\manager\SecurityManager;
use MealBooker\models\dao\UserDao;
$mod = "QUERY";
if (isset($_POST['email']) && sizeof($_POST['email']) > 0) {
    //query token
    try {
        $email = $_POST['email'];
        $userDao = new UserDao($em);
        $user = $userDao->getUserByMail($email);
        if ($user == null) {
            throw new Exception("Adresse Email inconnue");
        } else {
            $user->setRestoreToken(\MealBooker\utils\Utils::generateStringCode());
            $userDao->save($user);
            MailManager::get()->sendRestorePasswordMail($user);
            $message = 'Un E-mail vous a été envoyé pour réaliser la restauration de votre mot de passe';
        }
    } catch (Exception $ex) {
        $error = $ex->getMessage();
    }
} else {
    if (isset($_POST['restorepassword']) && sizeof($_POST['restorepassword']) > 0 && isset($_POST['token']) && sizeof($_POST['token']) > 0) {
        //token and new password validation
        try {
            $password = $_POST['restorepassword'];
            $token = $_POST['token'];
            $userDao = new UserDao($em);
            $user = $userDao->getByRestoreToken($token);