Exemplo n.º 1
0
 public static function getChoixByIns($idInscription)
 {
     $conn = Main::bdd();
     try {
         $reqPrepare = $conn->prepare("SELECT *,c.prioriteChoix as Priorite FROM seance as s\n                INNER JOIN spectacle as spec ON spec.idSpectacle = s.idSpectacle\n                INNER JOIN choix as c ON c.idSpectacle = spec.idSpectacle\n                WHERE c.idInscription = ?\n                ORDER BY Priorite");
         $reqPrepare->execute(array($idInscription));
         return $reqPrepare;
     } catch (\PDOException $e) {
         throw new \Exception($e->getMessage());
     }
 }
Exemplo n.º 2
0
 /**
  * Récupère tous les utilisateurs
  * @return Collection Utilisateurs
  * @throws \Exception
  */
 public static function getUsers()
 {
     $conn = Main::bdd();
     $reqPrepare = $conn->query("SELECT * FROM admin");
     $tabs = $reqPrepare->fetchAll();
     $coll = new Collection();
     foreach ($tabs as $tab) {
         $utilisateur = new Utilisateur($tab['code_user'], $tab['login'], $tab['password']);
         $coll->ajouter($utilisateur);
     }
     return $coll;
 }
Exemplo n.º 3
0
 public static function getSeanceByIns($idInscription)
 {
     $conn = Main::bdd();
     $lesSeances = new Collection();
     try {
         $reqPrepare = $conn->prepare("SELECT choix.idInscription, spectacle.idSpectacle, seance.idSeance, seance.idLieu, seance.date_heure, choix.prioriteChoix\n            FROM choix\n            INNER JOIN spectacle ON choix.idSpectacle = spectacle.idSpectacle\n            INNER JOIN seance ON seance.idSeance = spectacle.idSpectacle\n\n            WHERE choix.idInscription = ?\n            ORDER BY choix.prioriteChoix");
         $reqPrepare->execute(array($idInscription));
         $tabs = $reqPrepare->fetchAll();
         foreach ($tabs as $tab) {
             $spectacle = MSpectacle::getSpectacleById($tab['idSpectacle']);
             $inscription = MInscription::getInscriptionByIdInscription($idInscription);
             $lieu = MLieu::getLieuById($tab['idLieu']);
             $seance = new Seance($tab['idSeance'], $spectacle, new \DateTime($tab['date_heure']), $lieu);
             $choix = MChoix::getChoixBySub($inscription);
             $lesSeances->ajouter($seance);
         }
     } catch (\PDOException $e) {
         throw new \Exception($e->getMessage());
     }
     return $lesSeances;
 }
Exemplo n.º 4
0
            $message_html = "<html><head><meta charset='UTF-8'></head><body>Bonjour,<br><br>\n        Nous avons bien reçu l'inscription de votre classe pour la\n        saison spectacles du Kiosque.<br>\n        Nous vous remercions pour votre contribution\n        et espérons vivement pouvoir vous donner entière satisfaction.<br>\n        Valérie Martin reste à votre disposition pour tout complèment d'information.\n        N'hésitez pas à la contacter, par mail de préférence à v.martin@kiosque-mayenne.org\n        ou par téléphone au 02 43 30 10 16.<br>Voici le récapitulatif de votre demande : <br>\n        <br><strong>Etablissment</strong> :<br>Nom : " . $_SESSION['ecole']->getNom() . "<br>Adresse 1 : " . $_SESSION['ecole']->getAdresse() . "<br>\n        Code postal : " . $_SESSION['ecole']->getCp() . "<br>Ville : " . $_SESSION['ecole']->getVille() . "<br>T�l�phone : " . $_SESSION['ecole']->getDirecteur()->getTel() . "<br>\n        Mail : " . $_SESSION['ecole']->getMailDirecteur() . "<br><br><strong>Chef d'Etablissement</strong> : <br>\n        Civilité : " . $_SESSION['enseignant']->getCivilite() . "<br>Nom : " . $_SESSION['enseignant']->getNom() . "<br>Prénom : " . $_SESSION['enseignant']->getPrenom() . "<br>Facture libellée à : " . $_SESSION['facture'] . "<br>\n        <br><br><strong>Enseignant</strong> : <br>\n        Civilité : " . $_SESSION['enseignant']->getCivilite() . "<br>Nom : " . $_SESSION['enseignant']->getNom() . "<br>Prénom : " . $_SESSION['enseignant']->getPrenom() . "<br>Téléphone : " . $_SESSION['enseignant']->getTel() . "<br>\n        Mail : " . $_SESSION['enseignant']->getMail() . "<br>Classe : " . $classes . "<br>Divers : " . $_SESSION['divers'] . "<br>Elèves : " . $_SESSION['nbrEleve'] . "<br>Accompagnateurs : " . $_SESSION['nbrAccom'] . "<br>\n        <br><strong>Choix : </strong><br>\n        Premier choix : " . $_SESSION['choix1'] . "<br>Deuxième choix : " . $_SESSION['choix2'] . "<br>Troisième choix : " . $_SESSION['choix3'] . "<br>\n        <br>A très bientôt.<br>\n        L'équipe du Kiosque.</body></html>";
            // ====
            // === Sujet mail
            $sujet = "Confirmation demande d'inscription - Le Kiosque";
            // ===
            // Cr�ation message HTML
            $message = $passage_ligne . $message_html . $passage_ligne;
            // =======
            //=====Envoi de l'e-mail.
            mail($mail, $sujet, $message, $header);
            mail('*****@*****.**', $sujet, $message, $header);
            $bla = $_SESSION['enseignant']->getMail();
            // === Mail si difff�rent du mail de �tablissement de celui du responsable
            if ($_SESSION['enseignant']->getMail() && $_SESSION['enseignant']->getMail() != $_SESSION['ecole']->getMailDirecteur() && $_SESSION['enseignant']->getMail() != "" && $_SESSION['enseignant']->getMail() != null) {
                // ==== Cr�ation header mail
                $header = "From: kiosque-noreply@kiosque-mayenne.org" . $passage_ligne;
                $header .= "Reply-to: \"" . $_SESSION['nomEcole'] . "\" " . $_SESSION['mailEns'] . $passage_ligne;
                $header .= "MIME-Version: 1.0" . $passage_ligne;
                $header .= 'Content-Type: text/html; charset=iso-8859-1' . $passage_ligne;
                $header .= "Content-Transfer-Encoding: 8bit" . $passage_ligne;
                // ====
                utf8_encode($message);
                mail($bla, $sujet, $message, $header);
                // ===
            }
            require_once ROOT . 'views/inscriptionEcole/v_Fin.php';
        } catch (\Exception $e) {
            Main::setFlashMessage($e->getMessage(), "error");
        }
        break;
}
Exemplo n.º 5
0
 /**
  * Supprime un spectacle
  * @param Spectacle $spectacle
  * @throws \Exception
  */
 public static function rmSpectacle(Spectacle $spectacle)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         MSaison::rmSaisonSpectacle($spectacle);
         foreach ($spectacle->getLesSeances()->getCollection() as $seance) {
             MPlanning::rmPlanningbySeance($seance);
         }
         MSeance::rmSeancesSpec($spectacle);
         $reqPrepare = $conn->prepare("DELETE FROM spectacle WHERE idSpectacle = ?");
         $reqPrepare->execute(array($spectacle->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception("Le spectacle " . $spectacle->getId() . " n'a pas pu être supprimé. Détails : <p>" . $e->getMessage() . "</p>");
     }
 }
Exemplo n.º 6
0
} else {
    ?>
                        <a href="?uc=connexionCL">Collège Lycée</a> <?php 
}
?>
                </li>
                <?php 
if (Main::connexionExistante()) {
    ?>
                    <li><a href="?uc=admin&action=voirAdmin">Administration</a></li>
                <?php 
}
?>
            </ul>
            <?php 
if (Main::connexionExistante()) {
    ?>
                <ul class="nav navbar-nav pull-right">
                    <li><a type="button" href="?uc=connexion&action=logout">Déconnexion</a></li>
                </ul>
            <?php 
}
?>
        </div>
    </div>
</nav>
<div class="container taille">
    <?php 
if (isset($_GET['uc'])) {
    switch ($_GET['uc']) {
        case 'index':
Exemplo n.º 7
0
?>
<!-- Alerte error -->
<?php 
if (isset($_SESSION['error'])) {
    ?>
    <div class="alert alert-danger" role="alert">
        <?php 
    echo $_SESSION['error'];
    ?>
    </div>
<?php 
}
?>
<h1 class="text-justify">
    Bienvenue sur le site d'inscription du Kiosque.
</h1>
<a href="?uc=connexion" class="btn btn-link">Accéder au formulaire d'inscription Jeune Public</a>
<a href="?uc=connexionCL" class="btn btn-link">Accéder au formulaire d'inscription Collège Lycée</a>



<?php 
if (isset($_SESSION['error'])) {
    unset($_SESSION['error']);
}
if (isset($_SESSION['valid'])) {
    unset($_SESSION['valid']);
}
if (Main::connexionExistantePublic()) {
    session_destroy();
}
Exemplo n.º 8
0
 /**
  * Ajoute la séance et l'inscription au planning
  * @param Planning $unPlanning
  * @throws \Exception
  */
 public static function addUnPlanning(Planning $unPlanning)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         $reqPrepare = $conn->prepare("INSERT INTO planning (idSeance, idInscription) VALUES (?,?)");
         $reqPrepare->execute(array($unPlanning->getSeance()->getId(), $unPlanning->getInscription()->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception("L'ajout du planning a échoué. Détails : <p>" . $e->getMessage() . "</p>");
     }
 }
Exemplo n.º 9
0
 /**
  * Supprime un enseignant et ses inscriptions en cascade
  * @param Enseignant $enseignant
  * @throws \Exception
  */
 public static function rmEnseignant(Enseignant $enseignant)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         foreach ($enseignant->getLesInscriptions()->getCollection() as $inscription) {
             $reqPrepare = $conn->prepare("DELETE FROM choix WHERE idInscription = ?");
             $reqPrepare->execute(array($inscription->getId()));
         }
         $reqPrepare = $conn->prepare("DELETE FROM inscription WHERE idEns = ?");
         $reqPrepare->execute(array($enseignant->getId()));
         $reqPrepare = $conn->prepare("DELETE FROM enseignant WHERE idEns = ?");
         $reqPrepare->execute(array($enseignant->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception("L'enseignant " . $enseignant->getId() . " n'a pas pu être supprimé. Détails : <p>" . $e->getMessage() . "</p>");
     }
 }
Exemplo n.º 10
0
 /**
  * Modifie un lieu
  * @param Lieu $lieu
  * @throws \Exception
  */
 public static function editLieu(Lieu $lieu)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         $reqPrepare = $conn->prepare("UPDATE lieu SET nomLieu = ?, adrLieu = ?, cpLieu = ?, villeLieu = ? WHERE idLieu = ?");
         $reqPrepare->execute(array($lieu->getNom(), $lieu->getAdresse(), $lieu->getCp(), $lieu->getVille(), $lieu->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception("Le lieu " . $lieu->getId() . " n'a pas pu être modifié. Détails : <p>" . $e->getMessage() . "</p>");
     }
 }
Exemplo n.º 11
0
 /**
  * Supprime une école et ses enseignant en cascade
  * @param Ecole $ecole
  * @throws \Exception
  */
 public static function rmEcole(Ecole $ecole)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         $reqPrepare = $conn->prepare("DELETE FROM enseignant WHERE idEcole = ?");
         $reqPrepare->execute(array($ecole->getId()));
         $reqPrepare = $conn->prepare("DELETE FROM ecole WHERE idEcole = ?");
         $reqPrepare->execute(array($ecole->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception("L'école " . $ecole->getId() . " n'a pas pu être supprimée. Détails : <p>" . $e->getMessage() . "</p>");
     }
 }
Exemplo n.º 12
0
        try {
            if (Main::connexionExistantePublic()) {
                echo '<script>document.location.href ="?uc=jp&action=choisirTypeEcole"</script>';
            }
            if (isset($_POST['login'])) {
                $pwd = sha1($_POST['password']);
                if (strtolower($_POST['login']) == "jeunepublic" && $pwd == "120525d1a28d39f78ef479b07011de199c5c2e92") {
                    $_SESSION['utilisateur'] = new Utilisateur(3, "jeunePublic", "120525d1a28d39f78ef479b07011de199c5c2e92");
                    Main::setFlashMessage("Connecté avec succès", "valid");
                    echo '<script>document.location.href ="?uc=jp&action=choisirTypeEcole"</script>';
                } else {
                    Main::launchWrongUserPwd();
                    echo '<script>document.location.href ="?uc=connexion"</script>';
                }
            } else {
                echo '<script>document.location.href ="?uc=index"</script>';
                exit;
            }
        } catch (\Exception $e) {
            Main::setFlashMessage($e->getMessage(), "error");
        }
        break;
    case 'logout':
        session_destroy();
        Main::setFlashMessage("Déconnecté avec succès", "valid");
        echo '<script>document.location.href ="?uc=index"</script>';
        break;
    default:
        echo '<script>document.location.href ="?uc=index"</script>';
        break;
}
Exemplo n.º 13
0
 public static function validerInscription(Inscription $inscription)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         $reqPrepare = $conn->prepare("UPDATE inscription SET validationInscription = 1 WHERE idInscription = ?");
         $reqPrepare->execute(array($inscription->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception("l'inscription n° " . $inscription->getId() . " n'a pas été valider.");
     }
 }
Exemplo n.º 14
0
 public static function rmSaisonSpectacle(Spectacle $spectacle)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         $reqPrepare = $conn->prepare("DELETE FROM saison_spectacle WHERE idSpectacle = ?");
         $reqPrepare->execute(array($spectacle->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception($e->getMessage());
     }
 }