2026-06-03 17:33:56 +02:00
|
|
|
<?php
|
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
|
|
class Genre extends CI_Controller {
|
|
|
|
|
|
|
|
|
|
public function view($id = NULL) {
|
|
|
|
|
if ($id === NULL) {
|
|
|
|
|
redirect('home');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->load->model('Game_model');
|
2026-06-10 16:31:05 +02:00
|
|
|
$this->load->model('Genre_model');
|
2026-06-03 17:33:56 +02:00
|
|
|
|
|
|
|
|
$this->db->where('genreId', $id);
|
|
|
|
|
$data['genre'] = $this->db->get('genre')->row_array();
|
|
|
|
|
|
|
|
|
|
if (empty($data['genre'])) {
|
|
|
|
|
show_404();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data['games'] = $this->Game_model->get_by_genre($id);
|
|
|
|
|
|
2026-06-10 16:31:05 +02:00
|
|
|
$this->load->view('games_list_view', $data);
|
2026-06-03 17:33:56 +02:00
|
|
|
}
|
|
|
|
|
}
|