Ritik Tamboli Project Documentation Voting

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 96

A

Project Report

On

ONLINE VOTING SYSTEM


Submitted in partial fulfilment of the requirements for the award of degree

Bachelor of Computer Application


From
Pt. Ravishankar Shukla University, Raipur (C.G.)
Year: 2022 -23

Guide: Submitted by:


Miss Pooja Singh Ritik Tamboli
Assist Professor (cs)
Assist Professor (c Submitted to
Disha College
Pt. Ravishankar Shukla University, Raipur (C.G.)

Page 1
CERTIFICATE OF APPROVAL

This is to certify that the Project work entitled “Online Voting System” is
carried out by Ritik Tamboli a student of BCA-III year at Disha College is
here by approved as a credible work in here discipline of Computer Science &
Information Technology for the award of degree of Bachelor of Computer
Application during the year 2022-23 from Pt. Ravishankar Shukla
University, Raipur (C.G.).

Dr. A.K. Tiwari


Principal
Disha College, Raipur

Page 2
CERTIFICATE

This is to certify that the Project work entitled “Online Voting System”

Submitted to Disha College by Ritik Tamboli, Roll No_____________ in

partial fulfillment for the requirements relating to nature and standard of the

award of Bachelor of Computer Application degree by Pt. Ravishankar

Shukla University, Raipur(C.G.) for the academic year 2022-23.

This project work has been carried put under my guidance.

Guide: Miss Pooja Singh


Disha College, Raipur

Page 3
CERTIFICATE OF EVALUATION

This is to certify that the Project work entitled “Online Voting System” is

carried out by Ritik Tamboli, Roll no_____________ a student of BCA-III

year at Disha College after my proper evaluation and examination, is here by

approved as a credible work in here discipline of Computer Science &

Information Technology for the award of degree of Bachelor of Computer

Application during the year 2022-23 from Pt. Ravishankar Shukla University,

Raipur (C.G.).

Internal Examiner
External Examiner

Page 4
DECLARATION

This is to certify that the project work entitled “Online Voting System”

submitted by me in the partial fulfillment for the award of the degree of

Bachelor of Computer Application to Disha College, comprises the original

work carried out by me.

I further declare that the work reported in this project has not been

submitted and will not be submitted, either in part or in full for the award of any

other degree or diploma in this Institute or University.

Place: Ritik Tamboli


Date: Roll no :

Page 5
ACKNOWLEDGEMENT

I feel highly elevated in expressing our immense sense of gratitude


towards my Project Guide Mrs. Rekha Awasthi for the esteemed guidance,
prompt suggestions and interest he showed towards completion of this project
entitled “Online Voting System” It was specially a contribution for me to have
him for the guidance of the project as he always gave us ideas and suggestions,
also response in best manners.

He has always been a source of most gracious encouragement and also


provided me a lot of valuable suggestions, which was important for my project.
He has also provided me with valued criticism, which was most essential.

I would also like to extend my gratitude to other faculty members of our


department for their support and encouragement. I believe this endeavor of mine
will boost my self-confidence and will go long on helping me to reach further
milestones and greater heights.

Ritik Tamboli

BCA-III

Page 6
INDEX

1. Objective and Scope of the Project


2. Theoretical Background of Project
3. Definition of Problem
4. System Analysis and Design
5. Methodology adopted and Detail of Hardware & Software Used
6. System Maintenance and Evaluation
7. Cost and Benefit Analysis
8. Detailed Life Cycle of the Project
8.1 ERD and DFD
8.2 Input and Output Screen Design.
8.3 Process Involved.
8.4 Methodology used for Testing.
8.5 Test reports, Print out of the code sheet
9. User/Operational Manual –Including Security aspects backup, Access Rights,
Controls etc.
10. Conclusion
11. References
12. Soft Copy of the Project on CD

Page 7
1.1- SCOPE1-OF THE PROJECT
OBJECTIVE

The Online Voting System is a web based application. The system has a
centralized database to keep records of all the Voters and Candidates and Final
Results. This Online Voting System is based on SMS sending to voters, to
confirmation of Vote. This web based system is time saving, work load reduced
information available at time and it provide sequrity for the data. During the
election, the election commission of India has introduced a new method of
polling by online voting system (OVS).

The objective of the system is a replacement of the traditional system that is in


existence. This smart system reduces the time for voting and also the system is
reliable, and faster. In this system the voter username and password will be sent
through SMS. The voter cast their vote enter the confirmation OTP sent their
mobile number . Database maintained by this system usually contains the
Voters information, Candidate information, The final Result of total votes

Page 8
The election commission will maintain this website. This is a simple, safe and
secure method that takes minimum of time. The word VOTE means to choose
from a list, to elect or to determine. The main goal of voting (in a scenario
involving the citizens of a given country) is to come up with leaders of the
people’s choice. Most countries, India not an exception have problems when it
comes to voting. Some of the problems involved include ridging votes during
election, insecure or inaccessible polling stations, inadequate polling materials
and also inexperienced personnel

As this website provides better way of election between voter and political
parties: hence we suppose that this project as a greater scope and is important
requirement is to provide a compact :stable system of voting with a facility
through online.

Page 9
2-THEORETICAL BACKGROUND OF
PROJECT

Hypertext Markup Language (HTML)is the standard markup language for


creating web pages and web applications. HTML is the language in which most
websites are written.

HTML is used to create pages and make them functional. 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 them 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. It 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 /> introduce content into the page directly. Others such as
<p>...</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.

History of HTML: -

HTML was created by Sir Tim Berners-Lee in late 1991 but was not released
officially, published in 1995 as HTML 2.0. HTML 4.01 was published in late 1999
and was a major version of HTML.

HTML is a very evolving markup language and has evolved with various
versions updating. Long before its revised standards and specifications are carried in,
each version has allowed its user to create web pages in a much easier and prettier
way and make sites very efficient.

 HTML 1.0 was released in 1993 with the intention of sharing information
that can be readable and accessible via web browsers. But not many of the
developers were involved in creating websites. So, the language was also not
growing.
 Then comes the HTML 2.0, published in 1995, which contains all the features
of HTML 1.0 along with that few additional features, which remained as the

Page 10
standard markup language for designing and creating websites until January
1997 and refined various core features of HTML.
 Then comes the HTML 3.0, where Dave Raggett who introduced a fresh paper
or draft on HTML. It included improved new features of HTML, giving more
powerful characteristics for webmasters in designing web pages. But these
powerful features of new HTML slowed down the browser in applying further
improvements.
 Then comes HTML 4.01, which is widely used and was a successful version of
HTML before HTML 5.0, which is currently released and used worldwide.
HTML 5 can be said for an extended version of HTML 4.01, which was
published in the year 2012.

Features of HTML: -

HTML is the most common used language to write web pages. It has recently
gained popularity due to its advantages such as:
1. It is the language which can be easily understood and can be modified.

2. Effective presentations can be made with the HTML with the help of its all-
formatting tags.

3. It provides the more flexible way to design web pages along with the text.

4. Links can also be added to the web pages so it helps the readers to browse the
information of their interest.

5. You can display HTML documents on any platforms such as Macintosh,


Windows and Linux etc.

6. Graphics, videos and sounds can also be added to the web pages which give an
extra attractive look to your web pages.

Page 11
Started with HTML: -

Covers the absolute basics of HTML, to get you started — we define elements,
attributes, and all the other important terms you may have heard, and where they fit in
to the language. We also show how an HTML element is structured, how a typical
HTML page is structured, and explain other important basic language features. Along
the way, we'll have a play with some HTML, to get you interested!

Meta data in HTML: -

The head of an HTML document is the part that is not displayed in the web
browser when the page is loaded. It contains information such as the page <title>,
links to CSS (if you want to style your HTML content with CSS), links to custom
favicons, and metadata (which is data about the HTML, such as who wrote it, and
important keywords that describe the document.)

HTML text fundamentals: -

One of HTML's main jobs is to give text meaning (also known as semantics),
so that the browser knows how to display it correctly. This article looks at how to use
HTML to break a block of text up into a structure of headings and paragraphs, add
emphasis /importance to words, create lists, and more.

Advanced text formatting: -

There are many other elements in HTML for formatting text, which we didn't
get to in the HTML text fundamentals article. The elements in here are less well-
known, but still useful to know about. In here you'll learn about marking up
quotations, description lists, computer code and other related text, subscript and
superscript, contact information, and more.

Document and website structure: -

Page 12
As well as defining individual parts of your page (such as "a paragraph" or "an
image"),
HTML is also used to define areas of your website (such as "the header", "the
navigation menu", "the main content column".) This article looks into how to plan a
basic website
structure, and write the HTML to represent this structure.

Creating hyperlink’s: -

Hyperlinks are really important — they are what makes the web a web. This
article shows the syntax required to make a link, and discusses link best practices.

Advantages: -

 HTML is widely used.


 Every browser supports HTML language.
 Easy to learn and use.
 HTML is light weighted and fast to load.
 HTML has many tags and attributes which can short of your line of code.

Page 13
3.2- CSS (Cascading Style Sheet)
Introduction:-
CSS is abbreviated as Cascading Style Sheets and describes how HTML
elements need to be displayed when represented in a web page format or other
media. It also helps save a lot of work because controlling the layout of multiple
web pages can be done all at a time. It helps in representing how markup-based
documents can be presented in conjunction with HTML. The latest version of
CSS was released in CSS3.
CSS is said to as the cornerstone design tool of the World Wide Web
along with HTML and JavaScript. CSS is intended for enabling the separation
of appearance with content, which includes layout, colouring, and font styles.
Such a smart approach can progress the accessibility of content, offer more
flexibility, and organize in the presentation order. It allows multiple web pages
to contribute to formatting by giving relevant CSS instructions in another file
with the file extension .CSS. This separation of design implementation helps in
reducing complexity as well as repetition in the structural content.

History Of CSS: -

CSS was first proposed by Hakon Wium Lie on October 10, 1994. At
the time, Lie was working with Tim Berners-Lee (father of Html) at CERN.
The European Organization for Nuclear Research is known as CERN. Hakon
wium lie is known as father of CSS.

CSS was proposed in 1994 as a web styling language, to solve some of


the problems of Html 4. There were other styling languages proposed at this
time, such as Style Sheets for Html and JSSS but CSS won.

CSS level 2 specification was developed by the W3C and published as a


recommendation in May 1998. CSS 2 includes a number of new capabilities
like below;

 absolute
 relative

Page 14
 fixed
 positioning
 bidirectional text
 new font properties such as shadows.

CSS3 was started in 1998 but it has never been completed. Some parts are
still being developed and some components work on some browsers. It
published in June 1999. CSS 3 is divided into several separate documents
called "modules". Each module adds new capabilities or extends features
defined in CSS 2.

Benefits Of CSS: -

Compatible with Old Versions: This is the most beautiful feature of


CSS3 as it gets compatible with its older versions. This is advantageous as
designers won't have to relinquish their previous work because of the arrival of
CSS3.

Simple yet Independent: Like that of CSS2, CSS3 is created using tiny
modules that compose the application more straightforward and more
comfortable to exercise. Some of the most vital components and features
offered by CSS3 are selectors, box model, colour, borders, backgrounds, 2D and
3D transformations, Text Effects, and user interface.

View and Change-Friendly: As the various CSS concepts have been broken
down into tiny chunks or modules, it has become easier to alter the elements
individually without particularly disturbing the remaining components. Also,
CSS has become compatible with all kinds of platforms.

Rapid development: Since it is not dependent on JavaScript, CSS3 has become


a lot swifter than its older versions and is relatively more compatible with every
browser available in the market.

Eye-catching backgrounds: CSS helps in making attractive backgrounds,


especially using CSS3. It permits web designers to prefer a wide range of
backgrounds that can be useful and catch the eye with ease. Also, these
backgrounds have the feature of gradient colours and resizing so that they can
fit for the project.

Page 15
Images and Animations: CSS helps in ornamenting the appearance and feel of
a website or web pages immeasurably by using some simple styles. It permits
the straightforward incorporation of a variety of images-including 3D images in
your web development project. It also makes easy insertion of videos or
animations in your web pages along with flexibility for customization.

Testing its features: Because of the smaller modules (specifically in CSS3),


testing of every entity becomes smooth, which ultimately saves a lot of time and
effort.

3.3- JAVASCRIPT

Introduction: -
JavaScript is a scripting language that is one of the three core languages used to
develop websites. Whereas HTML and CSS give a website structure and style,
JavaScript lets you add functionality and behaviours to your website, allowing
your website’s visitors to interact with content in many imaginative ways.

JavaScript is primarily a client-side language, meaning it runs on your computer


within your browser. However, more recently the introduction of Node.js has
allowed JavaScript to also execute code on servers.

Since its release, JavaScript has surpassed Java, Flash, and other
languages because it is relatively easy to learn, has a free and open community,
and, most importantly, is incredibly useful, allowing developers to quickly
create apps with audiences in the millions.

JavaScript is a scripting or programming language that allows you to implement


complex features on web pages every time a web page does more than just sit
there and display static information for you to look at displaying timely content
updates, interactive maps, animated 2D/3D graphics, scrolling video etc. you
can bet that JavaScript is probably involved. It is the third layer of the layer
cake of standard web technologies,.
JavaScript is a dynamic programming language that's used for web
development, in web applications, for game development, and lots more. It
allows you to implement dynamic features on web pages that cannot be done
with only HTML and CSS.

Page 16
History of JAVASCRIPT: -

JavaScript language comes from the times when early web browsers were
being developed. Netscape Communications Company in 1994 created
Netscape Navigator that became the most popular web browser in the 90s.

Company’s board quickly realized that browsers should allow create more
dynamic websites and do some activities that do server-side languages, like
input validation. First Netscape Communications cooperate with Sun
Microsystems to use in Netscape Navigator Sun’s programming language Java.
Then they wanted adopting and embedding a existing programming language
like Scheme, Perl or Python. Eventually they decided to create scripting
language that would complement Java and has a similar syntax.

In 1995 Netscape Communications employed Brendan Eich to develop scripting


language for web browser. Eich prepared it in a very short time. First version of
new language had Mocha name, whereas official version used in Netscape
Navigator 2 beta version was called LiveScript. In the same 1995 year new
developed scripting language was renamed to JavaScript and used in next beta
version of Netscape Navigator 2. LiveScript followed a lot of Java features.
This, but above all the desire to use the growing popularity of Java to call
positive associations with a new language where reasons that it was finally
called JavaScript. Also implementation of the language for server-side was
introduced.

To understand where we’re at today and where we’re going, we first need to
fully understand where we come from. For JavaScript, the story is a long and
bumpy road.

1995 is where it starts. In the offices of Netscape where the first version of
JavaScript was born. 1995… take a moment to think about how different the

Page 17
web landscaped was at that time. I was three-years-old; most readers were
probably not even born. Netscape it self’s a very distant memory.

At that moment though, Netscape’s Navigator was one of the most popular web
browsers. It’s to support it that JavaScript was created, as a companion language
to Java. The fact that Netscape wanted a language that would “look like Java”
ruled out many other existing languages that could have been used to run the
browser (Python, Tcl, Scheme, etc.).

Back then, the web was fully-static, powered by simple HTML & CSS. JS
brought dynamism.

Benefits of JAVASCRIPT: -

 Auto complete
 Loading new content or data onto the page without reloading the page
 Rollover effects and dropdown menus
 Animating page elements such as fading, resizing or relocating
 Playing audio and video
 Validating input from forms

Page 18
3.4- PHP

Introduction: -
PHP is a server side scripting language that is embedded in HTML. It is used to
manage dynamic content, databases, session tracking, even build entire e-
commerce sites. It is integrated with a number of popular databases, including
MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
PHP started out as a small open source project that evolved as more and more
people found out how useful it was. Rasmus Lerdorf unleashed the first version
of PHP way back in 1994.PHP is a recursive acronym for "PHP: Hypertext Pre-
processor

Why is PHP?

 PHP is open source and free.


 Short learning curve compared to other languages such as JSP, ASP etc.
 Large community document
 Most web hosting servers support PHP by default unlike other languages
such as ASP that need IIS. This makes PHP a cost effective choice.
 PHP is regular updated to keep abreast with the latest technology trends.
 Other benefit that you get with PHP is that it’s a server side scripting
language; this means you only need to install it on the server and client
computers requesting for resources from the server do not need to have
PHP installed; only a web browser would be enough.
 PHP has in built support for working hand in hand with MySQL; this
doesn’t mean you can’t use PHP with other database management
systems. You can still use PHP with
 Oracle
 MS SQL Server
 ODBC etc.
 PHP is cross platform; this means you can deploy your application on a
number of different operating systems such as windows, Linux, Mac OS
etc.

Page 19
Features of PHP: -

• Simple
• It is very simple and easy to use, compare to other scripting language it is
very simple and easy, this is widely used all over the world.
• Interpret
It is an interpreted language, i.e. there is no need for compilation.
• Faster
It is faster than other scripting language e.g. asp and jsp.
• Open Source
Open source means you no need to pay for use php, you can free
download and use.

• Platform Independent
PHP code will be run on every platform, Linux, UNIX, Mac OS X, and
Windows.
• Case Sensitive
PHP is case sensitive scripting language at time of variable declaration. In
PHP, all keywords (e.g. if, else, while, echo, etc.), classes, functions, and
user-defined functions are NOT case-sensitive.
• Error Reporting
PHP have some predefined error reporting constants to generate a
warning or error notice.
• Real-Time Access Monitoring
PHP provides access logging by creating the summary of recent accesses
for the user.
• Loosely Typed Language
PHP supports variable usage without declaring its data type. It will be
taken at the time of the execution based on the type of data it has on its
value.

Page 20
3.5- MYSQL

Introduction: -
MySQL is an open-source relational database management system (RDBMS).
It is the most popular database system used with PHP. MySQL is developed,
distributed, and supported by Oracle Corporation.
 The data in a MySQL database are stored in tables which consist of
columns and rows.
 MySQL is a database system that runs on a server.
 MySQL is ideal for both small and large applications.
 MySQL is very fast, reliable and easy to use database system. It uses
standard SQL
 MySQL compiles on a number of platforms.
.

History of MYSQL: -

MySQL was created by a Swedish company, MySQL AB, founded


by Swedes David Axmark, Allan Larsson and Finland Swede Michael "Monty"
Widenius. Original development of MySQL by Widenius and Axmark began in
1994. The first version of MySQL appeared on 23 May 1995. It was initially
created for personal usage from mSQL based on the low-level language ISAM,
which the creators considered too slow and inflexible. They created a
new SQL interface, while keeping the same API as mSQL. By keeping the API
consistent with the mSQL system, many developers were able to use MySQL
instead of the (proprietarily licensed) mSQL antecedent.

Characteristics of Mysql: -

1) Easy to use: MySQL is easy to use. We have to get only the basic
knowledge of SQL. We can build and interact with MySQL by using only a few
simple SQL statements.

Page 21
2) It is secure: MySQL consists of a solid data security layer that protects
sensitive data from intruders. Also, passwords are encrypted in MySQL.

3) Client/ Server Architecture: MySQL follows the working of client/server


architecture. There is a database server (MySQL) and arbitrarily many clients
(application programs), which communicate with the server; that is, they can
query data, save changes, etc.

4) Free to download: SQL is free to use so that we can download it from


MySQL official website without any cost.

5) It is scalable: MySQL supports multi-threading that makes it easily scalable.


It can handle almost any amount of data, up to as much as 50 million rows or
more. The default file size limit is about 4 GB. However, we can increase this
number to a theoretical limit of 8 TB of data.

6) Speed: MySQL is considered one of the very fast database languages,


backed by a large number of the benchmark test.

7) High Flexibility: MySQL supports a large number of embedded


applications, which makes MySQL very flexible.

8) Compatible on many operating systems: MySQL is compatible to run on


many operating systems, like Novell NetWare, Windows* Linux*, many
varieties of UNIX* (such as Sun* Solaris*, AIX, and DEC* UNIX), OS/2,
FreeBSD*, and others. MySQL also provides a facility that the clients can run
on the same computer as the server or on another computer (communication via
a local network or the Internet).

9) Allows roll-back: MySQL allows transactions to be rolled back, commit,


and crash recovery.
Page 22
10) Memory efficiency: Its efficiency is high because it has a very low memory
leakage problem.

11) High Performance: MySQL is faster, more reliable, and cheaper because
of its unique storage engine architecture. It provides very high-performance
results in comparison to other databases without losing an essential functionality
of the software. It has fast loading utilities because of the different cache
memory.

12) Platform Independent: It can download, install, and execute on most of


the available operating systems.

13) Partitioning: This feature improves the performance and provides fast
management of the large database.

Page 23
3-Problem Definition
4-System Analysis

The existing manual Voting system consumes more time for Vote
Casting. Voter has to wait for vote polling station to vote for a right
candidate. The election officers has to be check the voter , this voter
can vote in this booth then chek voterID present in voters list of booth
those are information will be present then the voter can vote in that
booth. The voter had to stand in the queue to cast his vote. All the
work is done in paper ballot so it is very hard to locate a particular
candidates, some voters cast their votes for all candidates. To
overcome of all these problems we have to implement a web
application, which is helpful for Voting from any where.

Existing System:-

Page 24
The voting system currently being used by the association is a paper based
system, in which the voter simply picks up ballots sheets from electoral
officials, tick off who they would like to vote for, and then cast their votes by
merely handing over the ballot sheet back to electoral official. The electoral
officials gather all the votes being cast into a ballot box. At the end of the
elections, he electoral officials converge and count the votes cast for each
candidate and determine the winner of each election category.

Proposed System:-

Here we are proposing an web application for voting process that is Online
Voting System through SMS. The online voting system will manages the
voter’s deatils,Candidate details. The main feature of the project includes voters
information and candidate information, voter can login and use his/her voting
rights. The system can manage the information data very efficiently. The
proposed system is more reliable, faster, accurate and easy to handle compared
to existing manual system. It helps to computerize everything and reducing the
errors as compare to manual voting system

Page 25
5-METHODOLOGY ADOPTED
4-SYSTEM AND
DESIGN
DETAIL OF HARDWARE & SOFTWARE
(1) USE CASE OF DIAGRAM

Use case diagram consists of use case and actors and shows the interaction
between them. The key points are:
o The main purpose is to show the interaction between the use case and the
actors.
o To represent the system requirement from user’s perspective.
o The use case is the functions that are to be performed in the module.

Page 26
Hardware Requirements
 Processor: Pentium
 RAM: 4GB
 Hard Disk: 1TB
 Speed: 1.1GHz

Software Requirements
 Operating System: Windows
 Scripting Language: JSP
 Back-End: MYSQL .
 Front-End: HTML5 and CSS3
 Supporting Tools: NetBeans IDE, JQUERY
 Type: Web Application.
 Server: XAMMP(cross platform, Apache, MYSQL, JSP)
 Java Version : J2SDSK1.5

Page 27
6-System Maintenance And Evaluation
7-Cost And Benefit Analysis

Maintenance:
The IEEE 1219-1998 software standards document defines software
maintenance as "the modification of a software product after delivery to correct
faults, to improve performance or other attributes, or to adapt the product to a
modified environment." Software maintenance is the concluding part of the
software development process or "life cycle." They categorized maintenance
activities into four classes:
 Adaptive – modifying the system to cope with changes in the software
environment.
 Perfective – implementing new or changed user requirements which
concern functional enhancements to the software.
 Corrective – diagnosing and fixing errors, possibly ones found by users.
 Preventive – increasing software maintainability or reliability to prevent
problems in the future.

Evaluation:
 The software should be delivered on time.
 The software should be in the budget of the customer.
 It should respond frequently to the user’s request.
 Customer will check whether s/he is convenient to the environment in
which it is developed.
 The software should be capable of healing virus instead of getting
affected or destroyed.

Page 28
The Constructive Cost Model (COCOMO) is a procedural software cost
estimation model developed by Barry W. Boehm. It consists of a hierarchy of
three increasingly detailed and accurate forms. The first level, Basic COCOMO
is good for quick, early, rough order of magnitude estimates of software costs,
but its accuracy is limited due to its lack of factors to account for difference in
project attributes (Cost Drivers.

Model Used: Basic COCOMO Model for Organic Project

Formulae:

Effort Applied (E) = ab(KLOC)bb [ man-months ]

Development Time (D) = cb(Effort Applied)db [months]

People required (P) = Effort Applied / Development Time [count]

Calculation:

 Assuming an estimate of 5 KLOC.


 Using the following values of constants

aa bb cc dd
2.4 1.05 2.5 0.38

Effort Applied (E) = 2.4*(5)1.05 = 13.006 [man-months]

Development Time (D) = 2.5*(13.006)0.38 = 6.63 [months]

People required (P) = E/D = 13.006/6.63 = 1.96

Salary: 2000/-

Page 29
Cost = Effort Applied*Salary = 13.006*2000 = 26012/-

BENEFIT ANALYSIS:
The user, who’ll use this project will have the following benefits:
 The person will have a system for his/her Furniture shop.
 The cost spent on Furniture shop for managing stock will be extremely
minimized, hence providing profit to the organization.
 If users further develop this project for personal use, and those changes if
approved, can be implemented into the main system, hence making each
change in the project global.
 As frontend is separate from backend, one backend can be deployed, and
multiple client can use the backend easily, hence saving cost.

 In future, this project can earn by selling additional add-ons for paid
access, or by advertisements.

Calculation of Break-Even Point:


The software provides an approximate profit of 6500/- (yearly) to the
institution:-
Assuming break even point = 4 years.
So profit = cost/beak even point = 26000/4 = 6500(yearly).

The software development charge = 26000/-


Total Profit generated in 4 years = 4*6500 = 26000
Break-Even Point = 4 years

Page 30
8- DETAILED LIFE CYCLE OF THE PROJECT

(8.1) ENTITY RELATION DIAGRAM (ERD)


Database : MySQL.
Documentation : MS-Office
In this model objects of similar structures are collected into an entity set. The
relationship between entity sets is represented by a named E-R relationship and
is 1:1(one to one), 1: N (one to many) or M: N (many to many) mapping from
one entity set to another. The database structures, employing the E-R model is
usually shown pictorially using entity relationship (E-R) diagrams. The E-R
diagrams are useful in representing the relationship among entities. The
following terms used in E-R Diagram: -

Entity: -An entity is a person, place, thing, event or concept about which
information is recorded.

Attribute: -Attribute gives the characteristic of the entity. In other words, every
entity has some basic attribute that characterize it.

Entity Type: -An entity type is defined as a collection of entities that have the
same attributes.

Relationships:
o One to One (1:1)
o One to many (1: N)
o Many to Many (N: N)
o Many to One (N: 1)

Page 31
(8.1) DATA FLOW DIAGRAM(DFD)

Data Flow Diagram (DFD) is a graphical technique that depicts


information flow and transfers that are applied as data moves from input to
output. The DFD is also known as Data flow graph or a bubble chart. The data
flow diagram may be used to represent a system or software at any level of
abstraction. In fact, DFD’s may be partitioned into levels that represent

FIG. :- E-R DIAGRAM OF Online Voting


increasing information and functional detail.
The basic notation to create a DFD is:
 A rectangle is used to represent an external entity, that is, a system
element (e.g., hardware, person and another program) or another
 System that produces information for transformation by the software or
receives information produced by the software.
Page 32
 A circle represents a process or transform that is applied to data (or
control) and changes it in some way.
 An arrow represents one or more data items.
 An open rectangle represents data store –s-tired information that is used
by the software, i.e., Temporary repository of data.
The simplicity of DFD notation is one reason why structured analysis
techniques are most widely used. The data flow diagram for the current system
is as given in the figure below:

Page 33
FIG. :- DATA FLOW OF Online Voting System (0)

Page 34
FIG. :- DATA FLOW OF Online Voting System (1)

Page 35
8.2-INPUT AND OUTPUT SCREEN DESIGN

HOME PAGE

Page 36
REGISTER PAGE

LOGIN PAGE
Page 37
LOGIN PAGE

Page 38
VOTING PAGE

Page 39
Page 40
VOTE RESULT PAGE

Page 41
CHANGE PASSWORD
PAGE

8.3- PROCESS
INVOLVED
Page 42
The model that is basically being followed is the WATER FALL MODEL,
which states that the phases are organized in a linear order. First of all the
feasibility study is done. Once that part is over the requirement analysis and
project planning begins. If system exists one and modification and addition of
new module is needed, analysis of present system can be used as basic model.

The design starts after the requirement analysis is complete and the coding
begins after the design is complete. Once the programming is completed, the
testing is done. In this model the sequence of activities performed in a software
development project are: -

 Requirement Analysis
 Project Planning
 System design
 Detail design
 Coding
 Unit testing
 System integration & testing

Here the linear ordering of these activities is critical. End of the phase and the
output of one phase is the input of other phase. The output of each phase is to be
consistent with the overall requirement of the system. Some of the qualities of
spiral model are also incorporated like after the people concerned with the
project review completion of each of the phase the work done.

Page 43
8.4-METHODOLOGY USED FOR TESTING

WATER FALL MODEL was being chosen because all requirements were
known beforehand and the objective of our software development is the
computerization/automation of an already existing manual working system.

Changed
Requirements
Communicated
Requirements

Requirements
Specification
Requirements
Engineering

Design
Specification
Design

Executable
Software
Programming Modules Maintenance

Integrated
Software
Product
Process Integration

Delivered
Software
Delivery Product
Product Product
Input Output

Water Fall Model

Page 44
THE TESTING SPECTRUM

The term implementation has different meanings ranging from the


conversation of a basic website to a complete replacement of a system. The
procedures however, are virtually the same. Implementation includes all those
activities that take place to convert from old system to new. The new system
may be totally new replacing an existing manual or automated system or it may
be major modification to an existing system. The method of implementation and
time scale to be adopted is found out initially. Proper implementation is
essential to provide a reliable system to meet organization requirement.

Unit Testing

In computer programming, unit testing is a software testing method by


which individual units of source code, sets of one or more computer program
modules together with associated control data, usage procedures, and operating
procedures, are tested to determine whether they are fit for use. Intuitively, one
can view a unit as the smallest testable part of an application. In procedural
programming, a unit could be an entire module, but it is more commonly an
individual function or procedure. In object-oriented programming, a unit is
often an entire interface, such as a class, but could be an individual method.
Unit tests are short code fragments created by programmers or occasionally
by white box testers during the development process. It forms the basis for
component testing. Ideally, each test case is independent from the others.
Substitutes such as method stubs, mock objects, fakes, and test harnesses can be
used to assist testing a module in isolation. Unit tests are typically written and
run by software developers to ensure that code meets its design and behaves as
intended.

Page 45
Benefits: -

The goal of unit testing is to isolate each part of the program and show that
the individual parts are correct. A unit test provides a strict, written contract that
the piece of code must satisfy. As a result, it affords several benefits.

 Find problems early

Unit testing finds problems early in the development cycle. In test-


driven development (TDD), which is frequently used in both extreme
programming and scrum, unit tests are created before the code itself is
written. When the tests pass, that code is considered complete. The same
unit tests are run against that function frequently as the larger code base is
developed either as the code is changed or via an automated process with
the build. If the unit tests fail, it is considered to be a bug either in the
changed code or the tests themselves. The unit tests then allow the
location of the fault or failure to be easily traced. Since the unit tests alert
the development team of the problem before handing the code off to
testers or clients, it is still early in the development process.

 Facilitates Change

Unit testing allows the programmer to refactor code or upgrade


system libraries at a later date, and make sure the module still works
correctly (e.g., in regression testing). The procedure is to write test cases
for all functions and methods so that whenever a change causes a fault, it
can be quickly identified. Unit tests detect changes which may break
a design contract.

Page 46
 Simplifies Integration

Unit testing may reduce uncertainty in the units themselves and can
be used in a bottom-up testing style approach. By testing the parts of a
program first and then testing the sum of its parts, integration
testing becomes much easier.

 Documentation
Unit testing provides a sort of living documentation of the system.
Developers looking to learn what functionality is provided by a unit, and
how to use it, can look at the unit tests to gain a basic understanding of
the unit's interface (API).Unit test cases embody characteristics that are
critical to the success of the unit. These characteristics can indicate
appropriate/inappropriate use of a unit as well as negative behaviours that
are to be trapped by the unit. A unit test case, in and of itself, documents
these critical characteristics, although many software development
environments do not rely solely upon code to document the product in
development.

Integration Testing

Page 47
Integration testing (sometimes called integration and testing,
abbreviated I&T) is the phase in software testing in which individual software
modules are combined and tested as a group. It occurs after unit testing and
before validation testing. Integration testing takes as its input modules that have
been unit tested, groups them in larger aggregates, applies tests defined in an
integration test plan to those aggregates, and delivers as its output the integrated
system ready for system testing.

Software Verification and Validation


In software project management, software testing, and software
engineering, verification and validation (V&V) is the process of checking that a
software system meets specifications and that it fulfils its intended purpose. It
may also be referred to as software quality control. It is normally the
responsibility of software testers as part of the software development lifecycle.
Validation checks that the product design satisfies or fits the intended use (high-
level checking), i.e., the software meets the user requirements. This is done
through dynamic testing and other forms of review. Verification and validation
are not the same thing, although they are often confused. Boehm succinctly
expressed the difference between

 Validation: Are we building the right product?


 Verification: Are we building the product, right?

According to the Capability Maturity Model (CMMI-SW v1.1)

Page 48
 Software Verification: The process of evaluating software to determine
whether the products of a given development phase satisfy the conditions
imposed at the start of that phase.
 Software Validation: The process of evaluating software during or at the
end of the development process to determine whether it satisfies specified
requirements.

In other words, software verification is ensuring that the product has been
built according to the requirements and design specifications, while software
validation ensures that the product meets the user's needs, and that the
specifications were correct in the first place. Software verification ensures that
"you built it right". Software validation ensures that "you built the right thing".
Software validation confirms that the product, as provided, will fulfil its
intended use.

From testing perspective:

 Fault – wrong or missing function in the code.


 Failure – the manifestation of a fault during execution.
 Malfunction – according to its specification the system does not meet its
specified functionality.

Both verification and validation are related to the concepts of quality and
of software quality assurance. By themselves, verification and validation do not
guarantee software quality; planning, traceability, configuration management
and other aspects of software engineering are required. Within the modelling
and simulation (M&S) community, the definitions of verification, validation
and accreditation are similar:

 M&S Verification is the process of determining that a computer model,


simulation, or federation of models and simulations implementations and

Page 49
their associated data accurately represent the developer's conceptual
description and specifications.
 M&S Validation is the process of determining the degree to which a model,
simulation, or federation of models and simulations, and their associated
data are accurate representations of the real world from the perspective of
the intended use(s).
 Accreditation is the formal certification that a model or simulation is
acceptable to be used for a specific purpose.

The definition of M&S validation focuses on the accuracy with which the
M&S represents the real-world intended use(s). Determining the degree of
M&S accuracy is required because all M&S are approximations of reality, and
it is usually critical to determine if the degree of approximation is acceptable for
the intended use(s). This stands in contrast to software validation.

 Classification of Methods
In mission-critical software systems, where flawless performance is
absolutely necessary, formal methods may be used to ensure the correct
operation of a system. However, often for non-mission-critical software
systems, formal methods prove to be very costly and an alternative
method of software V&V must be sought out. In such cases, syntactic
methods are often used.
 Test Cases
A test case is a tool used in the process. Test cases may be prepared for
software verification and software validation to determine if the product
was built according to the requirements of the user. Other methods, such
as reviews, may be used early in the life cycle to provide for software
validation.

Page 50
Black-Box Testing

Black-box testing is a method of software testing that examines the


functionality of an application without peering into its internal structures or
workings. This method of test can be applied virtually to every level of software
testing: unit, integration, system and acceptance. It typically comprises most if
not all higher-level testing, but can also dominate unit testing as well.

 Test Procedures
Specific knowledge of the application's code/internal structure and
programming knowledge in general is not required. The tester is aware
of what the software is supposed to do but is not aware of how it does it.
For instance, the tester is aware that a particular input returns a certain,
invariable output but is not aware of how the software produces the
output in the first place.
 Test Cases
Test cases are built around specifications and requirements, i.e., what the
application is supposed to do. Test cases are generally derived from
external descriptions of the software, including specifications,
requirements and design parameters. Although the tests used are
primarily functional in nature, non-functional tests may also be used. The
test designer selects both valid and invalid inputs and determines the
correct output, often with the help of an oracle or a previous result that is
known to be good, without any knowledge of the test object's internal
structure.

Page 51
 Test Design Techniques
Typical black-box test design techniques include:

o Decision table testing


o All-pairs testing
o Equivalence partitioning
o Boundary value analysis
o Cause–effect graph
o State transition testing
o Use case testing
o Domain analysis
o Combining technique

White-Box Testing

White-box testing (also known as clear box testing, glass box


testing, transparent box testing, and structural testing) is a method of
testing software that tests internal structures or workings of an application, as
opposed to its functionality (i.e. black-box testing). In white-box testing an
internal perspective of the system, as well as programming skills, are used to
design test cases. The tester chooses inputs to exercise paths through the code
and determine the appropriate outputs. This is analogous to testing nodes in a
circuit, e.g., in-circuit testing (ICT). White-box testing can be applied at
the unit, integration and system levels of the software testing process. Although
traditional testers tended to think of white-box testing as being done at the unit
level, it is used for integration and system testing more frequently today. It can
test paths within a unit, paths between units during integration, and between
subsystems during a system–level test. Though this method of test design can
uncover many errors or problems, it has the potential to miss unimplemented
parts of the specification or missing requirements.
Page 52
White-box test design techniques include the following code coverage criteria:

o Control flow testing


o Data flow testing
o Branch testing
o Statement coverage
o Decision coverage
o Modified condition/decision coverage
o Prime path testing
o Path testing

White-box testing is a method of testing the application at the level of the


source code. These test cases are derived through the use of the design
techniques mentioned above: control flow testing, data flow testing, branch
testing, path testing, statement coverage and decision coverage as well as
modified condition/decision coverage. White-box testing is the use of these
techniques as guidelines to create an error free environment by examining any
fragile code. These White-box testing techniques are the building blocks of
white-box testing, whose essence is the careful testing of the application at the
source code level to prevent any hidden errors later on. These different
techniques exercise every visible path of the source code to minimize errors and
create an error-free environment. The whole point of white-box testing is the
ability to know which line of the code is being executed and being able to
identify what the correct output should be.

Page 53
System Testing
System testing of software or hardware is testing conducted on a
complete, integrated system to evaluate the system's compliance with its
specified requirements. System testing falls within the scope of black-box
testing, and as such, should require no knowledge of the inner design of the
code or logic. As a rule, system testing takes, as its input, all of the "integrated"
software components that have passed integration testing and also the software
system itself integrated with any applicable hardware system(s). The purpose of
integration testing is to detect any inconsistencies between the software units
that are integrated together (called assemblages) or between any of
the assemblages and the hardware. System testing is a more limited type of
testing; it seeks to detect defects both within the "inter-assemblages" and also
within the system as a whole.

Page 54
8.5- TEST REPORTS,PRINTS OUT OF THE CODE SHEET
DATABASE TABLE

Login User

Page 55
Login User

Party Name

Page 56
Party Name
Page 57
Voters

Page 58
Voters
Page 59
CODING:-

Page 60
AUTH.PHP

<?php
if (!isset($_SESSION['SESS_NAME'])) {
header("Location: login.php");
}
?>

CHANGE_PASS.PHP
<?php
if(!isset($_SESSION)) {
session_start();
}
include "auth.php";
include "header_voter.php";
?>
<br>
<br>
<center><h3>Change Password</h3></center>
<h4 style="color:#e60808;"><?php global $nam; echo $nam;?> </h4>
<?php global $error; echo $error;?>

<center><form action="change_pass_action.php" method="post" id="myform">


Current Password :
<input type="password" name="cpassword" value="" >
<br>
<br>
New Password:
<input type="password" name="npassword" value="" >
<br>
<br>
Confirm New Password:
<input type="password" name="cnpassword" value="" >
<br>
<br>

Page 61
<input type="submit" name="cpass" value="UPDATE" >
</form></center>
<script type="text/javascript">
var frmvalidator = new Validator("myform");
frmvalidator.addValidation("cpassword","req","Please enter Current Password");
frmvalidator.addValidation("cpassword","maxlen=50");
frmvalidator.addValidation("npassword","req","Please enter New Password");
frmvalidator.addValidation("npassword","maxlen=50");
frmvalidator.addValidation("cnpassword","req","Please enter Confirm New Password");
frmvalidator.addValidation("cnpassword","maxlen=50");
</script>
<br>
<br>
<?php include "footer.php";?>

CHANGE_PASS ACTION.PHP
<?php
session_start();
include "auth.php";
include "connection.php";
if(isset($_POST['cpass'])) {
$currentpass = md5($_POST['cpassword']) ;
$newpass = md5($_POST['npassword']);
$cnewpass = md5($_POST['cnpassword']);
$currentpass = addslashes($currentpass);
$newpass = addslashes($newpass);
$cnewpass = addslashes($cnewpass);
$currentpass = mysqli_real_escape_string($con, $currentpass);
$newpass = mysqli_real_escape_string($con, $newpass);
$cnewpass = mysqli_real_escape_string($con, $cnewpass);

$sql = mysqli_query($con, 'SELECT password FROM loginusers WHERE username="'.$_SESSION['SESS_NAME'].'" ');


$row = mysqli_fetch_assoc($sql);
$pass = $row['password'];
if ($currentpass != $pass) {
$error = "<center><h4><font color='#FF0000'>Incorrect Current Password!</h4></center></font>";
include ("change_pass.php");
}
else if ($currentpass == $pass && $newpass == $cnewpass){
$sql1 = mysqli_query($con, 'UPDATE loginusers SET password="'. md5($_POST['npassword']).'" WHERE username="'.$_
$error = "<center><h4><font color='green'>Password successfully changed!</h4></center></font>";
include ("change_pass.php");
}
else {
$error = "<center><h4><font color='#FF0000'>New Password and Confirm Password does not match!</h4></center></fo

Page 62
include ("change_pass.php");
}
}
else {
$error = "<center><h4><font color='#FF0000'>Error!</h4></center></font>";
include ("change_pass.php");
}
?>

CONNECTION.PHP
<?php
$con = mysqli_connect("localhost","root","","polltest") or die ("error" . mysqli_error($con));
?>

FOTER.PHP

<br>
<br>
<br>
<br>
<center><b><i>VOTE FOR NEW LEADERSHIP </i></b></center>

Page 63
</body>
</html>

HEADER.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tra
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Online Voting System</title>
<script src="jscript/validation.js" type="text/javascript"></script>
</head>
<body bgcolor="#EBE9E9">
<marquee>Welcome To Online Voting System </marquee>
<center><font size='8' >
<a href="index.php">Home</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="register.php">Register</a>&nbsp;&nbsp;|&nbsp;&n
<br>
<br>

Page 64
HEADER_VOTER.PHP

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tra


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
<script src="jscript/validation.js" type="text/javascript"></script>
</head>

<body bgcolor="#EBE9E9">

Page 65
<marquee>Welcome To Online Voting System

</marquee>
<center><font size='6' >
<a href="voter.php">Home</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="lan_view.php">Vote Results</a>&nbsp;&nbsp;|&nb
&nbsp;&nbsp;<a href="logout.php">Logout</a>
&nbsp;&nbsp;|&nbsp;&nbsp;<a href="change_pass.php">Change Password</a>
</font></center>

INDEX.PHP
<?php include "header.php";
session_start();
if (isset($_SESSION['SESS_NAME'])!="") {
header("Location: voter.php");
}
?>
<?php global $msg; echo $msg;?>

<p><center><legend><font color='#008000' size='18'>This system allows all registered users to vote for their favorite POLI
<p>In order to make a vote you have to register first and then login.</font></legend></center>
<p>&nbsp;&nbsp;</p>
<?php include "footer.php";?>

PARTY VIEW.PHP
<?php
if(!isset($_SESSION)) {
session_start();
}
include "auth.php";

Page 66
include "header_voter.php";
?>
<center><h3> Voting So Far </h3></center>
<?php
include "connection.php";
$member = mysqli_query($con, 'SELECT * FROM languages' );
if (mysqli_num_rows($member)== 0 ) {
echo '<font color="red">No results found</font>';
}
else {
echo '<center><table><tr bgcolor="#FF6600">
<td width="30px">ID</td>
<td width="100px">LANGAUAGE</td>
<td width="100px">ABOUT</td>
<td width="30px">VOTE</td>
</tr>';
while($mb=mysqli_fetch_object($member))
{
$id=$mb->party_id;
$name=$mb->fullname;
$about=$mb->about;
$vote=$mb->votecount;
echo '<tr bgcolor="#BBBEFF">';
echo '<td>'.$id.'</td>';
echo '<td>'.$name.'</td>';
echo '<td>'.$about.'</td>';
echo '<td>'.$vote.'</td>';
echo "</tr>";
}
echo'</table></center>';
}
?>

LOGIN.PHP
<?php include "header.php";
if(!isset($_SESSION)) {
session_start();
}
if (isset($_SESSION['SESS_NAME'])!="") {
header("Location: voter.php");
}

Page 67
?>
<br>
<center>
<legend> <h3>Login for Voting </h3></legend>
<br>
</center>
<?php global $nam; echo $nam; ?>
<?php global $error; echo $error; ?>
<br>
<center><font size="4" >
<form action="login_action.php" method="post" id="myform" >
Username :
<input type="text" name="username" value="" >
<br>
<br>
Password :
<input type="password" name="password" value="" >
<br>
<br>
<input type="submit" name="login" value="login" >
</form></font>
</center>

<script type="text/javascript" >


var frmvalidator = new Validator("myform");
frmvalidator.addValidation("username" , "req" , "Please Enter Username");
frmvalidator.addValidation("username", "maxlen=50");
frmvalidator.addValidation("password", "req" , "Please Enter Password");
</script>

<?php include "footer.php"; ?>

LOGIN ACTION.PHP
<?php
session_start();
include "connection.php";
if(isset($_POST['login'])) {
$username = $_POST["username"];
$password = $_POST["password"];
$username = addslashes($username);
$password = addslashes($password);

Page 68
$username = mysqli_real_escape_string($con,$username);
$password = mysqli_real_escape_string($con,$password);

$sql = mysqli_query($con, 'SELECT * FROM loginusers WHERE username="'.$_POST['username'].'" AND password="'.m


if (mysqli_num_rows($sql) >0 ) {
$member = mysqli_fetch_assoc($sql);
$_SESSION['SESS_NAME'] = $member['username'];
$_SESSION['SESS_RANK'] = $member['rank'];

if($member['rank']=='administrator'){
header("location: admin.php");
}
else if($member['rank']=='voter'){
header("location: voter.php");
}
}
else {
$error = "<center><h4><font color='#FF0000'>Incorrect Username or Password</h4></center></font>";
include "login.php";
}
}
else {
$error = "<center><h4><font color='#FF0000'>Invalid Username or Password</h4></center></font>";
include "login.php";
}
?>

LOGOUT.PHP
<?php
session_start();
if (!isset($_SESSION['userSession'])) {
header("Location: login.php");
} else if (isset($_SESSION['userSession'])!="") {
header("Location: index.php");
}

if("username"){
session_destroy();
unset($_SESSION['SESS_NAME']);
include'login.php';
}

Page 69
?>

PROFILE.PHP
<?php
if(!isset($_SESSION)) {
session_start();
}
include "auth.php";
include "header_voter.php";
include "connection.php";
?>
<h4> Welcome <?php echo $_SESSION['SESS_NAME']; ?> </h4>
<?php
$username = $_SESSION['SESS_NAME'];
$query = 'SELECT status FROM voters WHERE username="'.$_SESSION['SESS_NAME'].'" AND status = "VOTED"';
if ($result = mysqli_query($con,$query)) {
if (mysqli_num_rows($result) > 0) {
$sql = mysqli_query($con, 'SELECT voted from voters WHERE username="'.$_SESSION['SESS_NAME'].'"');
$row = mysqli_fetch_assoc($sql);
echo "You have voted for: " . " " . $row['voted'];
} else {
echo "You have not voted yet. Please submit your vote!";
}
}
?>

REGISTER ACTION.PHP
<?php
session_start();
$captcha = "" ;
include "connection.php";
if(isset($_POST['submit'])) {
/*if (isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
$error = "Please check captcha too";
include ('register.php');
exit();
}
$secretKey = "6LeD3hEUAAAAADNeeaGRfKmABjn1gnsXxrpdTa2J";
$ip = $_SERVER['REMOTE_ADDR'];

Page 70
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$cap
$responseKeys = json_decode($response,true);
if(intval($responseKeys["success"]) !== 1) {
$error = "You are spammer !";
}*/
$name = mysqli_real_escape_string($con, $_POST['firstname']);
$name2 = mysqli_real_escape_string($con,$_POST['lastname']);
$name3 = mysqli_real_escape_string($con,$_POST['username']);
$pass = mysqli_real_escape_string($con,$_POST['password']);

$sq = mysqli_query($con, 'SELECT username FROM loginusers WHERE username="'.$_POST['username'].'"');


$exist = mysqli_num_rows($sq);

if($exist==1){
$nam="<center><h4><font color='#FF0000'>The username already exist, peak another.</h4></center></font>";
unset($username);
include('register.php');
exit();
}
$sql = mysqli_query($con, 'INSERT INTO voters(firstname,lastname,username)
VALUES("'.$_POST['firstname'].'","'.$_POST['lastname'].'","'.$_POST['username'].'")');
if (!$sql) {
die (mysqli_error($con));
}
$sql2 = mysqli_query($con, 'INSERT INTO loginusers(username,password)
VALUES("'.$_POST['username'].'","'.md5($_POST['password']).'")');
if (!$sql2) {
die (mysqli_error($con));
}
else {
echo "Successfully Registered! <a href= 'login.php'>Clich here to Login </a>";
}
}
else {
$error="<center><h4><font color='#FF0000'>Registration Failed Due To Error !</h4></center></font>";
include"register.php";
}
?>

Page 71
REGISTER.PHP

<script src='https://www.google.com/recaptcha/api.js'></script>
<?php include "header.php";
if(!isset($_SESSION)) {
session_start();
}
if (isset($_SESSION['SESS_NAME'])!="") {
header("Location: voter.php");
}
?>
<br>
<br>
<center>
<legend> <h3> Register </h3></legend> </center>
<?php global $nam; echo $nam; ?>
<?php global $error; echo $error; ?>
<center><font size="4" >
<form action= "reg_action.php" method= "post" id="myform" >
Firstname:
<input type="text" name="firstname" value="" />
<br>
<br>
Lastname:
<input type="text" name="lastname" value="" />
<br>
<br>
Username:
<input type="text" name="username" value="" />
<br>
<br>
Password:
<input type="password" name="password" value="" />
<br>
<br>
<div class="g-recaptcha" data-sitekey="6LeD3hEUAAAAAKne6ua3iVmspK3AdilgB6dcjST0"></div>
<br>
<br>
<input type="submit" name="submit" value="Next" />

Page 72
</form>
</font>
</center>
<script type= "text/javascript" >
var frmvalidator = new Validator("myform");
frmvalidator.addValidation("firstname","req","Please enter student firstname");
frmvalidator.addValidation("firstname","maxlen=50");
frmvalidator.addValidation("lastname","req","Please enter student lastname");
frmvalidator.addValidation("lastname","maxlen=50");
frmvalidator.addValidation("username","req","Please enter student username");
frmvalidator.addValidation("username","maxlen=50");
frmvalidator.addValidation("password","req","Please enter student password");
frmvalidator.addValidation("password","minlen=6","Password must not be less than 6 characters.");

</script>
<?php include "footer.php" ;?>

SUBMIT VOTE.PHP
<?php
include "connection.php";
session_start();
if(empty($_POST['lan'])){
$error="<center><h4><font color='#FF0000'>Please select a language to vote!</h4></center></font>";
include"voter.php";
exit();
}
$lan = $_POST['lan'];
$sess = $_SESSION['SESS_NAME'] ;
$lan = addslashes($_POST['lan']);
$lan = mysqli_real_escape_string($con, $lan);
$sql = mysqli_query($con, 'SELECT * FROM voters WHERE username="'.$_SESSION['SESS_NAME'].'" AND status="V
if(mysqli_num_rows($sql) > 0 ) {
$msg="<center><h4><font color='#FF0000'>You have already been voted, No need to vote again</h4></center></font>"
include 'voter.php';
exit();
}
else{
$sql1 =mysqli_query($con, 'UPDATE languages SET votecount = votecount + 1 WHERE fullname = "'.$_POST['lan'].'"');
$sql2 =mysqli_query($con, 'UPDATE voters SET status="VOTED" WHERE username="'.$_SESSION['SESS_NAME'].'"')
$sql3 = mysqli_query($con, 'UPDATE voters SET voted= "'.$_POST['lan'].'" WHERE username="'.$_SESSION['SESS_NA
if(!$sql1 && !$sql2){
die("Error on mysql query".mysqli_error());
}
else{
$msg="<center><h4><font color='#FF0000'>Congratulation, you have made your vote.</h4></center></font>";

Page 73
include 'voter.php';
exit();
}
}
?>

VOTE.PHP
<?php
if(!isset($_SESSION)) {
session_start();
}
include "auth.php";
include "header_voter.php";
?>
<h4> Welcome <?php echo $_SESSION['SESS_NAME']; ?> </h4>
<h3>Make a Vote </h3>
<form action="submit_vote.php" name="vote" method="post" id="myform" >
<center><font size='6'> What is your favorite political party? <BR>
<input type="radio" name="lan" value="BJP"> BJP<BR>
<input type="radio" name="lan" value="CONGRESS">CONGRESS<BR>
<input type="radio" name="lan" value="AAP"> AAP<BR>
<input type="radio" name="lan" value="NOTA"> NOTA<BR>
<input type="radio" name="lan" value="NIRDLIY"> NIRDLIY<BR>
</font></center><br>
<?php global $msg; echo $msg; ?>
<?php global $error; echo $error; ?>
<center><input type="submit" value="Submit Vote" name="submit" style="height:30px; width:100px" /></center>
</form>

Page 74
CONCLUSION

Electors abroad are clearly a focus group that is of particular interest for those cou
introduction of e-voting in a general manner. At the same time, they are a target g
voting for practical reasons. Other countries see a need to introduce e-voting for t
same urgency for introducing e-voting for the internal electors. However, there is
introduction of remote e-voting, not even in the countries where the first steps tow

Page 75
REFRENCES

BOOK: -
1. Head first Html and Css Book by Elisabeth Robson and Eric Freeman
2. HTML & CSS: Design and Build Web Sites Book by Jon Duckett.

WEB REFERNCES:-
1. https://www.w3schools.com/php/
2. https://www.w3schools.com/html
3. https://www.javatpoint.com/css-tutorial
4. https://javascript.info/
5. https://www.mysqltutorial.org/

Page 76
Page 77
Page 78
Page 79
Page 80
Page 81
Page 82
Page 83
Page 84
Page 85
Page 86
Page 87
Page 88
Page 89
Page 90
Page 91
Page 92
Page 93
Page 94
Page 95
Page 96

You might also like