projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adapts upgrade scripts to domain.
[platal.git]
/
modules
/
stats.php
diff --git
a/modules/stats.php
b/modules/stats.php
index
7c95ca8
..
376f2ba
100644
(file)
--- a/
modules/stats.php
+++ b/
modules/stats.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-201
0
Polytechnique.org *
+ * Copyright (C) 2003-201
1
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-46,18
+46,18
@@
class StatsModule extends PLModule
);
}
);
}
- function handler_stats(
&
$page)
+ function handler_stats($page)
{
$page->changeTpl('stats/index.tpl');
}
{
$page->changeTpl('stats/index.tpl');
}
- function handler_evolution(
&
$page, $jours = 365)
+ function handler_evolution($page, $jours = 365)
{
$page->changeTpl('stats/evolution_inscrits.tpl');
$page->assign('jours', $jours);
}
{
$page->changeTpl('stats/evolution_inscrits.tpl');
$page->assign('jours', $jours);
}
- function handler_graph_evo(
&
$page, $jours = 365)
+ function handler_graph_evo($page, $jours = 365)
{
define('DUREEJOUR', 24 * 3600);
{
define('DUREEJOUR', 24 * 3600);
@@
-65,9
+65,9
@@
class StatsModule extends PLModule
$res = XDB::iterRow('SELECT IF(registration_date > DATE_SUB(NOW(), INTERVAL {?} DAY),
TO_DAYS(registration_date) - TO_DAYS(NOW()),
-{?}) AS jour,
$res = XDB::iterRow('SELECT IF(registration_date > DATE_SUB(NOW(), INTERVAL {?} DAY),
TO_DAYS(registration_date) - TO_DAYS(NOW()),
-{?}) AS jour,
- COUNT(uid) AS nb
+ COUNT(
a.
uid) AS nb
FROM accounts AS a
FROM accounts AS a
- LEFT JOIN account_profiles AS ap ON
(ap.uid = a.uid AND FIND_IN_SET(\'owner\', ap.flag
s))
+ LEFT JOIN account_profiles AS ap ON
(ap.uid = a.uid AND FIND_IN_SET(\'owner\', ap.perm
s))
LEFT JOIN profiles AS p ON (ap.pid = p.pid)
WHERE state = \'active\' AND p.deathdate IS NULL
GROUP BY jour', (int)$jours, 1 + (int)$jours);
LEFT JOIN profiles AS p ON (ap.pid = p.pid)
WHERE state = \'active\' AND p.deathdate IS NULL
GROUP BY jour', (int)$jours, 1 + (int)$jours);
@@
-121,7
+121,7
@@
EOF2;
exit;
}
exit;
}
- function handler_graph(
&
$page, $promo = null)
+ function handler_graph($page, $promo = null)
{
if ($promo == 'all') {
// date de départ
{
if ($promo == 'all') {
// date de départ
@@
-132,7
+132,7
@@
EOF2;
FROM accounts AS a
INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms))
INNER JOIN profiles AS p ON (p.pid = ap.pid)
FROM accounts AS a
INNER JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms))
INNER JOIN profiles AS p ON (p.pid = ap.pid)
- INNER JOIN profile_education AS pe ON (pe.
u
id = ap.pid AND FIND_IN_SET('primary', pe.flags))
+ INNER JOIN profile_education AS pe ON (pe.
p
id = ap.pid AND FIND_IN_SET('primary', pe.flags))
WHERE pe.entry_year >= {?} AND p.deathdate IS NULL
GROUP BY promo", $depart);
WHERE pe.entry_year >= {?} 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))
$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.
u
id = ap.pid AND FIND_IN_SET('primary', pe.flags))
+ INNER JOIN profile_education AS pe ON (pe.
p
id = ap.pid AND FIND_IN_SET('primary', pe.flags))
WHERE pe.entry_year = {?} AND a.state = 'active'", (int)$promo);
$jours = -$res->fetchOneCell();
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))
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.
u
id = ap.pid AND FIND_IN_SET('primary', pe.flags))
+ INNER JOIN profile_education AS pe ON (pe.
p
id = 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);
WHERE pe.entry_year = {?} AND a.state = 'active'
GROUP BY jour", (int)$jours, 1 + (int)$jours, (int)$promo);
@@
-246,14
+246,14
@@
EOF2;
exit;
}
exit;
}
- function handler_promos(
&
$page, $promo = null)
+ function handler_promos($page, $promo = null)
{
$page->changeTpl('stats/nb_by_promo.tpl');
$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))
{
$page->changeTpl('stats/nb_by_promo.tpl');
$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.
u
id = ap.pid AND FIND_IN_SET(\'primary\', pe.flags))
+ INNER JOIN profile_education AS pe ON (pe.
p
id = ap.pid AND FIND_IN_SET(\'primary\', pe.flags))
WHERE pe.entry_year >= 1900 AND a.state = \'active\'
GROUP BY promo
ORDER BY promo');
WHERE pe.entry_year >= 1900 AND a.state = \'active\'
GROUP BY promo
ORDER BY promo');
@@
-273,7
+273,7
@@
EOF2;
$page->assign('promo', $promo);
}
$page->assign('promo', $promo);
}
- function handler_coupures(
&
$page, $cp_id = null)
+ function handler_coupures($page, $cp_id = null)
{
$page->changeTpl('stats/coupure.tpl');
{
$page->changeTpl('stats/coupure.tpl');
@@
-281,7
+281,7
@@
EOF2;
$res = XDB::query("SELECT debut,
TIME_FORMAT(duree,'%kh%i') AS duree,
resume, description, services
$res = XDB::query("SELECT debut,
TIME_FORMAT(duree,'%kh%i') AS duree,
resume, description, services
- FROM
coupur
es
+ FROM
downtim
es
WHERE id = {?}", $cp_id);
$cp = $res->fetchOneAssoc();
}
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
} else {
$beginning_date = date("Ymd", time() - 3600*24*21) . "000000";
$sql = "SELECT id, debut, resume, services
- FROM
coupur
es where debut > '$beginning_date' order by debut desc";
+ FROM
downtim
es where debut > '$beginning_date' order by debut desc";
$page->assign('coupures', XDB::iterator($sql));
$res = XDB::iterator("SELECT host, text
FROM mx_watch
$page->assign('coupures', XDB::iterator($sql));
$res = XDB::iterator("SELECT host, text
FROM mx_watch