DMXzone Calendar 2 Support Product Page

Dynamically block reserved dates in database

Reported 27 Sep 2013 15:51:12
2
have this problem
27 Sep 2013 15:51:12 David Hampton posted:
I'm using the calendar for rental cabins with PHP and mySQL database. After rental dates have been entered into the database by a customer, I want them blocked out to show they are already booked and can't be selected by the next person making a reservation. How is this done? Just so you know...I had gone through all the instructional videos prior to asking this question, and I can find nothing to provide me with a COMPLETE tutorial regarding my issue. I have a test page up using the calendar to insert dates into a MySQL database (utilizing the tutorial "Using Standard Dreamweaver Insert Record Behavior). That works fine. I want to use the same page to dynamically reflect dates that have already been reserved. The video "Holiday Reservation System" does not use dynamic data so it won't work. I've followed the video "Dynamic Conditional Formatting" until it gets to setting the class from the dropdown, but there is nothing in my dropdown menu to select. How do I get (create) the class? Also, should the "Selectable" checkbox be checked? I copied the conditional statement from the video then the next page goes to a "SQL Query Area" Where is this page? This is where it gets confusing...How does the "yes" or "no" condition get into the database? Then the video ends???
I'm not that experienced with PHP, but I can usually follow along with most tutorials. I'm lost here. Can you please be of assistance?

Replies

Replied 27 Sep 2013 16:01:19
27 Sep 2013 16:01:19 Teodor Kuduschiev replied:
Hello David,

The Class that is inside the dropdown is a simple CSS Class. You can create it using the ( + ) icon if it is easier for you.
The Selectable checkbox should not be checked, of course, when the date is reserverd
The YES/NO condition is just an example. This can be any condition in your database, something you use to mark your dates as "reserved" when inserting them into the database table.
Replied 27 Sep 2013 20:12:47
27 Sep 2013 20:12:47 David Hampton replied:
I've completed the conditional requirements on the calendar page and now the calendar does not even show up on the page. Any ideas? Here's the link to the test page:
www.the-cabins.net/rentalsnew/rentaltest.php
Replied 28 Sep 2013 07:52:40
28 Sep 2013 07:52:40 Teodor Kuduschiev replied:
Hello,

The Jquery on your server is an old version. Please reapply the extension and upload the latest one to your server.
Replied 28 Sep 2013 18:53:41
28 Sep 2013 18:53:41 David Hampton replied:
I have done that and it still does not work. I have downloaded and installed the latest version of the calenadar2 program"2.1.2" (twice). I have deleted the jquery-latest.pack.js from my local files, reintroduced the the calendar to the page and it automatically adds the deleted js file and uploads it to my server. The version of the js file is: v1.8.3 I believe this is an older version, but it is the one that downloaded with calendar2 "2.1.2" If this is the problem, how do I get an updated jquery-latest.pack.js file?
Replied 30 Sep 2013 07:51:28
30 Sep 2013 07:51:28 Teodor Kuduschiev replied:
Hello David,

It seems your DB returns some empty objects and the calendar cannot render them.
Can you please create a recordset of your database table containing the conditional dates and place it on your page, so we can see what is wrong?
Replied 30 Sep 2013 07:51:28
30 Sep 2013 07:51:28 Teodor Kuduschiev replied:
Hello David,

It seems your DB returns some empty objects and the calendar cannot render them.
Can you please create a recordset of your database table containing the conditional dates and place it on your page, so we can see what is wrong?
Replied 30 Sep 2013 19:31:41
30 Sep 2013 19:31:41 David Hampton replied:
I added a database table some distance below the calendar on the same page. It does not return any data from the database. I loaded another page with JUST the table and no calendar, and it returns data properly. Here are the two page locations:
www.the-cabins.net/rentalsnew/rentaltest.php
www.the-cabins.net/rentalsnew/datetest.php
Replied 03 Oct 2013 12:38:42
03 Oct 2013 12:38:42 David Hampton replied:
I'm sorry, I just checked the second link and the address was incorrect. It should be:
www.the-cabins.net/rentalsnew/datestest.php
Replied 15 Oct 2013 18:37:10
15 Oct 2013 18:37:10 David Hampton replied:
Teodor,
I provided the pages you requested over two weeks ago, but have not heard from you. I need to get this site working soon. Can you please provide me with an answer to my problem?
Thank you,
David Hampton
Replied 16 Oct 2013 08:48:48
16 Oct 2013 08:48:48 Teodor Kuduschiev replied:
Hello David,
Please check your email.
Replied 16 Oct 2013 15:50:22
16 Oct 2013 15:50:22 David Hampton replied:
Hi Teodor,
I received the new Calendar2 extension and loaded it. Now when I bring up the page I'm working on I receive the following error messages after the page loads:
"While executing onLoad in dmxCalendar20_install.htm, the following JavaScript errors occurred:
In file "dmxCalendar_install":
initUI is not defined"

And when I try to cancel or continue, I receive:
"While executing onClick in dmxCalendar20_install.htm, the following JavaScript errors occurred:
In file "dmxCalendar_install":
nextStep is not defined"
Replied 16 Oct 2013 16:07:08
16 Oct 2013 16:07:08 Teodor Kuduschiev replied:
Please clear your dreamweaver cache and try again: www.dmxzone.com/go/16740/clearing-dreamweaver-s-cache/
Replied 16 Oct 2013 22:13:14
16 Oct 2013 22:13:14 David Hampton replied:
Hi Teodor,
I rebuilt the page with the new extension and I can see the calendar now, but can not select it.
I have a feeling I haven't communicated clearly what I want to happen, because I'm not sure now if the calendar can do what I want based on what I've seen.

I'm going to explain again what I want to happen and please let me know if it can be done and if so, a step by step of how:
1. I want a page with a calendar that allows people to reserve "checkin dates" and "checkout dates" for a cabin along with name, address, etc. That information goes into my database. (I've already done this successfully)
2. On that same page, utilizing the same calendar, when a person selects a date that has already been reserved in the database, I want those dates blocked out and a tooltip message to indicate their reserved status. (I can't seem to make this happen) Here is the location of the current file:
the-cabins.net/rentalsnew/rentaltest2.php
I don't want people to have to go to one calendar to view reserved dates and go to another calendar to make a reservation. It seems like that's the only option. Please let me know.
thank you,
David Hampton
Replied 17 Oct 2013 08:30:22
17 Oct 2013 08:30:22 Teodor Kuduschiev replied:
Hello,

It all seems to be okay except the error message returned in the dev console. I see there that the dates returned appear to be empty..
Can you tell me what is the format of your dates, stored in the database?
Replied 17 Oct 2013 13:27:32
17 Oct 2013 13:27:32 David Hampton replied:
Hi,
The date format in the database is: yy-mm-dd
Here is a link to the coding of the page:
the-cabins.net/rentalsnew/rentaltest2code.txt
Here's a screenshot of the three entries in the database:
the-cabins.net/rentalsnew/screenshot.htm
Hopefully, this information will help.
Replied 18 Oct 2013 09:37:59
18 Oct 2013 09:37:59 Teodor Kuduschiev replied:
Hello David,

It seems you are trying to use the same recordset twice, which causes the issue.
You need to have 2 separate recordsets for the two calendars.
Replied 18 Oct 2013 19:56:50
18 Oct 2013 19:56:50 David Hampton replied:
Hi Teodor,
I added a second recordset for the reserved dates, but it still won't work (dates cannot be selected on the checkin and checkout calendars).
Here is a link to the new code for the page along with the link to the page itself. Can you please look at it and see where the problem lies?
the-cabins.net/rentalsnew/rentaltestfinalcode.txt
the-cabins.net/rentalsnew/rentaltestfinal.php
thank you,
Replied 21 Oct 2013 15:22:48
21 Oct 2013 15:22:48 Teodor Kuduschiev replied:
Once again you are using a same recordset for the two calendars.
All you need to do is to just create 2 different recordsets and then use them in the two callendars like:
Recordset checkin -> use it in checkin Calendar
Recordset checkout -> use it in checkout Calendar
Replied 21 Oct 2013 18:50:52
21 Oct 2013 18:50:52 David Hampton replied:
There are now two recordsets...one named "checkin" and one named "checkout" as you suggested. The calendars still do not work.

Please review code: the-cabins.net/rentalsnew/rentaltest.txt
Here is the actual page online: the-cabins.net/rentalsnew/rentaltest.php
Replied 22 Oct 2013 08:29:04
22 Oct 2013 08:29:04 Teodor Kuduschiev replied:
Okay now it is good, except this part of the code, where you define the condition:
<?php if ($row_reservecabin['agree'] =='yes') { ?>

row_reservecabin seems to me like an old code from a previously created recordset.
Replied 22 Oct 2013 12:48:06
22 Oct 2013 12:48:06 David Hampton replied:
Hi Teodor,
You're correct that code was from a previously created recordset. I changed each calendar to reflect the proper recordsets on the page and unfortunately it still does not work. When you try and click on the calendar icon(s) nothing happens.
Page: www.the-cabins.net/rentalsnew/rentaltest.php
Code: www.the-cabins.net/rentalsnew/rentaltest.txt
Replied 30 Oct 2013 02:44:53
30 Oct 2013 02:44:53 David Hampton replied:
Hi Teodor,
Any word yet on this problem? I'm still hanging in limbo.
Replied 05 Nov 2013 23:25:59
05 Nov 2013 23:25:59 David Hampton replied:
Hi Teodor,
Can someone please respond to this continuing problem?
Replied 07 Nov 2013 15:56:23
07 Nov 2013 15:56:23 Teodor Kuduschiev replied:
Hello,

An update of Calendar 2 is coming next week. It will fix the issue.
Replied 19 Nov 2013 16:32:51
19 Nov 2013 16:32:51 David Hampton replied:
I loaded the new update and it still does not work. Can you please look at the pages and give me an idea of what needs to be corrected to make it work?
Thanks,
Here is the page: www.the-cabins.net/rentalsnew/rentaltest.php
Here is the code: www.the-cabins.net/rentalsnew/rentaltest.txt

Reply to this topic