Professional Documents
Culture Documents
Voting
Voting
Voting
INTRODUCTION
In “ONLINE VOTING SYSTEM” a voter can use his\her voting right online
without any difficulty. He\She has to be registered first for him/her to vote.
Registration is mainly done by the system administrator for security reasons. The
system Administrator registers the voters on a special site of the system visited by him
only by simply filling a registration form to register voter. Citizens seeking
registration are expected to contact the system administrator to submit their details.
After the validity of them being citizens of India has been confirmed by the system
administrator by comparing their details submitted with those in existing databases
such as those as the Registrar of Persons, the citizen is then registered as a voter.
The aim of the project is to create and manage polling and election details.
This is a system which enables all citizens to cast their vote online. Increasing the
voting percentage across the country is the major goal of this project. People have to
visit the booth to cast their vote in the present system across the country. This system
is online and hence even people who live out of their home town can also vote.
Database of all the eligible citizens and candidates are maintained by the system.
Online voting system gathers its own significance since the NRI voting Rights
bill have been passed by the parliament on Feb 11 ,2011. . The new law will allow an
1
Indian citizen residing abroad to enrol in voter’s list and exercise his franchise even if
he or she remained away from place of residence in India for more than six months
owing to employment, education or otherwise. In the present case the person should
be present within the constituency on the day of polling for exercising his right to
vote.
After registration, the voter is assigned a secret Voter ID with which he/she
can use to log into the system and enjoy services provided by the system such as
voting. If invalid/wrong details are submitted, then the citizen is not registered to vote.
In “ONLINE VOTING SYSTEM” a voter can use his\her voting right online without
any difficulty. He\She has to fill a registration form to register himself\herself. All the
entries is checked by the DATABASE which has already all information about the
voter. If all the entries are correct then a USER ID and PASSWORD is given to the
voter, by using that ID and PASSWORD he\she can use his\her vote. If conditions are
wrong then that entry will be discarded.
2
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?
3
2 . SYSTEM REQUIREMENTS
RAM : 4 GB
Mouse : 3 buttons
Software : XAMPP
4
3. SYSTEM DESCRIPTION
Modules
• Admin
• User
Admin 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. The
admin can add the list of candidates in the election. It includes candidates name,
address, gender, party, party symbol etc. The candidates will be added to the list only
after completing the procedures. The voters can be added to the database. The voters
have also the privilege to check the voters list from the homepage. The voter’s details
includes name, address, gender, age, constituency, image etc. The election to be
conducted is selected. To add an election the constituency should be selected and
termination date of election should be specified. The constituency that is going to
conduct election should be selected. We can view the voters list. Each constituency
will be having separate voters list. The list of candidates participating in the election
can be seen. It includes the candidates name, party name and party symbol.
User 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. This facilitates the voter to view the candidate names,
the constituency name, their symbol and their party name.
5
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. 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. This provides an
option for the voter to quit the session, while in the voter home page.
PHP:
6
Specification of PHP
• PHP design is simple since libraries like C or C++ are not used. It
contains plenty of predefined functions to protect you information.
• It is an open source language so that it can be freely downloaded.
• In addition to session management features ,PHP 4.0 uses resource
allocation mechanisms and object –oriented programming.It removes
the unnecessary allocation of memory.
MySQL
7
4. SYSTEM ANALYSIS AND DESIGN
Analysis is the focus of system developing and is the stage when system
designers have to work at two levels of definition regarding the study of situational
issues and possible solutions in terms of “what to do” and “how to do”.
Now the existing system is subjected to close study and problem areas are
identified. The designer now functions as a problem solver and tries to sort out
difficulties that the enterprise faces. The solutions are given as proposals.
8
4.1.1 EXISTING SYSTEM
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.
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 function 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.
9
4.1.3 SYSTEM FLOW CHART
A system flow chart is a physical design tool that shows in general terms the
operations that will be performed on information in an information system. The
arrows on a system flowchart show the direction that data will flow in around the
system rather that the order in which the operations will be carried out.
System Admin User View user details View user score View user rank Select
subject Attend quiz View quiz questions View score.
Admin User
Candidate details
update profile
update profile
10
4.1.4 DATA FLOW DIAGRAMS
A Data Flow Diagrams is a structured analysis and design tool that can be used
for flowcharting in place of, or in association with, information-oriented and process-
oriented systems flowcharts. A DFD is a network that describes the flow of data and
the processes that change, or transform, data throughout a system. This network is
constructed by using a set of symbols that do not imply a physical implementation.
Data flow diagrams (DFD) was first developed by LARRY CONSTANTINE as way
representing system requirements in a graphical form; this lead to modular design. It
has the purpose of clarifying system requirements and identifying major
transformations that will become programs in system design. So it is the starting point
of the design phase that functionality decomposes the requirement specifications down
to the lowest level of detail.
Online
Admin Voter
Voting
Level 0 DFD
11
Election Master
Level 1 DFD
4.1.5 ER DIAGRAM
12
visualize database design ideas, you have a chance to identify the mistakes and
designs flows to make these corrections.
13
4.2 SYSTEM DESIGN
Design is the first step into the development phase for any engineered product
or system. Design is a creative process. A good design is the key to effective system.
The term “design” is defined as “the process of applying various techniques and
principles for the purpose of defining a process or a system in sufficient detail to
permit its physical realization”. It may be defined as a process of applying various
techniques and principles for the purpose of defining a device, a process or a system in
sufficient detail to permit its physical realization.
Software design sits at the technical kernel of the software engineering process
and is applied regardless of the development paradigm that is used. The system design
develops the architectural detail required to build a system or product. As in the case
of any systematic approach, this software too has undergone the best possible design
phase fine tuning all efficiency, performance and accuracy levels.
Input design is the link that ties the information system into the world of its
users. It comprises the developing specification and procedures for data preparation
and those steps are necessary to put transaction data in to a usable form for processing
can be achieved by inspecting the computer to read data from a written or printed
document or it can occur by having people keying the data directly into the system.
The input design involves determining the inputs, validating the data,
minimizing the data entry and provides a multi-user facility. Inaccurate inputs are the
most common cause of errors in data processing. Errors entered by the data entry
operators can be controlled by input design. The user-originated inputs are converted
to a computer based format in the input design. Input data are collected and organized
14
into groups of similar data. Once identified, the appropriate input media are selected
for processing.
USER REGISTRATION
First Name
Last Name
Password
Photo
Register Close
CANDIDATE REGISTRATION
First Name
Last Name
Password
Photo
Platform
Register Close
USER LOGIN
Voter id
Password
Sign in
ADMIN LOGIN
Name
Password
Sign in
15
VOTING FORM
Select One Candidate
Mohan
John
Frank
Ram
Preview Submit
The database design is a two level process. In the first step, user
requirements are gathered together and a database is designed which will meet these
requirements as clearly as possible. This step is called Information Level Design and it
is taken independent of any individual DBMS.
In the second step, this Information level design is transferred into a design
for the specific DBMS that will be used to implement the system in question. This
step is called Physical Level Design, concerned with the characteristics of the specific
DBMS that will be used.
A database design runs parallel with the system design. The organization of
the data in the database is aimed to achieve the following two major objectives:
▪ Data Integrity.
▪ Data independence.
16
Admin Table
Candidates Table
Positions Table
17
Votes Table
Voters Table
18
USER REGISTRATION
User_id Voters_id Password fname lname Photo
CANDIDATE REGISTRATION
Candidate_id Position_id Platform fname lname Photo
ADMIN LOGIN
id Username Password fname lname Created Photo
on
POSITIONS
Position_ id Description Max_vote priority
RESULT
Vote_id Voters_id Candidate_id Position_id
19
5. SYSTEM CODING AND IMPLEMENTATION
Methods of implementation
There are many ways of implementing a new system. The method chosen
will depend on the organization and the type of system being implemented. Methods
of implementing systems include:
• direct cutover
• parallel
• phased
• pilot
• Implementation allows the users to take over its operation for use and
evaluation. It involves training the users to handle the system and plan for a
smooth conversion.
22
candidate.php :
This displays the candidate list. The data will be read from the candidate table
in the database.
23
UNIT TESTING
Unit testing focuses verification effort on the smallest unit of software design –
the software component or module. Using the component level design description as a
guide, important control paths are tested to uncover errors within the boundary of the
module. The relative complexity of tests and uncovered scope established for unit
testing. The unit testing is white-box oriented, and step can be conducted in parallel
for multiple components. The modular interface is tested to ensure that information
properly flows into and out of the program unit under test. The local data structure is
examined to ensure that data stored temporarily maintains its integrity during all steps
in an algorithm’s execution. Boundary conditions are tested to ensure that all
statements in a module have been executed at least once. Finally, all error handling
paths are tested.
Tests of data flow across a module interface are required before any other test
is initiated. If data do not enter and exit properly, all other tests are moot. Selective
testing of execution paths is an essential task during the unit test. Good design dictates
that error conditions be anticipated and error handling paths set up to reroute or
cleanly terminate processing when an error does occur. Boundary testing is the last
task of unit testing step. Software often fails at its boundaries.
Unit testing was done in Sell-Soft System by treating each module as separate
entity and testing each one of them with a wide spectrum of test inputs. Some flaws in
the internal logic of the modules were found and were rectified.
INTEGRATION TESTING
Integration testing is systematic technique for constructing the program
structure while at the same time conducting tests to uncover errors associated with
interfacing. The objective is to take unit tested components and build a program
structure that has been dictated by design. The entire program is tested as whole.
Correction is difficult because isolation of causes is complicated by vast expanse of
entire program. Once these errors are corrected, new ones appear and the process
continues in a seemingly endless loop.
24
After unit testing in Sell-Soft System all the modules were integrated to test
for any inconsistencies in the interfaces. Moreover differences in program structures
were removed and a unique program structure was evolved.
FUNCTIONAL TESTING
Functional testing is a type of software testing whereby the system is tested
against the functional requirements/specifications. Functions are tested by feeding
them input and examining the output. Functional testing ensures that the requirements
are properly satisfied by the application. During functional testing Black Box testing
technique is used in which the internal logic of the system being tested is not known
to the tester. Functional testing is normally performed during the levels of System
testing and Acceptance testing.
Typically, functional testing involves the following steps:
• Identify functions that the software is expected to perform.
• Create input data based on the function’s specifications.
• Determine the output based on the function’s specifications.
• Execute the test case.
• Compare the actual and expected outputs.
ACCEPTANCE TESTING
Testing generally involves running a suite of tests on the completed system.
Each individual test, known as a case, exercises a particular operating condition of the
user's environment or feature of the system, and will result in a pass or fail, or
outcome. There is generally no degree of success or failure. The test environment is
usually designed to be identical, or as close as possible, to the anticipated user's
environment, including extremes of such. These test cases must each be accompanied
by test case input data or a formal description of the operational activities (or both) to
be performed—intended to thoroughly exercise the specific case—and a formal
description of the expected results.
25
REGRESSION TESTING
It is used to authenticate a code change in the software does not impact the
existing functionality of the product. It is making sure that the software works fine
with new functionality, bug fixes or any change in the existing feature. To ensure new
changes have not produced any bugs.
In this project, all the functionalities have been working properly and fixes all
possible bugs. The new changes in this project have not produced any Bugs on the
existing features.
VALIDATION TESTING
This is the final step in testing. In this the entire system was tested as a whole
with all forms, code, modules and class modules. This form of testing is popularly
known as Black Box testing or System testing. Black Box testing method focuses on
the functional requirements of the software. That is, Black Box testing enables the
software engineer to derive sets of input conditions that will fully exercise all
functional requirements for a program.
Black Box testing attempts to find errors in the following categories; incorrect
or missing functions, interface errors, errors in data structures or external data access,
performance errors and initialization errors and termination errors.
26
BLACK BOX TESTING
Black Box Testing is also known as behavioral, opaque-box, closed-box
specification based or eye-to-eye testing. It is a software testing method that analyzes
the functionality of a software/application without knowing much about the internal
structure/design of the item that is being tested and compares the input value with the
output value.
The main focus of Black Box Testing is on the functionality of the system as a
whole. The term ‘Behavioral Testing’ is also used for Black Box. A majority of the
application are tested using the Black Box method. We need to cover the majority of
test cases so that most of the bugs will get discovered by the Black-Box method.
Black Box testing method focuses on the functional requirements of the software.
That is, Black Box testing enables the software engineer to derive sets of input
conditions that will fully exercise all functional requirements for a program. Black Box
testing attempts to find errors in the following categories; incorrect or missing
functions, interface errors, errors in data structures or external data access,
performance errors and initialization errors and termination errors.
WHITE BOXTESTING
White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at least
its purpose. It is purpose. It is used to test areas that cannot be reached from a black
box level. White Box Testing is a testing technique which evaluates the code and the
internal structure of a program. White Box Testing involves looking at the structure
of the code. When you know the internal structure of a product, tests can be
conducted to ensure that the internal operations performed according to the
specification and all internal components have been adequately exercised.
27
6. CONCLUSION
This project has come as a platform to propose an online voting system that
will place our democracy on a path of success. In a nutshell, this research seeks to
increase the efficiency of voting process and the image of the Electoral Commissions
in charge of elections. This Online Voting System is simple and indigenous. It has an
authentication feature that will manage the Voter’s information by which voter can
login and use his/her voting rights. There is a database in which all the names of
voters with complete information is stored and it provides the tools for maintaining
voter’s vote to every candidate and also computes the total number of votes of every
candidate. Online voting offers speed and convenience to the voter and considerable
ease to election administrators as they can get election results out more quickly than
conventional methods of manual voting since vote counting is just a matter of
querying the database.
The success factors include:
• Faster electoral process.
• A better platform for the disabled as well as the outright elimination of
multiple voting.
• Finally, the integrated system would avail the electorates the opportunity of
casting their votes using the most convenient means.
• The adoption of this system is likely to increase the level of participation in
the polity because of the ease of voting and its tendency.
28
7. FUTURE ENHANCEMENT
Login
<?php
session_start();
include 'includes/conn.php';
if(isset($_POST['login'])){
$username = $_POST['username'];
$password = $_POST['password'];
$query = $conn->query($sql);
else{
$row = $query->fetch_assoc();
if(password_verify($password, $row['password'])){
$_SESSION['admin'] = $row['id'];
else{
30
else{
header('location: index.php');
?>
ballot
<?php
session_start();
include 'includes/conn.php';
if(isset($_POST['login'])){
$username = $_POST['username'];
$password = $_POST['password'];
$query = $conn->query($sql);
else{
$row = $query->fetch_assoc();
if(password_verify($password, $row['password'])){
$_SESSION['admin'] = $row['id'];
else{
31
$_SESSION['error'] = 'Incorrect password';
else{
header('location: index.php');
?>
Candidates
<?php
include 'includes/session.php';
if(isset($_POST['add'])){
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$position = $_POST['position'];
$platform = $_POST['platform'];
$filename = $_FILES['photo']['name'];
if(!empty($filename)){
move_uploaded_file($_FILES['photo']['tmp_name'], '../images/'.$filename);
32
if($conn->query($sql)){
else{
$_SESSION['error'] = $conn->error;
else{
header('location: candidates.php');
?>
Logout
<?php
session_start();
session_destroy();
header('location: index.php');
?>
Submit ballot
<?php
include 'includes/session.php';
include 'includes/slugify.php';
if(isset($_POST['vote'])){
33
if(count($_POST) == 1){
else{
$_SESSION['post'] = $_POST;
$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])){
$error = true;
else{
34
else{
header('location: home.php');
?>
Voter
<div class="wrapper">
<div class="content-wrapper">
<section class="content-header">
<h1>
Voters List
</h1>
<ol class="breadcrumb">
<li class="active">Voters</li>
</ol>
35
</section>
<section class="content">
<?php
if(isset($_SESSION['error'])){
echo "
".$_SESSION['error']."
</div>
";
unset($_SESSION['error']);
if(isset($_SESSION['success'])){
echo "
".$_SESSION['success']."
</div>
36
";
unset($_SESSION['success']);
?>
<div class="row">
<div class="col-xs-12">
<div class="box">
</div>
<div class="box-body">
<thead>
<th>Lastname</th>
<th>Firstname</th>
<th>Photo</th>
<th>Voters ID</th>
<th>Tools</th>
</thead>
<tbody>
<?php
37
$query = $conn->query($sql);
while($row = $query->fetch_assoc()){
echo "
<tr>
<td>".$row['lastname']."</td>
<td>".$row['firstname']."</td>
<td>
</td>
<td>".$row['voters_id']."</td>
<td>
</td>
</tr>
";
?>
</tbody>
38
</table>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<script>
$(function(){
e.preventDefault();
$('#edit').modal('show');
var id = $(this).data('id');
getRow(id);
});
e.preventDefault();
$('#delete').modal('show');
var id = $(this).data('id');
39
getRow(id);
});
e.preventDefault();
var id = $(this).data('id');
getRow(id);
});
});
function getRow(id){
$.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);
});
40
</script>
</body>
</html>
Home
<div class="wrapper">
<div class="content-wrapper">
<div class="container">
<section class="content">
<?php
$title = $parse['election_title'];
?>
<div class="row">
<?php
if(isset($_SESSION['error'])){
41
?>
<ul>
<?php
foreach($_SESSION['error'] as $error){
echo "
<li>".$error."</li>
";
?>
</ul>
</div>
<?php
unset($_SESSION['error']);
if(isset($_SESSION['success'])){
echo "
42
".$_SESSION['success']."
</div>
";
unset($_SESSION['success']);
?>
<span class="message"></span>
</div>
<?php
$vquery = $conn->query($sql);
?>
<div class="text-center">
</div>
<?php
43
else{
?>
<?php
include 'includes/slugify.php';
$candidate = '';
$query = $conn->query($sql);
while($row = $query->fetch_assoc()){
$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';
44
}
else{
if($value == $crow['id']){
$checked = 'checked';
$candidate .= '
<li>
</li>';
echo '
<div class="row">
45
<div class="col-xs-12">
<h3 class="box-title"><b>'.$row['description'].'</b></h3>
</div>
<div class="box-body">
<p>'.$instruct.'
<span class="pull-right">
</span>
</p>
<div id="candidate_list">
<ul>
'.$candidate.'
</ul>
</div>
</div>
</div>
</div>
</div>';
$candidate = '';
46
?>
<div class="text-center">
</div>
</form>
<?php
?>
</div>
</div>
</section>
</div>
</div>
</div>
<script>
$(function(){
47
$('.content').iCheck({
checkboxClass: 'icheckbox_flat-green',
radioClass: 'iradio_flat-green'
});
e.preventDefault();
$('.'+desc).iCheck('uncheck');
});
e.preventDefault();
$('#platform').modal('show');
$('.candidate').html(fullname);
$('#plat_view').html(platform);
});
$('#preview').click(function(e){
e.preventDefault();
if(form == ''){
$('#alert').show();
48
}
else{
$.ajax({
type: 'POST',
url: 'preview.php',
data: form,
dataType: 'json',
success: function(response){
if(response.error){
for (i in messages) {
errmsg += messages[i];
$('.message').html(errmsg);
$('#alert').show();
else{
$('#preview_modal').modal('show');
$('#preview_body').html(response.list);
});
49
}
});
});
</script>
</body>
</html>
50
OUTPUT SCREEN
SCREENSHOTS
HOME
BALLOT POSITION
51
CANDIDATES LIST
POSITIONS
52
VOTERS LIST
ADD CANDIDATE
53
VOTING
VOTES
54
LOGIN
55
9. BIBILIOGRAPHY
❖ www.mysql.com
❖ www.w3schools.com
❖ www.google.com
❖ www.wikipaedia.com
❖ www.eci.nic.in
56