Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rearranged code so some output is printed before tackling the big table

  • Loading branch information...
commit ad81212ec3194d767913baf7a0b80b6a9720ba3a 1 parent 8f1370c
moodler authored
Showing with 17 additions and 14 deletions.
  1. +17 −14 admin/user.php
View
31 admin/user.php
@@ -156,21 +156,8 @@
if ($users = get_records_sql("SELECT id, username, email, firstname, lastname, city, country, lastaccess from user WHERE username <> 'guest'
AND deleted <> '1' ORDER BY $sort $dir LIMIT $page,$recordsperpage")) {
- foreach ($users as $key => $user) {
- $users[$key]->country = $COUNTRIES[$user->country];
- }
- if ($sort == "country") { // Need to resort by full country name, not code
- foreach ($users as $user) {
- $susers[$user->id] = $user->country;
- }
- asort($susers);
- foreach ($susers as $key => $value) {
- $nusers[] = $users[$key];
- }
- $users = $nusers;
- }
-
print_heading("$usercount ".get_string("users"));
+
$a->start = $page;
$a->end = $page + $recordsperpage;
if ($a->end > $usercount) {
@@ -206,6 +193,22 @@
}
echo "</TD></TR></TABLE>";
+ flush();
+
+ foreach ($users as $key => $user) {
+ $users[$key]->country = $COUNTRIES[$user->country];
+ }
+ if ($sort == "country") { // Need to resort by full country name, not code
+ foreach ($users as $user) {
+ $susers[$user->id] = $user->country;
+ }
+ asort($susers);
+ foreach ($susers as $key => $value) {
+ $nusers[] = $users[$key];
+ }
+ $users = $nusers;
+ }
+
$table->head = array ($name, $email, $city, $country, $lastaccess, "", "");
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER");
$table->width = "95%";
Please sign in to comment.
Something went wrong with that request. Please try again.