<?php

 class Newsletter_model extends CI_Model{

     
     public function get_newsletters($per_page, $offset) {
        
         $this->db->order_by('data', 'desc')
                ->limit($per_page, $offset);
         
        return $this->db->get('newsletter');
     }
     
    
    public function get_count_newsletters() {

        $this->db->select('n.*');
        $this->db->from('newsletter as n');

        return $this->db->get()->num_rows();
    }
     
    
}

?>
