Ok so this is what I want to make:
red = booked
green = available
I have data in mysql in the format of:
property_id, booked_from, booked_until
.
Before I start trying to create the correct loops etc to create and style the table, i thought i best ask if there are already good jquery plugins / php classes create this visual interface and uncluttered enough to allow me to add a select date range method (like Google Analytics)?
I'm looking for something to create a basic calendar table on a loop, which i can then style and add jquery features. Though worth asking if there's a complete package that already does what i plan on making?!!
(jquery ui's date-picker doesn't look powerful enough / easy enough to modify)
Opened to any other suggestions and links!
I had to build an entire calendar based web app with PHP and MySQL not so long ago. I found that David Walsh articles are life savers.
If you want to tweak the JQuery UI DatePicker, you should read this: http://davidwalsh.name/jquery-datepicker-disable-days
If you want to build and display your own calendar, this article helped me a lot: http://davidwalsh.name/php-calendar There's a complete series on this PHP+MySQL Calendar.
The real challenge in this kind of applications is the model you use to store and retrieve data from the database. Showing information shouldn't be that complex.
As the second link suggests, you can easily bring to an array all the booked dates from an specific month and then loop through each day printing a "cell". If the cell is booked, add the "red" class to the div. Otherwise, add the "green" class.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With