Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $config = array();
  2. $config["base_url"] = base_url() . "/credits";
  3. $config['total_rows'] = 200;
  4. $config['per_page'] = 2;
  5. $config["uri_segment"] = 3;
  6.  
  7. $this->pagination->initialize($config);
  8.  
  9. $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
  10. $data["results"] = $this->credits_model->fetch_countries($config["per_page"], $page);
  11. $data["links"] = $this->pagination->create_links();
  12.  
  13. public function record_count() {
  14. return $this->db->count_all("sadmin_credits");
  15. }
  16.  
  17. public function fetch_countries($limit, $start) {
  18. $this->db->limit($limit, $start);
  19. $query = $this->db->get("sadmin_credits");
  20.  
  21. if ($query->num_rows() > 0) {
  22. foreach ($query->result() as $row) {
  23. $data[] = $row;
  24. }
  25. return $data;
  26. }
  27. return false;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement