Hello,
I installed AGreservations modules and this message is showing after customer choose date, number of units and try to "add to cart" :


• warning: mktime() expects parameter 4 to be long, string given in /home/ftponly/usr/gtestujt/web/sites/all/modules/agreservations/includes/agres_funcs.inc on line 111.
• warning: mktime() expects parameter 4 to be long, string given in /home/ftponly/usr/gtestujt/web/sites/all/modules/agreservations/includes/agres_funcs.inc on line 112.
• 0 item(s) in the cart.
I tried to change the code on line 111 and 112, but no change seen.
$iDateFrom=mktime(4,0,0,substr($strDateFrom,5,2), substr($strDateFrom,8,2),substr($strDateFrom,0,4));
$iDateTo=mktime(4,0,0,substr($strDateTo,5,2), substr($strDateTo,8,2),substr($strDateTo,0,4));
Changed to:
$iDateFrom=mktime(1,0,0,substr($strDateFrom,5,2), substr($strDateFrom,8,2),substr($strDateFrom,0,4));
$iDateTo=mktime(1,0,0,substr($strDateTo,5,2), substr($strDateTo,8,2),substr($strDateTo,0,4));
Any idea how to correct this problem?
Thanks in forward.
Comments
Comment #1
agill commentedhello,
it originally worked...i guess in more recent php versions this is causing warnings now.
solution:
change it to:
$iDateFrom=mktime(1,0,0,intval(substr($strDateFrom,5,2)),intval(substr($strDateFrom,8,2)),intval(substr($strDateFrom,0,4)));
$iDateTo=mktime(1,0,0,intval(substr($strDateTo,5,2)),intval(substr($strDateTo,8,2)),intval(substr($strDateTo,0,4)));
the intval function is applied to the according function in the 7.x versions of agreservations
but i did not add it to the d6 versions yet because i normally do not work on the old
d6 version anymore.
Comment #2
PN1 commentedHello,
many thanks for quick reply.
Your new code:
let go thrue complete process of reservation but selected one night (the same year) is



count as 365nights (one year).
How to correct?
Thanks in forward for reply.
More in Prt sc:
Comment #3
PN1 commentedProblem with number of choosen and showed nights is fixed.
I checked all AGreservation modules, fields and set up and if I good remember
changed only format of date in URL: www.myweb.cz/admin/settings/date-time/formats
FROM:
Date formats
Long date format: Saturday 2013, February 23, 15:20
Střední date format: 2013, February 23 - 15:26
Short date format: 2013/02/23 15:26
TO:
Date formats
Long date format: Saturday, February 23, 2013 - 15:26
Střední date format: Sat 2013-02-23 15:26
Short date format: 2013-02-23 15:26
And now number of choosen date (nights-on first step of reservation) coresponde with number of showed dates (nights) in next steps windows.
Comment #3.0
PN1 commentedadd the code which was changed.