SVN: toys/stbr/stats: 09monthly.php 10monthly.php
shadzik
shadzik at pld-linux.org
Sun May 30 00:59:45 CEST 2010
Author: shadzik
Date: Sun May 30 00:59:45 2010
New Revision: 11494
Modified:
toys/stbr/stats/09monthly.php
toys/stbr/stats/10monthly.php
Log:
- fix stats so that current year doesn't change stats of the year before
Modified: toys/stbr/stats/09monthly.php
==============================================================================
--- toys/stbr/stats/09monthly.php (original)
+++ toys/stbr/stats/09monthly.php Sun May 30 00:59:45 2010
@@ -33,8 +33,10 @@
}
if ((int)$month < 12)
$q = @$DBhandle->query('select count(*) from application where line="' . $line . '" and date >="'.$year.'-' . (string)$month . '-01 00:00:00" and date < "'.$year.'-'. (string)$month2 .'-01 00:00:00"');
- else
- $q = @$DBhandle->query('select count(*) from application where line="' . $line . '" and date >="'.$year.'-' . (string)$month . '-01 00:00:00"');
+ else {
+ $year2 = $year+1;
+ $q = @$DBhandle->query('select count(*) from application where line="' . $line . '" and date >="'.$year.'-' . (string)$month . '-01 00:00:00" and date < "'.$year2.'-01 00:00:00"');
+ }
if ($line == "th")
$thm[] = (int)$q->fetchSingle();
else
Modified: toys/stbr/stats/10monthly.php
==============================================================================
--- toys/stbr/stats/10monthly.php (original)
+++ toys/stbr/stats/10monthly.php Sun May 30 00:59:45 2010
@@ -33,8 +33,10 @@
}
if ((int)$month < 12)
$q = @$DBhandle->query('select count(*) from application where line="' . $line . '" and date >="'.$year.'-' . (string)$month . '-01 00:00:00" and date < "'.$year.'-'. (string)$month2 .'-01 00:00:00"');
- else
- $q = @$DBhandle->query('select count(*) from application where line="' . $line . '" and date >="'.$year.'-' . (string)$month . '-01 00:00:00"');
+ else {
+ $year2 = $year+1;
+ $q = @$DBhandle->query('select count(*) from application where line="' . $line . '" and date >="'.$year.'-' . (string)$month . '-01 00:00:00" and date < "'.$year2.'-01 00:00:00"');
+ }
if ($line == "th")
$thm[] = (int)$q->fetchSingle();
else
More information about the pld-cvs-commit
mailing list