Year 2008 doesn't work in version 0.6.1
Posted: Mon Mar 10, 2008 1:27 pm
My employer uses PHP-Residence 0.6.1. We have a problem
with it. (It might be the same as the problem described
in the post "Creating new year bug in 0.7.1", at
http://www.digitaldruid.net/php-residen ... .php?t=411 .)
The problem is as follows. If, from the page headed "Main menu of year
2008", I click the button which reads "View and Modify the Reservations"
(after making sure to specify March as the month and 2008 as the year),
I get a page for September 2008, which lists all the apartments (but
no reservations).
If I click the "March" link in the menubar, I get a
page with the same content. The URL when I do this is
/bookingmanager/tabella.php?id_sessione=&anno=2008&mese=3 (I've
left out the domain, to preserve privacy). If I edit the URL to be
/bookingmanager/tabella.php?id_sessione=&anno=2007&mese=15, I get a page
which shows all the apartments, with reservations for some of them.
My manager is normally the one who uses PHP-Residence. Apparently the
problem has existed since the start of the year, and he has been working
around it by editing the URL as I've just described.
I upgraded PHP-Residence to version 1.0.1, but the problem was still
there. (I therefore restored everything from backup, so we're now
running version 0.6.1 again.)
Last year, I wrote a program to query our PHP-Residence database, so I
have a little understanding of the database schema. The contents of
the periodi2008 table seem odd to me. I ran this SQL query from the
MySQL client:
select min(idperiodi), max(idperiodi), count(*), min(datainizio),
min(datafine), max(datainizio), max(datafine) from periodi2008
The output was:
min(idperiodi): 1
max(idperiodi): 365
count(*): 365
min(datainizio): 2008-09-01
min(datafine): 2008-09-02
max(datainizio): 2009-08-31
max(datafine): 2009-09-01
I'm going to mention 2 other things that may be irrelevant, but which
may tell you what's going wrong.
Firstly, for comparison, here is the result of running the above query
on the periodi2007 table:
min(idperiodi): 1
max(idperiodi): 762
count(*): 762
min(datainizio): 2007-01-01
min(datafine): 2007-01-02
max(datainizio): 2009-01-31
max(datafine): 2009-02-01
Secondly, every rate (tariffa1, tariffa2, etc) in every row in the
periodi2008 table is NULL.
And now (at last) my question: is there any way to change the database so
that the software will work properly? I am entirely comfortable working
with SQL and PHP, so if the solution involves writing code, I can do that.
If you like, I can give you access to our installation of PHP-Residence
(i.e. I can let you use it), and I can also send you a copy of our
database.
with it. (It might be the same as the problem described
in the post "Creating new year bug in 0.7.1", at
http://www.digitaldruid.net/php-residen ... .php?t=411 .)
The problem is as follows. If, from the page headed "Main menu of year
2008", I click the button which reads "View and Modify the Reservations"
(after making sure to specify March as the month and 2008 as the year),
I get a page for September 2008, which lists all the apartments (but
no reservations).
If I click the "March" link in the menubar, I get a
page with the same content. The URL when I do this is
/bookingmanager/tabella.php?id_sessione=&anno=2008&mese=3 (I've
left out the domain, to preserve privacy). If I edit the URL to be
/bookingmanager/tabella.php?id_sessione=&anno=2007&mese=15, I get a page
which shows all the apartments, with reservations for some of them.
My manager is normally the one who uses PHP-Residence. Apparently the
problem has existed since the start of the year, and he has been working
around it by editing the URL as I've just described.
I upgraded PHP-Residence to version 1.0.1, but the problem was still
there. (I therefore restored everything from backup, so we're now
running version 0.6.1 again.)
Last year, I wrote a program to query our PHP-Residence database, so I
have a little understanding of the database schema. The contents of
the periodi2008 table seem odd to me. I ran this SQL query from the
MySQL client:
select min(idperiodi), max(idperiodi), count(*), min(datainizio),
min(datafine), max(datainizio), max(datafine) from periodi2008
The output was:
min(idperiodi): 1
max(idperiodi): 365
count(*): 365
min(datainizio): 2008-09-01
min(datafine): 2008-09-02
max(datainizio): 2009-08-31
max(datafine): 2009-09-01
I'm going to mention 2 other things that may be irrelevant, but which
may tell you what's going wrong.
Firstly, for comparison, here is the result of running the above query
on the periodi2007 table:
min(idperiodi): 1
max(idperiodi): 762
count(*): 762
min(datainizio): 2007-01-01
min(datafine): 2007-01-02
max(datainizio): 2009-01-31
max(datafine): 2009-02-01
Secondly, every rate (tariffa1, tariffa2, etc) in every row in the
periodi2008 table is NULL.
And now (at last) my question: is there any way to change the database so
that the software will work properly? I am entirely comfortable working
with SQL and PHP, so if the solution involves writing code, I can do that.
If you like, I can give you access to our installation of PHP-Residence
(i.e. I can let you use it), and I can also send you a copy of our
database.