Ejemplo n.º 1
0
<?php

use Nostromo\Classes\Exception\AccessDeniedException;
use Nostromo\Classes\Exception\NotConnectedException;
use Nostromo\Models\MConnexion as Connexion;
use Nostromo\Models\MReservation;
$action = array_key_exists('action', $_REQUEST) ? $_REQUEST['action'] : 'voirReservation';
try {
    if (!Connexion::sessionOuverte()) {
        throw new NotConnectedException();
    }
} catch (NotConnectedException $e) {
    Connexion::setFlashMessage($e->getMessage());
    header('?page=connexion');
    echo "<script>window.location.replace('?page=connexion')</script>";
    exit;
}
switch ($action) {
    case 'voirReservation':
        require_once ROOT . 'src/Views/MaReservation/v_VoirReservation.php';
        break;
    case 'annulerReservation':
        if (array_key_exists('Reservation', $_SESSION)) {
            unset($_SESSION['Reservation']);
            $_SESSION['valid'] = 'Réservation annulée avec succès.';
        }
        header('Location:?page=maReservation');
        break;
    case 'validerReservation':
        try {
            if (array_key_exists('Reservation', $_SESSION)) {
Ejemplo n.º 2
0
                             src="<?php 
        echo $unArt->getUrl();
        ?>
"
                             title="Article n°<?php 
        echo $unArt->getNumArt();
        ?>
">
                    </a>
                <?php 
    }
    ?>

                <div class="caption">
                    <?php 
    if (Connexion::sessionOuverte() && $unArt->getQteStock() > 0) {
        ?>
                        <h4 class="text-center">
                            <a href="?page=materiel&action=voirArticle&article=<?php 
        echo $unArt->getNumArt();
        ?>
">
                                <?php 
        echo $unArt->getDesignation();
        ?>
                            </a>
                        </h4>
                        <?php 
    } else {
        echo '<h4 class="text-center">' . $unArt->getDesignation();
        if ($unArt->getQteStock() === 0) {