View Single Post
  #9  
Old 1st March 2012, 01:02
8omas 8omas is offline
Senior Member
 
Join Date: Jan 2011
Posts: 148
Thanks: 16
Thanked 35 Times in 26 Posts
Default

Just checked the code after real operations.

The operations are:
- my script run at 23:55, so I had a full February report
- ISPConfig cron run at 00:30, so the normal operations took place
- my script run again at 00:40

Things are almost normal. The default page shows March statistics, but the drop down menu has 2012-2 checked. In fact there are 2 instances of 2012-2. The First is at the top of the list, representing the real February, and the Second is at the bottom of the drop down list, representing March.
The problem (which is not a real problem) is related with the code :

Code:
        if (date("d") == 1)
        {
                $month = date("m")-1;
                if (date("m") == 1)
                {
                        $year = date("Y")-1;
                        $month = "12";
                }
       }
in index.php

The above code, works normal for ISConfig's scheduled cron job, but has this effect in my script. Anyway, I think that tomorrow, (which is not -- date("d") == 1 --) the list will be ok.

Remove the above lines, breaks the list for ISPConfig, and corrects it for my script.

I 'll stick with the ISPConfig implementation, as I do not like to mess with core. After all, one day with a little mistake in the list, is not a big deal
Reply With Quote