0% found this document useful (0 votes)
21 views50 pages

Voting System Overview and Details

about project codes

Uploaded by

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

Voting System Overview and Details

about project codes

Uploaded by

swathisowmya2023
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

 Count.

JSP

<%@ page contentType="text/html; charset=iso-8859-1" language="java"


import="[Link].*" errorPage="" %>

<%

Connection con=null;

ResultSet rst=null,rst1=null;

Statement stmt=null,stmt1=null;

try

[Link]("[Link]");

//con=[Link]("jdbc:mysql://[Link]-west-
[Link]/award?characterEncoding=latin1","root","root1234");

con=[Link]("jdbc:mysql://localhost:3306/award","root","root");

stmt=[Link]();

//[Link]("success");

}catch(Exception e){

[Link](e);

%>
 [Link]

<%@ page contentType="text/html; charset=iso-8859-1" language="java"


import="[Link].*" errorPage="" %>

<%@ include file="[Link]" %>

<%@ include file="[Link]" %>

<%

rst=[Link]("select name,category,cid, count(vote) as total from votes where


vote > 0 group by cid order by total desc");

%>

<style type="text/css">

<!--

body {

background-color: #AEAEAE;

.style7 {color: #FF0000; font-size: 18px; font-weight: bold; }

.style8 {

font-size: 24px;

font-weight: bold;

-->

</style>

<p align="center" class="style8">Voting Count </p>

<table width="348" border="1" align="center">


<tr>

<td><strong>Candidate Name </strong></td>

<td><strong>Category</strong></td>

<td><strong>Candidate ID</strong></td>

<td><strong>Count</strong></td>

</tr>

<%

while([Link]()){

%>

<tr>

<td><span class="style7"><%= [Link](1) %></span></td>

<td><span class="style7"><%= [Link](2) %></span></td>

<td><span class="style7"><%= [Link](3) %></span></td>

<td><span class="style7"><%= [Link](4) %></span></td>

</tr>

<%

%>

</table>

<div align="center"></div>
[Link]

<%@ page contentType="text/html; charset=iso-8859-1" language="java"


import="[Link].*" errorPage="" %>

<%@ include file="[Link]" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"[Link]

<html xmlns="[Link]

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

<style>

table {

border-collapse: collapse;

border-spacing: 0;

width: 100%;

border: 1px solid #ddd;

th, td {

text-align: left;

padding: 8px;

}
tr:nth-child(even){background-color: #f2f2f2}

</style>

</head>

<body>

<%@ include file="[Link]" %>

<br />

<br />

<p align="center"> <strong> NOMINEES DETAILS </strong> </p>

<div style="overflow-x:auto;">

<table style="background:#666666; color:black; border-radius:10px;" width="auto"


border="0" align="center">

<tr bgcolor="#999999">

<td ><strong>Name</strong></td>

<td ><strong>Voter Id </strong></td>

<td ><strong>Category</strong></td>

<td ><strong>Description</strong></td>

<td ><strong>Address</strong></td>

<td ><strong>Status</strong></td>

<td >Detailed File</td>

</tr>

<%
rst=[Link]("select * from nominies");

while([Link]()){

%>

<form action="" method="get">

<input name="e2" type="hidden" value="<%= [Link](2) %>"/>

<tr>

<td><span class="style3 style1"><%= [Link](1) %></span></td>

<td><span class="style3 style1"><%= [Link](2) %></span></td>

<td><span class="style3 style1"><%= [Link](3) %></span></td>

<td><span class="style3 style1"><%= [Link](4) %></span></td>

<td><span class="style3 style1"><%= [Link](5) %></span></td>

<td><span class="style3 style1"><%= [Link](7) %></span></td>

<td><a href="[Link]?select=<%= [Link](10) %>"


target="_blank">View More Details</a></td>

</tr>

</form>

<% } %>

</table>

</div>

<p>

<%

if([Link]("Accept")!=null){

try{
int x=[Link]("update nominies set status='Accept' where
voterid='"+[Link]("e2")+"' ");

if(x!=0)

%>

<script>

alert("Nominie Accepted");

[Link]("[Link]","_self");

</script>

<%

//[Link]("[Link]");

}catch(Exception e){

[Link]("error"+e);

%>

<%

if([Link]("Reject")!=null){

try{

int x=[Link]("update nominies set status='Reject' where


voterid='"+[Link]("e2")+"' ");
if(x!=0)

%>

<script>

alert("Nominie Rejected");

[Link]("[Link]","_self");

</script>

<%

//[Link]("[Link]");

}catch(Exception e){

[Link]("error"+e);

%>

</p>

</body>

</html>
[Link]
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="[Link].*" errorPage="" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"[Link]

<html xmlns="[Link]

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

<style type="text/css">

<!--

-->

</style>

</head>
<body><br />

<%@ include file="[Link]" %>

<%@ include file="[Link]" %>

<br />

<br />

<br />

<br />

<p align="center" style="color:#CCCCCC"> People details</p>

<table style="background:#666666; color:white; border-radius:10px;" width="auto"


border="0" align="center">

<tr bgcolor="#999999">

<td ><strong>Name</strong></td>

<td ><strong>Adhar</strong></td>

<td ><strong>Phone</strong></td>

<td ><strong>Email</strong></td>

<td ><strong>password</strong></td>

<td ><strong>ID</strong></td>

</tr>

<%
rst=[Link]("select * from people");

while([Link]()){

%>

<form action="" method="get">

<tr bgcolor="#003399">

<td><span class="style3 style1"><input name="e1" type="text" value="<%=


[Link](1) %>" readonly="true"/></span></td>

<td><span class="style3 style1"><input name="e2" type="text" value="<%=


[Link](2) %>"/></span></td>

<td><span class="style3 style1"><input name="e3" type="text" value="<%=


[Link](3) %>"/></span></td>

<td><span class="style3 style1"><input name="e4" type="text" value="<%=


[Link](4) %>"/></span></td>

<td><span class="style3 style1"><input name="e5" type="text" value="<%=


[Link](5) %>"/></span></td>

<td><span class="style3 style1"><input name="e5" type="text" value="<%=


[Link](6) %>"/></span></td>

</tr>

</form>

<% } %>

</table>
<%

if([Link]("update")!=null){

try{

int x=[Link]("update stores set storename='"+[Link]("e2")


+"',address='"+[Link]("e3")
+"',storemobileno='"+[Link]("e4")
+"',password='"+[Link]("e5")+"' where
storeid='"+[Link]("e1")+"' ");

if(x!=0)

%>

<script>

alert("Date Updated");

[Link]("[Link]","_self");

</script>

<%

//[Link]("[Link]");

}catch(Exception e){

[Link]("error"+e);

}
if([Link]("delete")!=null){

try{

int x=[Link]("delete from stores where


storeid='"+[Link]("e1")+"'");

if(x!=0){

%>

<script>

alert("Date Deleted successfully");

[Link]("[Link]","_self");

</script>

<%

}catch(Exception e){

[Link]("error"+e);

%>
<%

if([Link]("Accept")!=null){

try{

int x=[Link]("update stores set status='Accept' where


storeid='"+[Link]("e1")+"' ");

if(x!=0)

%>

<script>

alert("Date Updated");

[Link]("[Link]","_self");

</script>

<%

//[Link]("[Link]");

}catch(Exception e){

[Link]("error"+e);

%>
<%

if([Link]("Reject")!=null){

try{

int x=[Link]("update stores set status='Reject' where


storeid='"+[Link]("e1")+"' ");

if(x!=0)

%>

<script>

alert("Date Updated");

[Link]("[Link]","_self");

</script>

<%

//[Link]("[Link]");

}catch(Exception e){

[Link]("error"+e);

}
%>

</body>

</html>
[Link]
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="[Link].*" errorPage="" %>

<%@ include file="[Link]" %>

<%@ include file="[Link]" %>

<!DOCTYPE html>

<html lang="en" >

<head>

<meta charset="UTF-8">

<title>Login Page in HTML with CSS Code Example</title>

<link href="[Link] rel="stylesheet">

<link href="[Link]
[Link]" rel="stylesheet" integrity="sha384-
wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQV
nN" crossorigin="anonymous"><link rel="stylesheet" href="./[Link]">

</head>

<body><br>

<br>

<br>

<br>

<br>

<!-- partial:[Link] -->


<div class="box-form">

<div class="left">

<div class="overlay">

<h3>Login For Voters</h3>

<p>This page helps voters to login to the page and vote for the nominated
candidates.</p>

</div>

</div>

<div class="right">

<h3>Voters Login</h3>

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

<div class="inputs">

<input type="text" name="username" placeholder="Email Address">

<br>

<input type="password" name="password" placeholder="password">

</div>

<br>

<button type="submit" name="Submit">Voters Login</button>

<br>

</form>

<p>Don't have an account? <a href="[Link]">New Registration</a> it takes


less than a minute</p>
</div>

</div>

<!-- partial -->

<%

if([Link]("Submit")!=null){

try

String un=[Link]("username");

String pw=[Link]("password");

rst=[Link]("select * from people where email='"+un+"' and


password='"+pw+"'");

if([Link]()){

[Link]("email",un);

%>

<script>

alert("login Success");

[Link]("[Link]","_self");

</script>
<%

}else{

%>

<script>

alert("login failed");

</script>

<%

}catch(Exception e){

[Link](e);

%>

</body>

</html>
[Link]

<%@ page contentType="text/html; charset=iso-8859-1" language="java"


import="[Link].*" errorPage="" %>

<%@ include file="[Link]" %>

<%@ include file="[Link]" %>

<!DOCTYPE html>

<html lang="en" >

<head>

<meta charset="UTF-8">

<title>Login Page in HTML with CSS Code Example</title>

<link href="[Link] rel="stylesheet">

<link href="[Link]
[Link]" rel="stylesheet" integrity="sha384-
wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQV
nN" crossorigin="anonymous"><link rel="stylesheet" href="./[Link]">
</head>

<body><br>

<br>

<br>

<br>

<br>

<!-- partial:[Link] -->

<div class="box-form">

<div class="left">

<div class="overlay">

<h3>Login For Students.</h3>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Curabitur et est sed felis aliquet sollicitudin</p>

</div>

</div>

<div class="right">

<h3>Student Login</h3>

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

<div class="inputs">

<input type="text" name="username" placeholder="Email Address">


<br>

<input type="password" name="password" placeholder="password">

</div>

<br>

<button type="submit" name="Submit">Student Login</button>

<br>

</form>

<p>Don't have an account? <a href="[Link]">New Registration</a> it takes


less than a minute</p>

</div>

</div>

<!-- partial -->

<%

if([Link]("Submit")!=null){

try

String un=[Link]("username");

String pw=[Link]("password");

rst=[Link]("select * from studentreg where email='"+un+"' and


password='"+pw+"'");

if([Link]()){
String reg=[Link](2);

[Link]("email",un);

[Link]("regno",[Link](1));

[Link]("[Link]");

}else{

%>

<script>

alert("login failured");

</script>

<%

}catch(Exception e){

[Link](e);

%>

</body>

</html>
[Link]
body {

background-image: linear-gradient(135deg, #FAB2FF 10%, #1904E5 100%);

background-size: cover;

background-repeat: no-repeat;

background-attachment: fixed;

font-family: "Open Sans", sans-serif;

color: #333333;

.box-form {

margin: 0 auto;

width: 80%;

background: #FFFFFF;

border-radius: 10px;

overflow: hidden;

display: flex;

flex: 1 1 100%;

align-items: stretch;

justify-content: space-between;

box-shadow: 0 0 20px 6px #090b6f85;

@media (max-width: 980px) {

.box-form {

flex-flow: wrap;
text-align: center;

align-content: center;

align-items: center;

.box-form div {

height: auto;

.box-form .left {

color: #FFFFFF;

background-size: cover;

background-repeat: no-repeat;

background-image:
url("[Link]
[Link]");

overflow: hidden;

.box-form .left .overlay {

padding: 30px;

width: 100%;

height: 100%;

background: #5961f9ad;

overflow: hidden;

box-sizing: border-box;

.box-form .left .overlay h1 {


font-size: 10vmax;

line-height: 1;

font-weight: 900;

margin-top: 40px;

margin-bottom: 20px;

.box-form .left .overlay span p {

margin-top: 30px;

font-weight: 900;

.box-form .left .overlay span a {

background: #3b5998;

color: #FFFFFF;

margin-top: 10px;

padding: 14px 50px;

border-radius: 100px;

display: inline-block;

box-shadow: 0 3px 6px 1px #042d4657;

.box-form .left .overlay span a:last-child {

background: #1dcaff;

margin-left: 30px;

.box-form .right {

padding: 40px;
overflow: hidden;

@media (max-width: 980px) {

.box-form .right {

width: 100%;

.box-form .right h5 {

font-size: 6vmax;

line-height: 0;

.box-form .right p {

font-size: 14px;

color: #B0B3B9;

.box-form .right .inputs {

overflow: hidden;

.box-form .right input {

width: 100%;

padding: 10px;

margin-top: 25px;

font-size: 16px;

border: none;

outline: none;
border-bottom: 2px solid #B0B3B9;

.box-form .right .remember-me--forget-password {

display: flex;

justify-content: space-between;

align-items: center;

.box-form .right .remember-me--forget-password input {

margin: 0;

margin-right: 7px;

width: auto;

.box-form .right button {

float: right;

color: #fff;

font-size: 16px;

padding: 12px 35px;

border-radius: 50px;

display: inline-block;

border: 0;

outline: 0;

box-shadow: 0px 4px 20px 0px #49c628a6;

background-image: linear-gradient(135deg, #70F570 10%, #49C628 100%);

}
label {

display: block;

position: relative;

margin-left: 30px;

label::before {

content: ' \f00c';

position: absolute;

font-family: FontAwesome;

background: transparent;

border: 3px solid #70F570;

border-radius: 4px;

color: transparent;

left: -30px;

transition: all 0.2s linear;

label:hover::before {

font-family: FontAwesome;

content: ' \f00c';

color: #fff;

cursor: pointer;

background: #70F570;

}
label:hover::before .text-checkbox {

background: #70F570;

label [Link]-checkbox {

display: inline-block;

height: auto;

position: relative;

cursor: pointer;

transition: all 0.2s linear;

label input[type="checkbox"] {

display: none;

}
[Link]

<%@ page contentType="text/html; charset=iso-8859-1" language="java"


import="[Link].*" errorPage="" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"[Link]

<html xmlns="[Link]

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

<style type="text/css">

<!--

input[type=text], select {

width: 100%;

padding: 12px 20px;

margin: 8px 0;

display: inline-block;

border: 1px solid #ccc;

border-radius: 4px;

box-sizing: border-box;

padding-right:10px;

padding-left:10px;

input[type=password], select {

width: 100%;

padding: 12px 20px;


margin: 8px 0;

display: inline-block;

border: 1px solid #ccc;

border-radius: 4px;

box-sizing: border-box;

padding-right:10px;

padding-left:10px;

input[type=submit] {

width: 60%;

background-color: #4CAF50;

color: white;

padding: 14px 20px;

margin: 8px 0;

border: none;

border-radius: 4px;

cursor: pointer;

input[type=button] {

width: 60%;

background-color: #4CAF50;

color: white;

padding: 14px 20px;

margin: 8px 0;
border: none;

border-radius: 4px;

cursor: pointer;

input[type=submit]:hover {

background-color: #45a049;

body {

background-color: #FF6600;

background-image: url(images/[Link]);

.style2{

color:blue;

-->

</style>

</head>

<body>

<%@ include file="[Link]" %>

<%@ include file="[Link]" %>

<br />
<br />

<br />

<br />

<br />

<p align="center" class="style2">Add Document</p>

<form id="form1" name="form1" method="post" action="">

<table bgcolor="#CCCCCC" width="317" height="272" border="0" align="center">

<tr>

<td><div align="right"><span class="style3">Email:</span></div></td>

<td><div align="left"><span class="style3">

<input type="text" name="s1" value="<%= [Link]("email") %>"


readonly="true" />

</span></div></td>

</tr>

<tr>

<td><div align="right">Choose File </div></td>

<td><div align="left"><span class="style3">

<input type="file" name="s2" required/>

</span></div></td>

</tr>

<tr>

<td><div align="right"></div></td>

<td>
<div align="left">

<input type="submit" name="Submit" value="Submit" />

</div></td>

</tr>

</table>

</form>

<%

if([Link]("Submit")!=null){

try{

int x=[Link]("update nominies set doc='"+[Link]("s2")+"'


where email='"+[Link]("s1")+"'");

if(x!=0){

%>

<script>

alert("Document Added Successfull");

</script>

<%

}catch(Exception e){

%>

<script>

alert("already register with this data");


</script>

<%

%>

</body>

</html>

[Link]

<%@ page import="[Link]" %>

<%@ include file="[Link]" %>

<%

MultipartRequest m = new MultipartRequest(request, "D:/tomcat Installed Dont delete


it/Tomcat 5.5/webapps/Award/uploads");

//[Link]([Link]("file"));

String fn=[Link]("file").toString();

int x=[Link]("update nominies set fn='"+fn+"' where


voterid='"+[Link]("nid")+"'");

if(x!=0){

%>

<script>

alert("file uploaded ");

[Link]("[Link]","_self");
</script>

%>

}else{

%>

<script>

alert("data failed to upload");

[Link]("[Link]","_self");

</script>

<%

%>
[Link]
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="[Link].*,[Link],[Link]" errorPage="" %>

<%

Date cd=new Date();

String string ="2022-06-20 08:34:55.705";

Date ld = new SimpleDateFormat("yyyy-MM-dd HH:mm:[Link]").parse(string);

if([Link](ld)){

[Link]("[Link]");

%>
[Link]

<%@ page contentType="text/html; charset=iso-8859-1" language="java"


import="[Link].*" errorPage="" %>

<%@ include file="[Link]" %>

<%@ include file="[Link]" %>

<style type="text/css">

<!--

body {

background-color: #AEAEAE;

.style7 {color: #FF0000; font-size: 18px; font-weight: bold; }

.style8 {

font-size: 24px;

font-weight: bold;

-->

</style>

<p align="center" class="style8">Voting Count </p>

<table width="348" border="1" align="center">

<tr>
<td><strong>Candidate Name </strong></td>

<td><strong>Category</strong></td>

<td><strong>Candidate ID</strong></td>

<td><strong>Count</strong></td>

</tr>

<%

rst=[Link]("select status from people where status='off'");

if([Link]())

rst=[Link]("select name,category,cid, count(vote) as total from votes where


vote > 0 group by cid order by total desc");

while([Link]()){

%>

<tr>

<td><span class="style7"><%= [Link](1) %></span></td>

<td><span class="style7"><%= [Link](2) %></span></td>

<td><span class="style7"><%= [Link](3) %></span></td>

<td><span class="style7"><%= [Link](4) %></span></td>

</tr>
<%

}else{

[Link]("VOTING LINES are STILL ON please wait for the complition off VOTING
LINES CLOSED");

%>

</table>

<div align="center"></div>
[Link]
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="[Link].*" errorPage="" %>

<%@ include file="[Link]" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"[Link]

<html xmlns="[Link]

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

<style>

table {

border-collapse: collapse;

border-spacing: 0;

width: 100%;
border: 1px solid #ddd;

th, td {

text-align: left;

padding: 8px;

tr:nth-child(even){background-color: #f2f2f2}

</style>

</head>

<body>

<%@ include file="[Link]" %>

<br />

<br />

<p align="center"><strong> NOMINEES DETAILS</strong></p>

<div style="overflow-x:auto;">

<table style="background:#666666; color:black; border-radius:10px;" width="auto"


border="0" align="center">

<tr bgcolor="#999999">

<td ><strong>Name</strong></td>
<td ><strong>Category</strong></td>

<td ><strong>Address</strong></td>

<td ><strong>ID</strong></td>

<td ></td>

</tr>

<%

rst=[Link]("select * from nominies");

while([Link]()){

%>

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

<input name="e1" type="hidden" value="<%= [Link](1) %>"/>

<input name="e2" type="hidden" value="<%= [Link](3) %>"/>

<input name="e3" type="hidden" value="<%= [Link](6) %>"/>

<input name="e4" type="hidden" value="<%=[Link]("email") %>"/>

<tr>

<td>><%= [Link](1) %></td>


<td><%= [Link](3) %></td>

<td><%= [Link](5) %></td>

<td><%= [Link](6) %></td>

<td><input name="Vote" type="submit" value="Click here for voting"


/></td>

</tr>

</form>

<% } %>

</table>

</div>

<%

if([Link]("Vote")!=null){

try{

int x=[Link]("insert into votes(name,category,cid,vote,voteremail)


values('"+[Link]("e1")+"','"+[Link]("e2")
+"','"+[Link]("e3")+"','1','"+[Link]("e4")+"') ");

if(x!=0)

%>

<script>

alert("Congratulations voting Done Successfully");


[Link]("[Link]","_self");

</script>

<%

//[Link]("[Link]");

}catch(Exception e){

%>

<script>

alert("Sorry You have already used the voting chance");

[Link]("[Link]","_self");

</script>

<%

%>

</body>

</html>

You might also like