[eluser]Unknown[/eluser]
hi,
please help me with this problem
i have one one table connected with database,
i want to add feature pagination and select in that database but already try and error
my code is like this :
app/ VIEWS
Code:
<div id="data">
<div id="loading" ></div>
<table border="0" width="100%" cellspacing="0" class="table table-bordered">
<tr>
<th><center>No</center></th>
<th><center>PO_NO</center></th>
<th><center>Start_Date</center></th>
<th><center>New_Project_ID</center></th>
<th><center>Activity_ID</center></th>
<th colspan="2"><center>Aksi</center></th>
</tr>
<?php
$i=1;
foreach($data as $baris){?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $baris->PO_NO ?></td>
<td><?php echo $baris->Start_Date ?></td>
<td><?php echo $baris->New_Project_ID ?></td>
<td><center><?php echo $baris->Activity_ID ?><center></td>
<td width="80"><center><a class="btn btn-small" href="#"><i class="icon-pencil"></i> EDIT</a></center></td>
<td width="80"><center><a class="btn btn-small" href="#"><i class="icon-trash"></i> HAPUS</a></center></td>
</tr>
<?php
$i++;
}?>
</table>
<?php echo $this->pagination->create_links(); ?>
</div>
app/controllers
Code:
function __construct(){
parent::__construct();
// $this->load->model('modeldata');
}
function index(){
$data['judul'] = 'Data PO';
// $data['data'] = $this->modeldata->getDatadata();
//add
$this->load->library('pagination');
$this->load->library('table');
$config['base_url'] = 'http://localhost/cig/index.php/site/index';
$config['total_rows'] = $this->db->get('po_data')->num_rows();
$config['per_page'] = 10;
$config['num_links'] = 20;
$config['full_tag_open'] = '<div id="pagination">';
$config['full_tag_close'] = '</div>';
$this->pagination->initialize($config);
$data['data'] = $this->db->get('po_data', $config['per_page'], $this->uri->segment(3));
//add
$this->load->view('v_data',$data);
and got error like this
before i try to add pagination and search the page like this
can someone help me with this