buat paging di CI gmn ya?...
klu base URL seperti ini
$this->load->library('pagination');
------------------
$config['base_url'] = 'http://localhost/tes/index.php?d=tes;
------------------
$config['total_rows'] = '200';
$config['per_page'] = '20';
$this->pagination->initialize($config);
echo $this->pagination->create_links();
--------
pk variable POST ya ,?? gmn caranya ya??? help
BLS:
hummm...klo gtu pake query string donk...
so klo mau ngambil argumentnya pake variabel GET...
atau ngambilnya pake method
<?php $this->input->get('per_page');?>jangan lupa untuk enable query string di config.php-nya...
untuk lebih jelasnya coba liat di userguide-nya..ada di bagian pagination class.
regards,
Syamsul Bachri
IT Beginner
Computer Science, Bogor Agricultural University
http://syamsulbachri.co.cc
iya pake query string, tp msh bgg?
nambahin GET nya dimana ya??, klu base urlnya seperti ini, gmn ya...
jadi awalnya, dibuat variable...
class Tugas extends Controller {
var $indexx = "index.php?c=coba";
}
...
// manggil menu daftarterima pk method POST
function index()
{
if ($this->input->post('from') == 'daftarterima') {
$this->daftarterima();
return false;
}
}
---
di menu daftarterima --> indexx&m=daftarterima\">yang diterima
-----
//function daftar terima
<?
function daftarterima()
{
if (!$this->Loginkah()) {
$this->mainmenu();
return false;
}
//load paging
$this->load->library('pagination');
$config['base_url'] = "$this->indexx";
$config['total_rows'] = $this->db->count_all('pajak');
$config['per_page'] = '10';
$this->pagination->initialize($config);
$kond = $this->filter();
$kodeA = $this->getKodeA();
$kodeB = $this->getKodeB();
$this->data['terdaftar'] = $this->terdaftarmodel->getSelectTerdaftar($kodA, $kodB, $kond,config['per_page'],$this->uri->segment(4)');
$this->data['pagination'] = $this->pagination->create_links();
$this->data['title'] = "Rekap yang dterima";
$this->data['from'] = "daftarterima";
$this->load->view('terdaftar', $this->data);
}
?>
-----
Terdaftar model
<?
function &getSelectTerdaftar($kodeA = '', $kodeB = '', $kond = '', $page) {
.....
$grant = "SELECT * FROM pajak order by nomordaftar DESC LIMT $page ";
$result = $this->db->query($grant);
$all = array();
$all[geshifilter-] = array('id' => '' , 'text' => ''); foreach ($result->result() as $row) { $all[] = array('id' => $row->nomordaftar , 'text' => $row->nomordaftar); } return $all; } ------- view <? include "header.php"; ?> <? include "laporandaftar.php"; ?> echo $this->pagination->create_links(); <? include "footer.php";?> --- http://localhost/tugas/index.php?c=coba/20 URL mas tetep error The URI you submitted has disallowed characters. [/geshifilter-]