0% found this document useful (0 votes)
32 views5 pages

IRCTC Reservation System Report

Uploaded by

Adwait
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views5 pages

IRCTC Reservation System Report

Uploaded by

Adwait
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Adwait Date (A009), Varsha Gupta (A017), Mahek Jalawadiya (A021),

Purva Kamerkar (A025).

Project Report: IRCTC Reservation System


This report presents the IRCTC Reservation System project, developed by team members:
Adwait Date (A009), Varsha Gupta (A017), Mahek Jalawadiya (A021), and Purva Kamerkar
(A025).
The project simulates a train booking and reservation system using PHP, JavaScript, and
MySQL. The following sections provide an in-depth analysis of the data structures and
algorithms used in the project.

Data Structures
The project utilizes various data structures in both the backend (PHP) and frontend
(JavaScript):

1. Arrays : Arrays are frequently used for storing lists of passengers, train details, and user
input data. In PHP, indexed and associative arrays handle data from the MySQL database. In
JavaScript, arrays are employed to manage DOM elements, user inputs, and dynamically
generated lists.

2. Associative Arrays (PHP) : Associative arrays are used to store key-value pairs, such as
user session data and fetched results from SQL queries. This allows efficient data retrieval
using descriptive keys.

3. Objects (JavaScript) : JavaScript objects are used to represent complex entities, such as
user credentials and train information. They provide a structured way to group related data,
making it easier to manipulate and access.

4. Stack (JavaScript for Recent Searches)


The `dashboard.php` file implements a stack data structure in JavaScript to manage recent
train search queries. A stack is a Last-In-First-Out (LIFO) data structure, which is well-
suited for this feature because the most recent searches are displayed first.
- Push Operation : When a new search is performed, the query is added (pushed) to the top
of the stack.
- Pop Operation : If the stack exceeds a certain size, the oldest search query is removed
(popped) to maintain a fixed number of recent searches.
This implementation provides an efficient way to track and display the user's recent
activities in a chronological order.

Algorithms

1. Form Validation (JavaScript)


The `login.js` script employs regular expressions for input validation. The following checks
are implemented:
- Username Validation : Ensures the username is 6-10 characters long and contains both
Adwait Date (A009), Varsha Gupta (A017), Mahek Jalawadiya (A021),
Purva Kamerkar (A025).

uppercase and lowercase letters.


- Password Validation : Enforces password rules requiring uppercase, lowercase, and
special characters, with a length of 6-11 characters.
- Phone Number Validation : Confirms that the phone number consists of exactly 10 digits.
These checks prevent invalid data from being submitted to the server, enhancing security
and user experience.

2. Sorting Algorithms (JavaScript)


The `trains3.php` file implements custom sorting algorithms in JavaScript for sorting train
search results. The `sortTrains()` function sorts the trains based on three criteria:

- Departure Time Sorting : Converts the departure time from 'HH:MM' format to total
minutes (using `hours * 60 + minutes`) and sorts the trains numerically. This ensures that
the earliest departure times appear first.

- Arrival Time Sorting : Similar to departure time sorting, the arrival times are converted to
total minutes and sorted numerically.

- Name-Based Sorting : Uses the `localeCompare()` method for lexicographical comparison


of train names, sorting them alphabetically.

3. CRUD Operations (PHP and SQL)


The project backend, implemented in PHP, performs various Create, Read, Update, and
Delete (CRUD) operations with the MySQL database. These include:
- Create : Inserting new user registrations and booking records into the database.
- Read : Fetching train details, user data, and booking history using SQL `SELECT` queries.
- Update : Modifying user details or updating booking statuses.
- Delete : Removing cancelled bookings from the database.

4. Search and Filter Algorithms (PHP and JavaScript)


The project includes search functionalities to filter trains based on user input, such as
source, destination, and journey date. These are implemented using SQL `SELECT` queries
with `WHERE` clauses for backend filtering. On the frontend, JavaScript functions filter
displayed results based on selected journey class and time preferences.

Conclusion
In summary, the IRCTC Reservation System project effectively uses a combination of data
structures and algorithms to manage user data, provide search functionality, and
dynamically update the UI. The implemented validation, sorting, stack operations, and
CRUD functionalities demonstrate a strong understanding of both frontend and backend
development, as well as efficient data handling.
Adwait Date (A009), Varsha Gupta (A017), Mahek Jalawadiya (A021),
Purva Kamerkar (A025).
Adwait Date (A009), Varsha Gupta (A017), Mahek Jalawadiya (A021),
Purva Kamerkar (A025).
Adwait Date (A009), Varsha Gupta (A017), Mahek Jalawadiya (A021),
Purva Kamerkar (A025).

You might also like