I need to list a menu with a hierarchy where the idmenu is below the idmenupai, with sub-level.
At the moment I can only list all the menu items. the following code
<?php
foreach ($menu as $item) {
if(!empty($item->menu)) {
echo '<li class="menu-dropdown classic-menu-dropdown">
<a data-hover="megamenu-dropdown" data-toggle="dropdown">
'.$item['Descricao'].'<i class="fa fa-angle-down"></i>
</a>';
echo '</li>';
} else {
echo '<li class=""><a href="'.$item['Url'].'">'.$item['Descricao'].'</a></li>';
}
}
?>
This is the bank select.
IdMenu Description Url IdMenuPai Order Status DataCrize 1 Panels NULL NULL 1 1 2017-08-02 15: 20: 38,657 20 Flows GPS NULL 66 2 1 2017-12-17 00: 00: 00.000 21 Answer NULL 1 7 1 2018-02-28 00: 00: 00,000 22 Answer Mobile NULL 21 1 1 2018-02-28 00: 00: 00.000 5 Solutions NULL NULL 3 1 2017-08-10 11: 34: 59.660 35 Blended NULL 43 2 1 2018-03-21 00: 00: 00.000 7 SCC NULL 5 3 1 2017-08-25 00: 00: 00,000 8 Query Customers NULL 7 1 1 2017-08-25 00: 00: 00,000 9 Using the SCC NULL 7 2 1 2017-08-25 00: 00: 00.000 36 Cluster Service PJ NULL 67 1 1 2018-03-21 00: 00: 00,000 11 Management at View NULL 1 1 1 2017-08-31 00: 00: 00,000 12 SMS Human NULL 1 2 1 2017-08-31 00: 00: 00,000 13 Humanization NULL 1 4 0 2017-08-31 00: 00: 00,000 14 Channels Electronics NULL 1 13 0 2017-08-31 00: 00: 00,000 15 Installment NULL 5 1 1 2017-08-31 00: 00: 00.000 16 Humanization Pre NULL 13 1 0 2017-09-18 00: 00: 00,000 17 Humanization Control NULL 13 1 0 2017-09-18 00: 00: 00,000 18 URA NULL 1 4 1 2017-10-04 00: 00: 00.000 19 Humanization Post NULL 13 1 0 2017-10-23 00: 00: 00,000 23 Answer Fixed NULL 21 2 1 2018-02-28 00: 00: 00,000 24 Answer Siebel NULL 21 3 1 2018-02-28 00: 00: 00.000 25 SiteCorp NULL 5 2 1 2018-02-28 00: 00: 00,000 26 URA NULL 18 2 1 2018-02-28 00: 00: 00.000 27 Real URA Time NULL 18 3 1 2018-02-28 00: 00: 00,000 28 ODC NULL 1 8 1 2018-02-28 00: 00: 00.000 29 Mobile Ombudsman NULL 28 3 1 2018-02-28 00: 00: 00.000 37 Platinum NULL 43 3 0 2018-03-21 00: 00: 00,000 31 Registration Manager B2B NULL 1 14 0 2018-02-28 00: 00: 00,000 32 Retention NULL 1 9 1 2018-02-28 00: 00: 00,000 33 Mobile IN NULL 32 1 1 2018-02-28 00: 00: 00.000 34 Mobile IN D-1 NULL 32 2 0 2018-02-28 00: 00: 00,000 38 Change of Address NULL null NULL 43 NULL 1 2018-04-27 00: 00: 00.000
39 Procon NULL 28 2 1 2018-04-27 00: 00: 00,000 40 Converters NULL
32 NULL 1 2018-04-27 00: 00: 00.000 41 Committee Technical NULL 64 1 1 2018-04-27 00: 00: 00,000 42 Invoice Digital NULL 66 3 1 2018-04-27 00: 00: 00,000 43 NULL Islands 1 10 1 2018-04-27 00: 00: 00.000 44 Cross-Selling NULL 1 7 1 2018-04-27 00: 00: 00.000 45 Cross Fixed NULL 44 1 1 2018-04-27 00: 00: 00,000 46 TavaTa NULL 5 4 0 2018-04-27 00: 00: 00.000 47 Platinum NULL 43 2 1 2018-04-27 00: 00: 00,000 48 Simplification NULL 1 17 0 2018-04-27 00: 00: 00,000 50 TavaTá NULL 5 4 1 2018-05-17 00: 00: 00.000 51 Ombudsman Fixed NULL 28 4 1 2017-05-21 00: 00: 00,000 52 Dashboard of URA NULL 18 1 1 2018-06-25 00: 00: 00.000 53 Live To Solve NULL 28 6 1 2018-06-25 00: 00: 00.000 54 Welcome NULL 43 5 1 2018-06-29 00: 00: 00.000 55 Sophia NULL 68 1 1 2018-07-10 00: 00: 00.000 56 Anatel NULL 28 1 1 2018-07-11 00: 00: 00.000 57 Leaked to ODC NULL 28 5 1 2018-07-25 00: 00: 00.000 59 Email B2B NULL 67 2 1 2018-08-15 00: 00: 00,000 64 Technical NULL 1 3 1 2018-09-11 00: 00: 00.000 65 Efika NULL 64 4 1 2018-09-11 00: 00: 00.000 66 GPS NULL 1 5 1 2018-09-11 00: 00: 00.000 67 B2B NULL 1 11 1 2018-09-11 00: 00: 00.000 68 Projects NULL 1 12 1 2018-09-11 00: 00: 00.000 49 Retract NULL 43 1 1 2018-04-27 00: 00: 00.000 58 Virtual Agent (Vivi) NULL 68 2 1 2018-08-03 00: 00: 00.000 61 Requests NULL NULL 3 1 2018-08-20 00: 00: 00.000 62 MDP NULL 5 5 1 2018-08-21 00: 00: 00.000 63 Usability NULL 66 1 1 2018-08-24 00: 00: 00,000
Could you help me please?