0% found this document useful (0 votes)
68 views54 pages

Online Voting System Project

Uploaded by

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

Online Voting System Project

Uploaded by

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

A MAJOR PROJECT REPORT SUBMITTED

ON
“ONLINE VOTING SYSTEM”
PARTIAL FULFILMENT OF THE REQUIREMENT FOR THE DEGREE OF

BACHELOR OF TECHNOLOGY
IN

COMPUTER SCIENCE & ENGINEERING


BY
LAKHAN SHARMA UDAY SINGH NEGI
(ROLL NO-200530101026) (ROLL NO-200530101051)

UPENDRA PRATAP SINGH VINAYAK KUMAR SINGH


(ROLL NO-200530101052) (ROLL NO-200530101053)

Under the Supervision of


Mr. Santosh Mishra
(Assistant Professor)

VEER MADHO SINGH BHANDARI


UTTARAKHAND TECHNICAL UNIVERSITY
DEHRADUN, UTTRAKHAND
SESSION: 2020-2024

1
lOM oARcP SD| 39 87 380 5

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

JB INSTITUTE OF TECHNOLOGY, DEHRADUN

ACKNOWLEDGEMENT

It is my pleasure to acknowledge you that I have received a project on


Online Voting System from my teacher. My first sincere appreciation and gratitude goes to
“Asst. Prof. Santosh Mishra Sir” for her guidance, constructive comments, valuable
suggestions and inspirations.
During making of my Project he helped me lot. It is my proud privilege and duty to
acknowledge the kind of help and guidance received from several people in preparation of
this report. It would not have been possible to prepare this report in this form without their
valuable help, cooperation and guidance.

I express my sincere gratitude to “Prof. Manoj Chaudhary Sir” worthy HOD for providing
me an opportunity to undergo this Major Project as the part of the curriculum.
It is my pleasure to be indebted to various people, who directly or indirectly contributed in
the development of this work and who influenced my thinking, behavior and acts during this
course of study.

Lastly, I would like to thank the almighty and my parents for their moral support and friends
with whom I shared my day-to day experience and received lots of suggestions that
improves my quality of work.

DATE:-

PLACE:-
lOMoARcPSD|39873805

TABLE OF CONTENTS

S.NO. PAGE
DESCRIPTION NO.

1. Acknowledgement………………………………………………... i
2. Candidate’s Declaration………………………………………….. ii

3. Certificate from the guide………………………………………… iii


4. Chapter 1: Introduction………… …………………………… 1-3

1.1. Overview……………………………………………..….
1.2. Objective …………………………………………….…..
1.3. Problem Definition …………………………………….
1.4. Problem Identification …………………………………
1.5. Challenges of Online Voting …………………………...

5. Chapter 2: Project Analysis……………………………………… 3-4

2.1. Existing System………..……………..………………


2.2. Proposed System……………………..………………..
2.3. System Background………………………………….
6. Chapter 3: System Requirements…………………………….. 5-5

3.1. Hardware Requirements……………………………….


3.2. Software Requirements…………………………………
Chapter 4: Tools & Technologies Used…………...………….. 6-7

4.1. Introduction To CSS…………..…………………………..


4.2. Introduction To HTML…………..………………………..
4.3. XAMPP Apache………………......................................
4.4. MYSQL………..………………………………………..
Chapter 5: System Design…………………………..…………….. 8-11

5.1. Data Flow Daigram………………………..……………….


5.2. ER- Daigram………………………………….……………

Chapter 6: Feasibility Study …………………………...………. 11-14

6.1. Technical feasibility……………………………………….


6.2. Economical feasibility…………………………………….
6.3. Operational Feasibility……………………………………
6.4. Schedule feasibility………………………………………..

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

6. Chapter 7: Testing…………………….…………...………….. 14-16

7.1. System Testing…………………………………………....


7.2. Component testing……………………………………….
7.3. Unit Testing……………………………………………….
7.4. Validating Testing………………………………………..
7.5. Output Testing…………………………………………….
7.6. User Acceptance Testing………………………………….
7.7. Test Case Design………………………………………….
7.8. Requirements-based testing……………………………….

9. Chapter 8: Module Design 17-20

8.1. User (Voter) Module……………………………………...


8.2. Administrator Module…………………………………….

10. Chapter 9: Snapshots Of Our Web Applications ………………. 21-23

9.1. Admin Login Page…………………………………………


9.2. Admin Homepage………………………………………….
9.3. Add Candidate’s page……………………………………...
9.4. Add Voters Page…………………………………………..
9.5. Voters Voting Page………………………………………...

Chapter 10: Coding…………………………………………….. 24-46

Conclusion……………………………………………………… 47-47

References……………………………………………………… 48-48

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

1. INTRODUCTION

1.1 Overview

The objective of Online voting system is to help the organization in automatingthe whole manual
processing of the existing system.The main objective to develop the system is to make the accurate
& efficient decisions indifferent tasks at different time at different situations. The existing system is
manual somembers of the unit generally face a lot of embarrassing situations many times. Now they need
to automate the whole process so as to make it more easy and accurate.

System should support multi-user environment. System should be fully automated.System should provide
concrete security features like creating users and assigningprivileges to users of the system.
System should be capable to keep track of all the detailed descriptions of the client andthe whole details
of services offered by the client organization.
Various outputs (reports) should be available online any time.System should be able to handle extremely
large volumes of data (i.e. Large databasesupport).

1.2 Objective

The most crucial factor for a system like e-VOTE to be successful is to exhibit a Voting Protocol that can
prevent opportunities for fraud or for sacrificing the voter's privacy.The Voting Protocol that will be
designed and implemented for the e-VOTE system will combine the advantages of existing protocols and
techniques, while at the same time it will aim at eliminating most of the identified deficiencies and
problems. The related attributes that the e-VOTE system will fully support, and against which it will be
extensively tested and validated, are listed below. These attributes can be also considered, according to
the literature, as a set of criteria for a "good" electronic voting system that can easily enjoy the trust and
confidence of the voters and process organizers.

Democracy: The system should be "democratic" in the sense that it will permit only eligible voters to
vote (eligibility) and it will ensure that each eligible voter can vote only once (unreusability).

Privacy: The system should ensure that none of the actors involved in the voting process (organizers,
administrators, voters etc.) can link any ballot (contextually) to the voter who cast it, and that no voter can
prove that he or she voted in a particular way (unintractability).

Integrity: The necessary mechanism should be employed in order to guarantee that no one can duplicate
his or someone else's vote (duplicability) and no one can change someone else's vote (unchangeability)

Accuracy: The system functionality should ensure that no one can falsify or modify the result of the
voting by eliminating a valid vote or counting an invalid vote in the final tally.

Verifiability: The system should allow and support anyone to independently verify that all votes have
been counted correctly.

Convenience: The system should allow and assist voters to cast their votes quickly, in one session, and
with minimal equipment or special skills.

Flexibility: The system should allow a variety of ballot formats and it should be customized to the

Page 1

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

specific characteristics of the voting processes.


Mobility: The system should not pose any restrictions on the location from which a voter can cast a vote.

Efficiency: The election can be held in a timely manner (i.e. all computations during the election are done
in a reasonable amount of time and voters are not required to wait on other voters to complete the
process).

Scalability: The size of the election should not drastically affect performance. In parallel with the
development of the aforementioned e-VOTE functionality and the implementation of the associated
voting protocol, the consortium will take into account all relevant European legal and regulatory issues
that may pose extra requirements or constraints in terms of the functionality, the equipment, or the
security measures. Furthermore, legal issues associated with the use of Internet for electronic voting will
be explored, clarified and incorporated into the system.

1.3 Problem Definition


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.

1.4 Problem Identification:


The percentage of polling on the day of elections is not satisfactory as majority of the people are not
coming to vote and thinks is just as a wastage of time.The manual voting system takes long time as there
is a lot of paper work first and then human effort is also there for counting of the votes. Manual voting
consumes almost 4-6 hrs. (approx.) of every voter which is surely a headache. The voting will be done
online such that there is no need to come at the place on the time of elections and the people can vote
from the home or from any other place. A key will be provided to every person, so that on the time of
elections they can easily login on the election link and can use his/her vote.

1.5 Challenges of Online Voting


 Legal and bylaw issues: You need to check state statutes and your association’s bylaws to make sure
that online voting is an acceptable election method. Often, state law or internal policy clearly states if
online methods are acceptable. When in doubt, check with legal counsel. Your organization’s attorney
should be able to advise you as to whether you can immediately move forward with online voting. If
either state law or internal guidelines prohibit electronic methods, your challenge will be to revise the
applicable statute or policy to permit online voting.

 Learning curve: As with any new process, online election methods might cause anxiety and trepidation
for some members. You’ll need to invest in a well-planned promotion and education strategy to properly
teach and reassure members about the new election process. This plan will require buy-in from leadership
and must be large enough in scope to reach all members.

Page 2

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

 Not all organizations are a good fit: Online elections are not the best answer for every association, nor
are all association members computer-savvy. Some members may not have easy access to the Internet.
According to the Pew Internet and American Life Project, only 42 percent of Americans ages 65 and
older use the Internet. Also, only 67 percent of people living in rural communities use the Internet
compared to 81 percent of people living in urban areas. T

his means that an association consisting primarily of older members who live in sparsely populated areas
should consider maintaining some form of traditional voting practice. Before investing in an online voting
system, take the time to break down your association’s demographics and tendencies so that you can build
a voting process that best serves the needs of your members.

 Expertise required: Building an online voting system requires programming experience and an
understanding of election processes. Often, associations need to look outside the organization to establish
an online voting system either because their staff lacks the necessary expertise or because building such a
system internally would put an unreasonable strain on employee resources. If you use an outside vendor,
your challenge will be to find an election partner as serious about your election as you are

2. PROJECT ANALYSIS

2.1 Existing System


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.

In the present system the is no such application level system provisions in the country to carry out the
voting and procedure as a whole . Also in the present status, there is no such application in use for
automated system for voting according to the voting structure existing in the country. All the step by step
procedures are carried out by the authorized authorities according to the jobs assigned by the ECI. The
fact is all the procedures are carried out manually, starting from the registration process to result
publishing.
The government to do this process manually wastes a lot of time and money. Thus the present system
proves itself to be an inefficient one. The existing system is not web based. The user or person must want
to go to the polling station for casting their votes.

2.2 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.

Page 3

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

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. The new
implemented voting protocol has two main players: The voter and administrator sections. The
voter(which can be found at home, in a working station, in a special polling station or any other device
have the fuction of performing the Authentication and voting).The administrator performs the function of
voter and candidate registration, authorization and validation of voter, database and counting and the
result.
The main advantages of the new protocol are the following:

(1). Public transparency by the administrator (publication of Voter ID key, etc.).


(2). Inured to technical troubles like interruption of access, etc, uncomplicated recovery.
(3). Possibility of configuration for different voting models by policies and Greater performance.

Furthermore it is assumed that a trustworthy Administrator is available. Apart from that, the accessibility
to the public in the voting procedure plays a special role, which means that the voting result can be
monitored, although casting of the votes has to be secret as a matter of course.
Accessibility to the public is necessary for all voting stages and is performed by the electoral committee,
but also by any member of the public.

2.3 System Background


ONLINE VOTING SYSTEM is a voting system by which any Voter can use his\her voting rights from
any where in India. ONLINE VOTING SYSTEM contains-:

 Voter’s information in database


 Voter’s Names with ID.
 Voter’s vote in database
 Calculations of total numbers of vote
Various operational works that are done in the system are:-
 Recording information of the Voter in Voter database
 Checking of information filled by voter
 Discard the false information.
 Each information is sent to ELECTION COMMISSION OF INDIA

Page 4

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

3. SYSTEM REQUIREMENTS

Requirement Specification is the part of the project which gives the details about the hardware and
software requirements of our project. It also details the features of the programming language used.

[A]. Hardware Requirements


 Processor: Intel® Core (TM) i5-3380M
 RAM: 4GB
 Hard Disk: 500GB
 Speed: 1.1GHz

[4]. Software Requirements


 Operating System: Windows
 Back-End: MYSQL .
 Front-End: HTML5 and CSS3
 Supporting Tools: Bootstrap, JQUERY
 Type: Web Application.
 XAMPP Apache

Server Apache To develop application software, we use different types of software. The software for the
development has been selected based on several factors such as:

 Support
 Cost Effectiveness
 Development Speed
 Ability to create robust application least time
 Stability

Page 5

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

4. TOOLS AND TECHNOLOGIES USED

[A]. Introduction to CSS(Cascading Style Sheet)


CSS is a style sheet language used for describing the look and formatting of a document written in a
markup language While most often used to style web pages and interfaces written in HTML and
XHTML, the language can be applied to any kind of XML document. One of the favored features is its
ability to allow the sorting of document content written in markup languages (like HTML) from
document presentation written in CSS. Here are more advantages of CSS in website design:

1. Search Engine Optimization And Appearance


2. Maintainability and Browser Compatibility

[B]. Introduction to HTML(Hyper Text Markup Language)


HTML refers to the Hypertext Markup Language. HTML is used to create webpages. It uses many tags to
make a webpage. So it is a tag based language. The tags of HTML are surrounded by angular bracket. It
can use wide ranges of colors, objects and layouts. Very useful for beginners in web designing field

Advantages of HTML

1. First advantage it is widely used.


2. Every browser supports HTML language.
3. Easy to learn and use.
4. It is by default in every window so you don't need to purchase extra software.

[C]. XAMPP Apache

Many people know from their own experience that it's not easy to install an Apache web server and it gets
harder if you want to add MariaDB, PHP and Perl. The goal of XAMPP is to build an easy to install
distribution for developers to get into the world of Apache. To make it convenient for developers,
XAMPP is configured with all features turned on. In the case of commercial use please take a look at the
product licenses, from the XAMPP point of view commercial use is also free. There are currently
distributions for Windows, Linux, and OS X.

XAMPP is a compilation of free software (comparable to a Linux distribution), it's free of charge and it's
free to copy under the terms of the GNU General Public Licence. But it is only the compilation of
XAMPP that is published under GPL. Please check every single licence of the contained products to get
an overview of what is, and what isn't, allowed. In the case of commercial use please take a look at the
product licences (especially MySQL), from the XAMPP point of view commercial use is also free.

Page 6

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

[D]. MYSQL
It is the world's most popular open source database. It is a Relational Database Management System
(RDBMS) - data and it's relationships are stored in the form of tables that can be accessed by the use of
MYSQL queries in almost any format that the user wants.

The MySQL server software itself and the client libraries use dual-licensing distribution. They are offered
under GPL version 2, or a proprietary license.
Support can be obtained from the official manual.Free support additionally is available in different IRC
channels and forums. Oracle offers paid support via its MySQL Enterprise products. They differ in the
scope of services and in price. Additionally, a number of third party organisations exist to provide support
and services.
MySQL has received positive reviews, and reviewers noticed it "performs extremely well in the average
case" and that the "developer interfaces are there, and the documentation (not to mention feedback in the
real world via Web sites and the like) is very, very good". It has also been tested to be a "fast, stable and
true multi-user, multi-threaded SQL database server".

MySQL provides our small, medium and large enterprise customers with affordable, open access to their
web data warehouses. MySQL allows us to offer our System Administrator low cost, low maintenance
database solution for applications without sacrificing power, performance or scalability.

Benefits of MySQL are as follows:

 Easy to maintain & upgrade, does not have a slew of administrative tasks to put up.
 Its table format does not vary between releases
 It has cleanly separated table handler modules and can mix access to different type of tables.
 It seems to be developed iteratively, and the features are very stable when they ship them.
 It is a relational database. Over the past several years, this relational database management systems.
 become the most widely accepted way to manage data
 It offers benefits such as:
 Easy to access data
 Flexibility in data modeling
 Reduced data storage and redundancy
 Independence of physical storage and logical data design
 A high level data manipulation language

Page 7

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

5. SYSTEM DESIGN

System Design’s main aim is to identify the modules that should be in the system, the specifications of
these modules and how they interact with each other to produce the desired results. At the end of system
design all the major data structures, file formats and the major modules in the system and their
specifications are decided.The most creative and challenging phase of the system development process is
design phase, it is a solution, a “how to” approach to the creation of the proposed system Design, the first
step in the development of an engineered product is initiated only after a clear exposition of expected
product functions becomes available. Based on the user requirements and the detailed analysis of a new
system, the new system must be designed. This is the phase of system designing. Normally the design
proceeds in two stages: preliminary or general design, structure or detailed design.

Preliminary or general design: In the preliminary or general design, the features of the new system are
specified. The costs of implementing these features and benefits to be derived are estimated. If the project
is still considered to be feasible, we move to detailed design stage.
Structure or detailed design: In the detailed design stage, computer oriented work begins in the earnest.
At this stage, the design of the system becomes more structured. Structured design is a blue print of a
computer system solution to a given problem having the same components and inter- relationship among
the same components as the original problem. Input, output and processing specifications are drawn up in
detail .In the design stage, the programming language and the platform in which the new system will run
are also decided. There are several tools and techniques used for designing.

5.1 Data Flow Diagram


The data flow diagram(DFD) is a graphical tool used for expressing system requirements in a graphical
form. The DFD also known as the “bubble chart” as the purpose of clarification system requirements and
identification major transformation that will become program in system design. Thus DFD can be stated
as the starting point of the design phase that functionality decomposes the requirements specification
down to the lowest level of details. The DFD consists of series of bubble joined by lines. The bubble
represents data transformation and the lines represents the data flows in the system. A DFD describes
what data flow is does not to construct a Data Flow Diagram, we use

 Arrow: An arrow identifies the data flow in motion. It is a pipeline through which information is flow
like the rectangle in the flowchart
 Circle: A circle stands for process that converts data into information

Page 8

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

 Open End Box: An open ended box represents a data store, data at rest or a temporary repository of
data.
 Squares: A square defines a source or destination of system

DFD Level-0

The above diagram is a 0-level DFD that only shows the flow of data between the various and the system.
In online voting system the Administrator is the controller of the system and all the decisions are made by
him. The Administrator can handle the entire voter and their details, voting details etc. and view details of
them and he can update that detail also.

Page 9

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

Level-1 DFD
The above shown diagram is a 2.1 level Data Flow Diagram for the Online voting system. According to
this DFD. The Administrator can register the voter information. Administrator can allow or denies the
voter. A voter can give vote if all the information filled by him\her are correct.

Page 10

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

5.2 E-R Diagram

6. FEASIBILITY STUDY
Depending on the results of the initial investigation the survey is now expanded to a more detailed
feasibility study. “FEASIBILITY STUDY” is a test of system proposal according to its workability,
impact of the organization, ability to meet needs and effective use of the resources. It focuses on these
major questions:

1. What are the user’s demonstrable needs and how does a candidate system meet them?
2. What resources are available for given candidate system?
3. What are the likely impacts of the candidate system on the organization?
4. Whether it is worth to solve the problem?

During feasibility analysis for this project, following primary areas of interest are to be considered.
Investigation and generating ideas about a new system does this.

Page 11

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

Steps in feasibility analysis

Eight steps involved in the feasibility analysis are:

 Form a project team and appoint a project leader.


 Prepare system flowcharts.
 Enumerate potential proposed system.
 Define and identify characteristics of proposed system.
 Determine and evaluate performance and cost effective of each proposed system.
 Weight system performance and cost data.
 Select the best-proposed system.
 Prepare and report final project directive to management.

6.1 Technical feasibility

A study of resource availability that may affect the ability to achieve an acceptable system.
This evaluation determines whether the technology needed for the proposed system is available or not.

 Can the work for the project be done with current equipment existing software technology&
available personal?
 Can the system be upgraded if developed?
 If new technology is needed then what can be developed?
 This is concerned with specifying equipment and software that will successfully satisfy the user
requirement. The technical needs of the system may include:

Front-end and back-end selection

An important issue for the development of a project is the selection of suitable front-end and back-end.
When we decided to develop the project we went through an extensive study to determine the most
suitable platform that suits the needs of the organization as well as helps in development of the project.
The aspects of our study included the following factors.

Front-end selection:

1. It must have a GUI that assists employees that are not from IT background.
2. Scalability and extensibility.
3. Flexibility.
4. Robustness.
5. According to the organization requirement and the culture.
6. Must provide excellent reporting features with good printing support.
7. Platform independent.
8. Easy to debug and maintain.
9. Event driven programming facility.
10. Front end must support some popular back end like Ms Access.

According to the above stated features we selected PHP as the front-end for developing our project .

Page 12

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

Back-end Selection:
1. Multiple user support.
2. Efficient data handling.
3. Provide inherent features for security.
4. Efficient data retrieval and maintenance.
5. Stored procedures.
6. Popularity.
7. Operating System compatible.
8. Easy to install.
9. Various drivers must be available.
10. Easy to implant with the Front-end.

According to above stated features we selected MY SQL as the backend. The technical feasibility is
frequently the most difficult area encountered at this stage. It is essential that the process of analysis and
definition be conducted in parallel with an assessment to technical feasibility. It centers on the existing
computer system and to what extent it can support the proposed system.

6.2 Economical feasibility

Economic justification is generally the “Bottom Line” consideration for most systems. Economic
justification includes a broad range of concerns that includes cost benefit analysis. In this we weight the
cost and the benefits associated with the candidate system and if it suits the basic
purpose of the organization i.e. profit making, the project is making to the analysis and design phase.
The financial and the economic questions during the preliminary investigation are verified to estimate the
following:

 The cost to conduct a full system investigation


 The cost of hardware and software for the class of application being considered
. The benefits in the form of reduced cost.
 The proposed system will give the minute information, as a result the performance is improved
 This feasibility checks whether the system can be developed with the available funds. The Online
voting system does not require enormous amount of money to be developed.
 This can be done economically if planned judicially, so it is economically feasible. The cost of project
depends upon the number of man-hours required.

6.3 Operational Feasibility

It is mainly related to human organizations and political aspects. The points to be


considered are:

 What changes will be brought with the system?


 What organization structures are disturbed?
 What new skills will be required? Do the existing staff members have these
skills? If not, can they be trained in due course of time?
 The system is operationally feasible as it very easy for the End users to operate it. It only needs basic
information about Windows platform.

Page 13

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

6.4 Schedule feasibility

Time evaluation is the most important consideration in the development of project. The time schedule
required for the developed of this project is very important since more development time effect machine
time, cost and cause delay in the development of other systems. A reliable Online voting system can be
developed in the considerable amount of time.

7. TESTING

Types Of Testing

7.1 System Testing

Software testing is a critical element of software quality assurance and represents the ultimate review of
specification, design, and coding. The user tests the developed system and changes are made according to
their needs. The testing phase involves the testing developed system using various kinds of data. System
is the stage of implementation that is aimed at assuring at the system works accurately and efficiently
before live operation commences. Testing is vital to the success of the system.

System testing makes a logical assumption that if all the parts of the system are correct, the goal will be
successfully achieved. The candidate system is subject to a variety of tests such as recover, security and
usability tests. A series of testing is performed for the proposed system before the system is ready for the
user acceptance testing. Implementation ends with formal tests. The test data are very crucial to this
process. They must be realistic and cover extreme conditions are well. Ideally, vary alternative path
through the program should be exercised at least once beyond the test data. The system test must involve
all the elements that compose the system including program validation checking, files, and forms and
triggers procedures.

7.2 Component testing

 Testing of individual program components i.e. the each module is tested


 Usually the responsibility of the component developer (except sometimes for critical systems);
 Tests are derived from the developer’s experience.
 Component or unit testing is the process of testing individual components in isolation.
 It is a defect testing process.
 Components may be:
 Individual functions or methods within an object;
 Object classes with several attributes and methods; Composite components with defined interfaces used
to access their functionality.

Testing Strategies Following are few of the testing strategies used for the testing purpose:
 Unit testing
 Validation testing
 Output testing
 User acceptance testing

Page 14

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

7.3 Unit Testing


Unit testing focuses effort on the smallest unit of software design of the module. This is also known as
‘Module Testing’. The module of FSA system is tested separately. This testing was carried out during
programming stage itself in this testing each module is found to be working satisfactorily with regards to
the expected output from the module.

7.4 Validating Testing

At the culmination of integration testing, software is completely assembled as a package, interfacing


errors have been uncovered and corrected and final series of software test begins. Validation testing can
be defined in many ways, but a simple definition is that validation succeeds when the software function
in a manner that can be reasonably expected by the customer. After validation test has been conducted,
one of the two possible conditions exists, the functions are performance characteristics confirm to
specification and are accepted or a deviation from specification is uncovered and deficiency list is
created. Proposed system under consideration has been tested using validation testing and found to be
working satisfactorily.

7.5 Output Testing


After performing the validation testing the next test is output testing of the proposed system since no
system could be useful if it does not produce the required output in the specified format. Asking the user
about the format required by them tests the outputs generated or displayed by the system under
consideration. Here, the output format is considered in two ways. One on-screen and other is printed
format. The output format on the screen is found to be correct as the format was designed in the system
phase according to the user’s needs. Hence, output testing does not result in any correction in the system.

7.6 User Acceptance Testing

User acceptance of a system is the key factory for the success of any system. The system under
consideration is tested for user acceptance by constantly keeping in touch with the perspective system.
Users at time of developing can make changes wherever required. This is done in regards to the following
points:

 Input screen design.


 Output Screen design
 Menu driven system
 Format of reports and other outputs Taking various kinds of test data does the above tests. Preparation
of the test data places a vital role in system testing. After preparing the test data the system under study
is tested using the same. While testing the system by using the test, errors are uncovered. They are then
corrected and noted down for future use.

Page 15

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

Testing Guidelines

Testing guidelines are hints for the testing team to help them choose tests that will reveal defects in the
system.

• Choose inputs that force the system to generate all error messages;
• Design inputs that cause buffers to overflow;
• Repeat the same input or input series several times;
• Force invalid outputs to be generated;
• Force computation results to be too large or too small.

7.7 Test Case Design

 Involves designing the test cases (inputs and outputs) used to test the system.
 The goal of test case design is to create a set of tests that are effective in validation and defect testing.
 Design approaches:

7.8 Requirement’s based testing;

• Partition testing;
• Structural testing

(1) Partition testing

 Input data and output results often fall into different classes where all members of a class are related.
 Each of these classes is an equivalence partition or domain where the program behaves in an equivalent
way for each class member.
 Test cases should be chosen from each partition.

(2) Structural testing

 Sometime called white-box testing


 Derivation of test cases according to program structure
 Knowledge of the program is used to identify additional test cases.
 Objective is to exercise all program statements (not all path combination)

Page 16

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

8. MODULE DESIGN

The proposed system consists of two modules,

 Administrator Module

 User Module

8.1 USER (VOTER) MODULE

User interface consists of a login name and unique password using which he/she can login into the Online
Voting System. This will be supplied by the administrator to the user. Once the user has logged in, he has
the privilege to view the names of the candidates listed by the administrator, view the results after the
termination date of the election. The user module constitutes only one sub module:

Authentication & Voting


 Each voter is provided with unique username and password manually by the administrator. The voter
uses the username and password for login and exercise the fundamental right of voting. if incorrect
username and password entered, the access to is denied to the user. And also voter is allowed to vote only
once.
 This is the security feature provided against external access of the system.

After login the voter enters the voter home page ,which provides the links :

Candidate List
This facilitates the voter to view the candidate names, the constituency name, their symbol and their party
name.

Vote
This provides the voter with a list of candidate with in his/her constituency along with selection option
(radio button) to select the preferred candidate from the list. If the voting date is before termination date,
the vote goes valid else goes invalid.

Page 17

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

View Results
This provides graphical and user friendly representation of the votes obtained by each candidate. It
includes the percentage of the votes obtained by each candidate. But the result can be viewed only after
the termination date of the election.

Logout
This provides an option for the voter to quit the session ,while in the voter home page.

8.2 ADMINISTRATOR MODULE

Administrator interface consists of a login name and unique password using which admin can login into
the Online Voting System. Administrator has the main control of the system. By logging into the page it
can perform the following tasks.

Add Candidate
Here the admin can add the list of candidates in the election. It includes candidates name, address. party
symbol etc. The candidates will be added to the list only after completing the procedures.

Add Voter
Here the voters can be added to the database. The voters have also the privilege to check the voters list
from the homepage. The voters details includes name, address, gender, age, constituency, image etc.

Add Election
Here the election to be conducted is selected. To add an election the constituency should be selected and
termination date of election should be specified.

Add Constituency
The constituency that is going to conduct election should be selected.

Voters List
Here we can view the voters list. Each constituency will be having separate voters list.

Page 18

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

Candidate List
The list of candidates participating in the election can be seen. It includes the candidates name, party
name and party symbol.

The sub-modules of administrator are:


 Voting Structure,
 Voters Registration
 Candidate Registration
 Counting & Categorization of Results

Voting Structure
Here the eligible voters who are permitted to login to the system can utilize the right to vote. Each voter
can register a single vote to a candidate’s favour in his/her constituency. The security measures taken
within the system prevents them from exercising their votes again i.e. the second vote by the same user
goes invalid. The starting and ending dates of the election are specified by the administrator. The user
must have an identity card and he must be in voters list.

Voters Registration

The registration procedure of all the eligible voters .This registration process is done by the administrator.
According to voters database each voter is provided with a unique identification codes which includes
username and password.

The details of the voters include username, password, name, address, gender, constituency, image
etc.With the voter registration, thus producing the voter list with the given information of the voters. The
voter list can be viewed by anyone accessing the webpage. The admin can view the voter list with in his
homepage.

Candidate Registration

The registration of the candidates in each constituency is done by the administrator. The details of the
candidate includes name, address, gender ,his/her constituency, party and image. With the candidate
registration, thus producing the candidate list with the given information of the candidate’s

Page 19

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

The candidate list can be viewed by admin and the vote within their respective homepages. According to
candidates database (manual) each details of the candidates are stored in database controlled by the
admin including candidates details.

Counting & Categorization of Results

When the voter votes, the number of votes obtained by the selected candidate is incremented by 1.The
result is published only after the voting process is over. It is accessible from the next day after the
termination date. Here we depict the result in the graphical representation according to the percentage of
vote obtained by the candidate. Result can be viewed by everyone who visits into the site without any
authentication problem.

A link to view the result is kept in the index page and both admin and voter can view the result in their
respective homepages. When the user clicks the “RESULT” link, before the termination date of the
election, “Result not Published yet” Message will be displayed. The result comes with their party symbol
on the top of the graph representing the percentage of vote obtained by each candidate.

Page 20

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

9. SNAP SHOTS OF OUR WEB APPLICATION

9.1 Admin Login Page

9.2 Admin Homepage ( Dashboard )

Page 21

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

9.3 Add Candidate’s Page

9.4 Add Voters Page

Page 22

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

9.5 Voters Voting Page

Page 23

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

10. CODING

c:xampp > htdocs > votesystem > index.php

<?php
session_start();
if(isset($_SESSION['admin'])){
header('location: admin/home.php');
}

if(isset($_SESSION['voter'])){
header('location: home.php');
}
?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<b>Voting System</b>
</div>

<div class="login-box-body">
<p class="login-box-msg">Sign in to start your session</p>

<form action="login.php" method="POST">


<div class="form-group has-feedback">
<input type="text" class="form-control" name="voter" placeholder="Voter's ID" required>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" name="password" placeholder="Password"
required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat" name="login"><i
class="fa fa-sign-in"></i> Sign In</button>
</div>
</div>
</form>
</div>
<?php
if(isset($_SESSION['error'])){
echo "
<div class='callout callout-danger text-center mt20'>
<p>".$_SESSION['error']."</p>

Page 24

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

</div>
";
unset($_SESSION['error']);
}
?>
</div>

<?php include 'includes/scripts.php' ?>


</body>
</html>

c:xampp > htdocs > votesystem > submit_ballot.php

<?php
include 'includes/session.php';
include 'includes/slugify.php';

if(isset($_POST['vote'])){
if(count($_POST) == 1){
$_SESSION['error'][] = 'Please vote atleast one candidate';
}
else{
$_SESSION['post'] = $_POST;
$sql = "SELECT * FROM positions";
$query = $conn->query($sql);
$error = false;
$sql_array = array();
while($row = $query->fetch_assoc()){
$position = slugify($row['description']);
$pos_id = $row['id'];
if(isset($_POST[$position])){
if($row['max_vote'] > 1){
if(count($_POST[$position]) > $row['max_vote']){
$error = true;
$_SESSION['error'][] = 'You can only choose '.$row['max_vote'].' candidates for
'.$row['description'];
}
else{
foreach($_POST[$position] as $key => $values){
$sql_array[] = "INSERT INTO votes (voters_id, candidate_id, position_id) VALUES
('".$voter['id']."', '$values', '$pos_id')";
}

Page 25

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

else{
$candidate = $_POST[$position];
$sql_array[] = "INSERT INTO votes (voters_id, candidate_id, position_id) VALUES
('".$voter['id']."', '$candidate', '$pos_id')";
}

if(!$error){
foreach($sql_array as $sql_row){
$conn->query($sql_row);
}

unset($_SESSION['post']);
$_SESSION['success'] = 'Ballot Submitted';

}
else{
$_SESSION['error'][] = 'Select candidates to vote first';
}

header('location: home.php');

?>

Page 26

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

c:xampp > htdocs > votesystem > home.php

<?php include 'includes/session.php'; ?>


<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue layout-top-nav">
<div class="wrapper">

<?php include 'includes/navbar.php'; ?>

<div class="content-wrapper">
<div class="container">

<!-- Main content -->


<section class="content">
<?php
$parse = parse_ini_file('admin/config.ini', FALSE, INI_SCANNER_RAW);
$title = $parse['election_title'];
?>
<h1 class="page-header text-center title"><b><?php echo strtoupper($title); ?></b></h1>
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<?php
if(isset($_SESSION['error'])){
?>
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<ul>
<?php
foreach($_SESSION['error'] as $error){
echo "
<li>".$error."</li>
";
}
?>
</ul>
</div>
<?php
unset($_SESSION['error']);

}
if(isset($_SESSION['success'])){
echo "
<div class='alert alert-success alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
<h4><i class='icon fa fa-check'></i> Success!</h4>
".$_SESSION['success']."
</div>
";

Page 27

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

unset($_SESSION['success']);
}

?>

<div class="alert alert-danger alert-dismissible" id="alert" style="display:none;">


<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<span class="message"></span>
</div>

<?php
$sql = "SELECT * FROM votes WHERE voters_id = '".$voter['id']."'";
$vquery = $conn->query($sql);
if($vquery->num_rows > 0){
?>
<div class="text-center">
<h3>You have already voted for this election.</h3>
<a href="#view" data-toggle="modal" class="btn btn-flat btn-primary btn-lg">View Ballot</a>
</div>
<?php
}
else{
?>
<!-- Voting Ballot -->
<form method="POST" id="ballotForm" action="submit_ballot.php">
<?php
include 'includes/slugify.php';

$candidate = '';
$sql = "SELECT * FROM positions ORDER BY priority ASC";
$query = $conn->query($sql);
while($row = $query->fetch_assoc()){
$sql = "SELECT * FROM candidates WHERE position_id='".$row['id']."'";
$cquery = $conn->query($sql);
while($crow = $cquery->fetch_assoc()){
$slug = slugify($row['description']);
$checked = '';
if(isset($_SESSION['post'][$slug])){
$value = $_SESSION['post'][$slug];

if(is_array($value)){
foreach($value as $val){
if($val == $crow['id']){
$checked = 'checked';
}
}
}
else{

Page 28

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

if($value == $crow['id']){
$checked = 'checked';
}
}
}
$input = ($row['max_vote'] > 1) ? '<input type="checkbox" class="flat-red '.$slug.'"
name="'.$slug."[]".'" value="'.$crow['id'].'" '.$checked.'>' : '<input type="radio"
class="flat-red '.$slug.'" name="'.slugify($row['description']).'"
value="'.$crow['id'].'" '.$checked.'>';
$image = (!empty($crow['photo'])) ? 'images/'.$crow['photo'] : 'images/profile.jpg';
$candidate .= '
<li>
'.$input.'<button type="button" class="btn btn-primary btn-sm btn-flat clist platform" data-
platform="'.$crow['platform'].'" data-fullname="'.$crow['firstname'].'
'.$crow['lastname'].'"><i class="fa fa-search"></i> Platform</button><img
src="'.$image.'" height="100px" width="100px" class="clist"><span class="cname
clist">'.$crow['firstname'].' '.$crow['lastname'].'</span>
</li>
';
}

$instruct = ($row['max_vote'] > 1) ? 'You may select up to '.$row['max_vote'].' candidates'


: 'Select only one candidate';

echo '
<div class="row">
<div class="col-xs-12">
<div class="box box-solid" id="'.$row['id'].'">
<div class="box-header with-border">
<h3 class="box-title"><b>'.$row['description'].'</b></h3>
</div>
<div class="box-body">
<p>'.$instruct.'
<span class="pull-right">
<button type="button" class="btn btn-success btn-sm btn-flat reset" data-
desc="'.slugify($row['description']).'"><i class="fa fa-refresh"></i> Reset</button>
</span>
</p>
<div id="candidate_list">
<ul>
'.$candidate.'
</ul>
</div>
</div>
</div>
</div>
</div>
';

Page 29

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

$candidate = '';

?>
<div class="text-center">
<button type="button" class="btn btn-success btn-flat" id="preview"><i class="fa fa-file-
text"></i> Preview</button>
<button type="submit" class="btn btn-primary btn-flat" name="vote"><i class="fa fa-check-
square-o"></i> Submit</button>
</div>
</form>
<!-- End Voting Ballot -->
<?php
}

?>

</div>
</div>
</section>

</div>
</div>

<?php include 'includes/footer.php'; ?>


<?php include 'includes/ballot_modal.php'; ?>
</div>

<?php include 'includes/scripts.php'; ?>


<script>
$(function(){
$('.content').iCheck({
checkboxClass: 'icheckbox_flat-green',
radioClass: 'iradio_flat-green'
});

$(document).on('click', '.reset', function(e){


e.preventDefault();
var desc = $(this).data('desc');
$('.'+desc).iCheck('uncheck');
});

$(document).on('click', '.platform', function(e){


e.preventDefault();
$('#platform').modal('show');
var platform = $(this).data('platform');

Page 30

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

var fullname = $(this).data('fullname');


$('.candidate').html(fullname);
$('#plat_view').html(platform);
});

$('#preview').click(function(e){
e.preventDefault();
var form = $('#ballotForm').serialize();
if(form == ''){
$('.message').html('You must vote atleast one candidate');
$('#alert').show();
}
else{
$.ajax({
type: 'POST',
url: 'preview.php',
data: form,
dataType: 'json',
success: function(response){
if(response.error){
var errmsg = '';
var messages = response.message;
for (i in messages) {
errmsg += messages[i];
}
$('.message').html(errmsg);
$('#alert').show();
}
else{
$('#preview_modal').modal('show');
$('#preview_body').html(response.list);
}
}
});
}

});

});
</script>
</body>
</html>

Page 31

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

c:xampp > htdocs > votesystem > login.php

<?php
session_start();
include 'includes/conn.php';

if(isset($_POST['login'])){
$voter = $_POST['voter'];
$password = $_POST['password'];

$sql = "SELECT * FROM voters WHERE voters_id = '$voter'";


$query = $conn->query($sql);

if($query->num_rows < 1){


$_SESSION['error'] = 'Cannot find voter with the ID';
}
else{
$row = $query->fetch_assoc();
if(password_verify($password, $row['password'])){
$_SESSION['voter'] = $row['id'];
}
else{
$_SESSION['error'] = 'Incorrect password';
}
}

}
else{
$_SESSION['error'] = 'Input voter credentials first';
}

header('location: index.php');

?>

c:xampp > htdocs > votesystem > logout.php

<?php
session_start();
session_destroy();

header('location: index.php');
?>

Page 32

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

c:xampp > htdocs > votesystem > preview.php

<?php

include 'includes/session.php';
include 'includes/slugify.php';

$output = array('error'=>false,'list'=>'');

$sql = "SELECT * FROM positions";


$query = $conn->query($sql);

while($row = $query->fetch_assoc()){
$position = slugify($row['description']);
$pos_id = $row['id'];
if(isset($_POST[$position])){
if($row['max_vote'] > 1){
if(count($_POST[$position]) > $row['max_vote']){
$output['error'] = true;
$output['message'][] = '<li>You can only choose '.$row['max_vote'].' candidates for
'.$row['description'].'</li>';
}
else{
foreach($_POST[$position] as $key => $values){
$sql = "SELECT * FROM candidates WHERE id = '$values'";
$cmquery = $conn->query($sql);
$cmrow = $cmquery->fetch_assoc();
$output['list'] .= "
<div class='row votelist'>
<span class='col-sm-4'><span class='pull-right'><b>".$row['description']."
:</b></span></span>
<span class='col-sm-8'>".$cmrow['firstname']." ".$cmrow['lastname']."</span>
</div>
";
}

}
else{
$candidate = $_POST[$position];
$sql = "SELECT * FROM candidates WHERE id = '$candidate'";
$csquery = $conn->query($sql);
$csrow = $csquery->fetch_assoc();
$output['list'] .= "
<div class='row votelist'>
<span class='col-sm-4'><span class='pull-right'><b>".$row['description']."
:</b></span></span>

Page 33

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

<span class='col-sm-8'>".$csrow['firstname']." ".$csrow['lastname']."</span>


</div>
";
}

echo json_encode($output);

?>

c:xampp > htdocs > votesystem > admin> candidates.php

<?php include 'includes/session.php'; ?>


<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

<?php include 'includes/navbar.php'; ?>


<?php include 'includes/menubar.php'; ?>

<!-- Content Wrapper. Contains page content -->


<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Candidates List
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Candidates</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<?php
if(isset($_SESSION['error'])){
echo "
<div class='alert alert-danger alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
<h4><i class='icon fa fa-warning'></i> Error!</h4>
".$_SESSION['error']."
</div>
";

Page 34

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

unset($_SESSION['error']);
}
if(isset($_SESSION['success'])){
echo "
<div class='alert alert-success alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
<h4><i class='icon fa fa-check'></i> Success!</h4>
".$_SESSION['success']."
</div>
";
unset($_SESSION['success']);
}
?>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header with-border">
<a href="#addnew" data-toggle="modal" class="btn btn-primary btn-sm btn-flat"><i class="fa
fa-plus"></i> New</a>
</div>
<div class="box-body">
<table id="example1" class="table table-bordered">
<thead>
<th class="hidden"></th>
<th>Position</th>
<th>Photo</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Platform</th>
<th>Tools</th>
</thead>
<tbody>
<?php
$sql = "SELECT *, candidates.id AS canid FROM candidates LEFT JOIN positions ON
positions.id=candidates.position_id ORDER BY positions.priority ASC";
$query = $conn->query($sql);
while($row = $query->fetch_assoc()){
$image = (!empty($row['photo'])) ? '../images/'.$row['photo'] : '../images/profile.jpg';
echo "
<tr>
<td class='hidden'></td>
<td>".$row['description']."</td>
<td>
<img src='".$image."' width='30px' height='30px'>
<a href='#edit_photo' data-toggle='modal' class='pull-right photo' data-
id='".$row['canid']."'><span class='fa fa-edit'></span></a>
</td>
<td>".$row['firstname']."</td>

Page 35

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

<td>".$row['lastname']."</td>
<td><a href='#platform' data-toggle='modal' class='btn btn-info btn-sm btn-flat platform'
data-id='".$row['canid']."'><i class='fa fa-search'></i> View</a></td>
<td>
<button class='btn btn-success btn-sm edit btn-flat' data-id='".$row['canid']."'><i
class='fa fa-edit'></i> Edit</button>
<button class='btn btn-danger btn-sm delete btn-flat' data-id='".$row['canid']."'><i
class='fa fa-trash'></i> Delete</button>
</td>
</tr>
";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>

<?php include 'includes/footer.php'; ?>


<?php include 'includes/candidates_modal.php'; ?>
</div>
<?php include 'includes/scripts.php'; ?>
<script>
$(function(){
$(document).on('click', '.edit', function(e){
e.preventDefault();
$('#edit').modal('show');
var id = $(this).data('id');
getRow(id);
});

$(document).on('click', '.delete', function(e){


e.preventDefault();
$('#delete').modal('show');
var id = $(this).data('id');
getRow(id);
});

$(document).on('click', '.photo', function(e){


e.preventDefault();
var id = $(this).data('id');
getRow(id);
});

Page 36

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

$(document).on('click', '.platform', function(e){


e.preventDefault();
var id = $(this).data('id');
getRow(id);
});

});

function getRow(id){
$.ajax({
type: 'POST',
url: 'candidates_row.php',
data: {id:id},
dataType: 'json',
success: function(response){
$('.id').val(response.canid);
$('#edit_firstname').val(response.firstname);
$('#edit_lastname').val(response.lastname);
$('#posselect').val(response.position_id).html(response.description);
$('#edit_platform').val(response.platform);
$('.fullname').html(response.firstname+' '+response.lastname);
$('#desc').html(response.platform);
}
});
}
</script>
</body>
</html>

c:xampp > htdocs > votesystem > admin> positions.php

<?php include 'includes/session.php'; ?>


<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

<?php include 'includes/navbar.php'; ?>


<?php include 'includes/menubar.php'; ?>

<!-- Content Wrapper. Contains page content -->


<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Positions
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>

Page 37

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

<li class="active">Positions</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<?php
if(isset($_SESSION['error'])){
echo "
<div class='alert alert-danger alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
<h4><i class='icon fa fa-warning'></i> Error!</h4>
".$_SESSION['error']."
</div>
";
unset($_SESSION['error']);
}
if(isset($_SESSION['success'])){
echo "
<div class='alert alert-success alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
<h4><i class='icon fa fa-check'></i> Success!</h4>
".$_SESSION['success']."
</div>
";
unset($_SESSION['success']);
}
?>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header with-border">
<a href="#addnew" data-toggle="modal" class="btn btn-primary btn-sm btn-flat"><i class="fa
fa-plus"></i> New</a>
</div>
<div class="box-body">
<table id="example1" class="table table-bordered">
<thead>
<th class="hidden"></th>
<th>Description</th>
<th>Maximum Vote</th>
<th>Tools</th>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM positions ORDER BY priority ASC";
$query = $conn->query($sql);
while($row = $query->fetch_assoc()){
echo "

Page 38

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

<tr>
<td class='hidden'></td>
<td>".$row['description']."</td>
<td>".$row['max_vote']."</td>
<td>
<button class='btn btn-success btn-sm edit btn-flat' data-id='".$row['id']."'><i class='fa
fa-edit'></i> Edit</button>
<button class='btn btn-danger btn-sm delete btn-flat' data-id='".$row['id']."'><i class='fa
fa-trash'></i> Delete</button>
</td>
</tr>
";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>

<?php include 'includes/footer.php'; ?>


<?php include 'includes/positions_modal.php'; ?>
</div>
<?php include 'includes/scripts.php'; ?>
<script>
$(function(){
$(document).on('click', '.edit', function(e){
e.preventDefault();
$('#edit').modal('show');
var id = $(this).data('id');
getRow(id);
});

$(document).on('click', '.delete', function(e){


e.preventDefault();
$('#delete').modal('show');
var id = $(this).data('id');
getRow(id);
});

});

function getRow(id){
$.ajax({
type: 'POST',

Page 39

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

url: 'positions_row.php',
data: {id:id},
dataType: 'json',
success: function(response){
$('.id').val(response.id);
$('#edit_description').val(response.description);
$('#edit_max_vote').val(response.max_vote);
$('.description').html(response.description);
}
});
}
</script>
</body>
</html>

c:xampp > htdocs > votesystem > admin> voters.php

<?php include 'includes/session.php'; ?>


<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

<?php include 'includes/navbar.php'; ?>


<?php include 'includes/menubar.php'; ?>

<!-- Content Wrapper. Contains page content -->


<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Voters List
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Voters</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<?php
if(isset($_SESSION['error'])){
echo "
<div class='alert alert-danger alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
<h4><i class='icon fa fa-warning'></i> Error!</h4>

Page 40

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

".$_SESSION['error']."
</div>
";
unset($_SESSION['error']);
}
if(isset($_SESSION['success'])){
echo "
<div class='alert alert-success alert-dismissible'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>
<h4><i class='icon fa fa-check'></i> Success!</h4>
".$_SESSION['success']."
</div>
";
unset($_SESSION['success']);
}
?>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header with-border">
<a href="#addnew" data-toggle="modal" class="btn btn-primary btn-sm btn-flat"><i class="fa
fa-plus"></i> New</a>
</div>
<div class="box-body">
<table id="example1" class="table table-bordered">
<thead>
<th>Lastname</th>
<th>Firstname</th>
<th>Photo</th>
<th>Voters ID</th>
<th>Tools</th>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM voters";
$query = $conn->query($sql);
while($row = $query->fetch_assoc()){
$image = (!empty($row['photo'])) ? '../images/'.$row['photo'] : '../images/profile.jpg';
echo "
<tr>
<td>".$row['lastname']."</td>
<td>".$row['firstname']."</td>
<td>
<img src='".$image."' width='30px' height='30px'>
<a href='#edit_photo' data-toggle='modal' class='pull-right photo' data-
id='".$row['id']."'><span class='fa fa-edit'></span></a>
</td>
<td>".$row['voters_id']."</td>

Page 41

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

<td>
<button class='btn btn-success btn-sm edit btn-flat' data-id='".$row['id']."'><i class='fa
fa-edit'></i> Edit</button>
<button class='btn btn-danger btn-sm delete btn-flat' data-id='".$row['id']."'><i class='fa
fa-trash'></i> Delete</button>
</td>
</tr>
";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>

<?php include 'includes/footer.php'; ?>


<?php include 'includes/voters_modal.php'; ?>
</div>
<?php include 'includes/scripts.php'; ?>
<script>
$(function(){
$(document).on('click', '.edit', function(e){
e.preventDefault();
$('#edit').modal('show');
var id = $(this).data('id');
getRow(id);
});

$(document).on('click', '.delete', function(e){


e.preventDefault();
$('#delete').modal('show');
var id = $(this).data('id');
getRow(id);
});

$(document).on('click', '.photo', function(e){


e.preventDefault();
var id = $(this).data('id');
getRow(id);
});

});

function getRow(id){

Page 42

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

$.ajax({
type: 'POST',
url: 'voters_row.php',
data: {id:id},
dataType: 'json',
success: function(response){
$('.id').val(response.id);
$('#edit_firstname').val(response.firstname);
$('#edit_lastname').val(response.lastname);
$('#edit_password').val(response.password);
$('.fullname').html(response.firstname+' '+response.lastname);
}
});
}
</script>
</body>
</html>

c:xampp > htdocs > votesystem > includes > header.php

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Voting System using PHP</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<!-- iCheck for checkboxes and radio inputs -->
<link rel="stylesheet" href="plugins/iCheck/all.css">
<!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-
bs/css/dataTables.bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

Page 43

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- Google Font -->


<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic
,400italic,600italic">

<style>
.mt20{
margin-top: 20px;
}
.title{
font-size: 50px;
}
#candidate_list{
margin-top:20px;
}

#candidate_list ul{
list-style-type:none;
}

#candidate_list ul li{
margin:0 30px 30px 0;
vertical-align:top
}

.clist{
margin-left: 20px;
}

.cname{
font-size: 25px;
}

.votelist{
font-size: 17px;
}
</style>
</head>

Page 44

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

c:xampp > htdocs > votesystem > includes > footer.php

<footer class="main-footer">
<div class="container">
<div class="pull-right hidden-xs">
<b>All rights reserved</b>
</div>
<strong>Copyright &copy; 2023 <a href="">RakeshGehlot</a></strong>
</div>
<!-- /.container -->
</footer>

c:xampp > htdocs > votesystem > includes > navbar.php

<header class="main-header">
<nav class="navbar navbar-static-top">
<div class="container">
<div class="navbar-header">
<a href="#" class="navbar-brand"><b>Voting</b>System</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-
target="#navbar-collapse">
<i class="fa fa-bars"></i>
</button>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
<ul class="nav navbar-nav">
<?php
if(isset($_SESSION['student'])){
echo "
<li><a href='index.php'>HOME</a></li>
<li><a href='transaction.php'>TRANSACTION</a></li>
";
}
?>
</ul>
</div>
<!-- /.navbar-collapse -->
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="user user-menu">
<a href="">

Page 45

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

<img src="<?php echo (!empty($voter['photo'])) ? 'images/'.$voter['photo'] :


'images/profile.jpg' ?>" class="user-image" alt="User Image">
<span class="hidden-xs"><?php echo $voter['firstname'].' '.$voter['lastname']; ?></span>
</a>
</li>
<li><a href="logout.php"><i class="fa fa-sign-out"></i> LOGOUT</a></li>
</ul>
</div>
<!-- /.navbar-custom-menu -->
</div>
<!-- /.container-fluid -->
</nav>
</header>

c:xampp > htdocs > votesystem > includes > session.php

<?php
include 'includes/conn.php';
session_start();

if(isset($_SESSION['voter'])){
$sql = "SELECT * FROM voters WHERE id = '".$_SESSION['voter']."'";
$query = $conn->query($sql);
$voter = $query->fetch_assoc();
}
else{
header('location: index.php');
exit();
}

?>

Page 46

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

CONCLUSION

This Online Voting system will manage the Voter’s information by which voter can login and use his
voting rights. The system will incorporate all features of Voting system. Its provide the tools for
maintaining voter’s vote to every party and it count total no. of votes of every party. There is a
DATABASE which is maintained by the ELECTION COMMISION OF INDIA in which all the names
of voter with complete information is stored.

In this user who is above 18 year’s register his/her information on the database and when he/she want to
vote he/she has to login by his id and password and can vote to any party only single time.
Voting detail store in database and the result is displayed by calculation. By online voting system
percentage of voting is increases. It decreases the cost and time of voting process. It is very easy to use
and It is vary less time consuming. It is very easy to debug.

In this user who is above 18years’s register his/her information on the database and when he/she want to
vote he/she has to login by his id and password and can vote to any party only single time. Voting detail
store in database and the result is displayed by calculation. By online voting system percentage of voting
is increases.
It decreases the cost and time of voting process. It is very easy to use and it is very less time consuming.
It is very easy to debug. The traditional method of manual voting system has few drawbacks. This
method is obviously not efficient as it wastes the voter’s energy and quite slow in term of completion.
This smart system involves the voter’s can cast their vote easily, and can be implemented to the entire
India

Page 47

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)


lOMoARcPSD|39873805

REFERENCES :-

https://en.wikipedia.org/wiki/Electronic_voting

https://www.w3schools.com/MySQL/default.asp

https://www.apachefriends.org/

https://www.geeksforgeeks.org/election-system-in-india/

https://bootsnipp.com/tags/login

Page 48

Downloaded by Raghu Singh (raghusinghraghuwanshi@gmail.com)

You might also like