Page 4 of 7

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Mon 20 Mar 2023 7:05 pm
by surban21
Scripts have been updated to ver 1.0 - 03-20-2023

Added jqueryUI dialog popup. When clicking on any monthly snowfall amount in the main snowfall table, the daily amounts for that month will pop up in a calendar style dialog. You can view a pic of this on the first page. Notice: For those that have already installed my previous scripts, you will need to install all of version 1.0 scripts except for snowSumData.txt. You will not loose any data.

The download zip file is on the first page of this thread if you're interested.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Mon 10 Apr 2023 8:35 pm
by surban21
Scripts have been updated to ver 1.1 - 04-10-2023

Added a new HTML table containing the following items by month;

* Cumulative days with snowfall
* Cumulative snowfall depth
* Average annual snowfall depth
* Probability of snowfall %
* Year with most snowfall and its amount
* Year with least snowfall and its amount

Also re-wrote large portions of the script for better optimization.

If you're interested the file can be downloaded from the first post of this thread.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Mon 25 Nov 2024 8:44 pm
by Dador
The new winter season 2024/2025 has arrived, but it turns out that the script does not work. Could it be CMX's fault or PHP version 8.x?

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Tue 26 Nov 2024 3:53 pm
by weatherbee
It's working for me. I'm using Cumulus MX v4.2.1 build 4043 and using php 8.2.
Maybe a file got corrupted.
Tom

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Wed 27 Nov 2024 6:07 pm
by surban21
Dador wrote: Mon 25 Nov 2024 8:44 pm The new winter season 2024/2025 has arrived, but it turns out that the script does not work. Could it be CMX's fault or PHP version 8.x?
Dador - each year the "new" season will not show until you make the first entry for that season. It does not automatically roll over.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Wed 27 Nov 2024 6:14 pm
by HansR
Dador wrote: Mon 25 Nov 2024 8:44 pm The new winter season 2024/2025 has arrived, but it turns out that the script does not work. Could it be CMX's fault or PHP version 8.x?
You might try the Cutils snow reporting when the new CMX is released (which contains the new snow database).

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Wed 27 Nov 2024 7:31 pm
by Dador
surban21 wrote: Wed 27 Nov 2024 6:07 pm
Dador wrote: Mon 25 Nov 2024 8:44 pm The new winter season 2024/2025 has arrived, but it turns out that the script does not work. Could it be CMX's fault or PHP version 8.x?
Dador - each year the "new" season will not show until you make the first entry for that season. It does not automatically roll over.
I noted snowfall a few days ago and entered it in my diary. However, the new season has not appeared. I didn't change anything in the settings. For now, I don't know what doesn't work.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Wed 27 Nov 2024 7:33 pm
by Dador
HansR wrote: Wed 27 Nov 2024 6:14 pm
Dador wrote: Mon 25 Nov 2024 8:44 pm The new winter season 2024/2025 has arrived, but it turns out that the script does not work. Could it be CMX's fault or PHP version 8.x?
You might try the Cutils snow reporting when the new CMX is released (which contains the new snow database).
Of course I will test it. :D
I'm waiting for the official release of CMX 4.3 and Cutils 7.3

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Thu 28 Nov 2024 12:35 pm
by surban21
For now, I don't know what doesn't work.
Dador - I suggest re-reading the install instructions to verify nothing was changed or corrupted. I would also suggest looking at or reinstall the SnowSumData.php file and adjust the USER DEFINED VARIABLES in that file to suit your location. This file creates the text file of the same name which gets uploaded to your website. Mine works as designed as did weatherbee's. I know yours has been heavily modified by you for your needs and maybe that could have broke something but I know that yours did work previously.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Thu 28 Nov 2024 9:14 pm
by Dador
surban21 wrote: Thu 28 Nov 2024 12:35 pm
For now, I don't know what doesn't work.
Dador - I suggest re-reading the install instructions to verify nothing was changed or corrupted. I would also suggest looking at or reinstall the SnowSumData.php file and adjust the USER DEFINED VARIABLES in that file to suit your location. This file creates the text file of the same name which gets uploaded to your website. Mine works as designed as did weatherbee's. I know yours has been heavily modified by you for your needs and maybe that could have broke something but I know that yours did work previously.
Thanks for the tips. Do you have any alternative to xampp that would work with your script? I think it might have been his fault.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Thu 28 Nov 2024 9:50 pm
by surban21
Check your SnowSumData,txt file that gets uploaded to your website which contains the weather diary data. Look for fTimestamp toward the end of the file and see if the last date you made an entry in CMX is in there. If not, then verify in Extra Web Files inside CMX that it looks something like this below:

Screenshot Extra web files - Cumulus MX.png

Of course use your own directory paths where the snowSumDataT.txt file is located and where you want the converted snowSumData.txt to be uploaded.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Sat 30 Nov 2024 9:39 pm
by Dador
I reinstalled the original version 1.1.
My problem is that php-win.exe doesn't seem to work for me. I reinstalled xampp, turned off UAC in windows, because xampp had a problem with it. However, it still doesn't work. The snowSumData script is not executed locally on my computer.

In xampp don't work only Tomcat.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Sat 30 Nov 2024 10:02 pm
by freddie
You don't need Tomcat for PHP. Different technologies.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Sun 01 Dec 2024 11:25 am
by surban21
Dador - since it sounds like a problem with your php and you reinstalled xampp, check the php.ini file and search for sqlite. Look for extension=pdo_sqlite and if there is a semi-colon ( ; ) in front of it, delete the semi-colon and save the ini file. I seem to remember that I had to do this when I installed xampp/php. I could be wrong but something to check anyway.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Sun 01 Dec 2024 1:57 pm
by Dador
I did as you indicated, but it still doesn't work.
I noticed that the snowSumDataT.txt file stopped overwriting on October 2, 2024, and CMX 4.2 was released on October 1. I wonder if it's CMX's fault.

Edit:
In release 4.2.0 [b4039] - 2024-10-01 I found such changes.

Changed
External Programs now sets the working directory to the location of the executable/script rather than the Cumulus MX home directory - (Here I don't understand what the change has been)

Package Updates
SQLite: Reverted to v2.1.8 pending fix from author

Perhaps one of the above options prevents the script from being executed by CMX. Both my CMX installations where I use the snowSummary.php script stopped overwriting after installing version 4.2.0