0% found this document useful (0 votes)
37 views138 pages

Mini Project Report 2 - 2200980140041

online voting system approved by IMS NOIDA Sector 62. created by SREYANSH SAHAY MCA STUDENT 2ND YEAR. WORK PROPERLY THE PURPOSE OF THIS PROJECT IS GIVE ONLINE VOTING SYSTEM . TO CHOSSE YOUR CLASS INCHARGE, ANY MANY MORE.
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)
37 views138 pages

Mini Project Report 2 - 2200980140041

online voting system approved by IMS NOIDA Sector 62. created by SREYANSH SAHAY MCA STUDENT 2ND YEAR. WORK PROPERLY THE PURPOSE OF THIS PROJECT IS GIVE ONLINE VOTING SYSTEM . TO CHOSSE YOUR CLASS INCHARGE, ANY MANY MORE.
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/ 138

Online Voting System | 2022-2024

“Online Voting System”

MINI PROJECT REPORT (KCA-353)

SUBMITTED TO

DR. A.P.J. ABDUL KALAM TECHNICAL UNIVERSITY,


LUCKNOW
(U.P.)

FOR THE PARTIAL FULFILLMENT OF THE DEGREE OF


MASTER

IN COMPUTER APPLICATION SESSION (2023-24)

Under the Guidance of: Submitted by:

Dr. Pankaj Aggarwal Abhishek Kumar (2200980140003)


Assistant Professor Sreyansh Sahay (2200980140041)
School of IT Pratham Goyal (2200980140033)
IMS-Noida
Online Voting System | 2022-2024
Online Voting System | 2022-2024
Online Voting System | 2022-2024
Online Voting System | 2022-2024
Online Voting System | 2022-2024

INDEX

No. Description Page No.


1. Introduction 1
Project Profile
2.1 Existing System
2. 2.2 New Proposed System 2-3
2.3 Hardware & Software Requirement

Requirement Analysis
3.1 Feasibility Study
3. 3.2 Front-end and back-end selection 4-11
3.3 Project Modules

System Design & Specification


4.1 Database Table Structure
4. 4.2 E-R Diagram 12-22
4.3 Data Flow Diagram

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

“E VOTING SYSTEM” is an online voting technique. It is based on the other online


services like “ONLINE RESERVATION SYSTEM”. In this system people who have
citizenship of INDIA and whose age is above 18 years of any sex can give his\her vote
online without going to any polling booth. There is a DATABASE which is
maintained by the ELECTION COMMITEE in which all the names of voter with
complete information are stored.
Scope:

 This system will increase the voting percentage in India.

 If high security is applied then it may reduce false vote.

Objective:

• Planned approach towards working: - The working in the


organization will be well planned and organized. The data will be stored
properly in data stores, which will help in retrieval of information as
well as its storage.
• Accuracy: - The level of accuracy in the proposed system will be higher.
All operation would be done correctly and it ensures that whatever
information is coming from the centre is accurate.
• Reliability: - The reliability of the proposed system will be high due to
the above stated reasons. The reason for the increased reliability of the
system is that now there would be proper storage of information.
• No Redundancy: - In the proposed system utmost care would be that
no information is repeated anywhere, in storage or otherwise. This
would assure economic use of storage space and consistency in the data
stored.
• Immediate retrieval of information: - The main objective of proposed
system is to provide for a quick and efficient retrieval of information.
• Immediate storage of information: - In manual system there are many
problems to store the largest amount of information.

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.

2.2 New Proposed System

The online voting system is for the citizens from all over India that consists of the
data and information

1. Voter’s Id

2. Calculation of total votes

3. Checking information by the voter

4. Remove wrong information

2
Online Voting System | 2022-2024

2.3 Hardware & Software Requirement

Hardware

A laptop with the following specification

• Operating system: windows XP, windows 7 or windows 8

• Hard disk: at least 60 GB

• RAM: at least 1 GB

• Processor: Intel Pentium IV 3.5.2

Software

• PHP programming language

• MySQL Database

• JavaScript for client-side validation

• HTML for web page’s structure.

• CSS (cascaded style sheets) for presentation

3
Online Voting System | 2022-2024

3. Requirement Analysis

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

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?

• 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:

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 benefits in the form of reduced cost.

• 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

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.

6
Online Voting System | 2022-2024

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

Back-end Selection:

1. Multiple user support.

2. Efficient data handling.

7
Online Voting System | 2022-2024

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 SQL Server 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 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

3.3 Project Modules

1. Home Page:

 The landing page of the application.

 Provides an overview of the system and its features.

 May include links or buttons to navigate to other sections of the application.

2. User Registration Page:

 Allows new users to register themselves.

 Collects necessary information for voter registration.

 Validates and stores user information in the User Registration Database.

3. Login Page:

 Provides a login interface for registered users.

 Users enter their credentials to access the system.

 Authentication process to verify user identity.

4. Admin Login Page:

 Specific login page for administrators.

 Grants access to administrative functionalities and controls.

 Requires admin credentials for authentication.

5. ID Generate Page:

 Allows voters to request a unique ID.

 Captures necessary details for ID generation.

 Submits a request to the admin for approval.

6. Update ID Page by Admin:

 Admin interface to review and approve ID requests.

9
Online Voting System | 2022-2024

 Generates a unique ID for approved requests.

 Updates the ID Request Database with the assigned IDs.

7. User Login Home Page:

 Home page for registered users after successful login.

 Provides access to various user-specific functionalities.

8. Stats of Database:

 Displays statistics related to the user and election databases.

 Information may include the number of registered users, elections, and other
relevant metrics.

9. Result Page:

 Allows users to view the results of completed elections.

 Displays outcome details and possibly analytics.

10. Election Voting Page:

 Enables voters to cast their votes in ongoing elections.

 Presents a list of available elections for user selection.

 Records and updates votes in the Election Database.

11. Add New Election:

 Admin functionality to add new elections to the system.

 Captures details such as election name, date, and other relevant information.

12. Add Nominees in Election:

 Admin module to add candidates (nominees) to specific elections.

 Associates’ candidates with their respective elections.

13. Admin Home Page:

 Dashboard for the administrator after successful login.

10
Online Voting System | 2022-2024

 Provides access to various administrative functionalities and controls.

14. Logout:

 Allows users (both voters and admin) to log out of their accounts.

 Terminates the current session and returns to the login page.

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

4. System Design & Specification

INPUT DESIGN:

Input design is a part of overall system design. The main objective during the input
design is as given below:

• To produce a cost-effective method of input.

• To achieve the highest possible level of accuracy.

• To ensure that the input is acceptable and understood by the user.

INPUT STAGES:

The main input stages can be listed as below:

• Data recording

• Data transcription

• Data conversion

• Data verification

• Data control

• Data transmission

• Data validation

• Data correction

12
Online Voting System | 2022-2024

INPUT TYPES:

It is necessary to determine the various types of inputs. Inputs can be categorized as


follows:

• External inputs, which are prime inputs for the system.

• Internal inputs, which are user communications with the system.

• Operational, which are computer department’s communications to the


system?

• Interactive, which are inputs entered during a dialogue.

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

• Storage and handling requirements

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

• Operational outputs whose use is purely with in the computer department.

• Interface outputs, which involve the user in communicating directly with the
system.

OUTPUT DEFINITION

The outputs should be defined in terms of the following points:

• Type of the output

• Content of the output

• Format of the output

14
Online Voting System | 2022-2024

• Location of the output

• Frequency of the output

• Volume of the output

• Sequence of the output

It is not always desirable to print or display data as it is held on a computer. It should


be decided as which form of the output is the most suitable.

For Example

• Will decimal points need to be inserted

• Should leading zeros be suppressed.

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.

• The need for a hard copy.

• The response time required.

• The location of the users

• The software and hardware available.

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 preliminary design is created for the new 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

A second prototype is evolved by a fourfold procedure:

1. Evaluating the first prototype in terms of its strengths, weakness, and risks.

2. Defining the requirements of the second prototype.

3. Planning and designing the second prototype.

4. Constructing and testing the second prototype.

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.

• The final system is constructed, based on the refined prototype.

• The final system is thoroughly evaluated and tested. Routine maintenance is


carried on a continuing basis to prevent large scale failures and to minimize
down time.

17
Online Voting System | 2022-2024

4.1 Database Table Structure


User Registration Table: -

Id_request_table: -

Elections_table: -

Elections_candidates_table: -

Results_table: -

18
Online Voting System | 2022-2024

4.2 E-R Diagram

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

4.3 Data Flow Diagram

DFD: Level 0-:

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

DFD: Level 2-:

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

5.1 System Implementation Technologies

The web-based OVS was developed as an online information system to offer


users convenient access to the voter register. Several tools used during
implementation include the following:

• MYSQL DBMS – It allows combination, extraction, manipulation and


organization of

Data in the voters‟ database. It is platform independent and therefore can


be implemented and used across several such as windows, linux server and
is compatible with various Hardware mainframes. It is fast in performance,
stable and provides business value at a low cost.
• HTML – Hypertext Markup Language – This is currently the core of the
web world, it is a language used to makeup web page. It is the glue that holds
everything together. Although HTLM was used for the implementation of the
OVS, it is highly compatible with extensible HTML (XHTML) which is
designed to be a replacement of HTML made to handle data and is also
portable between different browsers and platforms with little or no alterations
in code. Macromedia Dreamweaver is a prefer tool for designing HTML pages
and that is the tool used in coming up with this OVS system.
• CSS- Cascading Style Sheet – This is for giving the styling for image and
fonts and maintains user interface.
• PHP coding – This is for advanced user who find PHP codes easy to work
with.

• Web browsers: Mozilla Firefox, Google chrome, Opera and Internet Explore

23
Online Voting System | 2022-2024

5.2 Form Layout

Home Page:

Registration Page:

24
Online Voting System | 2022-2024

User Login:

Welcome Page:

25
Online Voting System | 2022-2024

Id request to validate the user :

Vote :

26
Online Voting System | 2022-2024

Class Incharge vote:

Admin Login:

27
Online Voting System | 2022-2024

Admin Home:

ID Approval:

28
Online Voting System | 2022-2024

Update ID:

Add new elections:

29
Online Voting System | 2022-2024

Add Election Nominees:

30
Online Voting System | 2022-2024

5.3 Report Layout

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");

?>

<div class="flex flex-col lg:flex-row items-center justify-evenly w-full min-h-full py-


28 lg:px-20 bg-[#C4DDFF]">

<div class="row1 w-[80%] md:w-[65%] lg:w-[50%] xl:w-[40%] 2xl:w-[30%]


lg:mr-8">

<h4 class="text-6xl font-bold text-gray-600 mb-20 ">Cast your vote from


anywhere in the world with just a few clicks</h4>

<ul class='list-disc text-3xl'>

<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'>

Your Vote remains anonymous as our system's architecture strictly seprates


your personal data from the electronic ballot

</li>

</ul>

</div>

<div class="row2 w-[80%] lg:w-[50%] xl:w-[40%] 2xl:w-[30%] rounded-2xl">

<img src="image/1.jpg" class="bg-cover rounded-3xl"/>

</div>

</div>

<?php

include("includes/footer.php")

?>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</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'];

$check = "select * from user_db where user_email='$user_email'";

$exe = $conn->query($check);

if($exe->num_rows > 0){

$emailError = "<p class='text-4xl text-bolder mt-5 text-center text-red-


700'>Email already registered</p>";

else{

$insert = "insert into


user_db(user_name,user_email,user_gender,user_state,user_password)

36
Online Voting System | 2022-2024

values('$user_name','$user_email','$user_gender','$user_state','$user_password')";

$run = $conn->query($insert);

if($run){

$accountSuccess = "<p class='text-4xl text-bolder mt-5 text-center text-green-


400'>Account Created Successfully</p>";

else{

echo "Error";

?>

<body>

<!-- main -->

<div class='flex flex-col h-full w-full bg-[#C4DDFF] items-center justify-center'>

<!-- 1 -->

<div class="title my-20">

<h3 class="text-6xl font-bold tracking-wider text-slate-600 mt-30">User


Registration</h3>

<?php

if($emailError != ""){

echo $emailError;

if($accountSuccess != ""){

echo $accountSuccess;

37
Online Voting System | 2022-2024

?>

</div>

<!-- 2 -->

<div class="content bg-[#7FB5FF] mb-28 rounded-2xl shadow-2xl px-52 py-10 w-


[100%] md:w-[70%] lg:w-[60%] xl:w-[40%]">

<form method="post">

<div class="my-6">

<label for="Username">Full Name</label>

<input type="text" name="fullname" class="mt-1 px-3 py-2 bg-white border


shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-
sky-500 focus:ring-sky-500 block w-full rounded-md text-2xl focus:ring-1" required>

</div>

<div class="my-6">

<label for="InputEmail">Email</label>

<input type="email" name="email" class="mt-1 px-3 py-2 bg-white border


shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none focus:border-
sky-500 focus:ring-sky-500 block w-full rounded-md text-2xl focus:ring-1" required>

</div>

<div class="my-6">

<label for="Gender">Gender</label>

<select name="gender" class="mt-1 px-3 py-2 bg-white border shadow-sm


border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500
focus:ring-sky-500 block w-full rounded-md text-2xl focus:ring-1" required>

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

<select name="state" class="mt-1 px-3 py-2 bg-white border shadow-sm


border-slate-300 placeholder-slate-400 focus:outline-none focus:border-sky-500
focus:ring-sky-500 block w-full rounded-md text-2xl focus:ring-1" required>

<option value="">Select</option>

<option value="Delhi">Delhi</option>

<option value="up">Uttar Pardesh</option>

<option value="Maharastra">Maharashtra</option>

</select>

</div>

<div class="my-6">

<label for="password">Password</label>

<input type="password" name="password" class="mt-1 px-3 py-2 bg-white


border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none
focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md text-2xl focus:ring-
1" required>

</div>

<div class="my-6">

<button type="submit" class="w-full px-10 mt-2 shadow-xl py-4 border-2


text-3xl font-semibold tracking-wider text-white rounded-2xl hover:animate-bounce"
name="register">REGISTER</button>

</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'];

$select = "select * from user_db where user_email='$user_email' and


user_password='$user_password'";

$run = $conn->query($select);

if($run->num_rows > 0){

while($row = $run->fetch_array()){

$_SESSION['user_name'] = $user_name = $row['user_name'];

$_SESSION['user_email'] = $user_email = $row['user_email'];

echo "<script>window.location.href='welcome.php'</script>";

41
Online Voting System | 2022-2024

else{

$error = "Invalid Email or Password! Try Again";

?>

<body class="flex flex-col items-center justify-evenly w-full h-full bg-[#C4DDFF]">

<div class="containe flex flex-row justify-evenly items-center w-full h-max px-


10">

<div class="row1 w-[50%] lg:w-[40%] xl:w-[32%] 2xl:w-[25%]">

<img src="image/login.png" class='w-[100%] lg:w-[80%] animate:t lg:w-full'


alt="login">

</div>

<div class="row2 w-[50%] lg:w-[40%] bg-[#7FB5FF] shadow-lg px-4 py-2


rounded-2xl my-10">

<div class="flex flex-col justify-start items-center my-28">

<h3 class="text-5xl lg:text-6xl font-bold mt-6 mb-24"


style="color:white;">USER LOGIN</h3>

<h5 class="text text-center text-danger">

<?php

if($error != ""){

echo $error;

if($success != ""){

echo $success;

?>

42
Online Voting System | 2022-2024

</h5>

<form method="post" class="w-[80%] lg:w-[70%] xl:w-[50%] flex items-


center flex-col ">

<div class="form-group shadow-xl mb-8 w-full md:w-[80%] flex justify-


center items-center">

<input type="email" name="email" class="mt-1 px-3 py-2 bg-white


border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none
focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md text-2xl
focus:ring-1" placeholder="you@example.com" required />

</div>

<div class="form-group shadow-xl mb-8 w-full md:w-[80%] flex justify-


center items-center">

<input type="password" name="password" class="mt-1 px-3 py-2 bg-


white border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none
focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md text-2xl
focus:ring-1" placeholder="Password" required>

</div>

<div class="form-group">

<button type="submit" class="w-full px-10 mt-14 shadow-xl py-4


border-2 text-3xl font-semibold tracking-wider text-white rounded-2xl hover:animate-
bounce" name="login">LOGIN</button>

</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='bg-[#C4DDFF] w-full h-full'>

<nav class="navbar navbar-expand-lg" style="background-color: #7FB5FF;">

<div class="container-fluid">

<a class="navbar-brand text-2xl" href="/voting/welcome.php">E-VOTE</a>

45
Online Voting System | 2022-2024

<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-


bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-
expanded="false" aria-label="Toggle navigation">

<span class="navbar-toggler-icon"></span>

</button>

<div class=" navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0 transistion-all ease-in-out


duration-300">

<li class="nav-item">

<a class="nav-link active text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" aria-current="page" href="welcome.php">Home</a>

</li>

<li class="nav-item">

<a class="nav-link text-gray-700 text-lg hover:text-xl hover:text-


black" href="idgenerate.php">ID Generate</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" href="elections.php">Election</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" href="results.php">Results</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" href="vote.php">Vote</a>

46
Online Voting System | 2022-2024

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" href="logout.php">Logout</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" href=""><?php echo $_SESSION['user_name'];?></a>

</li>

</ul>

</div>

</div>

</nav>

<!-- body -->

<div class="body pt-16 flex flex-col bg-[#C4DDFF] items-center justify-


between">

<!-- body main -->

<div class="main flex flex-col lg:flex-row lg:pt-38 w-full px-20 items-center


justify-center">

<!-- row 1 -->

<div class="row1 w-full flex flex-col justify-evenly items-center my-10 lg:w-


[50%]">

<div class='border-2 w-max px-6 py-7 rounded-2xl shadow-2xl bg-


[#FEE2C5]'>

47
Online Voting System | 2022-2024

<h4 class="text-2xl font-bold uppercase tracking-wider text-slate-


600">How to Caste Your Vote?</h4>

</div>

<div>

<ul class='list-disc'>

<li class='my-3 text-lg'>First Select <b>"ID Generate"</b> from


navigation bar.</li>

<li class='my-3 text-lg'>Then send request to <b>"Admin"</b> from


Generate Your ID.</li>

<li class='my-3 text-lg'>Click on the <b>"Election"</b> from


Navigation bar.</li>

<li class='my-3 text-lg'>Select availabe election</li>

<li class='my-3 text-lg'>The secrecy of your ballot is maintained under


the high security standards adhedred to online voting software</li>

<li class='my-3 text-lg'>Your vote remains anonymous as our system's


architecture strictly seprates your personal data from the electronic ballot</li>

</ul>

</div>

</div>

<!-- row 2 -->

<div class="row2 w-full md:ml-10 md:w-[60%] lg:w-[45%] xl:w-[30%] mb-


10 flex flex-row items-center">

<img src="image/1.jpg" class="rounded-2xl shadow-xl"/>

</div>

<!-- body main ends -->

48
Online Voting System | 2022-2024

</div>

<!-- footer -->

<div class="containe bg-[#C4DDFF] w-full bottom-0 pb-5">

<div class="py-5 h-28 flex flex-col justify-between items-center">

<h4 class="text-2xl tracking-wide text-[#001D6E] font-semibold">


Developed By Sreyansh Sahay</h4>

<h3 class="text-xl text-[#001D6E] font-semibold tracking-


wider">Copyright ©2022 All Rights Reserved To The Creator</h3>

</div>

</div>

</div>

</div>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</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='w-full h-full bg-[#C4DDFF]'>

<nav class="navbar navbar-expand-lg" style="background-color: #7FB5FF;">

<div class="container-fluid">

50
Online Voting System | 2022-2024

<a class="navbar-brand text-2xl" href="#">E-VOTE</a>

<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-


target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-
expanded="false" aria-label="Toggle navigation">

<span class="navbar-toggler-icon"></span>

</button>

<div class="navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0 transistion-all ease-in-out duration-


300">

<li class="nav-item">

<a class="nav-link active text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" aria-current="page" href="welcome.php">Home</a>

</li>

<li class="nav-item">

<a class="nav-link text-gray-700 text-lg hover:text-xl hover:text-black"


href="idgenerate.php">ID Generate</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="elections.php">Election</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="results.php">Results</a>

</li>

<li class="nav-item">

51
Online Voting System | 2022-2024

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="vote.php">Vote</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="logout.php"><?php echo $_SESSION['user_name'];?></a>

</li>

</ul>

</div>

</div>

</nav>

<div class=' w-full bg-[#C4DDFF] '>

<div class='pt-14 flex justify-evenly items-center flex-col lg:flex-row'>

<!-- 1 -->

<div class='w-[90%] sm:w-[70%] md:w-[55%] xl:w-[35%] bg-[#7FB5FF] shadow-lg


px-10 py-2 rounded-2xl flex justify-center items-center'>

<?php

require("includes/db.php");

$user_email=$_SESSION['user_email'];

$select ="select * from id_request_tbl where user_email='$user_email'";

$run=$conn->query($select);

if($run->num_rows>0){

?>

<div class="w-[70%] text-white text-3xl text-bold">

52
Online Voting System | 2022-2024

<h4> Your Request already submitted</h4>

</div>

<?php

else{

$select="select* from user_db where user_email='$user_email'";

$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 class="w-[70%] b text-white text-3xl text-bold">

<h4>Your ID is "<span class="text text-danger"><?php echo


$user_id_generated ?></span>"</h4>

<p><b>Note:</b> Use this is with your login pass to caste your


vote</p>

</div>

<?php

}else{

53
Online Voting System | 2022-2024

?>

<form method="post" class='w-full py-2 md:w-[80%] lg:w-[60%]'>

<div class="form-grou my-4">

<label class='text-[#001D6E] text-bold tracking-wide'


for="InputEmail">User Name</label>

<input type="name" name="user_name" class="mt-1 px-3 py-2


bg-white border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-
none focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md text-md
focus:ring-1" placeholder="Enter Email" required value="<?php echo
$user_name;?>" readonly>

</div>

<div class="form-grou my-4">

<label class='text-[#001D6E] text-bold tracking-wide'


for="password">Email address</label>

<input type="Email" name="user_email" class="mt-1 px-3 py-


2 bg-white border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-
none focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md text-md
focus:ring-1" placeholder="Enter Password" required value="<?php echo
$user_email;?>" readonly>

</div>

<div class="form-grou my-4">

<label class='text-[#001D6E] text-bold tracking-wide'


for="password">State</label>

<input type="state" name="user_state" class="mt-1 px-3 py-2


bg-white border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-
none focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md text-md
focus:ring-1" placeholder="Enter Password" required value="<?php echo
$user_state;?>" readonly>

54
Online Voting System | 2022-2024

</div>

<div class="w-full">

<button type="submit" class="scale-100 hover:scale-90


transition ease-in-out duration-300 w-full mt-6 shadow-xl py-3 border-2 text-xl font-
semibold tracking-wider text-white rounded-2xl " name="idrequest">ID
Request</button>

</div>

</form>

<?php

?>

<?php

if(isset($_POST['idrequest'])){

$user_email=$_POST['user_email'];

$user_state=$_POST['user_state'];

require("includes/db.php");

$insert="insert into id_request_tbl (user_email, user_state)


values('$user_email','$user_state')";

$run=$conn->query($insert);

if($run){

echo "Your request has been submitted Successfully!";

// header("location:welcome.php");

else

55
Online Voting System | 2022-2024

echo"Error";

?>

</div>

<!-- 2 -->

<div class="w-[58%] pb-6 lg:w-[45%] xl:w-[35%] 2xl:w-[25%] mt-10">

<img src="image/vote.png"class="img img-responsive" />

</div>

</div>

</div>

<div class="containe bg-[#C4DDFF] w-full fixed bottom-0 pb-5">

<div class="py-5 h-28 flex flex-col justify-between items-center">

<h4 class="text-2xl tracking-wide text-[#001D6E] font-semibold">


Developed By Sreyansh Sahay</h4>

<h3 class="text-xl text-[#001D6E] font-semibold tracking-wider">Copyright


©2022 All Rights Reserved To The Creator</h3>

</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='w-full h-full bg-[#C4DDFF]'>

<nav class="navbar navbar-expand-lg" style="background-color: #7FB5FF;">

<div class="container-fluid">

57
Online Voting System | 2022-2024

<a class="navbar-brand text-2xl" href="/voting/welcome.php">E-VOTE</a>

<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-


target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-
expanded="false" aria-label="Toggle navigation">

<span class="navbar-toggler-icon"></span>

</button>

<div class="navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0 transistion-all ease-in-out duration-


300">

<li class="nav-item">

<a class="nav-link active text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" aria-current="page" href="welcome.php">Home</a>

</li>

<li class="nav-item">

<a class="nav-link text-gray-700 text-lg hover:text-xl hover:text-black"


href="idgenerate.php">ID Generate</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="elections.php">Election</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="results.php">Results</a>

</li>

<li class="nav-item">

58
Online Voting System | 2022-2024

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="vote.php">Vote</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="logout.php"><?php echo $_SESSION['user_name'];?></a>

</li>

</ul>

</div>

</div>

</nav>

<div class="w-full mt-10 Container flex items-center justify-center ">

<h3 class='text-4xl fw-bold text-gray-600' >

Vote In Election

</h3>

</div>

<div class="w-full flex justify-center items-center">

<div class="w-full w-[50%] lg:w-[40%] bg-[#7FB5FF] shadow-lg px-4 py-2


rounded-2xl my-10 flex flex-col justify-start items-center my-28">

<form method="post" class='"w-[80%] lg:w-[70%] xl:w-[50%] flex items-


center flex-col'>

<div class="form-group my-2">

<label for="InputEmail">Your ID </label>

59
Online Voting System | 2022-2024

<input type="text" name="user_id" class="form-control"


placeholder="Your ID" required>

</div>

<div class="form-group my-2">

<label for="password">Password</label>

<input type="password" name="user_password" class="form-


control" placeholder="Enter Password" required>

</div>

<div class="form-group my-3">

<button type="submit" class="btn btn-success btn-block"


name="login">Enter Voting Area</button>

</div>

</form>

</div>

</div>

<?php

require("includes/db.php");

if(isset($_POST['login'])){

$user_id= $_POST['user_id'];

$user_password=$_POST['user_password'];

$select="select * from user_db where user_password='$user_password' and


user_id_generated='$user_id'";

$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{

echo "Your ID or Password invalid";

?>

</div>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</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='w-full h-full bg-[#C4DDFF]'>

<nav class="navbar navbar-expand-lg" style="background-color: #7FB5FF;">

<div class="container-fluid">

<a class="navbar-brand text-2xl" href="#">E-VOTE</a>

62
Online Voting System | 2022-2024

<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-


target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-
expanded="false" aria-label="Toggle navigation">

<span class="navbar-toggler-icon"></span>

</button>

<div class="navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0 transistion-all ease-in-out duration-


300">

<li class="nav-item">

<a class="nav-link active text-bold text-gray-700 text-lg hover:text-xl


hover:text-black" aria-current="page" href="welcome.php">Home</a>

</li>

<li class="nav-item">

<a class="nav-link text-gray-700 text-lg hover:text-xl hover:text-black"


href="idgenerate.php">ID Generate</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="results.php">Results</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="vote.php">Vote</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl hover:text-


black" href="logout.php"><?php echo $_SESSION['user_name'];?></a>

63
Online Voting System | 2022-2024

</li>

</ul>

</div>

</div>

</nav>

<div class="w-full mt-10 Container flex items-center justify-center ">

<h3 class='text-4xl fw-bold text-gray-600'>

Vote In Election

</h3>

</div>

<div class="w-full flex flex-col justify-center items-center">

<div class="w-full w-[50%] lg:w-[30%] bg-[#7FB5FF] shadow-lg px-4 py-2


rounded-2xl my-10 flex flex-col justify-start items-center my-28">

<form method="post" class='w-[80%] lg:w-[60%] xl:w-[50%] flex


flex-col justify-center items-center min-h-36 flex-col py-10'>

<select class="form-control my-10" name="elections_name">

<option value="" selected="selected">Select


Election</option>

<?php

require("includes/db.php");

$select="select * from elections_tbl";

$run=$conn->query($select);

if($run->num_rows>0){

while($row=$run->fetch_array()){

64
Online Voting System | 2022-2024

?>

<option value="<?php echo


$row['elections_name'];?>"><?php echo $row['elections_name'];?></option>

<?php

?>

</select>

<button class='px-5 py-2 border-3 text-xl font-bold rounded-xl


shadow-xl hover:bg-green-600 bg-green-600/75 text-white' type="submit"
name="search_candidate" class="btn btn-success">Submit</button>

</form>

</div>

<?php

date_default_timezone_set("Asia/Kolkata");

if(isset($_POST['search_candidate'])){

$elections_name=$_POST['elections_name'];

$select="select * from elections_tbl where


elections_name='$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){

?>

<div class='flex flex-col py-5 items-center'>

<h3 class='px-5 py-2 border-3 text-xl font-bold text-red-


600/75'>

Election is yet to start..!!

</h3>

<a class='px-8 py-3 mt-5 border-3 text-xl font-bold rounded-xl


shadow-xl hover:bg-cyan-600 bg-cyan-600/75 text-white'
href="/voting/welcome.php">Back To Home</a>

</div>

<?php

else if($current_ts>$elections_end_date_ts){

?>

<div class='flex flex-col py-5 items-center'>

<h3 class='px-5 py-2 border-3 text-xl font-bold text-red-


600/75'>

Election closed..!!

</h3>

66
Online Voting System | 2022-2024

<a class='px-8 py-3 mt-5 border-3 text-xl font-bold rounded-xl


shadow-xl hover:bg-cyan-600 bg-cyan-600/75 text-white'
href="/voting/welcome.php">Back To Home</a>

</div>

<?php

else{

?>

<a class='px-5 py-2 border-3 text-xl font-bold rounded-xl shadow-xl


hover:bg-blue-600 bg-blue-600/75 text-white'
href="votecaste.php?elections_name=<?php echo str_replace('
','_',$elections_name);?>">Click Here To Go To Voting Page</a>

<?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();

?>

<div class="w-full h-full bg-[#C4DDFF]">

68
Online Voting System | 2022-2024

<nav class="navbar navbar-expand-lg" style="background-color: #7FB5FF;">

<div class="container-fluid">

<a class="navbar-brand text-2xl" href="#">E-VOTE</a>

<button class="navbar-toggler" type="button" data-bs-toggle="collapse"

data-bs-target="#navbarSupportedContent" aria-
controls="navbarSupportedContent"

aria-expanded="false" aria-label="Toggle navigation">

<span class="navbar-toggler-icon"></span>

</button>

<div class=" navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0 transistion-all ease-in-out


duration-300">

<li class="nav-item">

<a class="nav-link active text-bold text-gray-700 text-lg hover:text-


xl hover:text-black"

aria-current="page" href="welcome.php">Home</a>

</li>

<li class="nav-item">

<a class="nav-link text-gray-700 text-lg hover:text-xl hover:text-


black"

href="idgenerate.php">ID Generate</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black"

href="results.php">Results</a>

69
Online Voting System | 2022-2024

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black"

href="vote.php">Vote</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black"

href="logout.php"><?php echo $_SESSION['user_name'];?></a>

</li>

</ul>

</div>

</div>

</nav>

<div class="container mt-10 w-full">

<div class="col-md-6 col-md-offset-3">

<form method="post" action="">

<?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

<input type='text' value='<?php echo $elections_name;?>'

class=' px-1 py-1 bg-green-500/75 font-bold text-xl tracking-wide


text-gray-100 text-center rounded-lg'

readonly />

</div>

<?php

$select="select * from candidates_tbl where


elections_name='$elections_name'";

$run=$conn->query($select);

if($run->num_rows>0){

while($row=$run->fetch_array()){

?>

<div class="flex flex-row items-center my-3">

<input type="radio" name="candidates_name" class="list-group mr-5"

value="<?php echo $row['candidates_name'];?>">

<label><?php echo $row['candidates_name'];?></label>

</div>

<?php

?>

<input type="submit" name="vote_caste"

class="bg-blue-500 rounded-lg px-7 py-3 font-bold text-white


hover:bg-blue-700/75 tracking-wide text-xl lg:text-2xl"

value="VOTE">

</form>

71
Online Voting System | 2022-2024

</div>

<div class='text-2xl font-semibold'>

<?php

if(isset($_POST['vote_caste'])){

$candidates_name=$_POST['candidates_name'];

$user_email=$_SESSION['user_email'];

$select="select * from results_tbl where user_email='$user_email' and


elections_name='$elections_name'";

$exe1=$conn->query($select);

if($exe1->num_rows>0){

echo " You already cast your vote against election


".$elections_name;

else{

$insert ="insert into results_tbl


(user_email,candidates_name,elections_name)values('$user_email','$candidates_nam
e','$elections_name')";

$run=$conn->query($insert);

if($run){

$update="update candidates_tbl set


total_votes=`total_votes`+'1' where candidates_name='$candidates_name' and
elections_name='$elections_name'";

$exe=$conn->query($update);

if($exe){

echo "You have successfully voted ";

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="w-full min-h-full bg-[#C4DDFF]">

<nav class="navbar navbar-expand-lg" style="background-color: #7FB5FF;">

<div class="container-fluid">

74
Online Voting System | 2022-2024

<a class="navbar-brand text-2xl" href="#">E-VOTE</a>

<button class="navbar-toggler" type="button" data-bs-toggle="collapse"

data-bs-target="#navbarSupportedContent" aria-
controls="navbarSupportedContent"

aria-expanded="false" aria-label="Toggle navigation">

<span class="navbar-toggler-icon"></span>

</button>

<div class="navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0 transistion-all ease-in-out


duration-300">

<li class="nav-item">

<a class="nav-link active text-bold text-gray-700 text-lg hover:text-


xl hover:text-black"

aria-current="page" href="welcome.php">Home</a>

</li>

<li class="nav-item">

<a class="nav-link text-gray-700 text-lg hover:text-xl hover:text-


black"

href="idgenerate.php">ID Generate</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black"

href="results.php">Results</a>

</li>

<li class="nav-item">

75
Online Voting System | 2022-2024

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black"

href="vote.php">Vote</a>

</li>

<li class="nav-item">

<a class="nav-link text-bold text-gray-700 text-lg hover:text-xl


hover:text-black"

href="logout.php"><?php echo $_SESSION['user_name'];?></a>

</li>

</ul>

</div>

</div>

</nav>

<!-- main body -->

<div class='flex flex-col w-full items-center'>

<!-- election result form -->

<div class='w-[80%] mb-20'>

<form class='flex flex-col items-center' method="post" action ="">

<div class="form-grou w-[50%] lg:w-[30%] 2xl:w-[15%] my-10">

<select class="form-control py-2 font-semibold text-lg"


name="elections_name">

<option selected="selected" value="">Select Election</option>

<?php

$current_ts=time();

require("includes/db.php");

$select="select * from elections_tbl";

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){

?>

<option value="<?php echo $elections_name;?>"><?php echo


$elections_name;?></option>

<?php

?>

</select>

</div>

<div class="form-group">

<input type="submit" name="search_results"

class="bg-blue-500 rounded-lg px-7 py-3 font-bold text-white


hover:bg-blue-700/75 tracking-wide text-xl lg:text-2xl"

value="Search Results">

77
Online Voting System | 2022-2024

</div>

</form>

</div>

<!-- election result table -->

<div class='flex flex-wrap items-center mb-10 justify-center w-[80%]'>

<?php

if(isset($_POST['search_results'])){

//counting total votes

$elections_name=$_POST['elections_name'];

$select="select * from results_tbl where


elections_name='$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

$select1="select * from candidates_tbl where


elections_name='$elections_name'";

$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);

?>

<!-- card -->

<div class='flex flex-col items-center cursor-pointer bg-red-100 rounded-xl


h-max my-5 mx-5 py-5 w-[80%] sm:w-[60%] md:w-[50%] lg:w-[40%] xl:w-[25%]
bg-gray-500 rounded-lg bg-clip-padding backdrop-filter backdrop-blur-lg bg-opacity-
10 border-2 border-gray-100 shadow-xl hover:shadow-lg'>

<div class='mb-10'>

<p class='text-teal-800 text-2xl font-bold tracking-wide uppercase'>

<?php echo $candidates_name;?>

</p>

</div>

<div class='flex flex-row items-center justify-evenly w-full'>

<div class='flex flex-col items-center'>

<p class='text-teal-700 font-semibold tracking-wide'>

Winning Rate

</p>

<p class='text-gray-600 text-2xl font-semibold tracking-wide'>

<?php echo $percentage;?>%

</p>

</div>

<div class='flex flex-col items-center'>

<p class='text-teal-700 font-semibold tracking-wide'>

79
Online Voting System | 2022-2024

Number of Votes

</p>

<p class='text-gray-600 text-2xl font-semibold tracking-wide'>

<?php echo $total_votes;?>/<?php echo $total_elections_votes;?>

</p>

</div>

</div>

</div>

<?php

else{

?>

<p class='text-2xl text-red-600 font-semibold tracking-wide'>

Record Not Found..!!!

</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'];

$select="select * from adminuser_db where admin_email='$admin_email' and


admin_password='$admin_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{

$error="Invalid Email or Password! Try Again";

?>

<body>

<div class='flex flex-col justify-center items-center h-full bg-[#C4DDFF]'>

<div class="flex flex-col justify-center items-center w-max py-16 px-24 bg-


[#7FB5FF] rounded-2xl shadow-2xl">

<h3 class="text-4xl bg-[#001D6E] text-white px-5 py-3 mb-20 rounded-2xl" >Admin


Login</h3>

<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">

<input type="email" name="email" class="mt-1 px-3 py-2 bg-white


border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none
focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md text-2xl
focus:ring-1" placeholder="admin@xyz.com" required>

</div>

<div class="form-group">

<input type="password" name="password" class="mt-1 px-3 py-2 bg-


white border shadow-sm border-slate-300 placeholder-slate-400 focus:outline-none
focus:border-sky-500 focus:ring-sky-500 block w-full rounded-md text-2xl
focus:ring-1" placeholder="Password" required>

</div>

<div class="form-group">

<button type="submit" class="w-full px-10 mt-14 shadow-xl py-4


border-2 text-3xl font-semibold tracking-wider text-white rounded-2xl hover:animate-
bounce" name="login">login</button>

</div>

</form>

</div>

</div>

<?php

include("includes/footer.php")

?>

</body>

</html>

83
Online Voting System | 2022-2024

Admin Homepage:

<head>

<title>Admin Panel | 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['admin_email']){

echo "<script>window.location.href='adminlogin.php'</script>";

?>

<div class='bg-[#C4DDFF] w-full min-h-full flex flex-col justify-between items-


center'>

<div class='w-72 lg:w-96 mt-16'>

<img src="image/vote1.png" alt="vote.png">

</div>

84
Online Voting System | 2022-2024

<!-- body -->

<div class='flex flex-col justify-center mb-10 items-center'>

<div class='flex justify-center mt-10 items-center'>

<h1 class='text-3xl font-semibold tracking-wide text-gray-600 text-center'>

Welcome <span class='capitalize'><?php echo


$_SESSION['admin_name'];?></span> in the Admin Panel

</h1>

</div>

<div class="flex flex-col justify-center items-center lg:flex-row">

<div class='flex flex-col lg:flex-row justify-center items-center mt-20


transistion-all duration-300 ease-in-out lg:mr-10'>

<!-- PHP Code Snippet -->

</div>

</div>

<!-- buttons -->

<div class="flex flex-col justify-center items-center lg:flex-row">

<div class='flex flex-row justify-center items-center mt-20 transistion-all


duration-300 ease-in-out lg:mr-10'>

<!-- Buttons -->

</div>

<div class='flex flex-row justify-center items-center mt-20 transistion-all


duration-300 ease-in-out'>

<!-- Buttons -->

</div>

</div>

</div>

85
Online Voting System | 2022-2024

<div class="containe bg-[#7FB5FF] w-full bottom-0 py-4">

<div class="flex flex-col justify-between items-center">

<h4 class="text-lg tracking-wide text-[#001D6E] font-semibold">


Developed By Sreyansh Sahay</h4>

<h3 class="text-md text-[#001D6E] font-semibold tracking-


wider">Copyright ©2022 All Rights Reserved To The Creator</h3>

</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 class='w-full min-h-full flex flex-col justify-evenly items-center bg-


[#C4DDFF] '>

<div class='text-center text-[#001D6E] text-4xl font-bold tracking-wide w-full '>

<h1>Approve Users For Voting</h1>

</div>

<div class='w-full flex items-center justify-center'>

<table class="w-full mx-5 lg:w-[50%]">

<tr class='bg-[#001D6E] text-center text-gray-300 h-20'>

<th class='pb-2'>Sl No.</th>

87
Online Voting System | 2022-2024

<th>User Email</th>

<th>User State</th>

<th>Action</th>

</tr>

<?php

$conn = new mysqli("localhost", "root", "", "votingsystem_db");

$select = "select * from id_request_tbl";

$run = $conn->query($select);

if($run->num_rows > 0) {

$total = 0;

while($row = $run->fetch_array()) {

$total = $total + 1;

$id = $row['id'];

?>

<tr class='text-center h-20 text-lg font-bold text-gray-600'>

<td class='bg-[#7FB5FF]'><?php echo $total; ?></td>

<td><?php echo $row['user_email'];?></td>

<td class='bg-[#7FB5FF]'><?php echo $row['user_state'];?></td>

<td><a class='shadow-xl hover:bg-green-700/75 bg-green-700 px-10


py-3 rounded-lg text-white font-semibold tracking-wide'
href="updateid.php?id=<?php echo $id;?>">Approve</a></td>

</tr>

<?php

88
Online Voting System | 2022-2024

?>

</table>

</div>

<div class="">

<a class='px-7 py-4 border-3 text-xl font-bold rounded-xl shadow-xl bg-cyan-


600/75 text-white' href="/voting/adminhome.php">Back To Home</a>

</div>

</div>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</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>";

?>

<div class='bg-[#C4DDFF] w-full min-h-full flex flex-col justify-center items-


center'>

<?php

90
Online Voting System | 2022-2024

$postfix = "";

$prefix = "";

$id_generated = "";

$conn = new mysqli("localhost", "root", "", "votingsystem_db");

$id = $_GET['id'];

$select = "select * from id_request_tbl where id='$id'";

$run = $conn->query($select);

if($run->num_rows > 0){

while($row = $run->fetch_array()){

$user_email = $row['user_email'];

$user_state = $row['user_state'];

switch($user_state){

case 'Delhi':

$prefix = "del";

$rand = rand(9999999, 1234567);

$postfix = "xyz";

$id_generated = $prefix . $rand . $postfix;

break;

case 'up':

$prefix = "u";

$rand = rand(9999999, 1234567);

$postfix = "xyz";

$id_generated = $prefix . $rand . $postfix;

break;

91
Online Voting System | 2022-2024

case 'Maharastra':

$prefix = "mah";

$rand = rand(9999999, 1234567);

$postfix = "xyz";

$id_generated = $prefix . $rand . $postfix;

break;

?>

<form method="post" class='w-[70%] md:w-[50%] lg:w-[35%] xl:w-[20%]


flex flex-col justify-evenly'>

<div class='flex flex-col items- my-3'>

<label for="InputEmail" class='text-lg font-semibold tracking-


wide'>User Email</label>

<input type="email" name="user_email" class="form-control mt-2"


placeholder="Enter Email" required readonly value="<?php echo $user_email; ?>">

</div>

<div class='flex flex-col items- my-3'>

<label for="InputEmail" class='text-lg font-semibold tracking-


wide'>User State</label>

<input type="text" name="user_state" class="form-control mt-2"


placeholder="Enter Email" required readonly value="<?php echo $user_state; ?>">

</div>

<div class='flex flex-col items- my-3'>

<label for="InputEmail" class='text-lg font-semibold tracking-


wide'>User ID Generated by system</label>

92
Online Voting System | 2022-2024

<input type="text" name="user_id_generated" class="form-control mt-2"


placeholder="Enter Email" required readonly value="<?php echo
strtoupper($id_generated); ?>">

</div>

<div class='flex flex-col items- my-3'>

<input type="submit" name="update" value="Update User ID"


class="px-7 py-3 mr-4 border-3 text-xl font-bold rounded-xl shadow-xl hover:bg-teal-
500 bg-teal-500/75 text-white">

</div>

</form>

<?php

} else {

echo "Record Not Found";

?>

</div>

<?php

if(isset($_POST['update'])){

$user_email = $_POST['user_email'];

$user_id_generated = $_POST['user_id_generated'];

$update = "update user_db set user_id_generated='$user_id_generated' where


user_email='$user_email'";

$run = $conn->query($update);

if($run){

$delete = "delete from id_request_tbl where user_email='$user_email'";

93
Online Voting System | 2022-2024

$del = $conn->query($delete);

if($del){

echo "<script>alert('Update successfully and Deleted!')</script>";

echo "<script>window.location.href='idrequest.php'</script>";

} else {

echo "<script>alert('Update Failed')</script>";

?>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</body>

</html>

94
Online Voting System | 2022-2024

Add New Election

<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 class='w-full min-h-full flex flex-col justify-start items-center bg-[#C4DDFF]


'>

<div class='text-center text-[#001D6E] text-4xl my-28 font-bold tracking-wide


w-full '>

<h1>Add New Election</h1>

</div>

<div class='w-full flex items-center justify-center'>

<form method="POST">

<div class="flex flex-col my-4 text-lg text-gray-500">

<label class='font-semibold'>Type of Election</label>

<input type="text" name="elections_name" class="rounded-lg py-1 px-2


text-black font-semibold shadow-xl ">

95
Online Voting System | 2022-2024

</div>

<div class="flex flex-col my-4 text-lg text-gray-500">

<label class='font-semibold'>Election Start Date</label>

<input type="date" name="elections_start_date" class="rounded-lg py-1


px-2 shadow-xl ">

</div>

<div class="flex flex-col my-4 text-lg text-gray-500">

<label class='font-semibold'>Election End Date</label>

<input type="date" name="elections_end_date" class="rounded-lg py-1


px-2 shadow-xl ">

</div>

<div class='mt-8'>

<a class='px-7 py-4 mr-4 border-3 text-xl font-bold rounded-xl shadow-


xl hover:bg-cyan-600 bg-cyan-600/75 text-white'
href="/voting/adminhome.php">Back To Home</a>

<button class='px-7 ml-4 py-4 border-3 text-xl font-bold rounded-xl


shadow-xl hover:bg-green-600 bg-green-600/75 text-white' type="submit"
name="add_elections" class="btn btn-success">Submit</button>

</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){

echo "<script>alert('Election Added successfully!!!')</script>";

else{

echo "<script>alert('Error')</script>";

?>

</body>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</html>

97
Online Voting System | 2022-2024

Add New Candidates:

<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 class='w-full min-h-full flex flex-col justify-start items-center bg-[#C4DDFF]


'>

<div class='text-center text-[#001D6E] text-4xl my-28 font-bold tracking-wide


w-full '>

<h1>Add Election Nominees</h1>

</div>

<div class='w-full flex items-center justify-center'>

<form method="GET" action="add_details_candidates.php">

<div class="flex flex-col my-6 text-lg text-gray-500">

98
Online Voting System | 2022-2024

<label class='font-semibold mb-3'>Type of Election</label>

<select class="rounded-lg shadow-xl " name="elections_name">

<option value="" selected="selected">Select Election</option>

<?php

$conn=new mysqli("localhost","root","","votingsystem_db");

$select="select * from elections_tbl";

$run=$conn->query($select);

if($run->num_rows>0){

while($row=$run->fetch_array()){

?>

<option value="<?php echo $row['elections_name'];?>"><?php echo


$row['elections_name'];?></option>

<?php

?>

</select>

</div>

<div class="flex flex-col my-4 text-lg text-gray-500">

<label class='font-semibold'>No of candidates</label>

<input type="text" name="total_candidates" class="rounded-lg py-1 px-


2 shadow-xl ">

</div>

99
Online Voting System | 2022-2024

<div class='mt-8'>

<a class='px-7 py-4 mr-4 border-3 text-xl font-bold rounded-xl shadow-


xl hover:bg-cyan-600 bg-cyan-600/75 text-white'
href="/voting/adminhome.php">Back To Home</a>

<button class='px-7 ml-4 py-4 border-3 text-xl font-bold rounded-xl


shadow-xl hover:bg-green-600 bg-green-600/75 text-white' type="submit"
name="add_elections">Submit</button>

</div>

</form>

</div>

</div>

</body>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</html>

10
0
Online Voting System | 2022-2024

Add Candidates Details:

<html>

<head>

<title>Voting System | Add Candidates</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 class='w-full min-h-full flex flex-col justify-start items-center bg-[#C4DDFF]


'>

<!-- heading -->

<div class='text-center text-[#001D6E] text-4xl my-28 font-bold tracking-wide


w-full '>

<h1>Add Election Nominees</h1>

</div>

<!-- form -->

<div class='w-full flex items-center justify-center'>

10
1
Online Voting System | 2022-2024

<form method="POST">

<div class="flex flex-col my-6 text-lg text-gray-500">

<?php

$conn=new mysqli("localhost","root","","votingsystem_db");

$elections_name=$_GET['elections_name'];

$total_candidates=$_GET['total_candidates'];

?>

<label>Election Name</label>

<input type="text" name="elections_name" value="<?php echo


$elections_name;?>" class="rounded-lg py-1 px-2 shadow-xl " readonly="readonly">

</div>

<?php

for($i=1;$i<=$total_candidates;$i++){

?>

<div class="flex flex-col my-4 text-lg text-gray-500">

<label class='font-semibold'>Candidates Name <?php echo $i;?></label>

<input type="text" name="candidates_name<?php echo $i;?>"


class="rounded-lg py-1 px-2 shadow-xl ">

</div>

<?php

?>

<div class='mt-8'>

10
2
Online Voting System | 2022-2024

<a class='px-7 py-4 mr-4 border-3 text-xl font-bold rounded-xl shadow-


xl hover:bg-cyan-600 bg-cyan-600/75 text-white'
href="/voting/adminhome.php">Back To Home</a>

<button class='px-7 ml-4 py-4 border-3 text-xl font-bold rounded-xl


shadow-xl hover:bg-green-600 bg-green-600/75 text-white' type="submit"
name="add_details_candidates">Submit</button>

</div>

</form>

</div>

</div>

<?php

if(isset($_POST['add_details_candidates'])){

$total_candidates=$_GET['total_candidates'];

$elections_name=$_POST['elections_name'];

for ($i=1; $i<=$total_candidates; $i++){

$candidates_name[]=$_POST['candidates_name'.$i];

for($i=0;$i<$total_candidates;$i++){

$insert="insert into candidates_tbl (candidates_name,elections_name)


values ('$candidates_name[$i]','$elections_name')";

$run=$conn->query($insert);

if($run){

// add a custom message for user and redirect them to admin homepage

echo "<script>alert('Nominees Are Added successfully!!!')</script>";

10
3
Online Voting System | 2022-2024

else{

echo "Error";

?>

</body>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</html>

10
4
Online Voting System | 2022-2024

Registered Candidates:

<html>

<head>

<title>Voting System | Registered User</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 class='w-full min-h-full flex flex-col justify-evenly items-center bg-


[#C4DDFF] '>

<!-- heading -->

<div class='text-center text-[#001D6E] text-4xl mt-24 mb-10 font-bold tracking-


wide w-full '>

<h1>Registered Nominees</h1>

</div>

<div class='my-8'>

<a class='px-7 py-4 mr-4 border-3 text-xl font-bold rounded-xl shadow-xl


hover:bg-cyan-600 bg-cyan-600/75 text-white' href="/voting/adminhome.php">Back
To Home</a>

10
5
Online Voting System | 2022-2024

</div>

<!-- form -->

<div class='w-full flex items-center justify-center mb-10'>

<table class="w-full mx-5 lg:w-[50%]">

<tr class='bg-[#001D6E] text-center text-gray-300 h-20'>

<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'"));

} catch (PDOException $e) {

exit("Error: " . $e->getMessage());

$sql = "SELECT * from candidates_tbl";

$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 class='text-center h-20 text-lg font-bold text-gray-600'>

<td class='bg-[#7FB5FF]'><?php echo htmlentities($cnt);?></td>

<td><?php echo htmlentities($result->candidates_name);?></td>

<td class='bg-[#7FB5FF]'><?php echo htmlentities($result-


>elections_name);?></td>

<td><?php echo htmlentities($result->total_votes);?></td>

</tr>

<?php

$cnt = $cnt + 1;

?>

</table>

</div>

</div>

</body>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</html>

10
7
Online Voting System | 2022-2024

Registered User:

<html>

<head>

<title>Voting System | Registered User</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 class='w-full min-h-full flex flex-col justify-start items-center bg-[#C4DDFF]


'>

<!-- heading -->

<div class='text-center text-[#001D6E] text-4xl mt-20 mb-10 font-bold tracking-


wide w-full'>

<h1>Registered Users</h1>

</div>

<div class='mt-10 mb-20'>

10
8
Online Voting System | 2022-2024

<a class='px-7 py-4 mr-4 border-3 text-xl font-bold rounded-xl shadow-xl


hover:bg-cyan-600 bg-cyan-600/75 text-white' href="/voting/adminhome.php">Back
To Home</a>

</div>

<!-- form -->

<div class='w-full flex flex-col px-5 items-center justify-center'>

<!-- table head line -->

<table class="w-full mx-5 lg:w-[50%]">

<tr class='bg-[#001D6E] text-center text-gray-300 h-20'>

<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

DB_PASS,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES


'utf8'"));

} catch (PDOException $e) {

exit("Error: " . $e->getMessage());

$sql = "SELECT * from user_db";

$query = $dbh->prepare($sql);

$query->execute();

$results = $query->fetchAll(PDO::FETCH_OBJ);

$cnt = 1;

if($query->rowCount() > 0) {

foreach($results as $result) {

?>

<tr class='text-center h-20 text-lg font-semibold text-gray-600'>

<td class='bg-[#7FB5FF]'><?php echo htmlentities($cnt);?></td>

<td class='bg-teal-500 text-gray-200'><?php echo htmlentities($result-


>user_name);?></td>

<td class='bg-[#7FB5FF]'><?php echo htmlentities($result-


>user_email);?></td>

<td class='bg-teal-500 text-gray-200'><?php echo


substr(htmlentities($result->user_gender),0,1);?></td>

<td class='bg-[#7FB5FF]'><?php echo htmlentities($result-


>user_state);?></td>

11
0
Online Voting System | 2022-2024

<td class='bg-teal-500 text-gray-200'><?php echo htmlentities($result-


>user_id_generated);?></td>

</tr>

<?php

$cnt = $cnt + 1;

?>

</table>

</div>

</div>

</body>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</html>

11
1
Online Voting System | 2022-2024

Elections:

<html>

<head>

<title>Voting System | Registered User</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 class='w-full min-h-full flex flex-col justify-start items-center bg-[#C4DDFF]


'>

<!-- heading -->

<div class='text-center text-[#001D6E] text-4xl mt-24 mb-10 font-bold tracking-


wide w-full '>

<h1>ELECTIONS</h1>

</div>

<div class='my-8'>

<a class='px-7 py-4 mr-4 border-3 text-xl font-bold rounded-xl shadow-xl


hover:bg-cyan-600 bg-cyan-600/75 text-white' href="/voting/adminhome.php">Back
To Home</a>

11
2
Online Voting System | 2022-2024

</div>

<!-- form -->

<div class='w-full flex items-center justify-center'>

<table class="w-full mx-5 lg:w-[50%]">

<tr class='bg-[#001D6E] text-center text-gray-300 h-20'>

<th class='pb-2'>ELECTION TYPE</th>

<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'"));

} catch (PDOException $e) {

exit("Error: " . $e->getMessage());

$sql = "SELECT * FROM elections_tbl";

$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 class='text-center h-20 text-lg font-bold text-gray-600'>

<td class='bg-[#7FB5FF]'><?php echo htmlentities($result-


>elections_name);?></td>

<td><?php echo htmlentities($result->elections_start_date);?></td>

<td class='bg-[#7FB5FF]'><?php echo htmlentities($result-


>elections_end_date);?></td>

</tr>

<?php

$cnt = $cnt + 1;

?>

</table>

</div>

</div>

</body>

<script type="text/javascript" src="js/bootstrap.js"></script>

<script type="text/javascript" src="js/jquery-3.5.0.js"></script>

</html>

11
4
Online Voting System | 2022-2024

DataBase:

-- phpMyAdmin SQL Dump

-- version 5.2.1

-- https://www.phpmyadmin.net/

--

-- Host: 127.0.0.1

-- Generation Time: Sep 23, 2023 at 01:30 PM

-- Server version: 10.4.28-MariaDB

-- PHP Version: 8.0.28

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 */;

/*!40101 SET NAMES utf8mb4 */;

-- Database: `votingsystem_db`

11
5
Online Voting System | 2022-2024

-- Table structure for table `adminuser_db`

CREATE TABLE `adminuser_db` (

`admin_id` int(11) NOT NULL,

`admin_name` varchar(20) NOT NULL,

`admin_email` varchar(50) NOT NULL,

`admin_password` varchar(100) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4


COLLATE=utf8mb4_general_ci;

-- Dumping data for table `adminuser_db`

INSERT INTO `adminuser_db` (`admin_id`, `admin_name`, `admin_email`,


`admin_password`) VALUES

(1, 'Admin', 'admin@voting.com', '123456');

-- Table structure for table `candidates_tbl`

CREATE TABLE `candidates_tbl` (

`candidates_id` int(11) NOT NULL,

`candidates_name` varchar(100) NOT NULL,

`elections_name` varchar(100) NOT NULL,

`total_votes` int(11) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4


COLLATE=utf8mb4_general_ci;

-- Dumping data for table `candidates_tbl`

INSERT INTO `candidates_tbl` (`candidates_id`, `candidates_name`,


`elections_name`, `total_votes`) VALUES

11
6
Online Voting System | 2022-2024

(40, 'Prof. Shilpi Singhal', 'Class Incharge', 3),

(41, 'Prof. Puja Shree Sinha', 'Class Incharge', 4),

(42, 'Prof. Shailendra Vats', 'Class Incharge', 0),

(43, 'Prof. Vaishnavi Sharma', 'Class Incharge', 2),

(44, 'Prof. Dhwani Garg', 'Class Incharge', 1);

-- Table structure for table `elections_tbl`

CREATE TABLE `elections_tbl` (

`elections_id` int(11) NOT NULL,

`elections_name` varchar(100) NOT NULL,

`elections_start_date` date NOT NULL,

`elections_end_date` date NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4


COLLATE=utf8mb4_general_ci;

-- Dumping data for table `elections_tbl`

INSERT INTO `elections_tbl` (`elections_id`, `elections_name`,


`elections_start_date`, `elections_end_date`) VALUES

(16, 'Class Incharge', '2023-09-23', '2024-09-30');

-- Table structure for table `id_request_tbl`

CREATE TABLE `id_request_tbl` (

`id` int(11) NOT NULL,

`user_email` varchar(100) NOT NULL,

`user_state` varchar(100) NOT NULL

11
7
Online Voting System | 2022-2024

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4


COLLATE=utf8mb4_general_ci;

-- Table structure for table `results_tbl`

CREATE TABLE `results_tbl` (

`id` int(11) NOT NULL,

`user_email` varchar(100) NOT NULL,

`candidates_name` varchar(100) NOT NULL,

`elections_name` varchar(100) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4


COLLATE=utf8mb4_general_ci;

-- Dumping data for table `results_tbl`

INSERT INTO `results_tbl` (`id`, `user_email`, `candidates_name`, `elections_name`)


VALUES

(23, 'sreyansh.sahay@gmail.com', 'Prof. Puja Shree Sinha', 'Class Incharge'),

(24, 'kanakDivya@gmail.com', 'Prof. Puja Shree Sinha', 'Class Incharge'),

(25, 'rohit@gmail.com', 'Prof. Dhwani Garg', 'Class Incharge'),

(26, 'smriti@gmail.com', 'Prof. Puja Shree Sinha', 'Class Incharge'),

(27, 'abhishek@gmail.com', 'Prof. Puja Shree Sinha', 'Class Incharge'),

(28, 'akash@gmail.com', 'Prof. Shilpi Singhal', 'Class Incharge'),

(30, 'Prateek345@gmail.com', 'Prof. Vaishnavi Sharma', 'Class Incharge'),

(31, 'arushi@gmail.com', 'Prof. Shilpi Singhal', 'Class Incharge'),

(32, 'subham@gmail.com', 'Prof. Vaishnavi Sharma', 'Class Incharge'),

(33, 'kanakShrivastava@gmail.com', 'Prof. Shilpi Singhal', 'Class Incharge');

11
8
Online Voting System | 2022-2024

-- Table structure for table `user_db`

CREATE TABLE `user_db` (

`user_id` int(11) NOT NULL,

`user_name` varchar(20) NOT NULL,

`user_email` varchar(50) NOT NULL,

`user_gender` varchar(100) NOT NULL,

`user_state` varchar(100) NOT NULL,

`user_password` varchar(100) NOT NULL,

`user_id_generated` varchar(500) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4


COLLATE=utf8mb4_general_ci;

-- Dumping data for table `user_db`

INSERT INTO `user_db` (`user_id`, `user_name`, `user_email`, `user_gender`,


`user_state`, `user_password`, `user_id_generated`) VALUES

(18, 'Sreyansh Sahay', 'sreyansh.sahay@gmail.com', 'Male', 'up', 'stfu',


'U4033255XYZ'),

(19, 'Kanak Divya', 'kanakDivya@gmail.com', 'Female', 'Delhi', '1234',


'DEL7931000XYZ'),

(20, 'Rohit Rajput', 'rohit@gmail.com', 'Male', 'Delhi', '1234', 'DEL6966610XYZ'),

(21, 'Smriti Pathak', 'smriti@gmail.com', 'Female', 'up', '1234', 'U6492512XYZ'),

(22, 'Abhishek Kumar', 'abhishek@gmail.com', 'Male', 'Maharastra', '1234',


'MAH5563418XYZ'),

(23, 'Akash Rawat', 'akash@gmail.com', 'Male', 'up', '1234', 'U7675093XYZ'),

(24, 'Prateek Tiwari', 'Prateek345@gmail.com', 'Male', 'Delhi', '1234',


'DEL3042912XYZ'),

11
9
Online Voting System | 2022-2024

(25, 'Arushi Anand', 'arushi@gmail.com', 'Female', 'up', '1234', 'U9748314XYZ'),

(26, 'Subham', 'subham@gmail.com', 'Male', 'Maharastra', '1234',


'MAH9337689XYZ'),

(27, 'Kanak Shrivastava', 'kanakShrivastava@gmail.com', 'Female', 'up', '1234',


'U7732921XYZ');

-- Indexes for table `adminuser_db`

ALTER TABLE `adminuser_db`

ADD PRIMARY KEY (`admin_id`);

-- Indexes for table `candidates_tbl`

ALTER TABLE `candidates_tbl`

ADD PRIMARY KEY (`candidates_id`);

-- Indexes for table `elections_tbl`

ALTER TABLE `elections_tbl`

ADD PRIMARY KEY (`elections_id`);

-- Indexes for table `id_request_tbl`

ALTER TABLE `id_request_tbl`

ADD PRIMARY KEY (`id`);

-- Indexes for table `results_tbl`

ALTER TABLE `results_tbl`

ADD PRIMARY KEY (`id`);

12
0
Online Voting System | 2022-2024

-- Indexes for table `user_db`

ALTER TABLE `user_db`

ADD PRIMARY KEY (`user_id`);

-- AUTO_INCREMENT for table `adminuser_db`

ALTER TABLE `adminuser_db`

MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=13;

-- AUTO_INCREMENT for table `candidates_tbl`

ALTER TABLE `candidates_tbl`

MODIFY `candidates_id` int(11) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=45;

-- AUTO_INCREMENT for table `elections_tbl`

ALTER TABLE `elections_tbl`

MODIFY `elections_id` int(11) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=17;

-- AUTO_INCREMENT for table `id_request_tbl`

ALTER TABLE `id_request_tbl`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=32;

-- AUTO_INCREMENT for table `results_tbl`

12
1
Online Voting System | 2022-2024

ALTER TABLE `results_tbl`

MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=34;

-- AUTO_INCREMENT for table `user_db`

ALTER TABLE `user_db`

MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=28;

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.

6.1 TYPES OF TESTS

• 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

Integration tests are designed to test integrated software components to determine


if they actually run as one program. Testing is event driven and is more concerned
with the basic outcome of screens or fields. Integration tests demonstrate that
although the components were individually satisfaction, as shown by successfully

12
3
Online Voting System | 2022-2024

unit testing, the combination of components is correct and consistent. Integration


testing is specifically aimed at exposing the problems that arise from the
combination of components.

• Functional test

Functional tests provide a systematic demonstration that functions tested are


available as specified by the business and technical requirements, system
documentation, and user manuals.
Functional testing is cantered on the following items:

Valid Input: identified classes of valid input must be accepted.

Invalid Input: identified classes of invalid input must be rejected.

Functions: identified functions must be exercised.

Output: identified classes of application outputs must be exercised.

Systems/Procedures: interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key


functions, or special test cases. In addition, systematic coverage pertaining to
identify
Business process flows; data fields, predefined processes, and successive
processes must be considered for testing. Before functional testing is complete,
additional tests are identified and the effective value of current tests is determined.

• 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

System testing is based on process descriptions and flows, emphasizing pre-driven


process links and integration points.

• White Box Testing

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

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

Test strategy and approach

Field testing will be performed manually and functional tests will be written in detail.

Test objectives
• All field entries must work properly.

• Pages must be activated from the identified link.

• The entry screen, messages and responses must not be delayed.

Features to be tested
• Verify that the entries are of the correct format

• No duplicate entries should be allowed

• All links should take the user to the correct page.

• Integration Testing

Software integration testing is the incremental integration testing of two or more


integrated software components on a single platform to produce failures caused
by interface defects.
The task of the integration test is to check that components or software
applications, e.g. components in a software system or – one step up – software
applications at the company level – interact without error.

Integration testing for Database Synchronization:

• Testing the links that call the Change Username & password, Migration and
Synchronization screens etc.

12
6
Online Voting System | 2022-2024

• The username should be retained throughout the application in the form of


hidden variables or by using cookies.
• If the login user does not have enough privileges to invoke a screen, the link
should be disabled.

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

Acceptance testing for Data Synchronization:

• Users have separate roles to modify the database tables.

• The timestamp for all insertions and updating should be maintained.

• 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

7. System Security Measures

• SINGLE-VOTE VERIFICATION

Single-vote verification is technical speak for preventing duplicate votes.

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.

How does single-vote verification work?

In practice, an election specialist would be able to see if an online ballot was


processed. Once they have the name of the voting member, they’ll cross that
person off their formal list of eligible voters. As soon as that person has been
marked as having voted, any subsequent vote from them won’t be counted.

Such verification programs are the hallmarks of any secure election system.

• SECURE NOMINATIONS & BALLOTS

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

This feature is exactly as it sounds: Internet elections have an added layer of


security with ballot tracking, which facilitates real-time voting monitoring by
election specialists. This means they will be alerted at the exact moment a vote
has successfully been processed.

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.

As aforementioned, member-based groups have a broad definition of election


security. Something as simple as following voting in real time actually provides a
huge relief to groups who want to ensure elections are operating properly.

• DATA PRIVACY

Whether in your personal or professional life, data privacy is hugely important.

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

Elections are crucial exercises in democracy for member-based organizations,


therefore it’s critical security and data protection be taken seriously. It’s likewise
vital that groups are able to conduct these contests over secure sites, knowing
votes will be accurately tallied, personal information kept under lock and key, and
24/7 monitoring included, among other necessities. Your members take elections
seriously, so it’s imperative that security is foremost on your mind, too.

13
0
Online Voting System | 2022-2024

8. Future Scope of The Project

1. Advanced technology- It is an advanced technology used now a days. It


increases the E knowledge of the users which is very necessary for current
generation.
2. Internet: It is an online facility and hence very useful for the users.

Voters can vote from anywhere at any time.

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:

• Fast and easy service.

• The online voting system provides a less time consuming.

• It reduces the paperwork and makes the work less tedious for Election
Committee.

• It is a better way for voting.

• By this voting percentage will increase drastically.

• Voter has no need to go to any polling booth, so it is easy to use.

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy