vraiment bon travail
This commit is contained in:
@@ -3,7 +3,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Albums extends CI_Controller {
|
||||
|
||||
private $filter = 'default';
|
||||
private $sort = 'Tri';
|
||||
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
@@ -13,13 +14,37 @@ class Albums extends CI_Controller {
|
||||
$this->load->helper('form');
|
||||
}
|
||||
public function index(){
|
||||
$albums = $this->model_music->getAlbums();
|
||||
$num_results = count($albums);
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('albums_list', ['albums' => $albums, 'sort' => $this->sort, 'num_results' => $num_results, 'is_search' => false]);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
public function view($id){
|
||||
$tracks = $this->model_music->getTracksByAlbumId($id);
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('album_info', ['tracks' => $tracks]);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
$albums = $this->model_music->getAlbums();
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('albums_list',['albums'=>$albums]);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
public function tri(){
|
||||
$Ctri = $this->input->get('Ctri');
|
||||
$trie = $this->model_music->get_tri_Albums($Ctri);
|
||||
$num_results = count($trie);
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('albums_list', ['albums' => $trie, 'sort' => $this->sort, 'num_results' => $num_results, 'is_search' => false]);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
public function search(){
|
||||
$query = $this->input->get('query');
|
||||
$albums = $this->model_music->searchAlbums($query);
|
||||
$num_results = count($albums);
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('albums_list', ['albums' => $albums, 'sort' => $this->sort, 'num_results' => $num_results, 'is_search' => true]);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -38,6 +38,39 @@ class ConnexionController extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function traitement() {
|
||||
if(isset($_POST['ok'])){
|
||||
$this->load->database();
|
||||
|
||||
|
||||
$prenom = ucfirst(strtolower($this->input->post('prenom')));
|
||||
$nom = strtoupper($this->input->post('nom'));
|
||||
$pseudo = $this->input->post('pseudo');
|
||||
$mdp = $this->input->post('pass');
|
||||
$email = $this->input->post('email');
|
||||
|
||||
$data = array(
|
||||
'pseudo' => $pseudo,
|
||||
'nom' => $nom,
|
||||
'prenom' => $prenom,
|
||||
'mdp' => $mdp,
|
||||
'email' => $email
|
||||
);
|
||||
|
||||
$this->db->insert('users', $data);
|
||||
|
||||
$this->session->set_userdata('pseudo', $pseudo);
|
||||
redirect('../index.php');
|
||||
|
||||
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('connexion', $data);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function deconnexion() {
|
||||
$this->session->unset_userdata('pseudo');
|
||||
$this->session->sess_destroy();
|
||||
|
@@ -10,7 +10,7 @@ class InscriptionController extends CI_Controller {
|
||||
|
||||
public function inscription() {
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('inscription');
|
||||
$this->load->view('connexion');
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class InscriptionController extends CI_Controller {
|
||||
$data['confirmation_message'] = "Inscription réussie ! Vous êtes maintenant inscrit.";
|
||||
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('inscription', $data);
|
||||
$this->load->view('connexion', $data);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user