application/controllers/Dashboard.php
// method untuk menampilkan seluruh data buku
method untuk menampilkan seluruh data buku
method untuk menampilkan seluruh data buku
public function books()
	{
		$id = false;
		$data['jumlah'] = $this->book_model->countAll();
		$config['base_url'] = base_url() . 'index.php/dashboard/books/';
		$config['total_rows'] = $data['jumlah'];
		$config['per_page'] = 5;
		$config['full_tag_open'] = '<nav><ul class="pagination">';
		$config['full_tag_close'] = '</ul></nav>';
		$config['num_tag_open'] = '<li class="page-item">';
		$config['num_tag_close'] = '</li>';
		$config['cur_tag_open'] = '<li class="page-item active"> <span class="page-link">';
		$config['cur_tag_close'] = '<span class="sr-only">(current)</span></span></li>';
		$config['next_link'] = FALSE;
		$config['prev_link'] = FALSE;
		$config['attributes'] = array('class' => 'page-link');
		$from = $this->uri->segment(3);
		$data['book'] = $this->book_model->showBook($id, $config['per_page'], $from);
		$this->pagination->initialize($config);
		$this->load->view('dashboard/books', $data);
		$this->load->view('dashboard/template/footer');
	}
public function books ( ) { $ id = false ; $ data [ 'jumlah' ] = $ this -> book_model -> countAll ( ) ; $ config [ 'base_url' ] = base_url ( ) . 'index.php/dashboard/books/' ; $ config [ 'total_rows' ] = $ data [ 'jumlah' ] ; $ config [ 'per_page' ] = 5 ; $ config [ 'full_tag_open' ] = '<nav><ul class="pagination">' ; $ config [ 'full_tag_close' ] = '</ul></nav>' ; $ config [ 'num_tag_open' ] = '<li class="page-item">' ; $ config [ 'num_tag_close' ] = '</li>' ; $ config [ 'cur_tag_open' ] = '<li class="page-item active"> <span class="page-link">' ; $ config [ 'cur_tag_close' ] = '<span class="sr-only">(current)</span></span></li>' ; $ config [ 'next_link' ] = FALSE ; $ config [ 'prev_link' ] = FALSE ; $ config [ 'attributes' ] = array ( 'class' => 'page-link' ) ; $ from = $ this -> uri -> segment ( 3 ) ; $ data [ 'book' ] = $ this -> book_model -> showBook ( $ id , $ config [ 'per_page' ] , $ from ) ; $ this -> pagination -> initialize ( $ config ) ; $ this -> load -> view ( 'dashboard/books' , $ data ) ; $ this -> load -> view ( 'dashboard/template/footer' ) ; }
method untuk menampilkan seluruh data buku
method untuk menampilkan seluruh data buku
// panggil method showBook() dari book_model untuk membaca seluruh data buku // Mengatur Pagination // Nampilin data sebanyak 5 dari total // tampilkan view 'dashboard/books'