Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP script for creating calendar table or jquery complete solution required [closed]

Tags:

jquery

php

Ok so this is what I want to make:

alt text

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)

like image 356
finn_meister Avatar asked Feb 28 '23 04:02

finn_meister


2 Answers

How To Build my first Calendar App


  1. Lightweight Calendar Script
  2. Knowledge of Standard Date and Time Formats
  3. PHP Date/Time Function you needs to play with
  4. MYSQL Date/Time Function you needs to play with
  5. XHTML & CSS Style for your Calendar
  6. JAVASCRIPT Framework and Calendar Widget for easy Access
  7. JAVASCRIPT Date/Time Functions you may need to play with
  8. USEFULL STUFF
    1. List of PHP Date Time Examples
    2. Highlight multiple dates in jQuery datepicker
    3. PHP Date Generator

Opened to any other suggestions and links!

like image 139
Luca Filosofi Avatar answered Mar 08 '23 23:03

Luca Filosofi


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.

like image 25
fedeisas Avatar answered Mar 09 '23 01:03

fedeisas