function getChildEbenen($ebenenID) { global $db; $res = array(); $ql = "SELECT ID FROM ebene WHERE Aktiv LIKE 'Y' AND FK_Ebene_Parent = " . $ebenenID; if ($mr = $db->query($ql)) { while ($row = $mr->fetch_array(MYSQLI_ASSOC)) { array_push($res, $row["ID"]); $res = array_merge($res, getChildEbenen($row["ID"])); } } return $res; }
function getChildEbenen($ebenenID) { global $db; $res = array(); $ql = "SELECT ID FROM ebene e JOIN ebene_mandant em on em.FK_EBENE_ID=e.id WHERE Aktiv LIKE 'Y' AND FK_Ebene_Parent = " . $ebenenID . " AND FK_MANDANT_ID=" . $_SESSION["mandant"]; if ($mr = $db->query($ql)) { while ($row = $mr->fetch_array(MYSQLI_ASSOC)) { array_push($res, $row["ID"]); $res = array_merge($res, getChildEbenen($row["ID"])); } } return $res; }