3 Replies Latest reply: Jul 22, 2014 4:28 PM by Rob Hecker2 RSS

    Coding a Calendar to Show What Days an Item Has Been Booked

    Max Resnikoff Community Member

      Hi,

       

      I have an inventory system already made, which displays all of my inventory.

       

      I now need to create a way in which people can see a small calendar next to the item to see what days it has been booked.

      I also need to create a page where people can book the item, and it will update on the inventory list.

       

      The calendar should show the dates which are booked, and information about the booker/location etc should show up if you click on the dates booked.

       

      I found an example of this on youtube, but can't seem to find any codes for sale that do what i need to do. : Event Calendar Tutorial - YouTube

       

      I don't have an in-depth knowledge about PHP, so any help (for noobs) will be very much appreciated.

      If there are any features in Dreamweaver I would find that easier than just coding.

      This is for a school project btw.

       

      Thank you!

        • 1. Re: Coding a Calendar to Show What Days an Item Has Been Booked
          Rob Hecker2 CommunityMVP

          OK. I do a lot of work in PHP with scheduling appointments, booking rooms, etc. On the one hand, PHP has a really great dateTime class for performing all kinds of actions with dates and times, but I think your project would get you into some moderately advanced database and PHP work.

           

          This would also require working with multi-level arrays. For each date cell to be click-able and return the info for the booking on that date (or date range) then the calendar array must be populated with the relevant data from the database.

           

          If you wrote your own inventory system from scratch (meaning also that Dreamweaver didn't write the data bindings) then you may be up for such a project.

           

          If you do go down this road, then get off on the right foot by storing dates in the database as dates (2014-07-22), never as text. Remember that humans, LINUX, and MySQL each use a different format for dates. Also, in PHP, dates should be worked with as dates, not strings. Don't use the PHP date functions. Use the dateTime class instead.

          • 2. Re: Coding a Calendar to Show What Days an Item Has Been Booked
            Max Resnikoff Community Member

            Hi,

            Thank you for your response.

             

            Dreamweaver did all the bindings for me.

             

            Do you think there is an easier way to go about this?

            I don't have much time, and I am stuck on this.

             

            Maybe not have a calendar. How would I go about letting the user know if the item is available when they are booking something?

             

            Thank you for your help!

            • 3. Re: Coding a Calendar to Show What Days an Item Has Been Booked
              Rob Hecker2 CommunityMVP

              It would certainly be easier to code if you don't show the info on a calendar; however, people really like that visual way of getting info.

               

              You could go at it from the opposite direction, have people enter the dates, then you check the database for a match. For that purpose you can use the nice little jquery calendar widget as a way of inputting their date data.