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
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to