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

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

View File

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

View File

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