public function action_index() { $pagination = \Fuel\Core\Pagination::forge('projecttasknames', array('pagination_url' => \Fuel\Core\Config::get('pagination.pagination_url', '') . 'admin/projecttasknames/index/', 'total_items' => Model_Projecttaskname::count(), 'per_page' => \Fuel\Core\Config::get('pagination.per_page', 10), 'num_links' => \Fuel\Core\Config::get('pagination.num_links', 10), 'show_first' => \Fuel\Core\Config::get('pagination.show_first', false), 'show_last' => \Fuel\Core\Config::get('pagination.show_last', false), 'uri_segment' => \Fuel\Core\Config::get('pagination.uri_segment', 4))); $data['projecttasknames'] = Model_Projecttaskname::find('all', array('order_by' => array('name' => 'asc'), 'limit' => $pagination->per_page, 'offset' => $pagination->offset)); $data['pagination'] = $pagination; $this->template->title = "Task Types"; $this->template->content = View::forge('admin/projecttasknames/index', $data, false); }
public function action_index() { $config = \Fuel\Core\Config::get('pagination'); $pagination = \Fuel\Core\Pagination::forge('settings', $config); $pagination->total_items = Model_Setting::count(); $settings = Model_Setting::find('all', array('order_by' => array(array('setting_title', 'asc')), 'limit' => $pagination->per_page, 'offset' => $pagination->offset)); $data_types = Model_Setting_Data_Type::find('all', array('order_by' => array(array('name', 'asc')))); $this->template->title = "Settings"; $this->template->content = View::forge('admin/settings/index', array('pagination' => $pagination, 'settings' => $settings, 'data_types' => $data_types)); }
public function action_index() { $config = \Fuel\Core\Config::get('pagination'); $pagination = \Fuel\Core\Pagination::forge('user_types', $config); $pagination->total_items = Model_User_Type::count(); $data['pagination'] = $pagination; $data['user_types'] = Model_User_Type::find('all', array('order_by' => array(array('name', 'asc')), 'offset' => $pagination->offset, 'limit' => $pagination->per_page)); $this->template->title = "Employee Types » Listing"; $this->template->content = View::forge('admin/user/types/index', $data); }
public function action_index() { $config = \Fuel\Core\Config::get('pagination'); $pagination = \Fuel\Core\Pagination::forge('suppliers', $config); $pagination->total_items = Model_Supplier::count(); $data['pagination'] = $pagination; $data['suppliers'] = Model_Supplier::find('all', array('order_by' => array(array('description', 'asc')), 'limit' => $pagination->per_page, 'offset' => $pagination->offset)); $this->template->title = "Suppliers"; $this->template->content = View::forge('admin/suppliers/index', $data); }
public function action_index() { $config = \Fuel\Core\Config::get('pagination'); $pagination = \Fuel\Core\Pagination::forge('inventory.units', $config); $pagination->total_items = Model_Inventory_Unit::count(); $data['pagination'] = $pagination; $data['inventory_units'] = Model_Inventory_Unit::find('all', array('order_by' => array(array('name', 'asc')), 'limit' => $pagination->per_page, 'offset' => $pagination->offset)); $this->template->title = "Inventory Units » Listing"; $this->template->content = View::forge('admin/inventory/units/index', $data); }
public function action_index() { $config = \Fuel\Core\Config::get('pagination'); $pagination = \Fuel\Core\Pagination::forge('customers', $config); $pagination->total_items = Model_Customer::count(); $data['customers'] = Model_Customer::find('all', array('limit' => $pagination->per_page, 'offset' => $pagination->offset)); $data['pagination'] = $pagination; $this->template->title = "Customers » Listing"; $this->template->content = View::forge('admin/customers/index.twig', $data); }
public function action_index() { $pagination = \Fuel\Core\Pagination::forge('userprojects', array('pagination_url' => \Fuel\Core\Config::get('pagination.pagination_url', '') . 'user/projects/index/', 'total_items' => Model_Project::count(array('related' => array('customer', 'project_members'), 'where' => array(array('project_members.user_id', $this->current_user->id)))), 'per_page' => \Fuel\Core\Config::get('pagination.per_page', 10), 'num_links' => \Fuel\Core\Config::get('pagination.num_links', 10), 'uri_segment' => \Fuel\Core\Config::get('pagination.uri_segment', 4), 'show_first' => \Fuel\Core\Config::get('pagination.show_first', false), 'show_last' => \Fuel\Core\Config::get('pagination.show_last', false))); $view = Fuel\Core\View::forge('user/projects/index'); $view->set_global('user_is_admin', false); $view->set_global('projects', Model_Project::find('all', array('related' => array('customer', 'project_members'), 'order_by' => array('customer.name' => 'asc', 'name' => 'asc'), 'where' => array(array('project_members.user_id', $this->current_user->id)), 'limit' => $pagination->per_page, 'offset' => $pagination->offset))); $view->set_global('customers', \Fuel\Core\Arr::assoc_to_keyval(Model_Customer::find('all', array('order_by' => array('name' => 'asc'))), 'id', 'name')); $view->set_global('project_statuses', Model_Projectstatus::find('all', array('order_by' => array(array('description', 'asc'))))); $view->set_global('selected_status_id', \Fuel\Core\Config::get('projects.default_status_id', 0)); $view->set_global('user_is_admin', $this->check_user_is_admin()); $view->set_global('project_status_id', 0); $view->set_global('selected_status_id', 0); $view->set_global('pagination', $pagination, false); $view->set_global('admin', false); $this->template->title = 'My Projects'; $this->template->content = $view; }
/** * The basic welcome message * * @access public * @return Response */ public function action_index() { $this->setJavascript('responesive_tabs.js'); $this->setPageTitle('Funnycoder Top'); $aryDataTemplate = array(); $aryCategory = Model_Category::find_by(DELETE_FLG, '0'); $aryDataTemplate['category'] = $aryCategory; $post = Input::param(); $where = array(array(DELETE_FLG, 0)); if (isset($post['category'])) { $where[] = array(BLOG_CATEGORY_ID, $post['category']); } $configPagi = Config::get('pagi'); $configPagi['total_items'] = Model_Blog::count(array('where' => $where)); $pagination = Pagination::forge('mypagination', $configPagi); $aryBlog = Model_Blog::find('all', array('where' => $where, 'order_by' => array(BLOG_CREATED_DATE => 'desc'), 'limit' => $pagination->per_page, 'offset' => $pagination->offset)); $aryDataTemplate['blog'] = $aryBlog; $aryDataTemplate['pagi'] = $pagination; $this->template->content = View_Smarty::forge('blog/index.tpl', $aryDataTemplate); }
/** * Bootstrap pager. * * @access public * @static * @param mixed $prev_value * @param mixed $next_value * @param array $attrs (default: array()) * @return void */ public static function pager($prev_value, $next_value, $attrs = array()) { $prev = parent::prev_link($prev_value); $next = parent::next_link($next_value); if (is_null(self::$helper)) { self::$helper = Bootstrap::forge('pagination'); } self::$helper->merge_classes($attrs, array('pager')); return html_tag('ul', $attrs, $prev . $next); }
/** * @overwrap */ protected function _make_link($name) { $uri = parent::_make_link($name); return Query::rebuild($uri); }
/** * Forges a new pagination instance. * * @return Pagination */ public static function forge($name = 'default', $config = array()) { $config = array_merge(array('per_page' => 20, 'uri_segment' => 'page', 'current_page' => Input::get('page', 1)), $config); return parent::forge($name, $config); }