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