Skip to content
Open

Qwwe #29

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dummy-Database.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ CREATE TABLE "RESERVATION"."TRAIN"

CREATE TABLE "RESERVATION"."HISTORY"
(
"TRANSID" VARCHAR2(30) PRIMARY KEY,
"TRANSID" VARCHAR2(36) PRIMARY KEY,
"MAILID" VARCHAR2(40) REFERENCES "RESERVATION"."CUSTOMER"(MAILID),
"TR_NO" NUMBER(10),
"DATE" DATE,
Expand All @@ -65,6 +65,8 @@ INSERT INTO RESERVATION.TRAIN VALUES(10003,'NILANCHAL EXP','GAYA','HOWRAH', 92,
INSERT INTO RESERVATION.TRAIN VALUES(10004,'JAN SATABDI EXP','RANCHI','PATNA', 182, 550);
INSERT INTO RESERVATION.TRAIN VALUES(10005,'GANGE EXP','MUMBAI','KERALA', 12, 945);
INSERT INTO RESERVATION.TRAIN VALUES(10006,'GARIB RATH EXP','PATNA','DELHI', 1, 1450.75);
INSERT INTO RESERVATION.TRAIN VALUES(10008,'MUMBAI MAIL','HAWRAH','MUMBAI', 100, 2150.75);
INSERT INTO RESERVATION.TRAIN VALUES(10007,'AJMER-SEALDAH EXP','SEALDAH','AJMER', 120, 1000.50);

INSERT INTO RESERVATION.HISTORY VALUES('BBC374-NSDF-4673','[email protected]',10001,TO_DATE('02-FEB-2024'), 'HOWRAH', 'JODHPUR', 2, 981);
INSERT INTO RESERVATION.HISTORY VALUES('BBC375-NSDF-4675','[email protected]',10004,TO_DATE('12-JAN-2024'), 'RANCHI', 'PATNA', 1, 550);
Expand Down
117 changes: 68 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# TrainBooking Website
- Youtube video for local setup of similar project: https://www.youtube.com/watch?v=mLFPodZO8Iw&t=8s
- Live Url: https://traintickets.herokuapp.com <br>
- Login Credentials: admin/admin
# Train Ticket Reservation System
<!-- - Youtube video for local setup of similar project: https://www.youtube.com/watch?v=mLFPodZO8Iw -->
- Youtube video for Step by Step Guide on Local Setup: https://www.youtube.com/watch?v=Wd2GlEJJJlw
<!-- - Live Url: https://traintickets.herokuapp.com <br> -->
<!-- - Login Credentials: admin/admin -->

### About:
This project is about the Train-Ticket-Reservation-System which is used to view Train Schedule, search trains, Seat availability, Train timings. We can also enquire about fare of different trains. We can get information about train between two stations. We can book seats online. This provides a safe and secure seat reservation system.
Expand All @@ -15,6 +16,9 @@ This project is about the Train-Ticket-Reservation-System which is used to view
- Trains Between Stations
- Booking seats online.
- Login and Logout Security
- Password Changes
- Payment Gateway
- Ticket Booking History

<span style="color:blue">**The Admin have the following access to this website:-**</span>
- Login
Expand All @@ -33,48 +37,56 @@ This project is about the Train-Ticket-Reservation-System which is used to view
- Search Trains
- Train Avaiablity and Fare Between Stations
- Books Tickets
- View Booking History
- View Profile
- Update Profile
- Change Password
- Logout

### Technologies used:-
1. Front-End Development:
- Html
- Css
- Javascript
- HTML
- CSS
- Bootstrap

2. Back-End Development
- Java
- Java [J2EE]
- JDBC
- Servlet
- Oracle ( SQL )

### ==== Software And Tools Required ======
- : Oracle SQL
- : Eclipse EE
- : Java JDK 8+
- : Tomcat v8.0
-
- : Git [https://www.youtube.com/watch?v=gv7VPQ4LZ7g]
- : Java JDK 8+ [https://www.youtube.com/watch?v=O9PWH9SeTTE]
- : Eclipse EE [https://www.youtube.com/watch?v=8aDsEV7txXE]
- : Apache Maven [https://www.youtube.com/watch?v=jd2zx3dLjuw]
- : Tomcat v8.0+ [https://youtu.be/mLFPodZO8Iw?t=903]
- : Oracle (SQL) / SQL PLUS [https://www.youtube.com/watch?v=ZYOqykEDSqU]
- : Oracle SQL Developer [https://www.youtube.com/watch?v=2a1JKIGVtd0]

### ========== Dummy Database Initialization ===========

STEP 1: Open Oracle Sql Command Line
STEP 1: Open SQL Plus OR SQL Developer

STEP 2: Login to administrator User as: ```connect <username>/<password>```
STEP 2: Login and connect to database using administrator username and password

STEP 3 :Copy paste the following SQL Query:
STEP 3 :Execute the below command first to create a new user:

```SQL
ALTER SESSION SET "_ORACLE_SCRIPT"=TRUE;

ALTER SESSION SET "_ORACLE_SCRIPT"=TRUE;
CREATE USER RESERVATION IDENTIFIED BY MANAGER;

GRANT DBA TO RESERVATION;

COMMIT;

CONNECT RESERVATION/MANAGER;
```
NOTE: If the above command fails for alter session issues, try to remove first line and then execute it.

STEP 4: Now execute the below sql query in same terminal

```SQL

CONNECT RESERVATION/MANAGER;
CREATE TABLE "RESERVATION"."CUSTOMER"
(
"MAILID" VARCHAR2(40) PRIMARY KEY,
Expand Down Expand Up @@ -108,7 +120,7 @@ CREATE TABLE "RESERVATION"."TRAIN"

CREATE TABLE "RESERVATION"."HISTORY"
(
"TRANSID" VARCHAR2(30) PRIMARY KEY,
"TRANSID" VARCHAR2(36) PRIMARY KEY,
"MAILID" VARCHAR2(40) REFERENCES "RESERVATION"."CUSTOMER"(MAILID),
"TR_NO" NUMBER(10),
"DATE" DATE,
Expand Down Expand Up @@ -136,13 +148,24 @@ INSERT INTO RESERVATION.HISTORY VALUES('BBC373-NSDF-4674','[email protected]',1000

COMMIT;
```
STEP 5: Now Execute the below query one by one to check if the tables are created successfully
```SQL
SELECT * FROM ADMIN;
SELECT * FROM CUSTOMER;
SELECT * FROM TRAIN;
SELECT * FROM HISTORY;

```
Note: If any of the above commands fails, please try to fix it first and then proceed to next step

### ====== Importing and Running the Project Through Eclipse EE ===========
Step 0: Open Eclipse Enterprise Edition. [Install if not available]
Step 0: Open Eclipse Enterprise Edition. [Install if not available](https://www.youtube.com/watch?v=8aDsEV7txXE)

Step 1: Click On File > Import > Git > Projects From Git > Clone Uri > Paste The Repository Url: ```https://github.com/shashirajraja/Train-Ticket-Reservation-System.git``` > Next > Select Master Branch > Next > Finish

Step 2: Right Click On Project > Build Path > Configure Build Path > Libraries > Remove And Update Any Libraries With Red Mark > Finish
Step 2.A: Right Click on Project > Run as > Maven Build > In the goals field enter "clean install" > apply > run

Step 2.B: Right Click On Project > Build Path > Configure Build Path > Libraries > Remove And Update Any Libraries With Red Mark > Finish

Step 3: [Only if Tomcat v8.0 is not Configured in Eclipse]: Right Click On Project > Run As > Run On Server > Select Tomcat v8.0 > (Select Tomcat V8.0 Installation Location If Asked) Next > Add <project-name> > Finish

Expand All @@ -161,44 +184,40 @@ Step 8: Default Username And Password For User Is "[email protected]" And "shashi"
### The Screenshots of some of the webPages of this project are Here:

1. Login Page
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/login.png" width="100%">

<img width="100%" alt="Login to Book Trains" src="https://user-images.githubusercontent.com/34605595/232219369-85b55a1d-6640-4821-941a-dcca08036fbe.png">

2. Register New User
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/registeruser.png" width="100%">


3. View Profile
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/viewprofile.png" width="100%">


4. View and Book Trains
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/Search.png" width="100%">

<img width="100%" alt="Register New User" src="https://user-images.githubusercontent.com/34605595/232219485-2b00949a-be20-44f7-b6c1-107213221f94.png">

5. Add Trains By Admin
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/addtrains.png" width="100%">
3. User Profile
<img width="100%" alt="View User Profile" src="https://user-images.githubusercontent.com/34605595/232219729-2720e50f-e14b-4253-831a-85c59e3054b3.png">

4. Search Trains Between Stations
<img width="100%" alt="Search Trains Between Stations" src="https://user-images.githubusercontent.com/34605595/232220357-54b634d6-afae-427c-b3af-57b372b70906.png">

6. Change Password
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/passwordchange.png" width="100%">
5. View Trains
<img width="100%" alt="View Available Trains" src="https://user-images.githubusercontent.com/34605595/232219905-983eeefe-977b-40ad-a695-4ec577272dcc.png">

7. Train Fare Enquiry
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/fareenquiry.png" width="100%">
7. Book Trains
<img width="100%" alt="Book Trains Project" src="https://user-images.githubusercontent.com/34605595/232220107-415b251f-90b9-4e70-aff8-e94d370927f6.png">

8. Train Details
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/Availability.png" width= "100%">
8. Payment Gateway
<img width="100%" alt="Pay to Book Trains" src="https://user-images.githubusercontent.com/34605595/232220744-351c2c6d-e1f6-49ad-a11b-7680aa63dbe3.png">

9. Booked Ticket Information
<img width="100%" alt="Show Booked Ticket Details" src="https://user-images.githubusercontent.com/34605595/232220935-654bda38-cbde-4203-84b8-3078a32ac6ec.png">

9. User Home
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/userhome.png" width="100%">
10. Ticket Booking History
<img width="100%" alt="All Ticket Booking History" src="https://user-images.githubusercontent.com/34605595/232220491-3e7996cb-a54c-4375-a35a-6ab1d211a001.png">

11. Fare Enquiry
<img alt="Fare Enquiry between stations" src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/fareenquiry.png" width="100%">

10. Book Trains Now
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/booknow.png" width="100%">
12. Change Password
<img alt="Change user Password" src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/passwordchange.png" width="100%">

11. Train Ticket Book
<img src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/TicketBook.png" width="100%">
13. Add Trains By Admin
<img alt="Admin Home" src="https://github.com/shashirajraja/Train-Ticket-Reservation-System/blob/master/Screenshots/addtrains.png" width="100%">


#### "Suggestions and project Improvement are Invited"
Expand Down
96 changes: 53 additions & 43 deletions WebContent/AddTrains.html
Original file line number Diff line number Diff line change
@@ -1,52 +1,62 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Admin Home</title>
<link rel="stylesheet" href="UserHome_Css.css">
<style>

</style>
<meta charset="ISO-8859-1">
<title>E-Trains</title>
<link rel="stylesheet" href="UserHome_Css.css">
</head>
<body>
<header>
<header>
<h1 class="hd">National Ticket Booking Spot</h1>
<div class="home">
<p1 class="menu"><a href="AdminHome.html">Home</a></p1>
</div>
<div class="home">
<p1 class="menu"><a href="adminsearchtrainfwd">Search Trains</a></p1>
</div>
<div class="home">
<p1 class="menu"><a href="adminviewtrainfwd">View Trains</a></p1>
</div>
<div class="home">
<p1 class="menu"><a href="addtrainfwd">Add Train</a></p1>
</div>
<div class="home">
<p1 class="menu"><a href="cancletrainfwd">Cancel Train </a></p1>
</div>
<div class="home">
<p1 class="menu"><a href="updatetrain">Update Schedule</a></p1>
</div>
<div class="home">
<p1 class="menu"><a href="adminlogout">Logout</a></p1>
</div>
</header>
<div class='main'>
<p1 class='menu'>
Add Trains
</p1>
</div>
<form class="tab" action="adminaddtrain" method="post"><br/>
Train Number:<input type="text" name="trainno"><br/><br/>
Train Name: <input type="text" name="trainname"><br/><br/>
From Station: <input type="text" name="fromstation"><br/><br/>
To Station: <input type="text" name="tostation"><br/><br/>
Available: <input type="text" name="available"><br/><br/>
Fare (INR): <input type="text" name="fare"><br/><br/>
<input type="submit" value=" ADD TRAIN ">
</form><br/>
<div class="home">
<p class="menu">
<a href="AdminHome.html">Home</a>
</p>
</div>
<div class="home">
<p class="menu">
<a href="adminviewtrainfwd">View Trains</a>
</p>
</div>
<div class="home">
<p class="menu">
<a href="adminsearchtrainfwd">Search By TrainNo</a>
</p>
</div>

<div class="home">
<p class="menu">
<a href="addtrainfwd">Add Train</a>
</p>
</div>
<div class="home">
<p class="menu">
<a href="cancletrainfwd">Delete Train </a>
</p>
</div>
<div class="home">
<p class="menu">
<a href="updatetrain">Update Train Details</a>
</p>
</div>
<div class="home">
<p class="menu">
<a href="adminlogout">Logout</a>
</p>
</div>
</header>
<div class='main'>
<p class='menu'> Add Trains </p>
</div>
<form class="tab" action="adminaddtrain" method="post">
<br /> Train Number:<input type="text" name="trainno"><br />
<br /> Train Name: <input type="text" name="trainname"><br />
<br /> From Station: <input type="text" name="fromstation"><br />
<br /> To Station: <input type="text" name="tostation"><br />
<br /> Available: <input type="text" name="available"><br />
<br /> Fare (INR): <input type="text" name="fare"><br />
<br /> <input type="submit" value=" ADD TRAIN ">
</form>
<br />
</body>
</html>
Loading