Download as pdf or txt
Download as pdf or txt
You are on page 1of 104

A

Industrial Project Report

“Railway Reservation System”

Submitted by

Subham Bohra

Registration number: 18BCON476

SARVADKSH EVENT SOLUTIONS Pvt. ltd


Under the Guidance of

Faculty Internship Guide: Mr.Srawan Nath Sir Industry Guide: Chandan Singh

Department of Computer Science Engineering

JECRC UNIVERSITY

JAIPUR

January To June 2022


Sarvadaksh Event Solutions Pvt Ltd & Develop India Online
S-DIO - Offer Letter
13/JAN/2022 REG..NO - SDIO61D411976F23M

Subham Bohra

Re: Internship Offer

Dear Subham,

We are pleased to offer you an internship with S-D.I.O (Sarvadaksh Event


Solutions Pvt Ltd & Develop India Online). This is an educational internship. Ourgoal
foryou is to make you learn more about IT and SOFTWARE INDUSTRY.

As we discussed, your internship is expected to last from 15th Jan 2022 to 15th July 2022,
4-6 hours per week. [However, at the sole discretion of the Company,the duration of the
internship may be extended or shortened with or without advance notice.]

Description of Internship program and training :-


Web Development Internship –
HighlightsInternshipduration: 6 Months
• Software & other tools installation Guidance
• Hardware support
• Internship Report creation / Project Report creation
• 1 project ( real time)
Internship Certificate & Achievement certificate to best performers
S.No Web Design Training –Syllabus
100% Practical – Real Time Training
Topic 1 : Introduction
(Covering 20 Concepts) – HTML5 Tags , HTML 5 Controls / Basic Web
Designing
Topic 2 : CSS3 Programming
(Covering 25 – CSS Basics / Advanced,CSS Types,
Concepts) Web page integrations
Inline/Internal/External CSS
Topic 3 : (Covering 10 CSS Advanced
Concepts) – CSS Class Selector, Internal
Designers, External Designers
Topic 4 : PHP Programming – PHP Training , Basics , Advanced & PHP
(Covering 30 Programming
Concepts)
Topic 5 : JavaScript Programming
(Covering 20 – JavaScript Training & JavaScript
Concepts) Programming, Events, Internal
Indicators/Controllers , External
Indicators/Controllers
Topic 6 : AJAX Programming
(Covering 15 – AJAX Training, AJAX Programming
Concepts) &AJAX programme
Complete Free Web Designing Project Students
Project: will finish this project in the specified
duration
Course Completion certificate + (Achievement certificate for best
performers)
Web Development INTERNSHIP MATERIALS
forstudents:
1. Internship Materials will be provided for the students after the internship program.
2. 1 Project will be given to the students.
3. Technological guidance and materials will be shared throughout entire year for
thestudentsto mold technically.

For this position, your major duties will include:


1. All the task will be updated from time to time on Mail.
2. Mention about this internship on top platforms ( Linkedin / Facebooketc.,).

Terms & Conditions:


1. Certification of Internship will be issued only after you successfully
complete theinternship.
2. It is mandatory to participate in the live session.

As an intern, you will not be a company employee. Therefore, you will not receive a salary, wages, or
other compensation. In addition, you will not be eligible for any benefits that the company offers its
employees, including, but not limited to, health benefits, holiday pay, vacationpay, sick leave,
retirementbenefits, or participation in the company's other plans. You must understand that
participation in the internship program is not an offer of employment, and successful completion of the
internship does not entitle you to employment with the company.

During your internship, you may have access to confidential, proprietary, and/or trade secret
information belonging to the Company. You will keep all of this information strictly
confidentialand refrain from using it for your own purposes or from disclosing it to anyone
outside the Company. Inaddition, upon completion of the internship, you will immediately return
to the Company all of its property, equipment, and documents, including electronically stored
information.

By accepting this offer, you agree that you will follow all of the Company's policies that apply to non-
employee interns. Our company observes zero tolerance policy about any activity against female
employees/interns and any intern who indulges in such activities will be solely responsiblefor the
consequences arising out of such activities, our company does not take any liability for
theconsequences.

I hope that your internship with the Company will be successful and rewarding. If you have anyqueries,
donot hesitate to contact me.
Chandan KhareDirector

Sarvadaksh Event Solutions Pvt. Ltd.


Joining Report

Student Details
Student Name: _Subham Bohra_ Student ID: 18BCON476
Residential Address of Student: NO 10 Krishnamoorthy thottam
opp Erode dying Factorty. Erode- 638003
Mobile Number: 8248495648 EmailID: subhambohra123@gmail.com

Project Details

Title of Project:CRM Project Type: Core


Organization Name: Sarvadaksh Event Solutions Pvt.
Ltd.Site Address: Work From Home
Phone Number: 7049266884 Email ID:
sarvadakshevent@gmail.com Head Office Address: 574, Chandanwari Apartment,
Plot No. 8, Sector-10, Dwarka, NewDelhi - 110075
Phone Number: 7049266884 Email ID: sarvadakshevent@gmail.com

I hereby inform that I have joined the organization on 15/01/2022 for the VIII
semesterIndustrial Project

Dated: 04-02-2022 Signature of Student

Certificate by the Industry Guide


Certified that the above-mentioned student has joined our organization for the VIII
semesterIndustrial Project

Dated: 04/02/2022 Signature of Industry


Guide(with company
seal)

Name: CHANDAN KHARE Designation: DIRECTOR


Mobile Number: 7049266884 Email ID: sarvadakshevent@gmail.com
Table of Contents
Certificate ...................................................................................................................................ii

Candidate Declaration… ...........................................................................................................iii

Aknowledgement ......................................................................................................................iv

Table of Content ........................................................................................................................v

Chapter 1. Introduction and objective................................................................................1


1.1 HTML ............................................................................................................ 2
1.2 Commonly used terms in HTML ................................................................... 3
1.3 Types of websites ........................................................................................... 4
1.4 Tags ................................................................................................................ 4
1.5 Structure of HTML ........................................................................................ 5
1.6 Heading tags ................................................................................................... 5
1.7 List ..................................................................................................................8
1.8 Table .............................................................................................................10
1.9 Multiline text input control .......................................................................... 13
1.10 Attributes.....................................................................................................14
1.11 Checkbox control ....................................................................................... 14
1.12 Radio button control ...................................................................................14
1.13 Select box control ...................................................................................... 15
1.14 File upload box .......................................................................................... 16
1.15 Button control ............................................................................................. 17
1.16 HTML links ................................................................................................ 18

Chapter 2. Cascading style sheets .....................................................................................19


2.1 Internal CSS ........................................................................................... 20
2.2 External CSS .......................................................................................... 21
2.3 Inline CSS ................................................................................................... 21
2.4 Difference between CSS2 and CSS3 ........................................................... 22
2.5 Advantages of CSS ....................................................................................... 22

2.6 CSS margins ......................................................................................................... 23


2.7 CSS padding ..........................................................................................................23

vii
Chapter 3. Bootstrap ................................................................................................................... 24
3.1 Introduction ............................................................................................................ 25
3.2 What is open source framework ............................................................................ 25
3.3 Advantages of Bootstrap ....................................................................................... 26
3.4 Why we use bootstrap ........................................................................................... 26
3.5 Where to get bootstrap ........................................................................................... 26
3.6 Appealing features of Bootstrap ........................................................................... 27
3.7 Drawbacks of Bootstrap.........................................................................................27

Chapter 4. Javascript .................................................................................................................. 28


4.1 What is Javascript ...................................................................................................28
4.2 What can JavaScript Do? ....................................................................................... 28
4.3 Features .................................................................................................................. 29
4.3.1 Imperative and structured ........................................................................ 29
4.3.2 Weakly typed ...........................................................................................29
4.3.3 Object-orientation (prototype-based) ....................................................... 29
4.4 Javascript Output .....................................................................................................30
4.4.1 Using innerHTML..................................................................................... 30
4.4.2 Using document.write() ............................................................................30
4.4.3 Using window.alert() ................................................................................31
4.4.4 Using console.log() .................................................................................. 31
4.5 JavaScript Syntax................................................................................................... 32
4.6 JavaScript Values ................................................................................................... 32
4.6.1 JavaScript Literals ...................................................................................... 33
4.6.2 JavaScript Variables ................................................................................... 33
4.6.3 Using let and const ..................................................................................... 33
4.7 JavaScript Identifiers ............................................................................................. 34
4.8 Arithmetic Operators .............................................................................................34
4.9 Data Types ............................................................................................................. 35
4.9.1 String Data Type ........................................................................................ 35
4.9.2 Number Data Type ..................................................................................... 35

4.9.3 Boolean Data Type ..................................................................................... 36


4.9.4 Undefined Data Type ................................................................................. 36

viii
4.9.5 Null Data Type ........................................................................................... 36
4.9.6 Object Data Type ....................................................................................... 37
4.10 Functions .............................................................................................................. 37
4.10.1 JavaScript Function Syntax ...................................................................... 38
4.10.2 Function Invocation .................................................................................38
4.10.3 Function Return ........................................................................................ 38

4.11 HTML Events ...................................................................................................... 39


4.12 What is an Array? ................................................................................................ 39
4.13 Date Objects ......................................................................................................... 39
4.14 What is this?..........................................................................................................40
4.15 Conditional Statements ........................................................................................ 40
4.15.1 if Statement .............................................................................................. 41
4.15.2 Else Statement .......................................................................................... 41
4.15.3 Else if Statement.......................................................................................42
4.15.4 Switch Statement ...................................................................................... 42
4.16 Different Kinds of loops ....................................................................................... 43
4.16.1 For Loop ................................................................................................... 43
4.16.2 While Loop .............................................................................................. 43

References ......................................................................................................... 44

ix
ABSTRACT

The Indian Railways (IR) carries about 5.5 lakhs passengers


in reserved accommodation every day. The Computerised
Passenger Reservation System (PRS) facilates the booking
and cancellation of tickets from any of the 4000 terminals (i.e.
PRS booking window all over the countries). These tickets
can be booked or cancelled for journeys commencing in any
part of India and ending in any other part, with travel time as
long as 72hours and distance upto several thousand
kilometers.

In the given project we will be developing a website which


will help users to find train details, book and cancel tickets
and the exact rates of their tickets to the desired destination.

With the help of online booking people can book their


tickets online through internet, sitting in their home by a
single click of mouse. Using their credit cards people can
easily get their tickets done within minutes.

x
DECLARATION

I, Subham Bohra hereby declare that the project work entitled “Railway
Reservation System ” is an authentic record of my own work carried out at
“SARVADAKSH EVENT SOLUTIONS Pvt. Ltd.” as requirements of six months
project semester for the award of degree of B. Tech. Computer Science
Engineering (CSE), JECRC University, under the guidance of “Mr. Yogesh
Bhardwaj” during January to June 2022.

Subham Bohra
18BCON476

Certified that the above statement made by the student is correct to the best of our
knowledge

SrawanNath Sir
(Professor)
Faculty Internship Guide

xi
ACKNOWLEDGEMNET
I would like to express my special thanks of gratitude to my project guide
Clever Programmer who gave me the golden opportunity to do this wonderful
project which also helped me in doing a lot of research and My family has as
always offered me their unconditional support, thank you! I have taken efforts
in the Project. However, it would not have been possible without the kind
support and many individuals and organizations. I would like to extend my
sincere thanks to each and every member related to JECRC University. I came
to know about so many new things I am really thankful to them.

SubhamBohra
18BCON476

xii
ABOUT ORGANISATION

xiii
INDUSTRY MENTOR PROFILE

NAME: Mr. Yogesh


DESIGNATION: Web developer Analyst at Sarvadaksh
EXPERIENCE: 1.5 Years
QUALIFICATION: Bachelor of Engineering in Computer Science
ABOUT: He is our front-end developer at Sarvadaksh & he completed
Bachelor’s Degree in Computer science from LPU university. He
has 5+ years’ experience in application development and
testing. 4+ years’ SDLC implementation experience.
Abilityto create support documentation for all new
applications.
It was a great Experience working under him as I learned
somany new methodologies of advanced web developing.

xiv
INTERNSHIP PROFILE

INTERNSHIPPROFILE: Web Development

MODE OF INTERNSHIP: Work from Home

MY ROLE:
• Vulnerability Assessment & Penetration testing on daily assigned websites.
• Performing periodic Configuration audits on Network Devices, Servers and
othercritical functions.
• Performing security configuration reviews of host operating systems,
databases,web infrastructure components and network devices.
• Creating detailed report/documentation that clearly communicates
vulnerabilitiesand remediation steps.

Motivation
“We need to accept that we won’t always make the right decisions, that
we’llscrew up royally sometimes – understanding that failure is not the opposite
of success, it’s part of success.”

xv
INTRODUCTION AND OBJECTIVE

Chapter-1
Web development is an evolving amalgamation of languages that work in concert to
receive, modify, and deliver information between parties using the Internet as a
mechanism of delivery.

While it is easy to describe conceptually, implementation is accompanied by an


overwhelming variety of languages, platforms, templates, frameworks, guidelines, and
standards. Navigating a project from concept to completion often requires more than
mastery of one or two complementing languages, meaning today’s developers need both
breadth, and depth, of knowledge to be effective.

This text provides the developer with an understanding of the various elements of web
development by focusing on the concepts and fundamentals through the examples within,
providing a foundation that allows easier transition to other languages and a better
understanding of how to approach their work. The reader will be introduced to topics in a
manner that follows most project development methods, from initial conceptualization
and design through front end development, back end development, and introducing
additional concepts like accessibility and security, while focusing on responsive design
techniques. Each section of the text includes opportunities to practice the material and
assess increased knowledge after examining the topics.

“While most web development texts opt to delve deeply into one or two of the tools in the
belt of a web programmer, the author of this text takes a broad approach to teaching web
programming and development. The result is a single resource that integrates good design
practices, modern technologies, and all of the programming tools that one would need to
build a successful, dynamic web site.
1.1 HTML (Hyper Text Mark-Up Language)

• Hypertext Mark-up Language (HTML) is the standard mark-up


language for creating web pages and web applications. With
Cascading Style Sheets (CSS) and JavaScript, it forms a triad of
cornerstone technologies for the World Wide Web.

• Web browsers receive HTML documents from a web server or from


local storage and render the documents into multimedia web pages.
HTML describes the structure of a web page semantically and
originally included cues for the appearance of the document.

• HTML elements are the building blocks of HTML pages. With HTML
constructs, images and other objects such as interactive forms may be
embedded into the rendered page. HTML provides a means to create
structured documents by denoting structural semantics for text such as
headings, paragraphs, lists, links, quotes and other items. HTML
elements are delineated by tags, written using angle brackets. Tags
such as <img /> and <input /> directly introduce content into the page.
Other tags such as <p> surround and provide information about
document text and may include other tags as sub-elements. Browsers
do not display the HTML tags, but use them to interpret the content of
the page.

• The two languages HTML and CSS are independent of one another
and should remain that way. CSS should not be written inside of an
HTML document and vice versa. As a rule, HTML will always
represent content, and CSS will always represent the appearance of
that content.

• HTML can embed programs written in a scripting language such as


JavaScript, which affects the behaviour and content of web pages.
Inclusion of CSS defines the look and layout of content. The World
Wide Web Consortium (W3C), maintainer of both the HTML and the
CSS standards, has encouraged the use of CSS over explicit
presentational HTML since 1997.
1.2 Commonly Used Terms in Html

• Elements
Elements are designators that define the structure and content of objects within a page.
Some of the more frequently used elements include multiple levels of headings (identified
as <h1> through <h6> elements) and paragraphs (identified as the <p>element); the list
goes on to include the <a>, <div>, <span>, <strong>, and <em>elements, and many
more. Elements are identified by the use of less-than and greater-than angle brackets, < >,
surrounding the element name.

• Tags
The use of less-than and greater-than angle brackets surrounding an element
creates what is known as a tag. Tags most commonly occur in pairs of
opening and closing tags. An opening tag marks the beginning of an element.
It consists of a less-than sign followed by an element’s name, and then ends
with a greater-than sign; for example, <div>. A closing tag marks the end of
an element. It consists of a less-than sign followed by a forward slash and
the element’s name, and then ends with a greater-than sign; for example,
</div>. The content that falls between the opening and closing tags is the
content of that element.

• Attributes
Attributes are properties used to provide additional information about an
element. The most common attributes include the id attribute, which
identifies an element; the class attribute, which classifies an element; the
<src> attribute, which specifies a source for embeddable content; and the
<href > attribute, which provides a hyperlink reference to a linked resource.

Attributes are defined within the opening tag, after an element’s name.
Generally, attributes include a name and a value. The format for these
attributes consists of the attribute name followed by an equal's sign and then
a quoted attribute value.
1.3 Types of Websites

Fig 1.1 Classification of websites

1.4 What Are Tags?

HTML attaches special meaning to anything that starts with the less-than
sign ("<") and ends with the greater-than sign (">"). Such markup is called
a tag. For Example: <head>

• Types of Tags

Fig 1.2 Different tags


1.5 Structure of Html

<html>

<head>

<title> (. ..........) </title>

</head>

<body>

(.....

.....)

</body>

</html>

Fig 1.3 Explaining the Structure of Image

1.6 Heading Tags

Heading Tags are of 6 types. Starting from <h1> to <h6>.


Inside <body>
<h1> to <h6> - Defines HTML headings
Fig 1.4 Explains heading tag

<b>: FOR BOLD TEXT

<i> : FOR ITALICS

<u>: FOR UNDERLYING

<center>: ALIGNING TEXT TO THE LINE’S CENTER

<p>: PARAGRAPH

<tt> : TEXT DECORATION

<strike>: A LINE STRIKING THROUGH TEXT

Fig 1.5 Defines use of different tags


<sup>: DEFINES SUPERSCRIPTED TEXT

Fig 1.6 Defines superscription

<sub>: DEFINES SUB SCRIPTED TEXT

Fig 1.7 Defines subscripting

<br>: DEFINES A SINGLE LINE BREAK

<hr>: HORIZONTAL LINE BREAK

<img>: DEFINES AN IMAGE


<embed>: embed an external application like audio or video

Fig 1.8 Using external application

<a>: This tag defines a hyperlink, which is used to link from one page to
another the most important attribute of the <a> element is the href
attribute, which indicates the link’s destination.

Properties:

Starts with

a href

Fig 1.9 United documents


1.7 List

Fig 1.10 Types of list

Fig 1.11(a) Lists


Fig 1.11(b) Example of ordered list and unordered list

1.8 Table <table>: Defines a table

Fig 1.12 Example of a table


Table, width, height, border, align
<tr>: Defines a row in a table
<td>: Defines a cell in a table
Merge Table

Fig 1.13 Example of merge table


Form <form>:
Form is used to submit all basic information on a server/database.
• A form will take input from the site visitor and then will post it to a back-
end application such PHP script. The back-end application will perform
required processing on the passed data based on defined business logic
inside the application.
• There are various form elements available like text fields, text-area
fields, drop-down menus, radio buttons, checkboxes, etc.

Text Input Controls

There are three types of text input used on forms:

• Single-line text input controls - This control is used for items that
require only one line of user input, such as search boxes or names. They
are created using
HTML <input> tag.
• Syntax:

• Output :
Password Input Controls - This is also a single-line text input but it
masks the character as soon as a user enters it. They are also created
using HTML <input> tag.

Syntax:

Output:

1.9 Multi-Line Text Input Controls

This is used when the user is required to give details that may be longer
than a single sentence. Multi-line input controls are created using
HTML <text area> tag.

Syntax:

Output:
1.10 Attributes

Following is the list of attributes for <input> tag for creating password field.

Type Indicates the type of input control and for


password input control it will be set
to password.

Name Used to give a name to the control which is


sent to the server to be recognized and get
the value.

Value This can be used to provide an initial value


inside the control.

Size Allows specifying the width of the text-


input control in terms of characters.

Max length Allows specifying the maximum number


of characters a user can enter into the text
box.

Table 1.1 Attributes for input tag

1.11 Checkbox Control

Checkboxes are used when more than one option is required to be selected. They are
also created using HTML <input> tag but type attribute is set to checkbox.

Syntax:

Output:
1.12 Radio Button Control

Radio buttons are used when out of many options; just one option is required to be
selected. They are also created using HTML <input> tag but type attribute is set to radio.

Syntax:

Output:

Attributes:

Following is the list of attributes for radio button.

Type Indicates the type of input control and for checkbox input control it will be
set to radio.

Name Used to give a name to the control which is sent to the server to be
recognized and get the value.

Value The value that will be used if the radio box is selected.

Table 1.2 Attributes for radio button

1.13 Select Box Control

A select box, also called drop down box which provides option to list down various
options in the form of drop-down list, from where a user can select one or more options.
Syntax & Output:

Attributes:

Following is the list of important attributes of <select> tag

Name Used to give a name to the control


which is sent to the server to be
recognized and get the value.

Value The value that will be used if an


option in the select box is selected.

Selected Specifies that this option should be


the initially selected value when the
page loads.

Table 1.3 Attributes for select tag

1.14 File Upload Box

If you want to allow a user to upload a file to your web site, you will need to use a file
upload box, also known as a file select box. This is also created using the <input>
element but type attribute is set to file.

Syntax:
Output:

1.15 Button Controls

There are various ways in HTML to create clickable buttons. You can also create a
clickable button using <input> tag by setting its type attribute to button. The type
attribute can take the following values:

SUBMIT This creates a button that automatically


submits a form.

RESET This creates a button that automatically


resets form controls to their initial
values.

BUTTON This creates a button that is used to


trigger a client-side script when the user
clicks that button.

Table 1.4 Attributes for button controls

Syntax:

Output:
1.16 Html Links

Links are found in nearly all web pages. Links allow users to click their way from page
to page. HTML links are hyperlinks. A hyperlink is a text or an image you can click on,
and jump to another document.

Syntax:

Output:

Fig 1.14 First page


Chapter-2
CSS (CASCADING STYLE SHEETS)
CSS Introduction

• Cascading Style Sheets, fondly referred to as CSS, is a simple design language


intended to simplify the process of making web pages presentable.
• CSS handles the look and feel part of a web page. Using CSS, you can control the
color of the text, the style of fonts, the spacing between paragraphs, how columns are
sized and laid out, what background images or colors are used, layout designs, and
variations in display for different devices and screen sizes as well as a variety of other
effects.
• It is not a language it is a part of design. It is the heart of HTML.

Fig 2.1 Types of CSS


2.1 Internal CSS
• It is used in head section.
• When using internal CSS, you must add a new tag, <style>, inside the <head> tag.
Styles are placed at the top of each web page document, before any of the content is
listed. This is the next best thing to external, because they're easy to find, yet allow you to
'override' an external style sheet - for that special page that wants to be a nonconformist

2.2 External CSS

Style sheets are separate files full of CSS instructions (with the file extension .css). When
any web page includes an external style sheet, its look and feel will be controlled by this
CSS file (unless you decide to override a style using one of these next two types). This is
how you change a whole website at once. And that's perfect if you want to keep up with
the latest fashion in web pages without rewriting every page.

• A different CSS page is made for external CSS.


• This page is linked in the html file using anchor tag.
• This linking is done in the <head> section.
2.3 Inline CSS

CSS saves time It is re-useable. You can write CSS


once and then reuse same sheet in
multiple HTML pages. You can define
a style for each HTML element and
apply it to as many Web pages as you
want.

Pages load faster If you are using CSS, you do not need
to write HTML tag attributes every
time. Just write one CSS rule of a tag
and apply it to all the occurrences of
that tag. So, less code means faster
download times.

Easy maintenance To make a global change, simply


change the style, and all elements in all
the web pages will be updated
automatically.

Table 2.1 Inline CSS

2.4 Difference between CSS2 & CSS3

The latest version of CSS is the CSS3 version which basically differs from CSS2 in the
incorporation of Modules and other changes. Modules enable the designing to be done in
a lesser time with more ease while updating individual features and specifications. The
CSS3 version supports many more browsers than CSS2, but be sure to test it on all
operating systems and browsers.
2.5 Advantages of CSS

Inline css is used with tags, inside the tag <head>

Fig 2.2 Defining HTML line

2.6 CSS Margins

• The CSS margin properties are used to generate space around elements.
• There are CSS properties for setting the margin for each side of an
element (top, right, bottom, and left).
2.7 CSS Padding

The CSS padding properties are used to generate space around content. The padding
properties set the size of the white space between the element content and the element
border.
Chapter-3
BOOTSTRAP
3.1 Introduction

• Bootstrap is the world’s most popular open-source framework for building


responsive, mobile-first sites and applications.
• Bootstrap, originally named Twitter Blueprint, was developed by Nirav Panchal and
Jacob Thornton at Twitter as a framework to encourage consistency across internal
tools. Before Bootstrap, various libraries were used for interface development, which
led to inconsistencies and a high maintenance burden.
• After a few months of development by a small group, many developers at Twitter
began to contribute to the project as a part of Hack Week, a hackathon-style week for
the Twitter development team. It was renamed from Twitter Blueprint to Bootstrap,
and released as an open-source project on August 19, 2011. It has continued to be
maintained by Mark Otto, Jacob Thornton, and a small group of core developers, as
well as a large community of contributors.
• On January 31, 2012, Bootstrap 2 was released, which added a twelve-column
responsive grid layout system, inbuilt support for Glyph icons, several new
components, as well as changes to many of the existing components.
• On August 19, 2013, Bootstrap 3 was released, which redesigned components to use
flat design, and a mobile first approach.
• On October 29, 2014, Mark Otto announced that Bootstrap 4 was in development.
The first alpha version of Bootstrap 4 was released on August 19, 2015.
• The first beta version was released on 10 August 2017. The stable version of
Bootstrap 4 was released on January 18, 2018 basically improving print styles, border
utilities and provides more control over the flex box.

3.2 What Is an Open-Source Framework?


• Source code is freely available and it can be modified according to the user’s need.
3.3 Advantages Of Bootstrap
• Save lots of time — you can save lots of time and efforts using the Bootstrap
predefined design templates and classes and concentrate on other development work.
• Responsive features — Using Bootstrap you can easily create responsive designs.
Bootstrap responsive features make your web pages to appear more appropriately on
different devices and screen resolutions without any change in markup.
• Consistent design — All Bootstrap components share the same design templates and
styles through a central library, so that the designs and layouts of your web pages are
consistent throughout your development.

• Easy to use — Bootstrap is very easy to use. Anybody with the basic working
knowledge of HTML and CSS can start development with Bootstrap.

3.4 Why We Use Bootstrap?

• Easy to use: Anybody with just basic knowledge of HTML and CSS can start using
Bootstrap.
• Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets, and
desktops.
• Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the core
framework.
• Browser compatibility: Bootstrap is compatible with all modern browsers (Chrome,
Firefox, Internet Explorer, Safari, and Opera).

3.5 Where to Get Bootstrap?

• There are two ways to start using Bootstrap on your own web site.
• You can: Download Bootstrap from getbootstrap.com
• Include Bootstrap from a CDN.
• Downloading Bootstrap:
• If you want to download and host Bootstrap yourself, go to getbootstrap.com, and
follow the instructions there.
3.6 Appealing Features of Bootstrap

Bootstrap has a lot of features. These features not only make it stand out, but they also
make it more popular even among those web designers who like to take things in a very
conventional way.

1. Easy To Begin With

It is pretty easy, to begin with. Being easy to get started with is probably the first quality
which makes Bootstrap very appealing.

2. Less As Well As Css Files

Bootstrap not only offers fewer files but also includes the old CSS files.

3. Easily Customizable

Despite the fact that Bootstrap is designed in responsive 12-column grids, layouts, and
components, it is also very easy to customize. Whether you need a fixed grid or a
responsive one, it can be made possible by making a few changes. Offsetting and nesting
of columns are also easy to do in both CPU-based and mobile-based browser grids.

4. Responsive Utility Classes

Another prominent feature of Bootstrap is its responsive utility classes. Using responsive
utility classes, a particular piece of content can be made to appear or hide only on devices
depending on the size of the screen being used. This feature is extremely helpful for
designers who want to make a mobile and tablet-friendly version of their websites.

5. Components of Bootstrap

Some of the components that come pre-styled in Bootstrap are:

• Drop-downs
• Button
• Navigation
• Badges Alerts
• Progress Bar
6. Drop-Down Component Menu

The drop-down component menu is a responsive additive feature of a website. To include


it in a website, a lot of different plugins, mostly Java-based, are tested. But, via Bootstrap
and its easy customizing options, this can easily be done in a matter of minutes.

7. Bootstrap Templates

The readily available templates make it easier for inexperienced users to create a website
following a simple tutorial or demo available on the Bootstrap.

3.7 Drawback of Bootstrap

Everything has its pros and cons. We have talked about the features that make Bootstrap
appealing. Now we will discuss a few flaws and drawbacks of Bootstrap. One of the
biggest drawbacks is its free availability. Since it is a "Free for all" program, there are
higher chances of people using common themes on their individual websites. Now, there
is big competition to develop the most unique and different website using the same
library that maybe 10,000+ people are already using or have used. Due to increased use in
this modern day and time where websites have such a big part of a person’s everyday life,
it has become quite easy to determine which websites and applications have used the
same template unless they have been heavily and massively customized.

Linking bootstrap.css in your html file:


Chapter 4
JavaScript
4.1 What is Javascript
JavaScript was developed by Brendan Eich in 1995, which appeared in Netscape, a
popular browser of that time.

Java Script is a robust client side scripting language with objectoriented capabilities. Java
Script also helps to reduce traffic of server side. We will learn some additional effects for
the web pages i.e. Image zoom, sliders, and data collapse hide, pop up, validation using
Java Script.

JavaScript, initially called LiveScript is a robust client-side scripting language, used


mainly for make your webpage more interactive. This also helps in communicate data
between the server and the browser. JavaScript is also used in game development and
mobile application development. It Also help in reduce the traffic of server side.

4.2 What can JavaScript Do?


Event handlers can be used to handle, and verify, user input, user actions, and browser
actions:

• Things that should be done every time a page loads


• Things that should be done when the page is closed
• Action that should be performed when a user clicks a button
• Content that should be verified when a user inputs data.

Many different methods can be used to let JavaScript work with events:

• HTML event attributes can execute JavaScript code directly


• HTML event attributes can call JavaScript functions
• You can assign your own event handler functions to HTML elements
• You can prevent events from being sent or being handle.
4.3 Features
4.3.1 Imperative and structured
JavaScript supports much of the structured programming syntax

from C (e.g., if statements, while loops, switch statements, do while loops, etc.). One
partial exception is scoping: JavaScript originally had only function scoping with var .
ECMAScript 2015 added keywords let and const for block scoping, meaning JavaScript
now has both function and block scoping. Like C, JavaScript makes a distinction between
expressions and statements. One syntactic difference from C is automatic semicolon
insertion, which allows the semicolons that would normally terminate statements to be
omitted.

4.3.2 Weakly typed


JavaScript is weakly typed, which means certain types are implicitly cast depending on
the operation used.

• The binary + operator casts both operands to a string unless both operands are
numbers. This is because the addition operator doubles as a concatenation
operator
• The binary - operator always casts both operands to a number

• Both unary operators ( + , - ) always cast the operand to a number

• Strings are left as-is


• Numbers are converted to their string representation

• Arrays have their elements cast strings after which they are joined by commas ( , )

• Other objects are converted to the string [object Object] where Object is the name
of the constructor of the object.
Values are casted to numbers by casting to strings and then casting the strings to numbers.
These processes can be modified by defining toString and valueOf functions on the prototype
for string and number casting respectively.

4.3.3 Object-orientation (prototype-based)


Prototypal inheritance in JavaScript is described by Douglas Crockford as:

You make prototype objects, and then … make new instances. Objects are mutable in
JavaScript, so we can augment the new instances, giving them new fields and methods.
These can then act as prototypes for even newer objects. We don't need classes to make
lots of similar object Objects inherit from objects.

In JavaScript, an object is an associative array, augmented with a prototype (see below);


each string key provides the name for an object property, and there are two syntactical
ways to specify such a name: dot notation ( obj.x = 10 ) and bracket notation ( obj['x'] =
10 ). A property may be added, rebound, or deleted at run-time. Most properties of an
object (and any property that belongs to an object's prototype inheritance chain) can be

enumerated using a for in loop.

4.4 Javascript Output


4.4.1 Using innerHTML
To access an HTML element, JavaScript can the document.getElementById(id) method.

The id attribute defines the HTML element. The innerHTML property defines the HTML
content:

<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My First Paragraph</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 5 + 6;
</script>
</body>
</html>
4.4.2 Using document.write()

For testing purposes, it is convenient to use document.write():

<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script>
document.write(5 + 6);
</script>
</body>
</html>

4.4.3 Using window.alert()

You can use an alert box to display data:

<!DOCTYPE html>
<html>
<body>

<h1>My First Web Page</h1>


<p>My first paragraph.</p>

<script>
window.alert(5 + 6);
</script>

</body>
</html>
4.4.4 Using console.log()

For debugging purposes, you can call the console.log() method in the browser to
display data.

<!DOCTYPE html>
<html>
<body>

<script>
console.log(5 + 6);
</script>

</body>
</html>

4.5 JavaScript Syntax


JavaScript syntax is the set of rules, how JavaScript programs are constructed:
var x, y, z; // Declare Variables
x = 5; y = 6; // Assign
Values z = x + y; //
Compute Values

4.6 JavaScript Values


The JavaScript syntax defines two types of values:

• Fixed values
• Variable values

Fixed values are called Literals and variable values are called Variables.

4.6.1 JavaScript Literals


The two most important syntax rules for fixed values are:

• Numbers are written with or without

decimals: Example 10.50 or 1001


. Strings are text, written within double or single quotes:

Example "John Doe" or 'John Doe'

4.6.2 JavaScript Variables


In a programming language, variables are used to store data values.

JavaScript uses the var keyword to declare variables.

An equal sign is used to assign values to variables.

Example
var x = 5;
var y = 6;
var z = x + y;

From the example above, you can expect:

• x stores the value 5


• y stores the value 6
• z stores the value 11

4.6.2.1 Using let and const

Before 2015, using the var keyword was the only way to declare a JavaScript variable.

The 2015 version of JavaScript (ES6 - ECMAScript 2015) allows the use of the const
keyword to define a variable that cannot be reassigned, and the let keyword to define a
variable with restricted scope.

Because it is a little complicated to describe the difference between these keywords, and
because they are not supported in older browsers, the first part of this tutorial will most
often use var.

4.7 JavaScript Identifiers


All JavaScript variables must be identified with unique names.These unique names are
called identifiers. Identifiers can be short names (like x and y) or more descriptive names
(age, sum, totalVolume).
The general rules for constructing names for variables (unique identifiers) are:

• Names can contain letters, digits, underscores, and dollar signs.


• Names must begin with a letter
• Names can also begin with $ and _ (but we will not use it in this tutorial)
• Names are case sensitive (y and Y are different variables)
• Reserved words (like JavaScript keywords) cannot be used as names

4.8 JavaScript Arithmetic Operators


Arithmetic operators perform arithmetic on numbers (literals or variables).

Operator Descripton
+ Addtion
- Subtration
* Multiplication
** Exponentiation
/ Division
% Modulus
++ Increment
-- Decrement

Table 4.8 Arithmetic operators

4.9 Data types


Data types basically specify what kind of data can be stored and manipulated within a
program.

There are six basic data types in JavaScript which can be divided into three main
categories: primitive (or primary), composite (or reference), and special data types.
String, Number, and Boolean are primitive data types. Object, Array, and Function
(which are all types of objects) are composite data types. Where as Undefined and Null
are special data types.
Primitive data types can hold only one value at a time, whereas composite data types can
hold collections of values and more complex entities. Let's discuss each one of them in detail.
4.9.1 String Data Type
The string data type is used to represent textual data (i.e. sequences of characters). Strings
are created using single or double quotes surrounding one or more characters.

Example: var a = 'Hi there!';

4.9.2 Number Data Type


The number data type is used to represent positive or negative numbers with or without
decimal place, or numbers written using exponential notation e.g. 1.5e-4 (equivalent to
1.5x10-4).

Example:
var a = 25; // integer

var b = 80.5; // floating-point number

4.9.3 Boolean Data Type


The Boolean data type can hold only two values: true or false. It is typically used to store
values like yes (true) or no (false), on (true) or off (false), etc. as demonstrated below:

Example:
var isReading = true;
var isSleeping = false;

4.9.4 Undefined Data Type


The undefined data type can only have one value-the special value undefined. If a
variable has been declared, but has not been assigned a value, has the value undefined.
Example: var b = "Hello World!" alert(a)

4.9.5 Null Data Type


This is another special data type that can have only one value-the null value. A null value
means that there is no value. It is not equivalent to an empty string ("") or 0, it is simply
nothing.
A variable can be explicitly emptied of its current contents by assigning it the null value.

Example:

var a = null; alert(a);

var b = "Hello World!" alert(b);

4.9.6 Object Data Type


The object is a complex data type that allows you to store collections of data.

An object contains properties, defined as a key-value pair. A property key (name) is


always a string, but the value can be any data type, like strings, numbers, booleans, or
complex data types like arrays, function and other objects.

The following example will show you the simplest way to create an object in JavaScript.
Example
var emptyObject = {};
var car = { modal: "BMW X3", color: "white", doors: 5 }

4.9.7 Array Data Type


An array is a type of object used for storing multiple values in single variable. Each value
(also called an element) in an array has a numeric position, known as its index, and it may
contain data of any data type-numbers, strings, booleans, functions, objects, and even
other arrays. The array index starts from 0, so that the first array element is arr[0] not
arr[1].

The simplest way to create an array is by specifying the array elements as a comma-
separated list enclosed by square brackets.

Example:

var colors = ["Red", "Yellow","Green", "Orange"];

alert(colors[0]);
4.10 Functions
Functions are one of the fundamental building blocks in JavaScript. A function in
JavaScript is similar to a procedure—a set of statements that performs a task or calculates
a value, but for a procedure to qualify as a function, it should take some input and return
an output where there is some obvious relationship between the input and the output. To
use a function, you must define it somewhere in the scope from which you wish to call it.

4.10.1 JavaScript Function Syntax

A JavaScript function is defined with the function keyword, followed by a name,


followed by parentheses ().Function names can contain letters, digits, underscores, and
dollar signs (same rules as variables).

The code to be executed, by the function, is placed inside curly brackets: {}

function name(parameter1, parameter2, parameter3) {


// code to be executed
}

Function parameters are listed inside the parentheses () in the function definition.
Function arguments are the values received by the function when it is invoked. Inside the
function, the arguments (the parameters) behave as local variables.

4.10.2 Function Invocation

The code inside the function will execute when "something" invokes (calls) the function:

• When an event occurs (when a user clicks a button)


• When it is invoked (called) from JavaScript code

4.10.2 Function Return

When JavaScript reaches a return statement, the function will stop executing.If the
function was invoked from a statement, JavaScript will "return" to execute the code after
the invoking statement.
Functions often compute a return value. The return value is "returned" back to the
"caller":

Example
var x = myFunction(4, 3);

function myFunction(a, b) {
return a * b;
}

4.11 HTML Events

An HTML event can be something the browser does, or something a user does.

Here are some examples of HTML events:

4.11.1 An HTML web page has finished loading


4.11.2 An HTML input field was changed
4.11.3 An HTML button was clicked

HTML allows event handler attributes, with JavaScript code, to be added to HTML
elements.

Example
<element event='some JavaScript'>
<element event="some JavaScript">

In the following example, an onclick attribute (with code), is added to


a <button> element:

<button onclick="document.getElementById('demo').innerHTML = Date()">The


time is?</button>

4.12 What is an Array?

An array is a special variable, which can hold more than one value at a time.

If you have a list of items (a list of car names, for example), storing the cars in single
variables could look like this:
var car1 = "Saab";
var car2 = "Volvo"; var
car3 = "BMW";

4.12.1 Creating an Array

Using an array literal is the easiest way to create a JavaScript Array.

Syntax: var array_name = [item1, item2, ...];

4.13 Date Objects

Date objects are created with the new Date() constructor.

There are 4 ways to create a new date object:

4.13.1 new Date()


4.13.2 new Date(year, month, day, hours, minutes, seconds, milliseconds)
4.13.3 new Date(milliseconds)
4.13.4 new Date(date string)

4.14 What is this?

The JavaScript this keyword refers to the object it belongs to.

It has different values depending on where it is used:

4.14.1 In a method ,this refers to the owner object .

4.14.2 Alone ,this refers to the global object

4.14.3 In a event ,this refers to the element that received the event.

4.15 Conditional Statements

Very often when you write code, you want to perform different actions for different
decisions.
In JavaScript we have the following conditional statements:

4.15.1 Use if to specify a block of code to be executed, if a specified condition is true


4.15.2 Use else to specify a block of code to be executed, if the same condition is false
4.15.3 Use else if to specify a new condition to test, if the first condition is false
4.15.4 Use switch to specify many alternative blocks of code to be executed

4.15.1 if Statement
Use the if statement to specify a block of JavaScript code to be executed if a condition is
true.

Syntax:
if (condition) {
// block of code to be executed if the condition is true
}

Example:
if (hour < 18) {
greeting = "Good day";
}

4.15.2 Else Statement

Use the else statement to specify a block of code to be executed if the condition is false.

Syntax:
if (condition) {
// block of code to be executed if the condition is
true } else {
// block of code to be executed if the condition is false
}

Example:
if (hour < 18) {
greeting = "Good day";
} else {
greeting = "Good evening";
}

4.15.3 Else if Statement

Use the else if statement to specify a new condition if the first condition is false.
Syntax:
if (condition1) {
// block of code to be executed if condition1 is true
} else if (condition2) {
// block of code to be executed if the condition1 is false and condition2 is
true } else {
// block of code to be executed if the condition1 is false and condition2 is false
}

Example:
if (time < 10) {
greeting = "Good morning";
} else if (time < 20) {
greeting = "Good day";
} else {
greeting = "Good evening";
}

4.15.4 Switch Statement

Use the switch statement to select one of many code blocks to be executed.

Syntax
switch(expression)
{ case x:
// code
block break;
case y:
// code
block break;
default:
// code block
}

This is how it works:


• The switch expression is evaluated once.

• The value of the expression is compared with the values of each case.
• If there is a match, the associated block of code is executed.
• If there is no match, the default code block is executed.
Example

switch (new Date().getDay()) {


case 0:
day = "Sunday";
break;
case 1:
day = "Monday";
break;
case 2:
day = "Tuesday";
break;
case 3:
day = "Wednesday";
break;
case 4:
day = "Thursday";
break;
case 5:
day = "Friday";
break;
case 6:
day = "Saturday";
}

4.16 Different Kinds of Loops

JavaScript supports different kinds of loops:


. for - loops through a block of code a number of times
4.16.1 for/in - loops through the properties of an object
4.16.2 for/of - loops through the values of an iterable object
4.16.3 while - loops through a block of code while a specified condition is true
4.16.4 do/while - also loops through a block of code while a specified condition is
true

4.16.1 For Loop

The for loop has the following syntax:

for (statement 1; statement 2; statement 3) {


// code block to be executed
}

Statement 1 is executed (one time) before the execution of the code block.

Statement 2 defines the condition for executing the code block.

Statement 3 is executed (every time) after the code block has been executed

Example

var i;
for (i = 0; i < cars.length;
i++) { text += cars[i] +
"<br>";
}

4.16.2 While Loop

The while loop loops through a block of code as long as a specified condition is true.

Syntax:
while (condition) {
// code block to be executed
}

Example
while (i < 10) {
text += "The number is
" + i; i++;
}
INDEX

1 INTREODUCTION

1.1 General Overview………….


1.2 Survey ………………………
1.3 Objectives…………………..
1.4 Analysis……………………..
1.5 Organization of the report………..

2 SOFTWERE REQUIERMENT SPECIFICATION

2.1 Development environment……………….


2.2 Operating environment……………………

3 DESIGN

3.1 Design specification……………….


3.2 Data flow diagram………………..
3.3 ER diagram…………………………

4 SDLC

4.1 Waterfall model……………………..


4.2 Development Schedule…………….

5 IMPLIMENTION DETAILS

6 RESULTS AND DESCUSION

7 SUMMARY AND CONCLUSION

8 BIBLIOGRAPHY
Organization of the report

Serial Topic
No.
Abstract
1 Introduction
1.1 General Overview
1.2 Survey
1.3 Analysis of problem
1.4 Organization of the Report.
2 Software Requirement and Specification
3. Detail design
3.1 Detailed design Specification
3.2 Data flow diagram
3.2.1 Level 0 DFD
3.2.2 Level 1 DFD
3.2.3 Level 2 DFD
3.2.4 Level 3 DFD
3.3 ER-Diagram
4 SDLC
4.1 Implementation
5. Results and discussions
6 Summary and Conclusion
6.1 Summary of achievements
6.2 Main difficulties encountered
6.3 Limitation of the project
6.4 Future Scope of work
7. References/Bibliography
INTRODUCTION
1.1 General Overview
Our website has various kinds of information that helps regarding booking of tickets via
railways .

Users will be able to search the train availability ,the exact fare ,the arrival and departure time of
the train and they can also book the ticket by using the debit ,credit or master card and after
booking the ticket if the user want to cancel it then they can easily do it also.

1.2 Survey
Railway passengers frequently need to know about their ticket reservation status, ticket
availability on a particular train or for a place, train arrival or departure details, special trains
etc.. Customer information centers at the railway stations are unable to serve such queries at
peak periods.
The number of the reservation counters available to the passengers and customers are very less.
On most of the reservation systems there are long queues, so it takes a long time for any individual to
book the ticket.
As now there are no call centers facilities available to solve the queries of the passengers.

The online railway ticket reservation system aims to develop a web application which aims at
providing trains details, trains availability, as well as the facility to book ticket in online for
customers.
So, we thought of developing a web based application which would provide the users all these
facilities from his terminal only as well as help them in booking their tickets. The Application was to
be divided into two parts namely the user part , and the administrator part. And each of these has
their corresponding features.
We decided to give the name of the website “ONLINE RAILWAY TICKET RESEVATION”.
The online railway ticket reservation system is developed using ASP.NET with C# as the backend in
the .NET Framework.

The report has been organized into seven sections, each section dealing with a different aspect of
project and its development. A brief overview of each of the section is in order.

The Software Requirements Specification section will deal with the technical details of the
proposed system. It will contain information regarding the developmental and operational
environments, user interfaces, functional and requirements specifications and the exception and
error handling features of the system.
The Design section will provide a detailed insight into the working of the system, how the system to
be framed to make the implementation error free and to avoid a possible rework. All the features
mentioned in the SRS section will be dealt with in detail through the means of architectural
design, block diagram, detailed data flow diagrams, structure charts, flow chart and any other
relevant method.
Through the use of pseudo-codes, the Implementation Details section will provide the final
design step before actual implementation of the system. It will list all the functions that will be
used in the system, parameters used by them, what results they will produce and how they will
interact with the rest of the system.
All queries regarding the actual performance of the developed system will be cleared in the Results
and Discussion section. It will list all the test cases, results of those tests and a discussion on
whether these tests yielded the desired results or not. If negative, this section will also provide
information regarding the failure.
Concluding all this will be the Summary and Conclusion section which will round up the entire
discussion.
This will be followed by the Reference/Bibliography section that will tell about the books and
site that have been referred by us while developing the website.
2. DESIGN
2.1 Detailed design specification:

USER

MAIN
WINDOW

ADMIN

Fig: Homepage

BOOK
TICKET

GET TRAIN
DETAILS DATABASE

REGISTERED
USER
CANCEL
TICKET

Fig: User’s booking window


Chang train details
ADMIN

Show all Train


details

2.2 Data Flow Diagram

3.2.1 Level 0:
CONTEXT DIAGRAM

Login,user ID, Show all train


password. details.

Search Train Train details


and book ticket
Admin
0.0

3.2.2 Level 1 DFD

Search train
Registered user,
Train
Administrator
details
(User ID password).
0.1

Book ticket
0.2
3.2.3 Level 2 DFD

For 0.1(Registered user) -----------------


DATABASE
-----------------
Login
account Registered user,
0.1.1

Error message
Login failed…….. Authentica valid
invalid tion
0.1.2
book ticket
0.1.3

(Administrator)

Login
account
0.1.1 Admin
login page.
Error message valid
0.1.3
Login failed…….. Authenti
invalid cation

INSERT/UPDATE/DELETE

CHANGE TRAIN SHOW ALL


DETAILS0.1.4 TRAIN
DETAILS.
0.1.5
3.2.4 Level 3 DFD
For 0.2 Book ticket
Book ticket for 0.2.1
authenticated user

Book ticket ---------------


Show ticket no to valid
Show ticket no Database
0.2.2
---------------

Cancel ticket if
one wants to.

Cancel ticket
0.2.3
TR des clas
t
3 E-R AIN
NO src s

DIAGRAM
t_nam
PASSWORD Email SLNO
id
a_time
N Traindetails
price
name
Sho
W jrnydt t_seat

r_tim 1
user 1

Generat

Generat
es 1 tiktn u_name

t_nam
add
t_n0

Booking
r_time
payment
c_no
gende
a_time

r_se J_da
u_name
fair
add
1 dest

src phon
class
t_no

country

phno E_ID
3. SDLC (Software development Life Cycle)

Every activity has a life cycle and software development process is not an exception for the
same. Even if you are not aware of SDLC you still must be following it unknowingly. But if a
software professional is aware about SDLC he can execute the project in a much controlled
fashion. One of the big benefits of this awareness is that hot blooded developers will not start
directly execution (coding) which can really lead to project running in an uncontrolled fashion.
Second it helps customer and software professional to avoid Confusion by anticipating the
problems and issues before hand. In short SDLC defines the various stages in a software life
cycle. But before we try to understand what SDLC is all about. We need to get a broader view
of the start and end of SDLC. Any project started if it does not have a start and end then its
already in trouble. It’s like if you go out for a drive you should know where to start and where to
end or else you are moving around endlessly.
Below is the figure that shows typical flow in SDLC which has five main models .
· Waterfall - Big Bang and Phased model .
· Iterative - Spiral and Incremental model.
Iterative model
Iterative model was introduced because of problems faced in Waterfall model.
The iterative waterfall model is used in the development of the system. The system is developed
in increments, each increments adding some functional capability to the system until the full
system is fully implemented.
The advantage of this approach is that it will result in better testing, as testing of each increment is
easier than testing the entire system in totality. Furthermore, this approach provided us with important
feedback that was very useful in the implementation of the system.

Feasibility Study

Requirement analysis and


specification

Design

Coding and
unit testing

Integration and
System testing

Maintenance
Development Schedule
The work on the proposed ONLINE RAILWAY TICKET RESERVATION was started on 17th June, 2011 and
it was estimated to be over by 17th of Augusest, 2011.
The following Gantt chart has explained the estimated duration of the different phases of the software
development work diagrammatically:

Feasibility Study

g and specification
Requirement gatherin

Datab ase Design

Activities GUI Design

Code database part

Code GUI part

Unit & System testing

17th-30th june 1st -15th 16th-25th 25th - 5th-17th auguest


th
july july 5
.

4.1 Implementation Details


4.1.1 System Overview
Online railway ticket reservation system is a web based application. It has been developed using
ASP.NET and C# as the code end programming language. A MS SQL Server database consisting
of multiple tables is used for data storage.
This Website is a online travel booking website, which is capable of booking tour of national and
international destination with easy steps at the cheapest rate . It allows the Administrator to
perform all operations and view bookings. The general user is however given only restricted
access.
Travelmasti helps in booking tour packages. The user can’t book any tour until he is a
registered user.
4.1MySQL

MySQL server: - MySQL server is basically a database server which is mostly


used for storing user data into the required database in a specific table for easy
access of these data in the future. The database server works when a local
application invokes it. Before storing data into a database with the help of database
server, PHP sends a SQL query to MySQL database server for establishing a
connection to the server by using the loopback address, i.e.,

127.0.0.1 along with the user name and password for getting authentication from the
database server. Since connection is established locally with the database server by
PHP, so there is no chance of getting access to database server for modifying database
by the client. Also , when PHP request for information retrieval from the database
server by sending SQL query then the database server sends back the result of query
after executing it by the database server. Another method of accessing database server
is only possible by locally, i.e., only administrator of that particular computer can get
all the access facilities of the database server as well as all the database which are not
available to restricted users. PHP can update information in the database server if it
has the administrator username and password to access thespecific database, otherwise
connection will be rejected by MySQL server and the database cannot be updated.

Since before the dawn of the computer age,people have been using databases.
computers, a database may have been a Rolodex containing phone numbers
of the important people you knew, or it was a filing cabinet that contained all
the personnel records for the company. Today, databases are computer-based and
are found virtually everywhere. From desktop databases of your record
collection to Web-enabled databases that run large corporations.
4.1.1.2 EVOLUTION OF ASP.NET

The first beta version of ASP was code named denali. Denali allowed the developer to execute
code within a web page. Advanced functions could be performed using ActiveX Data Objects.
The next version of ASP was ASP 1.0, WHICH WAS available as an add-on IIS 3.0.In this
version of ASP, ADO had had become faster and effective as compared with the previous
version. The next version ASP 2.0, came as a part of windows NT 4.0. Now components were
easier to build because of the introduction of Microsoft Transaction Server, which allowed the
components to be a part of transaction. Then, ASP 3.0 was introduced which came along with
windows 2000. In this version, Microsoft combined MTS with core COM into COM+ and
included it as a part of windows 2000 itself.
The latest version, of ASP is ASP.NET. ASP.NET has come to us along with the .NET
framework. ASP.NET is an object oriented server side scripting tool. Hence, it facilitates
easy development of object oriented and granularized code.

Drawbacks of ASP
• VBScripts and JavaScript are the only two scripting languages available in ASP.
These are basic non-typed languages. You cannot use strongly typed languages like
Visual Basic or c++.
• ASP pages are interpreted. This makes their execution slower.
• ASP pages are very untidy. They are a spaghetti-like mixture of code. HTML and
text.
• While creating a web application using ASP pages, the programmers and the designer
had to work on the same life. The programmers had to write the code to provide
required functionality and the designers too had to create the graphics and content, and
all this had to be combined into a single file.
• In ASP, you have to write code to provide any functionality you require. For example,
if you required any validations to be performed you had to write code for it to occur. A
huge numbers of lines of code had to be written.
• Re-use of code was not given much focus in ASP. You could do it only by using the
include statement.
• There was no debugging mechanism in ASP. You could debug ASP application
only by using the response.write. This is very tedious and not very effective.
• In ASP, you had to stop the web server to install a new version of a DLL. DLL’S had to
be registered in the registry to be available for usein an application. Moreover, the DLL
registration process is a very complex one.

Advantage of ASP.NET
• ASP.NET supports strongly typed languages like VB, c#,and much more.
• ASP.NET pages get compiled instead of being interpreted, thus their execution
speed is faster than ASP pages.
• ASP.NET pages are tidier than ASP pages. The code can be separated from the
HTML design and text. Thus, programmers can work separately from the designers.
• ASP.NET provides server controls that are declarative. You just have to declare
them and you can use them. Thus, the number of lines of code to be written is
reused.
• ASP.NET supports re-use of code by the mechanism of inheritance. For
example, you can inherit c# classes and use them to provide the required
functionality.
• ASP.NET has an inbuilt method called Trace, which helps you in debugging a page.
You can either display the trace information at the end of the page or re- direct it to
another location to check later.

Features of ASP.NET
• ASP.NET can recognize the type of browser the client is using and accordingly
display the content to the client. For example, if the client uses an uplevel browser
(ie> 4.0 version), then the validation is performed on the client –side and on the
server-side. However, if the client is using a downlevel browser, then the validation
is performed only on the server-side.
• ASP.NET improves performance by using server-side caching. It allows you to cache
the entire output of a page for re-use by other clients.
• ASP.NET functionality can be coded using different languages like C# or VB.NET.
However, only one language can be used for coding in a single page.
• ASP.NET ships with many built –in server controls that have the common required
functionalities. For example, the developer need not create a control for accepting
data; the textbox control is provided for this purpose. Thus, the developer need not
to recreate these controls to obtain the required functionality.
• A web service can be described as a function that can be deployed over the web and
can be called by any application or other services. It can be a business application or
a system function. ASP.NET allows you to create such web services.

Minimum Requirements
The software requirements to successfully run all the programs are

• Operating System - Windows 7, Windows XP.


• Microsoft IIS WEB server 5.0
• SQL Serv0er 2005
• Visual Studio 2005
Database Tables

The following tables were created for the application:

Table Name Description


Train details Store details of each train
Booking Stores details of user and particular train
Bank Stores the details of all banking information of
user while booking a ticket.

High-level Diagram

Following is a high-level diagram depicting the overall working of the system:

Basic System Architectural Design

The system has a three level architecture:


• The first level (front end) uses ASP.NET technology with C# at the code end, to provide
the users with the front-end.
• The lower lever (back end) uses MS SQL Server to house the database.
• The middle level comes into play only when Available tours are to be searched. This is
achieved through the use of Active X Components (Data Grid). This picks up the requisite
data from the database (depending upon the tours available and any other required
conditions) and uses them to show the available tours.

After starting the web application this is the front page.


HOME PAGE.

For searching the train user should enter the source(to) and destination(from),date and class in
which the the user want to go.To press the “search now” user can know the train details.
SEARCH TRAIN PAGE.

There is another part of that page which is ADMINISTRATOR ,by which administrator can
modify the train deatails.
Here user find the train detail and to press the “book ticket” option for booking the ticket.
TRAIN DETAILS PAGE.

To book a ticket a user first login with user name and password and if user forget his password
then there is a another option to change the password.
LOG IN PAGE.

For a new user there is a hyperlink by which user can create a new account.
CREATE USER PAGE.

After login this page is open and in this page there are two parts one is TRAIN
INFORMATION which is atomatically comes from the train details page and other part is
PERSONAL DETAILS which is filled by user.
TICKET BOOKING FORM PAGE.
To press the continue option user would go to the payment page.
PAYMENT PAGE.
Here user should fill up all the necessary details of personal and card that he wants to use to
book a ticket.
After filling up all the information in the payment page user press the “continue to pay” button
and the following page is coming.

TICKET NO PAGE.
In this page user find his ticket no.
If the user wants to cancel the ticket then he/she press the cancel ticket option to cancel the
ticket .In that case user should fill the name and ticket no to find the train and then click the
cancel ticket hyperlink which delete the ticket from the datadase.
There are many pics of hotels clicking on which makes the image larger.
There is another helping window for the user to find the railway route across the country.Here
also have a download link to download the map.
MAP PAGE.
.Here is a FAQ section where user asked some important question and the site automatically
generate the answare.
FAQ page.
For the administrator use this page will open.Only admin can open this page .

ADMINISTRATOR EDITING PAGE.


4. Results and Discussions
5.1 Test Results
5.1.1 Unit Tests
Starting from the bottom the first test level is "Unit Testing". It involves checking that each feature
specified in the "Component Design" has been implemented in the component.
In theory an independent tester should do this, but in practice the developer usually does it, as
they are the only people who understand how a component works. The problem with a
component is that it performs only a small part of the functionality of a system, and it relies on
co-operating with other parts of the system, which may not have been built yet. To overcome this,
the developer either builds, or uses special software to trick the component into believe it is
working in a fully functional system.

The summary of unit tests is provided below:


For User:
UNIT PURPOSE VERIFIED
Search Train This unit search the trains. Yes
Train details This unit shows the trains of a Yes
particular source to destination in a
particular date and a specific seat .
Book ticket. This unit user can select a particular Yes
train and book ticket .
Login. This unit login the registered user and Yes
create an account for a new user.
Fill the booking User fill the form to book ticket. Yes
form.
payment. User fill the form and pay the money Yes
with the help of credit card.
Ticket no This unit allows to show his ticket no. Yes

Cancel ticket This unit allows user to cancel ticket. Yes

For Administrator

UNIT PURPOSE VERIFIED


Administrator This unit detects the authorization of Yes
Login the Administrator.
Change the train This unit allows the administrator to Yes
details change the train details.
hjx

Integration Testing
As the components are constructed and tested they are then linked together to check if they work
with each other. It is a fact that two components that have passed all their tests, when connected
to each other produce one new component full of faults. These tests can be done by specialists, or
by the developers.
Integration Testing is not focused on what the components are doing but on how they
communicate with each other, as specified in the "System Design". The "System Design"
defines relationships between components.
The tests are organized to check all the interfaces, until all the components have been built and
interfaced to each other producing the whole system.
Thus this test was successfully done. No conflicts or inconsistencies were detected.

System Testing
Once the entire system has been built then it has to be tested against the "System
Specification" to check if it delivers the features required. It is still developer focused, although
specialist developers known as systems testers are normally employed to do it.
In essence System Testing is not about checking the individual parts of the design, but about
checking the system as a whole. In fact it is one giant component.
System testing can involve a number of specialist types of test to see if all the functional and
non - functional requirements have been met. In addition to functional requirements these may
include the following types of testing for the
non - functional requirements:
· Performance - Are the performance criteria met?
· Volume - Can large volumes of information be handled?
· Stress - Can peak volumes of information be handled?
· Documentation - Is the documentation usable for the system?
· Robustness - Does the system remain stable under adverse circumstances? The
system was found to perform its function properly under all conditions.

Acceptance Testing
Acceptance Testing checks the system against the "Requirements". It is similar to systems
testing in that the whole system is checked but the important difference is the change in focus:
Systems testing checks that the system that was specified has been delivered. Acceptance Testing
checks that the system will deliver what was requested.
The customer should always do acceptance testing and not the developer. The customer knows
what is required from the system to achieve value in the business and is the only person
qualified to make that judgment. This testing is more of getting the answer for whether is the
software delivered as defined by the customer. It’s like getting a green flag from the customer
that the software is up to the expectation and ready to be used.

Figure 1.4: - V model cycle flow

5.1.2 Result
Online railway ticket reservation system was successfully designed and developed as per the
specifications. It was extensively tested using a database which contains data similar to what can
be expected in an actual database. The system was found to work satisfactorily without any
errors under all conditions.
5.Summary and Conclusions
5.1 Summary of Achievements

The following achievements were made during the project:

We had the opportunity to learn a new technology ASP.net


Learned to work in visual studio 2010.
We learned to handle a project efficiently and correctly.
Learned to tackle various adverse situations while managing and developing software.
Learning about the functioning of the IT industry and work ethics in the corporate
world.
Learning to work with C#.NET and MS SQL Server 2005.
Learning about the different phases of software development and the software
engineering processes involved in the development of software.

5.2 Main difficulties encountered


The main difficulty that was encountered during this project was that we had to learn a
new technology ASP.net as well as a new language C# with which we were not at all
familiar with earlier .
Time constraint.
Learning the use of triggers.

5.3 Limitations of the Project

Print ticket option is not provided here.


Ajax could not be used.
6. BIBLIOGRAPHY

Website
Dynamicdrive.com
Freecsstemplates.com

Books
Microsoft Official Custom Workshop
ASP.NET The Complete Reference (Herbert Schild)

Microsoft ASP training kit 2.0 framework(70-528)


*{ font-family: 'Roboto', sans-serif; }
html,
button,
input,
select,
textarea {
color: #222;
}
html {
font-size: 1em;
line-height: 1.4;
}

::-moz-selection {
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}

hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
audio,
canvas,
img,
video {
vertical-align: middle;
}
fieldset {
border: 0;
margin: 0;
padding: 0;
}
textarea {
resize: vertical;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
background: #333333 url(../img/background.jpg) no-repeat center bottom fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-weight: 300;
}
.login-form {
margin: 50px auto;
background: white;
padding: 30px 0;
position: relative;
-webkit-box-shadow: 0 0 5px 3px rgba(0, 0, 0, 0.125);
box-shadow: 0 0 5px 3px rgba(0, 0, 0, 0.125);
height: 400px;
}
.login-form #form-loading {
text-align: center;
position: absolute;
top: 0;
bottom: 0;
width: 100%;
opacity: 0.5;
filter: alpha(opacity=50);
z-index: 1000;
background: #555555;
}
.login-form #form-loading i {
font-size: 100px;
}
.login-form #form-message {
text-align: center;
color: #555555;
}
.login-form .h1 {
font-size: 30px;
color: #3EC038;
padding: 15px 15px 35px 15px;
text-transform: uppercase;
text-align: center;
}
.login-form .logo {
height: auto;
max-width: 100%;
}
.login-form .group {
*zoom: 1;
-webkit-transition: all ease .2s;
transition: all ease .2s;
border-left: 4px solid #fff;
padding: 10px 0;
}
.login-form .group:before,
.login-form .group:after {
content: " ";
display: table;
}
.login-form .group:after {
clear: both;
}
.login-form .group > label {
padding-left: 15px;
padding-top: 5px;
color: #555555;
font-size: 16px;
display: block;
}
.login-form .group > label.empty {
display: block;
height: 1px;
padding: 0;
margin: 0;
}
.login-form .group > div {
padding: 0 15px;
}
.login-form .group > div.addon-right {
position: relative;
padding-right: 50px;
}
.login-form .group > div.addon-right > i {
position: absolute;
right: 25px;
top: 9px;
z-index: 999;
color: #555555;
}
.login-form .group > div .error-message {
font-size: 12px;
color: red;
margin-top: 5px;
}
.login-form .group.active {
background: #F6F6F6;
border-left-color: #40C2FF;
-webkit-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.03);
box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.03);
}
.login-form input[type=submit] {
border: none;
background: #65CA60;
color: white;
padding: 5px 20px;
text-transform: uppercase;
font-weight: 500;
border-radius: 1px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: background ease-in-out .15s;
transition: background ease-in-out .15s;
cursor:pointer;
}
.login-form input[type=button] {
border: none;
background: #65CA60;
color: white;
padding: 5px 20px;
text-transform: uppercase;
font-weight: 500;
border-radius: 1px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: background ease-in-out .15s;
transition: background ease-in-out .15s;
cursor:pointer;
}
.login-form input[type=submit]:hover {
background: #5AC253;
}
.login-form {
width: 320px;
}
@media (min-width: 550px) {
.login-form {
width: 520px;
}
.login-form .group > label {
float: left;
width: 180px;
}
.login-form .group > div {
margin-left: 180px;
padding-left: 0;
}
}
.form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 1px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233,
0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.form-control::-moz-placeholder {
color: #999999;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #999999;
}
.form-control::-webkit-input-placeholder {
color: #999999;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
cursor: not-allowed;
background-color: #eeeeee;
opacity: 1;
}
textarea.form-control {
height: auto;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.one-line {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.arrow-up {
border-left-color: transparent;
border-right-color: transparent;
border-top-style: none;
}
.arrow-down {
border-left-color: transparent;
border-right-color: transparent;
border-bottom-style: none;
}
.arrow-right {
border-top-color: transparent;
border-bottom-color: transparent;
border-right-style: none;
}
.arrow-left {
border-top-color: transparent;
border-bottom-color: transparent;
border-left-style: none;
}
.arrow {
width: 0;
height: 0;
display: inline-block;
vertical-align: middle;
border-color: white;
border-width: 5px;
border-style: solid;
}
.arrow.up {
border-left-color: transparent;
border-right-color: transparent;
border-top-style: none;
}
.arrow.down {
border-left-color: transparent;
border-right-color: transparent;
border-bottom-style: none;
}
.arrow.right {
border-top-color: transparent;
border-bottom-color: transparent;
border-right-style: none;
}
.arrow.left {
border-top-color: transparent;
border-bottom-color: transparent;
border-left-style: none;
}
label.err {
color: red;
display: block;
margin: 0;
width: auto;
}
em {
display: block;
margin: 5px 0 0px 180px;
font-style: inherit;
}
.welcome{
line-height: 50px;
padding-left:30px;
color: #555555;
}
<html>
<head>
<title>Change password</title>
<link rel="stylesheet" href="css/main.css">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,500'
rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"
rel="stylesheet">
<script src="js/jquery-1.8.2.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/main.js"></script>
<style type="text/css">
a:link {color: #ffffff}
a:visited {color: #ffffff}
a:hover {color: #ffffff}
a:active {color: #ffffff}
</style>
</head>
<body>
<?php
session_start();
include("header.php"); ?>
<form id="login-form" class="login-form" name="form1" method="post"
action="changepw.php">
<div id="form-content">
<div class="welcome">
Do you want to change your password?
<br />
Email ID: <input type="text" name="email"><br/>
Current password: <input type="password" name="opw"><br/>
New password: <input type="password" name="npw"><br/><br/>
<center><input type="submit" name="changepw" value="Change
password"></center>
</div>
</div>
</form>
</body>
</html>
<?php
$connect = mysql_connect("localhost","root","");
mysql_select_db("foodies") or die("couldn't find database");
if (isset($_POST['changepw'])){
$email=$_POST['email'];
$opw=$_POST['opw'];
$npw=$_POST['npw'];
$query = mysql_query("select * from php_users_login where email='$email'");
$numrows = mysql_num_rows($query);
if($numrows!=0)
{
while($row = mysql_fetch_assoc($query))
{
$dbemail = $row['email'];
$dbpassword = $row['password'];
}
if($dbemail==$email&&$opw==$dbpassword)
{
$sql2 ="UPDATE php_users_login SET password= '$npw' WHERE email=
'$dbemail';";
if(mysql_query($sql2))
{
echo "<script type='text/javascript'>alert('Password changed
successfully');</script>";
}
else
{
echo "<script type='text/javascript'>alert('Error');</script>";
}
}
else
echo "<script type='text/javascript'>alert('Incorrect password');</script>";
}
else
echo "<script type='text/javascript'>alert('User does not exist');</script>";
}
?>
function validate()
{
var fname=document.getElementById("fname");
var lname=document.getElementById("lname");
var age=document.getElementById("age");
var mob=document.getElementById("mob");
var EmailId=document.getElementById("email");
var pw=document.getElementById("pw");
var cpw=document.getElementById("cpw");
var alphaExp = /^[a-zA-Z]+$/;
var atpos = EmailId.value.indexOf("@");
var dotpos = EmailId.value.lastIndexOf(".");
if(fname.value==null || fname.value=="")
{
fname.focus();
alert("Enter valid first name");
return false;
}
if(fname.value.match(alphaExp)){}
else{
alert("First name can have only letters");
fname.focus();
return false;
}
if(lname.value==null || lname.value=="")
{
lname.focus();
alert("Enter valid last name");
return false;
}
if(lname.value.match(alphaExp)){}
else{
alert("Last name can have only letters");
lname.focus();
return false;
}
if(age.value==null || age.value=="")
{
alert("Please Enter Age");
age.focus();
return false;
}
if (isNaN(age.value))
{
alert(" Your Age must be Integer");
age.focus();
return false;
}
if(mob.value==null || mob.value==" ")
{
alert("Please Enter Mobile Number");
mob.focus();
return false;
}
if (isNaN(mob.value))
{
alert(" Your Mobile Number must be Integers");
mob.focus();
return false;
}
if((mob.value.length!= 10))
{
alert("Enter the valid Mobile Number(Like : 9669666999)");
mob.focus();
return false;
}
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=EmailId.value.length)
{
alert("Enter valid email-ID");
EmailId.focus();
return false;
}
if(pw.value.length< 8 || cpw.value.length< 8)
{
alert("Please enter a password of atleast 8 characters");
pw.focus();
return false;
}
else if (pw.value.length != cpw.value.length)
{
alert("Passwords do not match.");
pw.focus();
return false;
}
else if (pw.value != cpw.value)
{
alert("Passwords do not match.");
pw.focus();
return false;
}
return true;
}
<?php
session_start();
if(empty($_SESSION['user_info'])){
echo "<script type='text/javascript'>alert('Please login before proceeding
further!');</script>";
}
$conn = mysqli_connect("localhost","root","","railway");
if(!$conn){
echo "<script type='text/javascript'>alert('Database failed');</script>";
die('Could not connect: '.mysqli_connect_error());
}
if (isset($_POST['submit']))
{
$trains=$_POST['trains'];
$sql = "SELECT t_no FROM trains WHERE t_name = '$trains'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$email=$_SESSION['user_info'];
$query="UPDATE passengers SET t_no='$row[t_no]' WHERE email='$email';";
if(mysqli_query($conn, $query))
{
$message = "Ticket booked successfully";
}
else {
$message="Transaction failed";
}
echo "<script type='text/javascript'>alert('$message');</script>";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Book a ticket</title>
<LINK REL="STYLESHEET" HREF="STYLE.CSS">
<style type="text/css">
#booktkt {
margin:auto;
margin-top: 50px;
width: 40%;
height: 60%;
padding: auto;
padding-top: 50px;
padding-left: 50px;
background-color: rgba(0,0,0,0.3);
border-radius: 25px;
}
html {
background: url(img/bg7.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#journeytext {
color: white;
font-size: 28px;
font-family:"Comic Sans MS", cursive, sans-serif;
}
#trains {
margin-left: 90px;
font-size: 15px;
}
#submit {
margin-left: 150px;
margin-bottom: 40px;
margin-top: 30px
}
</style>
<script type="text/javascript">
function validate() {
var trains=document.getElementById("trains");
if(trains.selectedIndex==0)
{
alert("Please select your train");
trains.focus();
return false;
}
}
</script>
</head>
<body>
<?php
include ('header.php');
?>
<div id="booktkt">
<h1 align="center" id="journeytext">Choose your journey</h1><br/><br/>
<form method="post" name="journeyform" onsubmit="return validate()">
<select id="trains" name="trains" required>
<option selected disabled>-------------------Select trains here--------
--------------</option>
<option value="rajdhani" >Rajdhani Express - Mumbai Central to
Delhi</option>
<option value="duronto" >Duronto Express - Mumbai Central to
Ernakulum</option>
<option value="geetanjali">Geetanjali Express - CST to Kolkata</option>
<option value="garibrath" >Garib Rath - Udaipur to Jammu Tawi</option>
<option value="mysoreexp" >Mysore Express - Talguppa to Mysore
Jn</option>
</select>
<br/><br/>
<input type="submit" name="submit" id="submit" class="button" />
</form>
</div>
</body>
</html>

REFERENCES
1. https://www.tutorialspoint.com/
2. https://www.github.com
3. https://www.w3schools.in/
4. http://www.javatpoint.com
5. https://www.geeksforgeeks.org

You might also like