Online Railway Ticketing Management System (2021)
Introduction
Sri Lanka Railways (SLR) is one of the leading public transport service providers in Sri Lanka. It is the only railway passenger transport service provider in the country to be précised. In a time when many other countries have developed and enhanced their railway services with the use of new technologies, the progress made by Sri Lanka Railways is somewhat questionable, especially regarding the ticketing process.
​
Since the time the railway services were initially operational in the country, a special cardboard-printed ticket was used as the passenger ticket in Sri Lanka Railway. However, even after several decades, the same process with the cardboard-printed ticket is used in SLR at present.
​
These passenger tickets are only available at the ticket counters in railway stations and it is a manual process. Therefore, possible delays when issuing tickets at busy stations and the high cost of ticket printing materials are the common drawbacks of this manual ticketing process. In addition, it is difficult to get real-time records on the amount of ticket sales as it is a system that is handled manually. Therefore, in a time where technology is effectively used to enhance the productivity of services, the ticketing process of SLR can also be subjected to numerous changes to enhance its productivity and quality.
​
The proposed solution for the problems mentioned above is a web-based ticketing and booking management system. As the main client user, a Passenger will be able to search for trains, buy tickets and pay online with their credit cards through this system. Therefore, a Passenger will not have to be in a queue at a railway station to get tickets. In addition, the use of traditional cardboard-printed tickets will be partially replaced through this system with a Quick Response (QR) code based ticket delivered via an email to the passenger.
​
Furthermore, this web-based system is consisted of a module that includes details on famous attractions in Sri Lanka. A chatbot service will be provided through this system to ensure that the local and foreign passengers are guided well to make their travel plans by train with ease when visiting those places.
Administrators and the Railway Officers will also have access to the system on behalf of SLR. These two types of users will have different authentication levels in the system. The Administrators can manipulate the data regarding the stations, fares and trains. The railway officers who are assigned by the Administrators will be playing a supportive role to the passengers in manipulating data related to the payments. Both the Administrators and the Railway Officers can check on records regarding ticket sales and payments.
This web-based system is structured and engineered using programming languages, tools and frameworks such as PHP, HTML, CSS, JavaScript and Bootstrap. In addition, a MySQL database is used to store and manage the data related with the system.
Functional & Non-Functional Requirements
Functional Requirements - Passenger
-
A Passenger should be able to search for trains based on train type, date and class availability.
-
A Passenger should be able to use the Chatbot service to get details on Attractions and make travel plans.
-
A non-registered Passenger should create an account and register with the system before applying to buy tickets.
-
A Passenger should have the option to log in and log out of the system when needed.
-
A registered Passenger should be able to buy tickets for multiple passengers at once and pay online using a credit or debit card.
-
Once a payment is made, the Passenger should receive a QR code-generated ticket via email.
-
Registered Passengers should be able to search and view previous ticket purchase records and status.
-
A registered Passenger should have the option to update the account details including the password.
-
A Passenger should be able to provide feedback about the service.
Functional Requirements - Railway Station Officer
-
A Railway Officer should be able to search and view a list of trains available based on the type, classes and date.
-
A Railway Officer should be able to view a list of passengers based on the stations that they occupy.
-
A Railway Officer should be able to view a list of purchased train tickets.
-
A Railway Officer should be able to view and add reports based on the income from ticket sales.
-
A Railway Officer should have the capability to update personnel profile details when required.
Functional Requirements - Administrator
-
Only the Administrator can add or remove Railway Officers, trains, stations, fares and travel options.
-
The Administrator should be able to manage reservation requests.
-
The Administrator should be able to get reports on overall ticket sales.
-
An Administrator should be able to view the user login session details.
-
Only an Administrator of Sri Lanka Railways can view the feedback provided by the users of this system.
Non-Functional Requirements
-
Usability – The user interfaces of the web application will be designed in a user-friendly manner with the heightening of user experience (UX) and efficiency in focus. The user interfaces will include different UI components such as input controls, navigational components and informational components.
-
Security – The Passengers, Administrators and Railway Officers will have a unique username and password that can be used to login to the system once registered. In addition, the staff of SLR will have different authentication levels as Administrator and Railway Officer.
-
Reliability – The designed web application can be subjected to several tests to ensure that the system will work error-free with intended tasks being performed accurately through this system.
-
Robustness – The database and other physical components of the system should not be harmed in case of a sudden failure. Therefore, smooth handling of unexpected errors is a requirement.
-
Maintainability – The employees who work with the system will need a brief introduction to get used to the system's functionalities and operations. In addition, the servers should be maintained with regular services to avoid unexpected downfalls. A Maintenance Plan can be created to ensure that the maintenance only occurs outside the busy hours of service.
-
In addition, the response time and the recovery time in case of a failure should be satisfactory to avoid inconveniences for the user.
System Design Architecture
Overall System Design
The proposed Trains Ticketing Management System for Sri Lanka Railways is a web-based system. The administrative module of this application is accessed by the Administrators and the Railway Officers. Those two user roles are responsible for the manipulation of data regarding the trains, stations, ticket fares etc. used in this system. The customer module is accessed by the Passengers. A Passenger can access the web application via a web browser and get services such as buying tickets and reserving trains based on their requirements. This graphical representation is used to further explain the overall process of the proposed system.

Usecase Diagram

Class Diagram

Entity Relationship Diagram (ERD)

User Interfaces - Passenger
![]() | ![]() | ![]() |
|---|---|---|
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() |
User Interfaces - Administrator & Railway Officer
![]() | ![]() | ![]() |
|---|---|---|
![]() | ![]() | ![]() |
![]() | ![]() |
Special Features of the System
Password Encryption
The passwords of the user accounts will be saved as encrypted text to enhance the security of the system. This encryption of the passwords is applied for all three user-type accounts in this system. This code line is used for this process.

Password Reset Code
This code is used to generate a random number to allow a registered Passenger to reset the password of their account. This generated random number will be sent for the user via an email and will have to be entered correctly to continue with the password reset process.

CAPTCHA Verification
The Google CAPTCHA verification was also used in this system. The main purpose of using this verification method was to ensure the reduction of possibility on spam accounts accessing the system and its features.

Other Validation Methods
All the forms in the system will be following validation checks as well. So the null values, format errors etc. will be validated when a user is submitting a form in this web system.






















