include "include/pages/form/rechercherCitation.form.inc.php";
} else {
    if (empty($_POST['note']) && empty($_POST["date"]) && empty($_POST["prof"])) {
        throw new ExceptionPerso("Il faut remplir au moins un champ lors d'une recherche, sans quoi votre recherche est sans but !", ExceptionPerso::ERR_PEBCAK);
    }
    $note = $_POST["note"];
    $prof = empty($_POST['prof']) ? '' : $_POST['prof'];
    $date = empty($_POST['date']) ? '' : $_POST['date'];
    $recherche = array('note' => $note, 'prof' => $prof, 'date' => $date);
    $citationManager = new CitationManager($pdo);
    if (!isConnected() || !getPersonneConnectee()->isPerAdmin()) {
        $isAdmin = 0;
    } else {
        $isAdmin = 1;
    }
    $resultat = $citationManager->search($recherche, $isAdmin);
    if (empty($resultat)) {
        ?>
    <p>
      Aucun résultat trouvé, voulez vous réessayer en modifiant vos critères de recherche ? <br/>
      <a href="index.php?page=<?php 
        echo RECHERCHER_CITATIONS;
        ?>
">
        <b> Faire une nouvelle recherche </b>
      </a>
    </p>

    <?php 
    } else {
        $voteManager = new VoteManager($pdo);