Mini Project Report 2 - 2200980140041
Mini Project Report 2 - 2200980140041
SUBMITTED TO
INDEX
Requirement Analysis
3.1 Feasibility Study
3. 3.2 Front-end and back-end selection 4-11
3.3 Project Modules
Implementation
5.1 System Implementation Technologies
5. 5.2 Form Layout 23-122
5.3 Report Layout
5.4 Coding
Testing
6. 123-127
6.1 Types of Tests
7. System Security Measures 128-130
8. Future Scope of The Project 131
9. Bibliography 132
Online Voting System | 2022-2024
1. INTRODUCTION
Objective:
1
Online Voting System | 2022-2024
2. Project Profile
2.1 Existing System
The existing system is manual and the paper-based voting which is voted on paper
and counted manually. The electronic tabulation brings new kind of voting system in
which the electronic cards with all candidate’s symbol is marked manually and this
can be counted electronically. The electronic voting systems are now different types
known as the punch card, mark sense and the digital pen voting systems.
The Electronic Ballot Marker makes the voter easier to vote by providing the
selections on the display to vote present on the electronic machine.
The direct recording electronic voting machine is one which provides the display that
can be start when the voter touches the display consists of the mechanical and electro
optical buttons, software that accepts the vote and possesses a image or symbol on the
display.
The electronic ballots are connected with the central ballot systems which directly
accept and get the updated record of all ballots. The central ballot system applies the
Precinct count method which calculates all votes from the ballots present at polling
centres. The results are immediate.
The online voting system is for the citizens from all over India that consists of the
data and information
1. Voter’s Id
2
Online Voting System | 2022-2024
Hardware
• RAM: at least 1 GB
Software
• MySQL Database
3
Online Voting System | 2022-2024
3. Requirement Analysis
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?
3. What are the likely impacts of the candidate system on the organization?
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.
Steps in feasibility analysis
4
Online Voting System | 2022-2024
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?
Economic 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 proposed system will give the minute information, as a result the
performance is improved
5
Online Voting System | 2022-2024
• 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.
Operational Feasibility
• 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.
6
Online Voting System | 2022-2024
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.
3. Flexibility.
4. Robustness.
7. Platform independent.
10. Front end must support some popular back end like Ms Access.
Back-end Selection:
7
Online Voting System | 2022-2024
5. Stored procedures.
6. Popularity.
8. Easy to install.
The technical feasibility is frequently the most difficult area encountered at this stage.
It is essential that the process of analysis and definition b1e conducted in parallel with
an assessment to technical feasibility. It centres on the existing computer system and to
what extent it can support the proposed system.
8
Online Voting System | 2022-2024
1. Home Page:
3. Login Page:
5. ID Generate Page:
9
Online Voting System | 2022-2024
8. Stats of Database:
Information may include the number of registered users, elections, and other
relevant metrics.
9. Result Page:
Captures details such as election name, date, and other relevant information.
10
Online Voting System | 2022-2024
14. Logout:
Allows users (both voters and admin) to log out of their accounts.
These modules collectively form the core functionalities of your Online Voting System,
covering user management, authentication, voting processes, administration, and result
display. Each module serves a specific purpose to ensure the smooth operation of the
voting system.
11
Online Voting System | 2022-2024
INPUT DESIGN:
Input design is a part of overall system design. The main objective during the input
design is as given below:
INPUT STAGES:
• Data recording
• Data transcription
• Data conversion
• Data verification
• Data control
• Data transmission
• Data validation
• Data correction
12
Online Voting System | 2022-2024
INPUT TYPES:
INPUT MEDIA:
At this stage choice has to be made about the input media. To conclude about the input
media consideration has to be given to;
• Type of input
• Flexibility of format
• Speed
• Accuracy
• Verification methods
• Rejection rates
• Ease of correction
• Security
13
Online Voting System | 2022-2024
• Easy to use
• Portability
Keeping in view the above description of the input types and input media, it can be
said that most of the inputs are of the form of internal and interactive.
As input data is to be the directly keyed in by the user, the keyboard can be considered
to be the most suitable input device.
OUTPUT DESIGN:
Outputs from computer systems are required primarily to communicate the results of
processing to users. They are also used to provide a permanent copy of the results for
later consultation. The various types of outputs in general are:
• External Outputs whose destination is outside the organization.
• Internal Outputs whose destination is within organization and they are the
User’s main interface with the computer.
• Interface outputs, which involve the user in communicating directly with the
system.
OUTPUT DEFINITION
14
Online Voting System | 2022-2024
For Example
OUTPUT MEDIA:
In the next stage it is to be decided that which medium is the most appropriate for the
output. The main considerations when deciding about the output media are:
• The suitability for the device to the particular application.
Keeping in view the above description the project is to have outputs mainly coming
under the category of internal outputs. The main outputs desired according to the
requirement specification are:
15
Online Voting System | 2022-2024
The outputs were needed to be generated as a hard copy and as well as queries to be
viewed on the screen. Keeping in view these outputs, the format for the output is taken
from the outputs, which are currently being obtained after manual processing. The
standard printer is to be used as output media for hard copies.
SDLC METHODOLOGY
This document plays a vital role in the development of life cycle (SDLC) as it
describes the complete requirement of the system. It means for use by developers and
will be the basic during testing phase. Any changes made to the requirements in the
future will have to go through formal change approval process.
SPIRAL MODEL was defined by Barry Boehm in his 1988 article, “A spiral Model
of Software Development and Enhancement. This model was not the first model to
discuss iterative development, but it was the first model to explain why the iteration
models.
As originally envisioned, the iterations were typically 6 months to 2 years long. Each
phase starts with a design goal and ends with a client reviewing the progress thus far.
Analysis and engineering efforts are applied at each phase of the project, with an eye
toward the end goal of the project.
The steps for Spiral Model can be generalized as follows:
• The new system requirements are defined in as much details as possible. This
usually involves interviewing a number of users representing all the external
or internal users and other aspects of the existing system.
• A first prototype of the new system is constructed from the preliminary design.
This is usually a scaled down system, and represents an approximation of the
characteristics of the final product.
16
Online Voting System | 2022-2024
1. Evaluating the first prototype in terms of its strengths, weakness, and risks.
At the customer option, the entire project can be aborted if the risk is deemed too
great. Risk factors might involved development cost overruns, operating-cost
miscalculation, or any other factor that could, in the customer’s judgment, result in a
less-than-satisfactory final product.
• The existing prototype is evaluated in the same manner as was the previous
prototype, and if necessary, another prototype is developed from it according
to the fourfold procedure outlined above.
• The preceding steps are iterated until the customer is satisfied that the refined
prototype represents the final product desired.
17
Online Voting System | 2022-2024
Id_request_table: -
Elections_table: -
Elections_candidates_table: -
Results_table: -
18
Online Voting System | 2022-2024
The entity relationship diagram shows the relationship between the various users and
their attributes. There is a relationship between the election committee and voter.
19
Online Voting System | 2022-2024
The following 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.
20
Online Voting System | 2022-2024
DFD: Level 1: -
The following diagram is a 1-level Data Flow Diagram for the Online voting system.
According to this DFD various process are done after login process. The
Administrator can register voter. The ELECTION COMMITEE can register the
voters and voter can use their voting rights. The voter can view the final report after
giving vote.
21
Online Voting System | 2022-2024
The following diagram is a 2-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.
22
Online Voting System | 2022-2024
5. Implementation
• Web browsers: Mozilla Firefox, Google chrome, Opera and Internet Explore
23
Online Voting System | 2022-2024
Home Page:
Registration Page:
24
Online Voting System | 2022-2024
User Login:
Welcome Page:
25
Online Voting System | 2022-2024
Vote :
26
Online Voting System | 2022-2024
Admin Login:
27
Online Voting System | 2022-2024
Admin Home:
ID Approval:
28
Online Voting System | 2022-2024
Update ID:
29
Online Voting System | 2022-2024
30
Online Voting System | 2022-2024
ID Approved by admin
Vote
31
Online Voting System | 2022-2024
Result:
Registered User:
32
Online Voting System | 2022-2024
Registered Nominees:
Elections:
33
Online Voting System | 2022-2024
5.4 Coding
USER
Homepage
<?php
include("includes/header.php");
?>
<li class='my-6'>
Excercise your voting rights quickly and easily at home- or from the other
side of the world
</li>
<li class='my-6'>
Cast your ballot with any device with access to the internet from anywhere
in the world
</li>
<li class='my-6'>
34
Online Voting System | 2022-2024
The secrecy of your ballot is maintained under the high security standards
adhered to by online voting softare
</li>
<li class='my-6'>
</li>
</ul>
</div>
</div>
</div>
<?php
include("includes/footer.php")
?>
</body>
</html>
35
Online Voting System | 2022-2024
Registration:
<?php
include("includes/header.php");
?>
<?php
require("includes/db.php");
$emailError = "";
$accountSuccess = "";
if(isset($_POST['register'])){
$user_name = $_POST['fullname'];
$user_email = $_POST['email'];
$user_gender = $_POST['gender'];
$user_state = $_POST['state'];
$user_password = $_POST['password'];
$exe = $conn->query($check);
else{
36
Online Voting System | 2022-2024
values('$user_name','$user_email','$user_gender','$user_state','$user_password')";
$run = $conn->query($insert);
if($run){
else{
echo "Error";
?>
<body>
<!-- 1 -->
<?php
if($emailError != ""){
echo $emailError;
if($accountSuccess != ""){
echo $accountSuccess;
37
Online Voting System | 2022-2024
?>
</div>
<!-- 2 -->
<form method="post">
<div class="my-6">
</div>
<div class="my-6">
<label for="InputEmail">Email</label>
</div>
<div class="my-6">
<label for="Gender">Gender</label>
<option value="">Select</option>
<option value="Male">Male</option>
38
Online Voting System | 2022-2024
<option value="Female">Female</option>
</select>
</div>
<div class="my-6">
<label for="State">State</label>
<option value="">Select</option>
<option value="Delhi">Delhi</option>
<option value="Maharastra">Maharashtra</option>
</select>
</div>
<div class="my-6">
<label for="password">Password</label>
</div>
<div class="my-6">
</div>
39
Online Voting System | 2022-2024
</form>
</div>
</div>
<?php
include("includes/footer.php")
?>
</body>
</html>
40
Online Voting System | 2022-2024
Login:
<?php
session_start();
include("includes/header.php");
?>
<?php
require("includes/db.php");
$error = "";
$success = "";
if(isset($_POST['login'])){
$user_email = $_POST['email'];
$user_password = $_POST['password'];
$run = $conn->query($select);
while($row = $run->fetch_array()){
echo "<script>window.location.href='welcome.php'</script>";
41
Online Voting System | 2022-2024
else{
?>
</div>
<?php
if($error != ""){
echo $error;
if($success != ""){
echo $success;
?>
42
Online Voting System | 2022-2024
</h5>
</div>
</div>
<div class="form-group">
</div>
</form>
</div>
</div>
</div>
<?php
43
Online Voting System | 2022-2024
include("includes/footer.php")
?>
</body>
</html>
44
Online Voting System | 2022-2024
Welcome:
<head>
<title>Voting System</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-
0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmV
or" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-
pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['user_email']){
echo "<script>window.location.href='login.php'</script>";
?>
<div class="container-fluid">
45
Online Voting System | 2022-2024
<span class="navbar-toggler-icon"></span>
</button>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
46
Online Voting System | 2022-2024
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
</ul>
</div>
</div>
</nav>
47
Online Voting System | 2022-2024
</div>
<div>
<ul class='list-disc'>
</ul>
</div>
</div>
</div>
48
Online Voting System | 2022-2024
</div>
</div>
</div>
</div>
</div>
</body>
</html>
49
Online Voting System | 2022-2024
ID Generate:
<html>
<head>
<title>Voting System</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-
0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmV
or" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-
pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['user_email']){
echo"<script>window.location.href='login.php'</script>";
?>
<div class="container-fluid">
50
Online Voting System | 2022-2024
<span class="navbar-toggler-icon"></span>
</button>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
51
Online Voting System | 2022-2024
</li>
<li class="nav-item">
</li>
</ul>
</div>
</div>
</nav>
<!-- 1 -->
<?php
require("includes/db.php");
$user_email=$_SESSION['user_email'];
$run=$conn->query($select);
if($run->num_rows>0){
?>
52
Online Voting System | 2022-2024
</div>
<?php
else{
$run=$conn->query($select);
if($run->num_rows>0){
while($row=$run->fetch_array()){
$user_name=$row['user_name'];
$user_email=$row['user_email'];
$user_state=$row['user_state'];
$user_id_generated=$row['user_id_generated'];
if($user_id_generated!=""){
?>
</div>
<?php
}else{
53
Online Voting System | 2022-2024
?>
</div>
</div>
54
Online Voting System | 2022-2024
</div>
<div class="w-full">
</div>
</form>
<?php
?>
<?php
if(isset($_POST['idrequest'])){
$user_email=$_POST['user_email'];
$user_state=$_POST['user_state'];
require("includes/db.php");
$run=$conn->query($insert);
if($run){
// header("location:welcome.php");
else
55
Online Voting System | 2022-2024
echo"Error";
?>
</div>
<!-- 2 -->
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
56
Online Voting System | 2022-2024
Elections:
<html>
<head>
<title>Voting System</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-
0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmV
or" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-
pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['user_email']){
echo"<script>window.location.href='login.php'</script>";
?>
<div class="container-fluid">
57
Online Voting System | 2022-2024
<span class="navbar-toggler-icon"></span>
</button>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
58
Online Voting System | 2022-2024
</li>
<li class="nav-item">
</li>
</ul>
</div>
</div>
</nav>
Vote In Election
</h3>
</div>
59
Online Voting System | 2022-2024
</div>
<label for="password">Password</label>
</div>
</div>
</form>
</div>
</div>
<?php
require("includes/db.php");
if(isset($_POST['login'])){
$user_id= $_POST['user_id'];
$user_password=$_POST['user_password'];
$run=$conn->query($select);
if($run->num_rows>0){
while($row=$run->fetch_array()){
60
Online Voting System | 2022-2024
$_SESSION['user_id_generated']=$user_id_generated=$row['user_id_generat
ed'];
header('location:vote.php');
else{
?>
</div>
</body>
</html>
61
Online Voting System | 2022-2024
Vote:
<head>
<title>Voting System</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-
0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmV
or" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-
pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['user_id_generated']){
header("location:elections.php");
?>
<div class="container-fluid">
62
Online Voting System | 2022-2024
<span class="navbar-toggler-icon"></span>
</button>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
63
Online Voting System | 2022-2024
</li>
</ul>
</div>
</div>
</nav>
Vote In Election
</h3>
</div>
<?php
require("includes/db.php");
$run=$conn->query($select);
if($run->num_rows>0){
while($row=$run->fetch_array()){
64
Online Voting System | 2022-2024
?>
<?php
?>
</select>
</form>
</div>
<?php
date_default_timezone_set("Asia/Kolkata");
if(isset($_POST['search_candidate'])){
$elections_name=$_POST['elections_name'];
$run=$conn->query($select);
if($run->num_rows>0){
while($row=$run->fetch_array()){
$elections_start_date=$row['elections_start_date'];
$elections_end_date=$row['elections_end_date'];
65
Online Voting System | 2022-2024
$current_ts=time();
$elections_start_date_ts=strtotime($elections_start_date);
$elections_end_date_ts=strtotime($elections_end_date);
if($elections_start_date_ts>$current_ts){
?>
</h3>
</div>
<?php
else if($current_ts>$elections_end_date_ts){
?>
Election closed..!!
</h3>
66
Online Voting System | 2022-2024
</div>
<?php
else{
?>
<?php
?>
</div>
</div>
</body>
</html>
67
Online Voting System | 2022-2024
Vote Cast:
<head>
<title>Voting System</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-
0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmV
or" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-
pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['user_id_generated']){
header("location:elections.php");
exit();
?>
68
Online Voting System | 2022-2024
<div class="container-fluid">
data-bs-target="#navbarSupportedContent" aria-
controls="navbarSupportedContent"
<span class="navbar-toggler-icon"></span>
</button>
<li class="nav-item">
aria-current="page" href="welcome.php">Home</a>
</li>
<li class="nav-item">
href="idgenerate.php">ID Generate</a>
</li>
<li class="nav-item">
href="results.php">Results</a>
69
Online Voting System | 2022-2024
</li>
<li class="nav-item">
href="vote.php">Vote</a>
</li>
<li class="nav-item">
</li>
</ul>
</div>
</div>
</nav>
<?php
require("includes/db.php");
$elections_name=$_GET['elections_name'];
$elections_name=str_replace('_',' ',$elections_name);
?>
<div class="form-group">
70
Online Voting System | 2022-2024
readonly />
</div>
<?php
$run=$conn->query($select);
if($run->num_rows>0){
while($row=$run->fetch_array()){
?>
</div>
<?php
?>
value="VOTE">
</form>
71
Online Voting System | 2022-2024
</div>
<?php
if(isset($_POST['vote_caste'])){
$candidates_name=$_POST['candidates_name'];
$user_email=$_SESSION['user_email'];
$exe1=$conn->query($select);
if($exe1->num_rows>0){
else{
$run=$conn->query($insert);
if($run){
$exe=$conn->query($update);
if($exe){
72
Online Voting System | 2022-2024
else{
echo "error";
else{
echo "error";
?>
</div>
</div>
</div>
</body>
</html>
73
Online Voting System | 2022-2024
Results:
<head>
<title>Voting System</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-
0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmV
or" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-
pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['user_id_generated']){
header("location:elections.php");
?>
<div class="container-fluid">
74
Online Voting System | 2022-2024
data-bs-target="#navbarSupportedContent" aria-
controls="navbarSupportedContent"
<span class="navbar-toggler-icon"></span>
</button>
<li class="nav-item">
aria-current="page" href="welcome.php">Home</a>
</li>
<li class="nav-item">
href="idgenerate.php">ID Generate</a>
</li>
<li class="nav-item">
href="results.php">Results</a>
</li>
<li class="nav-item">
75
Online Voting System | 2022-2024
href="vote.php">Vote</a>
</li>
<li class="nav-item">
</li>
</ul>
</div>
</div>
</nav>
<?php
$current_ts=time();
require("includes/db.php");
76
Online Voting System | 2022-2024
$run=$conn->query($select);
if($run->num_rows>0){
while($row=$run->fetch_array()){
$elections_name=$row['elections_name'];
$elections_start_date=$row['elections_start_date'];
$eletions_end_date=$row['eletions_end_date'];
?>
<?php
$elections_end_date_ts=strtotime($elections_end_date);
if($elections_end_date_ts<$current_ts){
?>
<?php
?>
</select>
</div>
<div class="form-group">
value="Search Results">
77
Online Voting System | 2022-2024
</div>
</form>
</div>
<?php
if(isset($_POST['search_results'])){
$elections_name=$_POST['elections_name'];
$run=$conn->query($select);
if($run->num_rows>0){
$total_elections_votes=0;
while($row=$run->fetch_array()){
$total_elections_votes=$total_elections_votes+1;
$total=0;
//selecting candidates
$run1=$conn->query($select1);
if($run1->num_rows>0){
while($row2=$run1->fetch_array()){
78
Online Voting System | 2022-2024
$total=$total+1;
$candidates_name=$row2['candidates_name'];
$total_votes=$row2['total_votes'];
$percentage=round((($total_votes/$total_elections_votes)*100),2);
?>
<div class='mb-10'>
</p>
</div>
Winning Rate
</p>
</p>
</div>
79
Online Voting System | 2022-2024
Number of Votes
</p>
</p>
</div>
</div>
</div>
<?php
else{
?>
</p>
<?php
?>
</div>
</div>
</div>
</body>
</html>
80
Online Voting System | 2022-2024
Admin
Admin Login
<?php
session_start();
include("includes/header.php");
?>
<?php
require("includes/db.php");
$error="";
$success="";
if(isset($_POST['login'])){
$admin_email=$_POST['email'];
$admin_password=$_POST['password'];
$run=$conn->query($select);
if($run->num_rows>0){
while($row=$run->fetch_array()){
$_SESSION['admin_name']=$admin_name=$row['admin_name'];
$_SESSION['admin_email']=$admin_email=$row['admin_email'];
echo"<script>window.location.href='adminhome.php'</script>";
81
Online Voting System | 2022-2024
else{
?>
<body>
<h5 class="text-2xl">
<?php
if($error!=""){
echo $error;
if($success!="")
echo $success;
?></h5>
<form method="post">
82
Online Voting System | 2022-2024
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
</form>
</div>
</div>
<?php
include("includes/footer.php")
?>
</body>
</html>
83
Online Voting System | 2022-2024
Admin Homepage:
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-
0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmV
or" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-
pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo "<script>window.location.href='adminlogin.php'</script>";
?>
</div>
84
Online Voting System | 2022-2024
</h1>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
85
Online Voting System | 2022-2024
</div>
</div>
</div>
</body>
</html>
86
Online Voting System | 2022-2024
ID Approval:
<html>
<head>
<title>Voting System</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo "<script>window.location.href='../adminlogin.php'</script>";
?>
</div>
87
Online Voting System | 2022-2024
<th>User Email</th>
<th>User State</th>
<th>Action</th>
</tr>
<?php
$run = $conn->query($select);
if($run->num_rows > 0) {
$total = 0;
while($row = $run->fetch_array()) {
$total = $total + 1;
$id = $row['id'];
?>
</tr>
<?php
88
Online Voting System | 2022-2024
?>
</table>
</div>
<div class="">
</div>
</div>
</body>
</html>
89
Online Voting System | 2022-2024
Update ID:
<html>
<head>
<title>Update ID Request</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-
0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmV
or" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-
beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-
pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2"
crossorigin="anonymous"></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo "<script>window.location.href='../adminlogin.php'</script>";
?>
<?php
90
Online Voting System | 2022-2024
$postfix = "";
$prefix = "";
$id_generated = "";
$id = $_GET['id'];
$run = $conn->query($select);
while($row = $run->fetch_array()){
$user_email = $row['user_email'];
$user_state = $row['user_state'];
switch($user_state){
case 'Delhi':
$prefix = "del";
$postfix = "xyz";
break;
case 'up':
$prefix = "u";
$postfix = "xyz";
break;
91
Online Voting System | 2022-2024
case 'Maharastra':
$prefix = "mah";
$postfix = "xyz";
break;
?>
</div>
</div>
92
Online Voting System | 2022-2024
</div>
</div>
</form>
<?php
} else {
?>
</div>
<?php
if(isset($_POST['update'])){
$user_email = $_POST['user_email'];
$user_id_generated = $_POST['user_id_generated'];
$run = $conn->query($update);
if($run){
93
Online Voting System | 2022-2024
$del = $conn->query($delete);
if($del){
echo "<script>window.location.href='idrequest.php'</script>";
} else {
?>
</body>
</html>
94
Online Voting System | 2022-2024
<html>
<head>
<title>Voting System</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo "<script>window.location.href='../adminlogin.php'</script>";
?>
</div>
<form method="POST">
95
Online Voting System | 2022-2024
</div>
</div>
</div>
<div class='mt-8'>
</div>
</form>
</div>
</div>
<?php
$conn=new mysqli("localhost","root","","votingsystem_db");
if(isset($_POST['add_elections'])){
$elections_name=$_POST['elections_name'];
96
Online Voting System | 2022-2024
$elections_start_date=$_POST['elections_start_date'];
$elections_end_date=$_POST['elections_end_date'];
$insert="insert into
elections_tbl(elections_name,elections_start_date,elections_end_date)
values('$elections_name','$elections_start_date','$elections_end_date')";
$run=$conn->query($insert);
if($run){
else{
echo "<script>alert('Error')</script>";
?>
</body>
</html>
97
Online Voting System | 2022-2024
<html>
<head>
<title>Voting System</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo "<script>window.location.href='../adminlogin.php'</script>";
?>
</div>
98
Online Voting System | 2022-2024
<?php
$conn=new mysqli("localhost","root","","votingsystem_db");
$run=$conn->query($select);
if($run->num_rows>0){
while($row=$run->fetch_array()){
?>
<?php
?>
</select>
</div>
</div>
99
Online Voting System | 2022-2024
<div class='mt-8'>
</div>
</form>
</div>
</div>
</body>
</html>
10
0
Online Voting System | 2022-2024
<html>
<head>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo "<script>window.location.href='../adminlogin.php'</script>";
?>
</div>
10
1
Online Voting System | 2022-2024
<form method="POST">
<?php
$conn=new mysqli("localhost","root","","votingsystem_db");
$elections_name=$_GET['elections_name'];
$total_candidates=$_GET['total_candidates'];
?>
<label>Election Name</label>
</div>
<?php
for($i=1;$i<=$total_candidates;$i++){
?>
</div>
<?php
?>
<div class='mt-8'>
10
2
Online Voting System | 2022-2024
</div>
</form>
</div>
</div>
<?php
if(isset($_POST['add_details_candidates'])){
$total_candidates=$_GET['total_candidates'];
$elections_name=$_POST['elections_name'];
$candidates_name[]=$_POST['candidates_name'.$i];
for($i=0;$i<$total_candidates;$i++){
$run=$conn->query($insert);
if($run){
// add a custom message for user and redirect them to admin homepage
10
3
Online Voting System | 2022-2024
else{
echo "Error";
?>
</body>
</html>
10
4
Online Voting System | 2022-2024
Registered Candidates:
<html>
<head>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo"<script>window.location.href='../adminlogin.php'</script>";
?>
<h1>Registered Nominees</h1>
</div>
<div class='my-8'>
10
5
Online Voting System | 2022-2024
</div>
<th class='pb-2'>ID</th>
<th>NAME</th>
<th>ELECTION TYPE</th>
<th>TOTAL VOTES</th>
</tr>
<?php
define('DB_HOST','localhost');
define('DB_USER','root');
define('DB_PASS','');
define('DB_NAME','votingsystem_db');
try {
$dbh = new
PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USER,
DB_PASS,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES
'utf8'"));
$query = $dbh->prepare($sql);
$query->execute();
10
6
Online Voting System | 2022-2024
$results = $query->fetchAll(PDO::FETCH_OBJ);
$cnt = 1;
if($query->rowCount() > 0) {
foreach($results as $result) {
?>
</tr>
<?php
$cnt = $cnt + 1;
?>
</table>
</div>
</div>
</body>
</html>
10
7
Online Voting System | 2022-2024
Registered User:
<html>
<head>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo "<script>window.location.href='../adminlogin.php'</script>";
?>
<h1>Registered Users</h1>
</div>
10
8
Online Voting System | 2022-2024
</div>
<th class='pb-2'>ID</th>
<th>USERNAME</th>
<th>E-MAIL</th>
<th>GENDER</th>
<th>STATE</th>
<th>E-ID</th>
</tr>
<?php
define('DB_HOST','localhost');
define('DB_USER','root');
define('DB_PASS','');
define('DB_NAME','votingsystem_db');
try {
$dbh = new
PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USER,
10
9
Online Voting System | 2022-2024
$query = $dbh->prepare($sql);
$query->execute();
$results = $query->fetchAll(PDO::FETCH_OBJ);
$cnt = 1;
if($query->rowCount() > 0) {
foreach($results as $result) {
?>
11
0
Online Voting System | 2022-2024
</tr>
<?php
$cnt = $cnt + 1;
?>
</table>
</div>
</div>
</body>
</html>
11
1
Online Voting System | 2022-2024
Elections:
<html>
<head>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php
session_start();
if(!$_SESSION['admin_email']){
echo "<script>window.location.href='../adminlogin.php'</script>";
?>
<h1>ELECTIONS</h1>
</div>
<div class='my-8'>
11
2
Online Voting System | 2022-2024
</div>
<th>START DATE</th>
<th>END DATE</th>
</tr>
<?php
define('DB_HOST','localhost');
define('DB_USER','root');
define('DB_PASS','');
define('DB_NAME','votingsystem_db');
try {
$dbh = new
PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USER,
DB_PASS,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES
'utf8'"));
$query = $dbh->prepare($sql);
$query->execute();
$results = $query->fetchAll(PDO::FETCH_OBJ);
11
3
Online Voting System | 2022-2024
$cnt = 1;
if($query->rowCount() > 0) {
foreach($results as $result) {
?>
</tr>
<?php
$cnt = $cnt + 1;
?>
</table>
</div>
</div>
</body>
</html>
11
4
Online Voting System | 2022-2024
DataBase:
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone="+00:00";
/*!40101 SET
@OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET
@OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET
@OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-- Database: `votingsystem_db`
11
5
Online Voting System | 2022-2024
11
6
Online Voting System | 2022-2024
11
7
Online Voting System | 2022-2024
11
8
Online Voting System | 2022-2024
11
9
Online Voting System | 2022-2024
12
0
Online Voting System | 2022-2024
12
1
Online Voting System | 2022-2024
COMMIT;
/*!40101 SET
CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET
CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET
COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
12
2
Online Voting System | 2022-2024
6. . Testing
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub-assemblies, assemblies and/or a finished product It
is the process of exercising software with the intent of ensuring that the Software
system meets its requirements and user expectations and does not fail in an
unacceptable manner. There are various types of test. Each test type addresses a
specific testing requirement.
• Unit testing
Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program input produces valid outputs. All
decision branches and internal code flow should be validated. It is the testing of
individual software units of the application .it is done after the completion of an
individual unit before integration. This is a structural testing, that relies on
knowledge of its construction and is invasive. Unit tests perform basic tests at
component level and test a specific business process, application, and/or system
configuration. Unit tests ensure that each unique path of a business process
performs accurately to the documented specifications and contains clearly defined
inputs and expected results.
• Integration testing
12
3
Online Voting System | 2022-2024
• Functional test
• System Test
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration oriented system integration test.
12
4
Online Voting System | 2022-2024
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.
Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as
most other kinds of tests, must be written from a definitive source document, such
as specification or requirements document, such as specification or requirements
document. It is a testing in which the software under test is treated, as a black box.
you cannot “see” into it. The test provides inputs and responds to outputs without
considering how the software works.
• Unit Testing:
Unit testing is usually conducted as part of a combined code and unit test phase of
the software lifecycle, although it is not uncommon for coding and unit testing to
be conducted as two distinct phases.
12
5
Online Voting System | 2022-2024
Field testing will be performed manually and functional tests will be written in detail.
Test objectives
• All field entries must work properly.
Features to be tested
• Verify that the entries are of the correct format
• Integration Testing
• Testing the links that call the Change Username & password, Migration and
Synchronization screens etc.
12
6
Online Voting System | 2022-2024
• The XML file should retrieve only the records, which have been modified.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
• Acceptance Testing
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional
requirements.
• Users should have the ability to modify the privilege for a screen.
• The XML file should be generated in short time, i.e., before the next
modification occurs.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
12
7
Online Voting System | 2022-2024
• SINGLE-VOTE VERIFICATION
When election season rolls around, member-based groups have plenty on their
plates in addition to ensuring a smooth contest. Undue anxiety regarding secure
vote tabulations can be avoided if eligible voters are properly cross referenced
with actual participants.
Such verification programs are the hallmarks of any secure election system.
A secure site where members can select potential candidates and vote without any
apprehension is key to any successful election experience.
A vendor who has invested in properly configuring nomination and ballot sites
should be able to protect data and prevent malicious attacks.
When it comes to the nomination process, it’s critical members have access to a
secure site, since they’ll be inputting biographical information and potentially
uploading images.
The same goes for voting pages. Again, depending on the vendor, your
organization might have access to a secure site connected to a member’s portal
12
8
Online Voting System | 2022-2024
effectively enabling them to fill out an online ballot directly within your group’s
existing ecosystem. Hosting elections on a third-party site, typically via a secure
network, is another option.
• BALLOT TRACKING
Among other benefits, while also tracking actual votes, specialists have access to
open and click rates for online ballots, giving your group an accurate reading of
voter turnout during the election.
• DATA PRIVACY
The same goes for elections. Member-based groups make a point of protecting
constituent data. A reliable election vendor should therefore be transparent about
the collection of personal information. When interviewing potential election
management agencies, don’t forget to ask if they share data with third-party
groups. (Hint: The answer should be a forceful “No.”) Member lists should be
used exclusively for elections, and nothing else.
• TAKEAWAY
12
9
Online Voting System | 2022-2024
13
0
Online Voting System | 2022-2024
3. E-Mails: Election Committee can send the error report to a particular user if
he\she entered false
information.
4. E-SMS: People they have not internet connection they cannot check the
emails or not have email they can be informed by SMS on their mobile. Today
many websites provide free SMS to the mobile. Election Committee can use
these to send any information
Advantages:
• It reduces the paperwork and makes the work less tedious for Election
Committee.
13
1
Online Voting System | 2022-2024
9. Bibliography
https://www.w3schools.com/
https://www.phptpoint.com/
https://www.javatpoint.com/mysql-queries
https://www.w3schools.com/bootstrap/
13
2