Пример #1
0
 /**
  * Index
  */
 public function action_index($curr_page = 1, $order_by = null, $scope = null, $filter = null)
 {
     $data['filters'] = Input::param('q');
     $grid = new Petro_Grid('Model_DocMK', static::_columns('index'));
     $this->setup_scope($grid);
     $grid->add_summary('belt_price_net', 'sum');
     $grid->add_summary('belt_amount', 'sum');
     $data['index_content'] = $grid->render();
     //$curr_page, $order_by, $scope, $data['filters']);
     $this->sidebars->add('Filters', Petro::render_group_filters(array(array("By Document info", array('mk_date' => array('type' => 'date_range'), 'mk_no' => array('type' => 'string'), 'client_id' => array('label' => 'Customer', 'type' => 'select', 'collection' => Petro_Lookup::table('clients', 'id', 'name')), 'status' => array('type' => 'select', 'collection' => Petro_Lookup::get('prd.status')))), array("By Belt info", array('belt_type' => array('type' => 'select', 'collection' => Petro_Lookup::get('belt.type')), 'belt_width' => array('type' => 'numeric'), 'belt_grade' => array('type' => 'select', 'collection' => Petro_Lookup::get('belt.grade')), 'belt_color' => array('type' => 'select', 'collection' => Petro_Lookup::get('belt.color')), 'belt_thick' => array('label' => 'Thickness', 'type' => 'numeric'), 'belt_length' => array('label' => 'Length', 'type' => 'numeric'), 'belt_end' => array('label' => 'End Type', 'type' => 'select', 'collection' => Petro_Lookup::get('belt.end')))))));
     $this->action_items = array(array('title' => 'Add New Docmk', 'link' => Petro::get_routes('new')));
     // set this to override default page_title
     $this->template->page_title = "MK Index";
     $this->template->content = View::forge('docmk2/index', $data, false);
 }