SQL query bug fix
authorx2000chevalier <x2000chevalier>
Sun, 31 Oct 2004 17:58:32 +0000 (17:58 +0000)
committerx2000chevalier <x2000chevalier>
Sun, 31 Oct 2004 17:58:32 +0000 (17:58 +0000)
htdocs/marketing/index.php

index eb9818c..d5c079a 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: index.php,v 1.3 2004-10-31 16:39:06 x2000chevalier Exp $
+        $Id: index.php,v 1.4 2004-10-31 17:58:32 x2000chevalier Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -27,15 +27,15 @@ new_admin_page('marketing/index.tpl');
 # Quelques statistiques
 
 $sql = "SELECT count(*) as vivants,
-              count(user!='non-inscrit') as inscrits,
-              100*count(user!='non-inscrit')/count(*) as ins_rate,
+              count(NULLIF(perms!='non-inscrit', 0)) as inscrits,
+              100*count(NULLIF(perms!='non-inscrit', 0))/count(*) as ins_rate,
               count(NULLIF(promo >= 1972, 0)) as vivants72,
-              count(NULLIF(promo >= 1972 AND user!='non-inscrit', 0)) as inscrits72,
-              100 * count(NULLIF(promo >= 1972 AND user!='non-inscrit', 0)) /
+              count(NULLIF(promo >= 1972 AND perms!='non-inscrit', 0)) as inscrits72,
+              100 * count(NULLIF(promo >= 1972 AND perms!='non-inscrit', 0)) /
                    count(NULLIF(promo >= 1972, 0)) as ins72_rate,
               count(NULLIF(FIND_IN_SET('femme', flags), 0)) as vivantes,
-              count(NULLIF(FIND_IN_SET('femme', flags) AND user!='non-inscrit', 0)) as inscrites,
-              100 * count(NULLIF(FIND_IN_SET('femme', flags) AND user!='non-inscrit', 0)) /
+              count(NULLIF(FIND_IN_SET('femme', flags) AND perms!='non-inscrit', 0)) as inscrites,
+              100 * count(NULLIF(FIND_IN_SET('femme', flags) AND perms!='non-inscrit', 0)) /
                   count(NULLIF(FIND_IN_SET('femme', flags), 0)) as inse_rate
           FROM auth_user_md5
          WHERE deces = 0";