From 72deabb88fc3d23563286eeede36d55df0d83a08 Mon Sep 17 00:00:00 2001
From: Vince <vi.teissier@gmail.com>
Date: Tue, 4 Jun 2024 17:22:03 +0200
Subject: [PATCH]  View Artist 4/?

---
 application/controllers/Artistes.php | 38 ++++++++++------------------
 application/views/artistes_list.php  | 13 ----------
 application/views/artistes_name.php  | 11 ++++++++
 3 files changed, 25 insertions(+), 37 deletions(-)
 delete mode 100644 application/views/artistes_list.php
 create mode 100644 application/views/artistes_name.php

diff --git a/application/controllers/Artistes.php b/application/controllers/Artistes.php
index 42744e0..32648d6 100644
--- a/application/controllers/Artistes.php
+++ b/application/controllers/Artistes.php
@@ -3,28 +3,18 @@ defined('BASEPATH') OR exit('No direct script access allowed');
 
 class Artist extends CI_Controller {
 
-	public function __construct(){
-		parent::__construct();
-		$this->load->model('model_music');
-	}
-	public function index(){
-		$genre = $this->input->get('genre');
-		$order = $this->input->get('order');
-		$artists = $this->model_music->getArtists($genre, $order);
-		$genres = $this->model_music->researchtype();
-		$is_logged_in = $this->session->userdata('logged_in');
-	
-		$data = array(
-			'artists' => $artists,
-			'genres' => $genres,
-			'is_logged_in' => $is_logged_in
-		);
-	
-		$this->load->view('layout/header', $data);
-		$this->load->view('artistes_list', $data);
-		$this->load->view('layout/footer');
-	}
-	
-
-}
+        public function __construct(){
+                parent::__construct();
+                $this->load->model('model_music');
+        }
+        public function index(){
+                $genre = $this->input->get('genre');
+                $order = $this->input->get('order');
+                $artists = $this->model_music->getArtists($genre, $order);
+                $genres = $this->model_music->researchtype();
+                $this->load->view('layout/header',['genres'=>$genres]);
+                $this->load->view('artists_name',['artists'=>$artists]);
+                $this->load->view('layout/footer');
+        }
 
+}
\ No newline at end of file
diff --git a/application/views/artistes_list.php b/application/views/artistes_list.php
deleted file mode 100644
index 21cfb55..0000000
--- a/application/views/artistes_list.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<h5>Artists List</h5>
-<section class="list">
-
-<?php
-foreach($artists as $artist){
-	echo "<div><article>";
-	echo "<header class='short-text'>";
-	echo anchor("artistes/view/{$artistes->artistId}","{$artist->artistName}");
-	echo "</header>";
-	echo "</article></div>";
-}
-?>
-</section>
diff --git a/application/views/artistes_name.php b/application/views/artistes_name.php
new file mode 100644
index 0000000..2c7d739
--- /dev/null
+++ b/application/views/artistes_name.php
@@ -0,0 +1,11 @@
+<h5>Artists list</h5>
+<section class="list">
+<?php
+foreach($artists as $artist){
+        echo "<div><article>";
+        echo "<header class='short-text'>";
+        echo anchor("artist/view/{$artist->artistId}","{$artist->artistName}");
+        echo "</header></article></div>";
+}
+?>
+</section>
\ No newline at end of file