forms - Create Button in last page pagination codeigniter -


hello there have problem

i wanna create button in pagination codeigniter just in last page submit form

here code:

controller:

    function index() { /* pagination config */         $this->load->library('pagination');         $config['base_url'] = site_url('dcm/index');         $config['per_page'] = 6;         $config['num_link'] = 5;         $config['next_link'] = 'next';         $config['prev_link'] = 'prev' ;         $config['total_rows'] = $this->db->get('soal')->num_rows();  /* form still have problem have different post 1 */ /* if have idea please check question */         $data['form_action'] = site_url('dcm/index');              $jawab = $this->input->post('jawab');         $id_soal = $this->input->post('id_soal');         $this->dcm_model->inputjawab();         /*  */   /* pagination setting */         $this->pagination->initialize($config);         $data['query'] = $this->db->get('soal', $config['per_page'], $this->uri->segment(3));         $data['link'] = $this->pagination->create_links();         $this->load->view('dcm/soal', $data); } 

in view:

<form action="<?php echo $form_action; ?>"> <?php  foreach($query->result() $row) { ?> <?php echo $row->id_soal . '. ' . $row->soal; ?> <input type="checkbox" checked="checked"  value="<?=$row->id_soal;?>" name="jawab[]" /> <?php } ?> <?php echo $link; ?> </form> <input align="center" type="submit" value="selesai" /> 

you can check if on last page code:

if($this->pagination->cur_page >=      ceil($this->pagination->total_rows / $this->pagination->per_page)) {     $islastpage = true; } else {     $islastpage = false; } 

you can pass $islastpage variable view.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -