Codee
Codee
JSP
<%
Connection con=null;
ResultSet rst=null,rst1=null;
Statement stmt=null,stmt1=null;
try
Class.forName("com.mysql.jdbc.Driver");
//con=DriverManager.getConnection("jdbc:mysql://awarddb.czmpln0s33pi.us-west-
2.rds.amazonaws.com:3306/award?characterEncoding=latin1","root","root1234");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/award","root","root");
stmt=con.createStatement();
//out.print("success");
}catch(Exception e){
out.println(e);
%>
nomViewCount.jsp
<%
%>
<style type="text/css">
<!--
body {
background-color: #AEAEAE;
.style8 {
font-size: 24px;
font-weight: bold;
-->
</style>
<td><strong>Category</strong></td>
<td><strong>Candidate ID</strong></td>
<td><strong>Count</strong></td>
</tr>
<%
while(rst.next()){
%>
<tr>
</tr>
<%
%>
</table>
<div align="center"></div>
Nomviewnomies.jsp
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<style>
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
th, td {
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2}
</style>
</head>
<body>
<br />
<br />
<div style="overflow-x:auto;">
<tr bgcolor="#999999">
<td ><strong>Name</strong></td>
<td ><strong>Category</strong></td>
<td ><strong>Description</strong></td>
<td ><strong>Address</strong></td>
<td ><strong>Status</strong></td>
</tr>
<%
rst=stmt.executeQuery("select * from nominies");
while(rst.next()){
%>
<tr>
</tr>
</form>
<% } %>
</table>
</div>
<p>
<%
if(request.getParameter("Accept")!=null){
try{
int x=stmt.executeUpdate("update nominies set status='Accept' where
voterid='"+request.getParameter("e2")+"' ");
if(x!=0)
%>
<script>
alert("Nominie Accepted");
window.open("viewnominies.jsp","_self");
</script>
<%
//response.sendRedirect("viewstores.jsp");
}catch(Exception e){
out.print("error"+e);
%>
<%
if(request.getParameter("Reject")!=null){
try{
%>
<script>
alert("Nominie Rejected");
window.open("viewnominies.jsp","_self");
</script>
<%
//response.sendRedirect("viewstores.jsp");
}catch(Exception e){
out.print("error"+e);
%>
</p>
</body>
</html>
People.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="java.sql.*" errorPage="" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--
-->
</style>
</head>
<body><br />
<br />
<br />
<br />
<br />
<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=stmt.executeQuery("select * from people");
while(rst.next()){
%>
<tr bgcolor="#003399">
</tr>
</form>
<% } %>
</table>
<%
if(request.getParameter("update")!=null){
try{
if(x!=0)
%>
<script>
alert("Date Updated");
window.open("viewstores.jsp","_self");
</script>
<%
//response.sendRedirect("viewstores.jsp");
}catch(Exception e){
out.print("error"+e);
}
if(request.getParameter("delete")!=null){
try{
if(x!=0){
%>
<script>
window.open("viewstores.jsp","_self");
</script>
<%
}catch(Exception e){
out.print("error"+e);
%>
<%
if(request.getParameter("Accept")!=null){
try{
if(x!=0)
%>
<script>
alert("Date Updated");
window.open("viewstores.jsp","_self");
</script>
<%
//response.sendRedirect("viewstores.jsp");
}catch(Exception e){
out.print("error"+e);
%>
<%
if(request.getParameter("Reject")!=null){
try{
if(x!=0)
%>
<script>
alert("Date Updated");
window.open("viewstores.jsp","_self");
</script>
<%
//response.sendRedirect("viewstores.jsp");
}catch(Exception e){
out.print("error"+e);
}
%>
</body>
</html>
Peoplenomination.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="java.sql.*" errorPage="" %>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css" rel="stylesheet" integrity="sha384-
wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQV
nN" crossorigin="anonymous"><link rel="stylesheet" href="./style.css">
</head>
<body><br>
<br>
<br>
<br>
<br>
<div class="left">
<div class="overlay">
<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>
<div class="inputs">
<br>
</div>
<br>
<br>
</form>
</div>
<%
if(request.getParameter("Submit")!=null){
try
String un=request.getParameter("username");
String pw=request.getParameter("password");
if(rst.next()){
session.setAttribute("email",un);
%>
<script>
alert("login Success");
window.open("Peopleviewnominies.jsp","_self");
</script>
<%
}else{
%>
<script>
alert("login failed");
</script>
<%
}catch(Exception e){
out.println(e);
%>
</body>
</html>
Studentlogin.jsp
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css" rel="stylesheet" integrity="sha384-
wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQV
nN" crossorigin="anonymous"><link rel="stylesheet" href="./style.css">
</head>
<body><br>
<br>
<br>
<br>
<br>
<div class="box-form">
<div class="left">
<div class="overlay">
</div>
</div>
<div class="right">
<h3>Student Login</h3>
<div class="inputs">
</div>
<br>
<br>
</form>
</div>
</div>
<%
if(request.getParameter("Submit")!=null){
try
String un=request.getParameter("username");
String pw=request.getParameter("password");
if(rst.next()){
String reg=rst.getString(2);
session.setAttribute("email",un);
session.setAttribute("regno",rst.getString(1));
response.sendRedirect("studenttabs.jsp");
}else{
%>
<script>
alert("login failured");
</script>
<%
}catch(Exception e){
out.println(e);
%>
</body>
</html>
Style.css
body {
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
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-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("https://i.pinimg.com/736x/5d/73/ea/5d73eaabb25e3805de1f8cdea7df4a42--tumblr-
backgrounds-iphone-phone-wallpapers-iphone-wallaper-tumblr.jpg");
overflow: hidden;
padding: 30px;
width: 100%;
height: 100%;
background: #5961f9ad;
overflow: hidden;
box-sizing: border-box;
line-height: 1;
font-weight: 900;
margin-top: 40px;
margin-bottom: 20px;
margin-top: 30px;
font-weight: 900;
background: #3b5998;
color: #FFFFFF;
margin-top: 10px;
border-radius: 100px;
display: inline-block;
background: #1dcaff;
margin-left: 30px;
.box-form .right {
padding: 40px;
overflow: hidden;
.box-form .right {
width: 100%;
.box-form .right h5 {
font-size: 6vmax;
line-height: 0;
.box-form .right p {
font-size: 14px;
color: #B0B3B9;
overflow: hidden;
width: 100%;
padding: 10px;
margin-top: 25px;
font-size: 16px;
border: none;
outline: none;
border-bottom: 2px solid #B0B3B9;
display: flex;
justify-content: space-between;
align-items: center;
margin: 0;
margin-right: 7px;
width: auto;
float: right;
color: #fff;
font-size: 16px;
border-radius: 50px;
display: inline-block;
border: 0;
outline: 0;
}
label {
display: block;
position: relative;
margin-left: 30px;
label::before {
position: absolute;
font-family: FontAwesome;
background: transparent;
border-radius: 4px;
color: transparent;
left: -30px;
label:hover::before {
font-family: FontAwesome;
color: #fff;
cursor: pointer;
background: #70F570;
}
label:hover::before .text-checkbox {
background: #70F570;
label span.text-checkbox {
display: inline-block;
height: auto;
position: relative;
cursor: pointer;
label input[type="checkbox"] {
display: none;
}
Upload.jsp
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--
input[type=text], select {
width: 100%;
margin: 8px 0;
display: inline-block;
border-radius: 4px;
box-sizing: border-box;
padding-right:10px;
padding-left:10px;
input[type=password], select {
width: 100%;
display: inline-block;
border-radius: 4px;
box-sizing: border-box;
padding-right:10px;
padding-left:10px;
input[type=submit] {
width: 60%;
background-color: #4CAF50;
color: white;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
input[type=button] {
width: 60%;
background-color: #4CAF50;
color: white;
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/texture2.png);
.style2{
color:blue;
-->
</style>
</head>
<body>
<br />
<br />
<br />
<br />
<br />
<tr>
</span></div></td>
</tr>
<tr>
</span></div></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td>
<div align="left">
</div></td>
</tr>
</table>
</form>
<%
if(request.getParameter("Submit")!=null){
try{
if(x!=0){
%>
<script>
</script>
<%
}catch(Exception e){
%>
<script>
<%
%>
</body>
</html>
Uploadfile.jsp
<%
//out.print(m.getOriginalFileName("file"));
String fn=m.getOriginalFileName("file").toString();
if(x!=0){
%>
<script>
window.open("peoplenomination.jsp","_self");
</script>
%>
}else{
%>
<script>
window.open("peoplenomination.jsp","_self");
</script>
<%
%>
View.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="java.sql.*,java.text.SimpleDateFormat,java.util.Date" errorPage="" %>
<%
if(cd.after(ld)){
response.sendRedirect("login.html");
%>
Viewcount.jsp
<style type="text/css">
<!--
body {
background-color: #AEAEAE;
.style8 {
font-size: 24px;
font-weight: bold;
-->
</style>
<tr>
<td><strong>Candidate Name </strong></td>
<td><strong>Category</strong></td>
<td><strong>Candidate ID</strong></td>
<td><strong>Count</strong></td>
</tr>
<%
if(rst.next())
while(rst.next()){
%>
<tr>
</tr>
<%
}else{
out.print("VOTING LINES are STILL ON please wait for the complition off VOTING
LINES CLOSED");
%>
</table>
<div align="center"></div>
Voting.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="java.sql.*" errorPage="" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<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>
<br />
<br />
<div style="overflow-x:auto;">
<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>
<%
while(rst.next()){
%>
<tr>
</tr>
</form>
<% } %>
</table>
</div>
<%
if(request.getParameter("Vote")!=null){
try{
if(x!=0)
%>
<script>
</script>
<%
//response.sendRedirect("viewstores.jsp");
}catch(Exception e){
%>
<script>
window.open("voting.jsp","_self");
</script>
<%
%>
</body>
</html>