finition css

This commit is contained in:
2024-06-18 19:59:50 +02:00
parent 0b4dde90ac
commit 24fa946cf0
7 changed files with 133 additions and 112 deletions

View File

@@ -9,17 +9,18 @@ class Playlist extends CI_Controller {
$this->load->library('form_validation');
}
public function index(){
$user = $this->session->userdata('userId');
if ($recherche=filter_input(INPUT_GET,'recherche') == false or $recherche=filter_input(INPUT_GET,'recherche') == null){
$playlists = $this->model_music->getPlaylist();
$playlists = $this->model_music->getPlaylist($user);
}else{
$recherche=filter_input(INPUT_GET,'recherche');
$playlists = $this->model_music->getSearchPlaylist($recherche);
$playlists = $this->model_music->getSearchPlaylist($recherche,$user);
}
$this->load->view('layout/header');
if ($playlists == false){
$page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
$this->load->view('error',['page'=>$page[count($page)-1]]);
$playlists = $this->model_music->getPlaylist();
$playlists = $this->model_music->getPlaylist($user);
}
$this->load->view('playlist_list',['playlists'=>$playlists]);
$this->load->view('layout/footer');

View File

@@ -21,17 +21,28 @@ class User extends CI_Controller {
$this->load->view('layout/header');
$this->load->view('create_user');
$this->load->view('layout/footer');
}else{
}else{
$user=array(
"usernom" => $this->input->post("nom"),
"userprenom" => $this->input->post("prenom"),
"usermail" => $this->input->post("email"),
"userpassword" => password_hash(($this->input->post("password")), PASSWORD_DEFAULT),
);
$this->model_music->create_user($user);
redirect("user/auth");
if($this->model_music->verifyMail($this->input->post("email")) == false){
$this->model_music->create_user($user);
$dataUser=array(
"usernom" => $this->input->post("nom"),
"userprenom" => $this->input->post("prenom"),
"usermail" => $this->input->post("email"),
"userpassword" => password_hash(($this->input->post("password")), PASSWORD_DEFAULT),
"logged_in" => TRUE
);
$this->session->set_userdata($dataUser);
redirect("albums");
}else{
$this->session->set_flashdata('error', 'Cet email est déjà utilisé.');
redirect('user/create');
}
}
}
@@ -63,7 +74,7 @@ class User extends CI_Controller {
$this->session->set_userdata($dataUser);
redirect("albums");
}else{
redirect("user/create");
redirect("user/auth");
}
}