/** * Enter description here... * */ function index() { $data['page_name'] = '<b>Object of Expenditures</b>'; $data['msg'] = ''; $data['focus_field'] = 'keyword'; $this->load->library('pagination'); $b = new Budget_expenditure_m(); $config['base_url'] = base_url() . 'budget/index'; $config['total_rows'] = $b->get()->count(); $config['per_page'] = '500'; $config['full_tag_open'] = '<p>'; $config['full_tag_close'] = '</p>'; $this->pagination->initialize($config); // How many related records we want to limit ourselves to $limit = $config['per_page']; // Set the offset for our paging $offset = $this->uri->segment(3); //$b->order_by('training_type'); $data['expenditures'] = $b->get($limit, $offset); $data['page'] = $this->uri->segment(3); $data['main_content'] = 'index'; return View::make('includes/template', $data); }
/** * Enter description here... * */ function index($id = '', $from_budget = '') { $data['page_name'] = '<b>Expenses</b>'; $data['msg'] = ''; $data['id'] = ''; $data['from_budget'] = $from_budget; $this->load->library('pagination'); $b = new Budget_expenditure_m(); $config['base_url'] = base_url() . 'budget/index'; $config['total_rows'] = $b->get()->count(); $config['per_page'] = '500'; $config['full_tag_open'] = '<p>'; $config['full_tag_close'] = '</p>'; $this->pagination->initialize($config); // How many related records we want to limit ourselves to $limit = $config['per_page']; // Set the offset for our paging $offset = $this->uri->segment(3); //$b->order_by('training_type'); $data['expenditures'] = $b->get($limit, $offset); $e = new Budget_expenses_m(); if (Input::get('op')) { if (Input::get('budget_expenditure_id') != 0) { $e->where('budget_expenditure_id', Input::get('budget_expenditure_id')); } } // If the id is from url if ($id != '') { $e->where('budget_expenditure_id', $id); $data['id'] = $id; } $e->order_by('date'); $data['expenses'] = $e->get(); $data['page'] = $this->uri->segment(3); $data['main_content'] = 'expenses/index'; return View::make('includes/template', $data); }