Commit de Louay : Corrections

This commit is contained in:
stiti 2024-05-27 23:09:07 +02:00
parent 70c71f12fb
commit 1b073136e2
3 changed files with 4 additions and 11 deletions

View File

@ -17,8 +17,7 @@ class Model_playlist extends CI_Model {
return false;
}
}
// Récupérer une playlist par ID
public function get_playlist_by_id($playlist_id) {
return $this->db->get_where('playlist', array('id' => $playlist_id))->row();
@ -44,16 +43,13 @@ class Model_playlist extends CI_Model {
}
public function add_song_to_playlist($data) {
// Vérifier si la combinaison playlist_id et song_id existe déjà
$this->db->where($data);
$existing_entry = $this->db->get('playlist_song')->row();
// Si la combinaison existe déjà, retourner false
if ($existing_entry) {
return false;
}
// Sinon, effectuer l'insertion
return $this->db->insert('playlist_song', $data);
}

View File

@ -1,5 +1,3 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="<?php echo base_url('assets/css/accueil'); ?>">
<title>Accueil - Onzeur</title>
@ -105,4 +103,3 @@
</div>
</body>
<script src="<?php echo base_url('assets/js/script_accueil'); ?>"></script>
</html>

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="<?php echo base_url('assets/css/artiste_details'); ?>">
<title>Détails de l'artiste <?php echo $artiste->name; ?></title>
<title>Détails de l'artiste - Onzeur <?php echo $artiste->name; ?></title>
</head>
<body>
<div class="artist-details">
@ -27,9 +27,9 @@
<ul class="songs-list">
<?php foreach($album->tracks as $track): ?>
<li>
<span><?php echo $track->number . '.' . $track->diskNumber; ?></span>
<span><strong><?php echo $track->number . '.' . $track->diskNumber; ?></strong></span>
<span><?php echo $track->songName; ?></span>
<span><?php echo gmdate("i:s", $track->duration); ?></span>
<span><strong><?php echo gmdate("i:s", $track->duration); ?></strong></span>
</li>
<?php endforeach; ?>