application/controllers/Dashboard-backup.php
// halaman index dari dashboard -> menampilkan grafik statistik jumlah data buku berdasarkan kategori
halaman index dari dashboard -> menampilkan grafik statistik jumlah data buku berdasarkan kategori
halaman index dari dashboard - > menampilkan grafik statistik jumlah data buku berdasarkan kategori
public function index(){
        	$data['countBukuTeks'] = $this->book_model->countByCat('1');
        	$data['countMajalah'] = $this->book_model->countByCat('2');
        	$data['countSkripsi'] = $this->book_model->countByCat('3');
        	$data['countThesis'] = $this->book_model->countByCat('4');
        	$data['countDisertasi'] = $this->book_model->countByCat('5');
        	$data['countNovel'] = $this->book_model->countByCat('6');
        	$data['countKomik'] = $this->book_model->countByCat('7');
			$data['fullname'] = $_SESSION['fullname'];
			$data['role'] = $_SESSION['role'];
			$this->load->view('dashboard/header', $data);
			$this->load->view('dashboard/sidebar');
            $this->load->view('dashboard/index');
            $this->load->view('dashboard/footer', $data);
        }
public function index ( ) { $ data [ 'countBukuTeks' ] = $ this -> book_model -> countByCat ( '1' ) ; $ data [ 'countMajalah' ] = $ this -> book_model -> countByCat ( '2' ) ; $ data [ 'countSkripsi' ] = $ this -> book_model -> countByCat ( '3' ) ; $ data [ 'countThesis' ] = $ this -> book_model -> countByCat ( '4' ) ; $ data [ 'countDisertasi' ] = $ this -> book_model -> countByCat ( '5' ) ; $ data [ 'countNovel' ] = $ this -> book_model -> countByCat ( '6' ) ; $ data [ 'countKomik' ] = $ this -> book_model -> countByCat ( '7' ) ; $ data [ 'fullname' ] = $ _SESSION [ 'fullname' ] ; $ data [ 'role' ] = $ _SESSION [ 'role' ] ; $ this -> load -> view ( 'dashboard/header' , $ data ) ; $ this -> load -> view ( 'dashboard/sidebar' ) ; $ this -> load -> view ( 'dashboard/index' ) ; $ this -> load -> view ( 'dashboard/footer' , $ data ) ; }
halaman index dari dashboard -> menampilkan grafik statistik jumlah data buku berdasarkan kategori
halaman index dari dashboard - > menampilkan grafik statistik jumlah data buku berdasarkan kategori
// panggil method countByCat() di model book_model untuk menghitung jumlah data buku per kategori untuk ditampilkan di view // baca data session 'fullname' untuk ditampilkan di view // tampilkan view 'dashboard/index'