function getDiscDetails($bdd, $code) { $response = array(); $stmt = $bdd->prepare("SELECT Disque.Référence_Album FROM Disque WHERE Disque.Code_Disque = ?"); $stmt->execute(array($code)); while ($row = $stmt->fetch()) { $response[0] = $row[0]; } $response[1] = getDiscPrice($bdd, $code); return $response; }
$discs = getDiscsByAlbum($bdd, $_GET['code']); $nombreDisque = count($discs); $request = "../data/getAlbumPicture.php?id=" . $_GET['code']; echo "<div class=\"artistPic\">"; echo '<img src="' . $request . '" alt="Photo" style="width:200px;height:200px">'; echo "</div>"; echo "<p class=\"resultFilter\"><strong>Titre : </strong>" . $details[0] . "</p>"; echo "<p class=\"resultFilter\"><strong>Année : </strong>" . $details[1] . "</p>"; echo "<p class=\"resultFilter\"><strong>Genre : </strong>" . $details[2] . "</p>"; echo "<p class=\"resultFilter\"><strong>Éditeur : </strong>" . $details[3] . "</p>"; echo "<h4 class=\"titleDetails\">Disques de l'album :</h4><br/>"; echo "<p class=\"resultFilter\">Il y a <strong>" . $nombreDisque . "</strong> disque(s) sur cet album</p>"; $i = 1; foreach ($discs as $discID) { echo "<p class=\"resultFilter\">Disque n° <strong>" . $i . "</strong> :</p>"; echo "<p class=\"resultFilter\">Prix du disque : <strong>" . substr_replace(getDiscPrice($bdd, $discID), '', -2) . "€ </strong></p>"; echo "<a href=\"../administration/addToCart.php?discID=" . $discID . "\" class=\"btn btn-info\" role=\"button\">Ajouter le disque au panier</a>"; echo "<table class=\"table table-striped\">"; echo "<thead>"; echo "<tr>"; echo "<th>Identifiant</th>"; echo "<th>Titre</th>"; echo "<th>Durée</th>"; echo "<th>Prix</th>"; echo "<th>Extrait</th>"; echo "<th>Achat</th>"; echo "</tr>"; echo "</thead>"; echo "<tbody>"; $titres = getDiscsRecordings($bdd, $discID); foreach ($titres as $t) {