Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8740333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:06:44+00:00 2026-06-13T11:06:44+00:00

i have view vkategorimaterial like this <table border=1> <tr> <td colspan=4>Tampilkan<?php echo form_open(‘c_kategorimaterial/cari’); echo

  • 0

i have view vkategorimaterial like this

<table border="1">
                <tr>
                    <td colspan="4">Tampilkan<?php 
                    echo form_open('c_kategorimaterial/cari');
                    echo nbs();$intext=array('name' => 'cari', 'class' => 'GUI');
                    echo form_input($intext);
                    echo nbs(); $inbutton=array('value' => 'Cari', 'class' => 'button');
                    echo form_submit($inbutton);
                    echo form_close();
                    ?></td>
                </tr>

                <tr>
                    <td colspan="4"><a href="<?php echo base_url(); ?>index.php/c_kategorimaterial/tambah"><img class ="create" src="<?php echo base_url();?>img/create.png"></a></td>
                </tr>

                <tr>
                    <td>Nomor</td>
                    <td>Kode Kategori Material / Jasa</td>
                    <td>Nama Material / Jasa</td>
                    <td>Perintah</td>
                </tr>
                 <?php     if ( !empty($rows) ) 
                      {  
                            $no = 1;   
                            foreach ($rows as $row) { ?>  
                            <tr id="row">  
                             <td><?php echo $no;?></td>  
                             <td><?php echo $row->Kode_Kategori_Material_Jasa;?></td>  
                             <td><?php echo $row->Nama_Material_Jasa;?></td>  
                             <td> <a href="<?php echo site_url('c_kategorimaterial/ubah/'.$row->Kode_Kategori_Material_Jasa.'/'.$row->Nama_Material_Jasa);?>"><img class="perintah" src="<?php echo base_url(); ?>img/update.png"></a><a href="<?php echo site_url('c_kategorimaterial/hapus/'.$row->Kode_Kategori_Material_Jasa);?>" onclick="return confirm('akan dihapus, anda yakin ?');"><img class="perintah" src="<?php echo base_url(); ?>img/delete.png"></a></td>                           

                            </tr>  
                            <?php  
                             $no++;  
                            }  
                     } 
                     else { ?>  
            <tr id="row">  
            <td colspan="6" align="center">Tabel Kosong</td>  
            </tr>

        <?php  
        }  
        ?>  
        </table>
       <?php echo $this->pagination->create_links(); ?>

then i made the controller named c_kategorimaterial here is the index part

function index()
{
    $query = $this->m_kategorimaterial->get();  
    $config['base_url'] =  base_url().'index.php/c_kategorimaterial/index/';
    $config['total_rows'] = $query->num_rows();
    $config['per_page'] = 5; 
    $this->pagination->initialize($config);
    $data['rows'] = $query->result();
    $data['title'] = 'QB Kategori Material';
    $this->load->view('menu',$data);
    $this->load->view('v/vkategorimaterial');

}

i want to make a pagination that showing 5 rows per page. and here is the model of m_kategorimaterial->get

 $this->db->order_by('Kode_Kategori_Material_Jasa','DESC');
    $query = $this->db->get('ms_kategori_material',5);
    return $query;

why does the pagination is not showing ? here is the result of print_r($data['rows']);

Array ( [0] => stdClass Object ( [Kode_Kategori_Material_Jasa] => KKMJ006 [Nama_Material_Jasa] => Biji ) [1] => stdClass Object ( [Kode_Kategori_Material_Jasa] => KKMJ004 [Nama_Material_Jasa] => Teneh ) [2] => stdClass Object ( [Kode_Kategori_Material_Jasa] => KKMJ001 [Nama_Material_Jasa] => Air ) ) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:06:45+00:00Added an answer on June 13, 2026 at 11:06 am

    Try this block

    function index()
    {
       $query = $this->m_kategorimaterial->get();  
       $config['base_url'] =  base_url().'index.php/c_kategorimaterial/index/';
       $config['total_rows'] = $query->num_rows();
       $config['per_page'] = 5;        
       $data['rows'] = $query->result();
       $this->pagination->initialize($config);
       $this->load->vars($data); // !!!
       $data['title'] = 'QB Kategori Material';
       $this->load->view('menu',$data);
       $this->load->view('v/vkategorimaterial');
    
    }
    

    And in your view try this,

    echo $this->pagination->create_links();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have views here <?php echo form_open('c_kategorimaterial/tambah'); ?> <table> <tr> <td>Kode Kategori Material /
i have link like this <td><a href=<?php echo base_url(); ?>index.php/c_materialjasa/gkategorimaterial>Lihat Tabel</a></td> here is my
I have a view model coming from the server as json like this {
i have view which looks something like this : <% using (Ajax.BeginForm(new AjaxOptions {
In My Application i have View like this image: Now, I want to make
i have view like 'home/details/5', it can be access by anonymous user. but there
I have view controller, into the view i have put a table view, and
I have view stack in a app like so: <mx:ViewStack id=viewStack left=0 right=0 top=0
i have controller to show database record on table function gkategorimaterial() { $this->load->model('m_kategorimaterial'); $data['kirim']
I have view that contains a table with the following structure: <table id=mappings> <thead>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.