Results 1 to 6 of 6

Thread: Booking Calendar

  1. #1
    lazy student nvening's Avatar
    Join Date
    Jan 2005
    Location
    London
    Posts
    4,656
    Thanks
    196
    Thanked
    31 times in 30 posts

    Booking Calendar

    Hi, I am looking to create a calendar where I the user can select one or multiple dates for booking. Dependant on what dates and how many the user selects the price is worked out etc. Also already booked dates would be shown so they cannot be selected

    I'm sure there are scripts like this available but I would like to use this situation to learn some JavaScript - I think this is the best language to use? I am already competent in HTML/CSS.

    So JavaScript on the front end accessing a mysql database, is this the standard method of working JavaScript aps? I think this type of thing is know as AJAX?

    Anyway, I just wanted to ask for some guidance as to what to look into and how the app could work.

    Cheers, Neil
    (\__/)
    (='.'=)
    (")_(")

  2. #2
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,232
    Thanked
    2,290 times in 1,873 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Booking Calendar

    Javascript isn't really designed for accessing and updating databases - it's designed for creating a more dynamic and interactive experience on a web page. Javascript on its own can't retrieve data from your database - it needs some other serverside technology to process and output the data. Ajax does this on the client side by sending a request to a web server for some information, however the server has to respond with appropriately formatted data - i.e. some kind of text stream. To acheive that you'll need scripts on your server that can access your database, retrieve the necessary information, then format it appropriately for your ajax script to handle.

    However, your serverside scripts could also access the database then format the data into a new HTML page that is returned to the server - this is how most web apps work, and is also the way HTTP is *designed* to work: when the user fills out an HTML form and hits the submit button, their browser seonds all the input they've made to the web server, and expects to get a web page in reply. Ajax uses (abuses?) the fact that HTTP doesn't actually care whether you send HTML, XML, or any other format of data to give the impression of a user using a "normal" application, but it is essentially a trick.

    Anyway, you'd need serverside scripting in php, perl, ASP.NET or any of a wide variety of other languages, which would retrieve your data from the database. You would then either build this into dynamic web pages on the server and return this web page to the user, or format the data as XML and use an AJAX technology in a static webpage to retrieve and display the data. Ideally, if you're using ajax you'd also set up the app so it can work without javascript, and there are some clever tricks for doing this.

    In the first instance, however, I'd strongly recommend going down the "classic" route (i.e. using ordinary forms and doing all the processing on the server) as it means only one set of coding (serverside language to create a dynamic web page) rather than two (serverside language to create an XML feed, plus AJAX to handle the data on the web page).
    Last edited by scaryjim; 17-02-2010 at 01:37 AM.

  3. Received thanks from:

    nvening (17-02-2010)

  4. #3
    lazy student nvening's Avatar
    Join Date
    Jan 2005
    Location
    London
    Posts
    4,656
    Thanks
    196
    Thanked
    31 times in 30 posts

    Re: Booking Calendar

    Ah thats really helpful thanks, its given me more of an idea and pointed me in the right direction!

    I think ill follow your advice and create a basic form based version of the concept linked up to a mysql database via php. Then ill ajax it up *coined* later on. I know its not necessary to use Ajax for this project but its something i definitely want to learn how to implement it.

    Neil
    (\__/)
    (='.'=)
    (")_(")

  5. #4
    The late but legendary peterb - Onward and Upward peterb's Avatar
    Join Date
    Aug 2005
    Location
    Looking down & checking on swearing
    Posts
    19,378
    Thanks
    2,892
    Thanked
    3,403 times in 2,693 posts

    Re: Booking Calendar

    The 'standard' server-side scripting language to access mysql databases is php. (V-bulletin - which hosts Hexus is a php application running on top of a mysql database - so it is pretty scaleable. There are many other PHP apps around, Wordpress for example. If you haven't looked at php for retreiving (and writing) data to a mysql databqase, it might be worth spending a little time looking at it to see if it meets your requirements.
    (\__/)
    (='.'=)
    (")_(")

    Been helped or just 'Like' a post? Use the Thanks button!
    My broadband speed - 750 Meganibbles/minute

  6. #5
    lazy student nvening's Avatar
    Join Date
    Jan 2005
    Location
    London
    Posts
    4,656
    Thanks
    196
    Thanked
    31 times in 30 posts

    Re: Booking Calendar

    Im familiar with php/mysql I just wanted to use ajax to so that no page refreshes were needed, thus enabling the user to quickly and easily change their selection and choose what dates are the best for them depending on price etc

    Cheers, Neil
    (\__/)
    (='.'=)
    (")_(")

  7. #6
    The late but legendary peterb - Onward and Upward peterb's Avatar
    Join Date
    Aug 2005
    Location
    Looking down & checking on swearing
    Posts
    19,378
    Thanks
    2,892
    Thanked
    3,403 times in 2,693 posts

    Re: Booking Calendar

    Ah - I see - a sort of 'auto-refresh' whenever a change is made by the user.
    (\__/)
    (='.'=)
    (")_(")

    Been helped or just 'Like' a post? Use the Thanks button!
    My broadband speed - 750 Meganibbles/minute

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Android mobile phone - Google calendar problem
    By tjrundy in forum Smartphones and Tablets
    Replies: 2
    Last Post: 29-12-2009, 08:49 PM
  2. What is the best Calendar solution?
    By Parm in forum Software
    Replies: 10
    Last Post: 25-01-2008, 02:58 PM
  3. Free Jack Daniels 2007 Calendar
    By MagicFreebiesUK in forum Retail Therapy and Bargains
    Replies: 48
    Last Post: 17-01-2007, 01:05 PM
  4. Calendar logging in Outlook 2003
    By Dooms in forum Software
    Replies: 0
    Last Post: 29-11-2006, 03:46 PM
  5. Creating a Simple Web based calendar?
    By sybrows in forum Software
    Replies: 1
    Last Post: 18-06-2006, 10:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •