Вы загружаете js ссылки снова и снова. Вы должны разделить заголовок на css и html, как показано ниже: код
В вашем header_only файле
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark mb-5 align-center justify-content" height="30" >
<a class="navbar-brand" href="assets/img/foto.png">
<img src="../assets/img/foto.png" height="30"alt="" >
</a>
<div class="collapse navbar-collapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Monitoring dan Evaluasi
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo site_url('CapaianIKU') ?>">Capaian IKU Departemen/Prodi</a>
<a class="dropdown-item" href="<?= site_url('triwulan')?>">Capaian IKU PTN BH Departemen/Prodi</a>
</div>
</li>
</ul>
</nav>
В вашем content_only файле
<div class="container mt-5">
<h2 class="text-justify text-center">Hi<h2>
<br>
<h5 class="text-center">Have a good day<h5>
</div>
Создайте footer_only файл и добавьте его куда хотите
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</body>
</html>
Теперь ваш контроллер будет ниже Контроллер
class Welcome extends CI_Controller {
public function __construct()
{
parent::__construct();
/**Some validation here**/
}
public function index()
{
$levelUser = $this->session->userdata('level');
$data['nama'] = $this->session->userdata('nama');
if($levelUser == "3"){
$this->load->view('header_only',$data);
$this->load->view('content_only');
$this->load->view('footer_only');
}
else{
$this->load->view('another_header', $data);
$this->load->view('content_only');
$this->load->view('footer_only');
}
}
}