<td> <?php echo getFrenchDate($citation->getDateCitation()); ?> </td> <td> <?php if (!is_numeric($moyenneCit)) { echo "N/A"; } else { echo $moyenneCit; } ?> </td><?php if (isset($_SESSION['id'])) { ?> <td><?php if ($managerV->aVote($citation->getNumCit(), $_SESSION['id'])) { ?> <img src="image/erreur.png" alt="Erreur" title="Vous avez déja noté cette citation !"/> <?php } else { ?> <a href="index.php?page=80&citation=<?php echo $numCitation; ?> "><img src="image/modifier.png" alt="Noter" /><a><?php } ?> </td><?php } ?> </tr> <?php }
<h1> Noter une citation </h1> <?php $db = new Mypdo(); $managerP = new PersonneManager($db); $managerE = new EtudiantManager($db); $managerC = new CitationManager($db); $managerV = new VoteManager($db); $_SESSION['numCitation'] = $_GET['citation']; if (!$managerE->isEtudiant($_SESSION['id'])) { ?> <img src="image/erreur.png" alt="Erreur" /> Seul les <b>étudiants</b> ont le droit de noter une citation <br/><br/> <a href="index.php?page=2" class="bouton">Retour aux citations</a><?php } else { if ($managerV->aVote($_SESSION['numCitation'], $_SESSION['id'])) { ?> <img src="image/erreur.png" alt="Erreur" /> Vous avez déjà voté pour cette citation <br/><br/> <a href="index.php?page=2" class="bouton">Retour aux citations</a><?php } else { if ($managerC->isCitationValide($_GET['citation'])) { ?> <!-- libellé de la citation--> <p>Evaluez la citation : <b>"<?php echo $managerC->getLibelleCitation($_GET['citation'])->cit_libelle; ?> "</b></p> <div class="divCentre" id="ajout"> <form action="index.php?page=85" method="post" name="voteCitation"> <div class="texteFormulaire"> <p>Note :</p> </div>