$name) { $part = trim(substr($name, 0, $len)); if(isset($map[$part])) return FALSE; $map[$part] = TRUE; } return TRUE; } for($NameLength = 4; !IsUnique($NameLength); $NameLength++); // get matrix of group associations $matrix = array(); $res = $dbConn->query("SELECT * FROM wm_group_assoc", MYSQLI_USE_RESULT); while (($row = $res->fetch_assoc())) { if (!isset($matrix[$row['user']])) $matrix[$row['user']] = array(); $matrix[$row['user']][$row['group']] = $row['id']; } $res->free(); // page header echo <<Nutzer/Gruppen-Matrix

Sortieren nach: ID Name E-Mail Domain

EOF; // start query $order = $_GET['order']; $ocode = "ORDER BY id ASC"; if ($order == 'name') $ocode = "ORDER BY name ASC, email ASC"; else if ($order == 'email') $ocode = "ORDER BY email ASC"; else if ($order == 'domain') $ocode = "ORDER BY domain ASC, email ASC"; $res = $dbConn->query("SELECT id, name, email, SUBSTRING_INDEX(email,'@',-1) AS domain FROM wm_users $ocode", MYSQLI_USE_RESULT); // main loop $n = 0; while (($row = $res->fetch_assoc())) { if (!($n % 20)) { echo "\n"; foreach($groups as $id => $fullname) { echo "\n"; } echo "\n"; } $n++; echo "\n\n"; echo "\n"; echo "\n"; $mrow = $matrix[$row['id']]; foreach($groups as $gid => $dummy) { $check = isset($mrow[$gid]) ? " checked=\"checked\"" : ""; echo "\n"; } echo "\n"; } $res->free(); // end of page echo <<

 

Zurück zum Admin-Menü

EOF; CloseDB(); EndPage(); ?>
IDNameE-Mail"; echo htmlescape(substr($abbrev[$id], 0, $NameLength)) . "
{$row['id']}" . htmlescape($row['name']) . "" . htmlescape($row['email']) . "