Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ticketing UI

Files Included

The main homepage. It displays a title "Nowtrack", inspired by the name of USA's train system, Amtrack.

  • Four buttons are displayed:
    • Book : opens book.html
    • My Trip : opens ticket.html
    • My Account : blank button to fill space, later implementation.
    • Customer Service : blank button to fill space, to maybe later implementation.

Displays user input options for booking their ticket.

  • Some Features:
    • Takes in three user inputs (Travel Date, Number of Travelers, and Destination).
    • Travel Date requires month input before day input to properly display the right amount of days in the month.
      • this code was helped by ChatGPT.
    • writeCSVFile() is called and creates reservations.csv (to be replaced)
      • possible database to hold this information can be implemented at a later time.
      • Booking Number is displayed to show everything worked correctly.
      • User is presented with "Home" and "See Ticket" buttons.

Code and Features Explained

Displays user input options for booking their ticket.

  • There is an if statement that checks if all input values have been properly filled.
    • It will give an alert to tell the user to input all values if this if statement isn't statisfied.
  • writeCSVFile() creates a .csv file to hold booking information.
    • calls generateReservationNumber() to create a reservation number between 0001 - 9999
    • formats date from 2024 [Month] [Day] --> 2024-MM-DD

The following instructions are how to use this page:

  1. Click "Load Booking Data" (it is preconfigured to load a file named "reservations.csv"
  2. Type in your reservation number (it must be 4 digits)
  3. Press "Confirm"
  4. The details of your reservation will show!
  • Within ticket.html, it has a functions loadCSV() and parseCSV() that parces through the file to store it locally while the file is running in the browser.
  • the function getTicket() pulls data from the array that was created with parseCSV() to find the booking details according to the provided reservation number.

About

Ticketing Service Prototype

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages