X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fstats.php;h=24863ae7e2874c91f9047e64bb1e617de97d4e2f;hb=b3cd1320f091b2df9c8ed5f7b995a3d88c26ecad;hp=817a8e3db8411f8516047351f53536ef647c824a;hpb=353f2d2b11c4e3c6c0bc3553813368b6f42fa9c6;p=platal.git diff --git a/modules/stats.php b/modules/stats.php index 817a8e3..24863ae 100644 --- a/modules/stats.php +++ b/modules/stats.php @@ -1,6 +1,6 @@ = {?} AND p.deathdate IS NULL GROUP BY promo", $depart); @@ -181,7 +181,7 @@ EOF2; $res = XDB::query("SELECT MIN(TO_DAYS(a.registration_date) - TO_DAYS(NOW())) FROM accounts AS a INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms)) - INNER JOIN profile_education AS pe ON (pe.uid = ap.pid AND FIND_IN_SET('primary', pe.flags)) + INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET('primary', pe.flags)) WHERE pe.entry_year = {?} AND a.state = 'active'", (int)$promo); $jours = -$res->fetchOneCell(); @@ -192,7 +192,7 @@ EOF2; COUNT(a.uid) AS nb FROM accounts AS a INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms)) - INNER JOIN profile_education AS pe ON (pe.uid = ap.pid AND FIND_IN_SET('primary', pe.flags)) + INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET('primary', pe.flags)) WHERE pe.entry_year = {?} AND a.state = 'active' GROUP BY jour", (int)$jours, 1 + (int)$jours, (int)$promo); @@ -253,7 +253,7 @@ EOF2; $res = XDB::iterRow('SELECT pe.entry_year AS promo, COUNT(*) FROM accounts AS a INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET(\'owner\', ap.perms)) - INNER JOIN profile_education AS pe ON (pe.uid = ap.pid AND FIND_IN_SET(\'primary\', pe.flags)) + INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'primary\', pe.flags)) WHERE pe.entry_year >= 1900 AND a.state = \'active\' GROUP BY promo ORDER BY promo'); @@ -281,7 +281,7 @@ EOF2; $res = XDB::query("SELECT debut, TIME_FORMAT(duree,'%kh%i') AS duree, resume, description, services - FROM coupures + FROM downtimes WHERE id = {?}", $cp_id); $cp = $res->fetchOneAssoc(); } @@ -292,7 +292,7 @@ EOF2; } else { $beginning_date = date("Ymd", time() - 3600*24*21) . "000000"; $sql = "SELECT id, debut, resume, services - FROM coupures where debut > '$beginning_date' order by debut desc"; + FROM downtimes where debut > '$beginning_date' order by debut desc"; $page->assign('coupures', XDB::iterator($sql)); $res = XDB::iterator("SELECT host, text FROM mx_watch