Ignore:
Timestamp:
08/02/05 16:56:51 (8 years ago)
Author:
anarcat
Message:

ne pas load la liste d'usager avec admin->get_list() mais avec un join
dans la requete

trier par username

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bureau/admin/stats_show_per_month.php

    r1412 r1413  
    9191} 
    9292 
    93 if (! ($user_list = $admin->get_list())) { 
    94         $error = $err->errstr(); 
    95 } 
    96 $u = array(); 
    97 foreach ($user_list as $user) { 
    98   $u[$user['uid']] = $user['login']; 
    99 } 
    100 $u[0] = 'inconnu'; 
    101  
    10293// the stats in the last $count months for all accounts 
    10394$db->query(" 
    104 SELECT SUM( size ) AS cnt, uid, date_format( 
    105 DAY , '%Y-%m' ) AS `month` 
    106 FROM `stat_http` 
     95SELECT SUM( s.size ) AS cnt, s.uid, date_format( 
     96DAY , '%Y-%m' ) AS `month`, m.login 
     97FROM `stat_http` s, membres m 
    10798WHERE `day` < CONCAT( date_format( DATE_ADD( NOW( ) , INTERVAL 1  
    10899MONTH ) , '%Y-%m' ) , '-01' ) 
    109100AND `day` >= CONCAT( date_format( DATE_SUB( NOW( ) , INTERVAL " . (int) ($count - 1) . 
    110 " MONTH ) , '%Y-%m' ) , '-01' ) 
     101" MONTH ) , '%Y-%m' ) , '-01' )  
     102AND m.uid = s.uid 
    111103GROUP BY `uid` , `month` 
    112 ORDER BY `uid`  
     104ORDER BY `login` 
    113105"); 
    114106 
     
    118110    if (!is_null($current_user)) { // not the first time we enter this block 
    119111      $class = ($class== 'lst1' ? 'lst2' : 'lst1'); 
    120       print "<tr class=\"$class\"><td><acronym title=\"$u[$current_user]\">" . $current_user . "</acronym></td>\n"; 
     112      print "<tr class=\"$class\"><td><acronym title=\"$current_user\">".$db->f("login")."</acronym></td>\n"; 
    121113      foreach ($months as $m) { 
    122114        print "<td>" . m_quota::display_val('bw_web', $entries[$m]) . "</td>\n"; 
Note: See TracChangeset for help on using the changeset viewer.