Skip to content

Instantly share code, notes, and snippets.

@dkobia
Created April 14, 2011 14:27
Show Gist options
  • Save dkobia/919580 to your computer and use it in GitHub Desktop.
Save dkobia/919580 to your computer and use it in GitHub Desktop.
<?php
// Pagination
$pagination = new Pagination(array(
'query_string' => 'page',
'items_per_page' => (int) Kohana::config('settings.items_per_page'),
'total_items' => ORM::factory("incident")
->where("incident_active", 1)
->where($location_id_in)
->where($incident_id_in)
->count_all()
));
// Reports
$incidents = ORM::factory("incident")
->where("incident_active", 1)
->where($location_id_in)
->where($incident_id_in)
->orderby("incident_date", "desc")
->find_all((int) Kohana::config('settings.items_per_page_admin'), $pagination->sql_offset);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment