Beispiel #1
0
 public function modifierProfil($nom, $prenom, $login, $password)
 {
     $pdo = new PDO(parent::getPDOdsn(), parent::getUser(), parent::getPassword());
     $requete = "UPDATE Abonné SET Nom_Abonné = :nom, Prénom_Abonné = :prenom, Login = :login, Password = :pass WHERE Login = '******'";
     $stmt = $pdo->prepare($requete);
     $stmt->execute(array(':nom' => $nom, ':prenom' => $prenom, ':login' => $login, ':pass' => $password));
     header("Location: ../profil.php");
 }
Beispiel #2
0
 public function listeOeuvreAnnee($annee)
 {
     $pdo = new PDO(parent::getPDOdsn(), parent::getUser(), parent::getPassword());
     $requeteOeuvre = "SELECT Code_Oeuvre,Titre_Oeuvre, Année,Libellé_Type\n                          FROM Oeuvre\n                          INNER JOIN Type_Morceaux on Type_Morceaux.Code_type = Oeuvre.Code_Type\n                          WHERE Année = :annee";
     $stmt = $pdo->prepare($requeteOeuvre);
     $stmt->execute(array(':annee' => $annee));
     if ($stmt->rowCount() == 0) {
         echo '<div class="alert alert-danger" role="alert">Aucune oeuvre trouvé pour cette année</div>';
     } else {
         echo '<table class="table">';
         echo '<thead>';
         echo '<tr>';
         echo '<th>Code</th>';
         echo '<th>Nom</th>';
         echo '<th>Année</th>';
         echo '<th>Type</th>';
         echo '</tr>';
         echo ' </thead>';
         foreach ($stmt as $row) {
             echo '<tbody>';
             echo '<tr>';
             echo '<td>' . $row["Code_Oeuvre"] . '</td>';
             echo '<td>' . $row["Titre_Oeuvre"] . '</td>';
             echo '<td>' . $row[utf8_decode("Année")] . '</td>';
             echo '<td>' . $row[utf8_decode("Libellé_Type")] . '</td>';
             echo '</tr>';
             echo '</tbody>';
         }
         echo '</table>';
     }
     $pdo = null;
 }
Beispiel #3
0
 public function listeEnregistrement($codeAlbum)
 {
     $pdo = new PDO(parent::getPDOdsn(), parent::getUser(), parent::getPassword());
     $requete = "SELECT Enregistrement.Code_Morceau,Enregistrement.Titre,Enregistrement.Prix FROM Enregistrement INNER JOIN Composition_Disque ON Composition_Disque.Code_Morceau = Enregistrement.Code_Morceau INNER JOIN Disque ON Disque.Code_Disque = Composition_Disque.Code_Disque INNER JOIN Album ON Album.Code_Album = Disque.Code_Album WHERE Album.Code_Album = :code";
     $stmt = $pdo->prepare($requete);
     $stmt->execute(array(':code' => $codeAlbum));
     echo '<table class="table">';
     echo '<thead>';
     echo '<tr>';
     echo '<th>Code Oeuvre</th>';
     echo '<th>Titre oeuvre</th>';
     echo '<th>Prix</th>';
     echo '<th>Extrait</th>';
     echo '</tr>';
     echo ' </thead>';
     foreach ($stmt as $row) {
         echo '<tbody>';
         echo '<tr>';
         echo '<td>' . $row['Code_Morceau'] . '</td>';
         echo '<td>' . $row['Titre'] . '</td>';
         echo '<td>' . $row['Prix'] . '</td>';
         echo '<td><audio controls="controls"><source src="musique.php?Code=' . $row['Code_Morceau'] . '" type="audio/mp3" /> Votre navigateur ne supporte pas le format audio.</audio> </td>';
         echo '</tr>';
         echo '</tbody>';
     }
     echo '</table>';
     $pdo = null;
 }