function menu_display($menu_perants, $not_assigned_to_client = false, $cid = 0, $onclick = "") { $output = ""; $k = 0; $db_functions_obj = new DbFunctions(); if (is_array($menu_perants)) { foreach ($menu_perants as $key => $value) { if ($not_assigned_to_client) { //pr($value); //$menu_childs = $db_functions_obj->get_menu_childs_not_assigned_to_client($value->id, $cid); $menu_childs = $db_functions_obj->get_menu_childs_by_parent($value['id'], $value['cid']); } else { $menu_childs = $db_functions_obj->get_menu_childs_by_parent($value['id']); } // pr($menu_childs); $style = ""; if ($k % 6 == 0) { $style .= "style='clear:both'"; } $output .= "<div {$style} class='menu-checkboxs'>"; $output .= "<input {$onclick} type='checkbox' value='{$value['id']}' /><div style='font-weight:bold;margin-left: 20px;margin-top: -19px;position: absolute;'>" . $value['title'] . '</div><br />'; $i = 0; if (is_array($menu_childs)) { foreach ($menu_childs as $ckey => $cvalue) { //pr($menu_childs); $output .= " <input {$onclick} type='checkbox' value='" . $menu_childs[$i]['id'] . "' /><div style='margin-left: 43px;margin-top: -19px;position: absolute;'>" . $menu_childs[$i]['title'] . '</div><br />'; $i++; } } $output .= "</div>"; $k++; } } return $output; }