Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function renderResultsList()
- {
- $res = array();
- $query = new DbQuery();
- $query->select('*');
- $query->from('registform', 'r');
- $query->leftJoin('registform_lang', 'rl', '(rl.id_reg = r.id_reg AND rl.id_lang = '.$this->context->language->id.')');
- $res = DB::getInstance()->executeS($query);
- $this->_select = '
- cus.`id_customer`, cus.`firstname`, cus.`lastname`, cus.`email`, cus.`date_add`' ;
- $this->_join = '
- LEFT JOIN `' . _DB_PREFIX_ . 'customer` cus ON (a.`id_user` = cus.`id_customer`)';
- foreach($res as $r) {
- $this->_select .= ', '' `field_'.$r['id_reg'].'`';
- }
- $this->_orderBy = 'id_user';
- $this->_orderWay = 'ASC';
- $this->toolbar_btn = array();
- $this->show_toolbar = false;
- $this->_defaultOrderWay = 'asc';
- $this->lang = false;
- $this->position_identifier = 'id_reg';
- $this->list_simple_header = true;
- $this->_default_pagination = 100;
- $this->_group = 'GROUP BY a.`id_user`';
- $this->fields_list = array(
- 'id_customer' => array(
- 'title' => $this->l('ID'),
- 'width' => 'auto',
- 'align' => 'center'
- ),
- 'firstname' => array(
- 'title' => $this->l('First name'),
- 'width' => 'auto',
- 'align' => 'center'
- ),
- 'lastname' => array(
- 'title' => $this->l('Last name'),
- 'width' => 'auto',
- 'align' => 'center'
- ),
- 'email' => array(
- 'title' => $this->l('Email'),
- 'width' => 'auto',
- 'align' => 'center'
- ),
- 'date_add' => array(
- 'title' => $this->l('Date add'),
- 'width' => 'auto',
- 'align' => 'center'
- )
- );
- foreach($res as $r){
- $this->fields_list['field_'.$r['id_reg']] = array('title' => $r['label'], 'width' => 'auto', 'align' => 'center', 'callback' => 'getResults');
- }
- $this->tpl_list_vars['title'] = $this->l('Results');
- return parent::renderList();
- }
- public function getResults($currentCellValue, $fullRow)
- {
- return $fullRow['reg_value'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement