[eluser]Maxat[/eluser]
Hi,
I am new to Codeigniter and I seek your help in adding extra columns to the table generated from database.
The main thing is I need to add edit and delete columns to each generated row. Can you please help me?
Below is my code for controller
Code:
public function index() {
$config['base_url']= site_url('admin/fieldlist/index');
$config['total_rows']= $this->db->get('field')->num_rows();
$config['per_page']=5;
$config['num_links']=3;
$config['full_tag_open']= '<div id="pagination">';
$config['full_tag_close']='</div>';
$config['uri_segment'] = 4;
$this->pagination->initialize($config);
$data['records'] = $this->db->get('field',$config['per_page'],$this->uri->segment(1));
$this->load->view('admin/fieldlist_view',$data);
}
And View
Code:
<h3>Fields</h3>
<div id="holder">
<?php $this->table->set_heading('Field ID', 'Field Name');
echo $this->table->generate($records);
echo $this->pagination->create_links();
?>
</div>
Don't have a Module