debut suppression playlists
This commit is contained in:
parent
0e5002ce82
commit
15a1c8f6a6
@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||||||
| a PHP script and you can easily do that on your own.
|
| a PHP script and you can easily do that on your own.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['base_url'] = '/~brigitte/SAEWEB2.2/ci/';
|
$config['base_url'] = '/~gallego/SAEWEB2.2/ci/';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -28,4 +28,10 @@ class Playlist extends CI_Controller {
|
|||||||
$this->load->view('song_playlist', ['songPlaylists' => $songPlaylists]);
|
$this->load->view('song_playlist', ['songPlaylists' => $songPlaylists]);
|
||||||
//$this->load->view('layout/footer_album');
|
//$this->load->view('layout/footer_album');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function deletePlaylist($playlist_id) {
|
||||||
|
$playlists = $this->model_music->deletePlaylist($playlist_id);
|
||||||
|
/*$this->load->view('playlist_list', ['playlists' => $playlists]);*/
|
||||||
|
redirect('playlist/index');
|
||||||
|
}
|
||||||
}
|
}
|
@ -38,11 +38,10 @@ class Model_music extends CI_Model {
|
|||||||
return $query->result();
|
return $query->result();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePlaylist(){
|
public function deletePlaylist($playlist_id){
|
||||||
$query = $this->db->query(
|
$query = $this->db->query(
|
||||||
"SELECT playlist.id, playlist.name
|
"DELETE FROM SongPlaylist
|
||||||
FROM playlist
|
WHERE id = $playlist_id
|
||||||
Group by playlist.id
|
|
||||||
"
|
"
|
||||||
);
|
);
|
||||||
return $query->result();
|
return $query->result();
|
||||||
|
@ -3,15 +3,10 @@
|
|||||||
foreach($playlists as $playlist){
|
foreach($playlists as $playlist){
|
||||||
echo "<div><article>";
|
echo "<div><article>";
|
||||||
echo "<header class='short-text'>";
|
echo "<header class='short-text'>";
|
||||||
echo anchor("playlist/SongPLaylist/{$playlist->id}","{$playlist->name}");
|
echo anchor("playlist/SongPlaylist/{$playlist->id}","{$playlist->name}");
|
||||||
|
echo "<form action='" . base_url("index.php/playlist/deletePlaylist/{$playlist->id}") . "' method='post'>";
|
||||||
//bouton supprimer playlist
|
echo "<button type='Supprimer Playlist'>Delete</button>";
|
||||||
echo "<form action='".site_url('playlist/view')."' method='post'style='display:inline;'>";
|
|
||||||
echo "<input type='hidden' name='playlist_id' value='{$playlist->id}'>";
|
|
||||||
echo "<button type='submit'>Supprimer PLaylistn</button>";
|
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
|
|
||||||
echo "<br>";
|
|
||||||
echo "</header>";
|
echo "</header>";
|
||||||
echo "</article></div>";
|
echo "</article></div>";
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<h5>Song of the playlist</h5>
|
<h5>Song of the playlist</h5>
|
||||||
<section class="list">
|
<section class="list">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
foreach($songPlaylists as $songPlaylist){
|
foreach($songPlaylists as $songPlaylist){
|
||||||
echo "<div><article>";
|
echo "<div><article>";
|
||||||
echo "<header class='short-text'>";
|
echo "<header class='short-text'>";
|
||||||
@ -10,5 +9,6 @@ foreach($songPlaylists as $songPlaylist){
|
|||||||
echo "</header>";
|
echo "</header>";
|
||||||
echo "</article></div>";
|
echo "</article></div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</section>
|
</section>
|
Loading…
Reference in New Issue
Block a user