logo
    runBaseQuery("SELECT * FROM `settings_sidebar` WHERE status = 1 ORDER by `order` ASC "); $refs = array(); $list = array(); foreach ($hasil as $data) { $thisref = &$refs[$data['id']]; $thisref['menu_parent_id'] = $data['parent_id']; $thisref['menu_item_name'] = $data['name']; $thisref['url'] = $data['link']; $thisref['icon'] = $data['icon']; if ($data['parent_id'] == 0) { $list[$data['id']] = &$thisref; } else { $refs[$data['parent_id']]['children'][$data['id']] = &$thisref; } } function create_list($arr, $urutan) { print_r($arr); exit; if ($urutan == 0) { $html = "\n
      \n"; } else { $html = "\n
        \n"; } foreach ($arr as $key => $v) { if (array_key_exists('children', $v)) { $html .= "
      • \n"; $html .= ' ' . $v['menu_item_name'] . ' '; $html .= create_list($v['children'], 1); $html .= "
      • \n"; } else { $html .= '
      • '; if ($urutan == 0) { $html .= ''; } if ($urutan == 1) { $html .= ''; } $html .= $v['menu_item_name'] . "
      • \n"; } } $html .= "
      \n"; return $html; } echo create_list($list, 0); ?>