resolution bug
This commit is contained in:
@@ -57,7 +57,7 @@ class Chansons extends CI_Controller {
|
||||
}
|
||||
|
||||
public function deleteSongtoPlaylist($id){
|
||||
$playlists = $this->model_music->getPlaylistIdSong($id);
|
||||
$playlists = $this->model_music->getPlaylistIdSong($id, $this->session->userdata('userId'));
|
||||
|
||||
$this->form_validation->set_rules('playlist_id', 'playlist_id', 'required');
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ class Model_music extends CI_Model {
|
||||
return $query = false;
|
||||
}
|
||||
|
||||
public function getPlaylistIdSong($id){
|
||||
public function getPlaylistIdSong($id,$iduser){
|
||||
$result = $this->model_music->TrackidSonginPlaylist($id);
|
||||
|
||||
$track = $result->row();
|
||||
@@ -322,6 +322,7 @@ class Model_music extends CI_Model {
|
||||
$this->db->from('Playlist');
|
||||
$this->db->join('PlaylistSong','Playlist.playlistId = PlaylistSong.playlistId');
|
||||
$this->db->where('PlaylistSong.trackId',$trackId);
|
||||
$this->db->where('Playlist.userId',$iduser);
|
||||
$this->db->order_by('Playlist.name','ASC');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
<?php foreach ($playlists as $playlist){ ?>
|
||||
<div class="playlist-option">
|
||||
<label>
|
||||
<?php if($this->model_music->SongInThisPlaylist($id,$playlist->playlistid)){ ?>
|
||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
||||
<?php if($this->model_music->SongInThisPlaylist($id,$playlist->playlistId)){ ?>
|
||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistId ?>">
|
||||
<?= $playlist->name ?>
|
||||
<?php } ?>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user