Hello,

I installed AGreservations modules and this message is showing after customer choose date, number of units and try to "add to cart" :
error messageOnly local images are allowed.

•  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.

CommentFileSizeAuthor
#2 1--.jpg116.58 KBPN1
#2 2--.jpg139.56 KBPN1
#2 3--.jpg124.43 KBPN1
#2 4--.jpg140.45 KBPN1
#2 5--.jpg154.1 KBPN1
#2 6--.jpg131.42 KBPN1
#2 7--.jpg156.46 KBPN1
#2 8--.jpg134.01 KBPN1
3-.jpg160.92 KBPN1

Comments

agill’s picture

hello,

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.

PN1’s picture

StatusFileSize
new134.01 KB
new156.46 KB
new131.42 KB
new154.1 KB
new140.45 KB
new124.43 KB
new139.56 KB
new116.58 KB

Hello,

many thanks for quick reply.
Your new code:

$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)));

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:
selected only one night
step 2-ok
wrong-365nights-

PN1’s picture

Problem 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.

PN1’s picture

Issue summary: View changes

add the code which was changed.