To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 330b2f16 authored by Reto Da Forno's avatar Reto Da Forno

minor modif to update_stats

parent a3649281
......@@ -59,7 +59,7 @@ function collect_stats($filename)
$institutioncnt = 0;
while ($row = mysqli_fetch_array($rs)) {
$institutioncnt = $institutioncnt + 1;
if (intval($row['num']) < 4) {
if (intval($row['num']) < 5) {
$institutions['others'] += intval($row['num']);
} else {
$institutions[$row['institution']] = intval($row['num']);
......@@ -109,7 +109,11 @@ function collect_stats($filename)
$sql = 'select pname, count(*) as c from (select distinct test_fk, tbl_serv_platforms.name as pname from tbl_serv_map_test_observer_targetimages left join tbl_serv_targetimages on (targetimage_fk = serv_targetimages_key) left join tbl_serv_platforms on (platforms_fk = serv_platforms_key)) as a left join tbl_serv_tests as b on (a.test_fk = b.serv_tests_key) where year(time_start_act) = '.$year.' and pname is not null group by pname';
$rs2 = mysqli_query($db, $sql) or flocklab_die('Cannot get statistics from database because: ' . mysqli_error($db));
while ($row = mysqli_fetch_array($rs2)) {
if (array_key_exists($row['pname'], $tests_per_mote)) {
$tests_per_mote[$row['pname']] = $tests_per_mote[$row['pname']] + $row['c'];
} else {
$tests_per_mote[$row['pname']] = $row['c'];
}
if ($row['pname'] == 'Tmote') {
$tmotetests_per_year[$year] = round($row['c'] * 100 / $tests_per_year[$year]);
$tmotetestcnt = $tmotetestcnt + $row['c'];
......@@ -251,7 +255,6 @@ function collect_stats($filename)
$new_stats = "
[general]
last_update = ".(string)time()."
paper_citations = ".$citations."
[users]
registered = ".(string)$usercnt."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment