public function action_list() { $this->view = 'admin/contest/list'; // initial $page_id = $this->get_query('page', 1); $contest_list = Model_Contest::find(array(), $page_id, 50, array('contest_id' => Model_Contest::ORDER_DESC)); $this->template_data['total'] = Model_Contest::count(); $this->template_data['contest_list'] = $contest_list; $this->template_data['title'] = __('admin.contest.list.contest_list'); }
public function action_list() { // initial $page = $this->get_query('page', 1); $filter = array('defunct' => Model_Base::DEFUNCT_NO); $order_by = array('contest_id' => Model_Base::ORDER_DESC); $contest_list = Model_Contest::find($filter, $page, OJ::per_page, $order_by); $total = Model_Contest::count($filter); // view $this->template_data['total'] = ceil($total / OJ::per_page); $this->template_data['list'] = $contest_list; $this->template_data['title'] = __('contest.list.contest_list'); }