Todor Inchovski Posted December 12, 2018 Share Posted December 12, 2018 I am developing a module in which I need to have two or more tables which are displayed next to each other. When I tried to do that using the helper it put them one under the other like in the picture. So what I am asking is: How can I put the tables next to each other using the HelperList class? Link to comment Share on other sites More sharing options...
Daresh Posted December 12, 2018 Share Posted December 12, 2018 Code the grid first as HTML and insert the generated tables into it. Or render a tpl file to which you can assign the tables. Link to comment Share on other sites More sharing options...
Todor Inchovski Posted December 12, 2018 Author Share Posted December 12, 2018 Well the (probably bad) thing is that I render the tables into the configuration page of the module. This is the code that I use for one of the tables. I don't know how to do that with what I have here as I think the helper class has some predefined ways of creating the table. public function test() { $sql = 'SELECT ps_orders.id_order, ps_order_detail.product_name, ps_order_detail.product_quantity, product_reference, product_price FROM ps_orders LEFT JOIN ps_order_detail ON ps_orders.id_order = ps_order_detail.id_order WHERE id_customer = 2 AND ps_order_detail.id_order = 6'; if ($result = Db::getInstance()->executeS($sql)) { $this->fields_list = array( 'product_reference' => array( 'title' => 'референтен номер', 'width' => 10, 'type' => 'text' ), 'product_name' => array( 'title' => 'test name test', 'width' => 10, 'type' => 'text' ), 'product_price' => array( 'title' => 'ед. цена', 'width' => 10, 'type' => 'price' ), 'product_quantity' => array( 'title' => 'Първа зарядка', 'width' => 10, 'type' => '' ), 'asdasd' => array( 'title' => 'Втора зарядка', 'width' => 10, 'type' => '' ), 'ferwwer' => array( 'title' => 'Трета зарядка', 'width' => 10, 'type' => '' ) ); $helper = new HelperList(); $helper->simple_header = true; $helper->identifier = 'product_name'; $helper->show_toolbar = true; $helper->shopLinkType = ''; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; return ($helper->generateList($result, $this->fields_list)); } } Link to comment Share on other sites More sharing options...
Todor Inchovski Posted December 12, 2018 Author Share Posted December 12, 2018 Ok let me try another approach. If I hardcode a HTML table, how do I populate it with data from the database? Link to comment Share on other sites More sharing options...
Daresh Posted December 12, 2018 Share Posted December 12, 2018 I meant something like this: getContent() { $out = '<div class="row"><div class="col-md-6">'; $out .= test(); $out .= '</div></div>'; return $out; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now