<?php



class Dukut extends CI_Controller
{

  public function __construct()
  {
    parent::__construct();
    $this->load->model('Dukut_model');
  }

  public function index()
  {
    $this->load->library('pagination');
   
    //$config['base_url'] = site_url('/product');
    $config['page_query_string'] = TRUE;
    $config['total_rows'] =  $this->Dukut_model->get_published_count();
    $config['per_page'] = 20;
  
    //$config['full_tag_open'] = '<div class="pagination1">';
    //$config['full_tag_close'] = '</div>';
 
    $this->pagination->initialize($config);
    $limit = $config['per_page'];
    if (!is_null($this->input->get('per_page'))) { 
    $offset =   html_escape($this->input->get('per_page'));
    }
    else {
$offset = 0;
      
     //backup data ke tabel backup
    //$backupketabelbackupnyadulu = $this->Saldo_model->get_backup();

    }
    $data['dukuts'] = $this->Dukut_model->get_published($limit, $offset);
    $data['jmldata'] = $config['total_rows'];
    if(count($data['dukuts']) > 0){
      $this->load->view('products/list_dukut.php', $data);
    }  
  }
 
}