-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfirmEmail.jsp
More file actions
122 lines (104 loc) · 4.1 KB
/
confirmEmail.jsp
File metadata and controls
122 lines (104 loc) · 4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="styles/style.css">
<link rel="stylesheet" href="styles/authentication.css">
<link rel="stylesheet" href="styles/confirmEmail.css">
<link rel="icon" href="images/icon.png">
<title>Enter OTP</title>
</head>
<body>
<%
String name = (String)session.getAttribute("tempName");
String email = (String)session.getAttribute("tempEmail");
String phone = (String)session.getAttribute("tempPhone");
String role = (String)session.getAttribute("tempRole");
String password = (String)session.getAttribute("tempPassword");
String balance = null;
String licenceNo = null;
String experience = null;
String joiningDate = null;
if(role.equals("Passanger"))
{
balance = (String)session.getAttribute("tempBalance");
}
if(role.equals("Driver"))
{
licenceNo = (String)session.getAttribute("tempLicenceNo");
experience = (String)session.getAttribute("tempExperience");
joiningDate = (String)session.getAttribute("tempJoiningDate");
}
if(role.equals("Conductor"))
{
joiningDate = (String)session.getAttribute("tempJoiningDate");
}
if(role.equals("Ticket Checker"))
{
joiningDate = (String)session.getAttribute("tempJoiningDate");
}
%>
<div class="container">
<div class="imageDiv" style="background-image: url('images/profileBackground.png');">
</div>
<div class="workspace" >
<form method="POST" id="otpForm" style="display: block;" onsubmit="return CompareOTP();">
<h1 style="margin-bottom: 4vw;">Verify your email</h1>
<input type="hidden" value='<%=request.getAttribute("otp")%>' name="actualPassword">
<!-- <input type="hidden" value='1234' name="actualPassword"> --> <!--For testing purposes -->
<input type="text" placeholder="Enter OTP" name="enteredPassword">
<input type="submit" value="submit" >
</form>
<h2 id="errorMsg"style="text-align: center; display: none;">OTP didn't match</h2>
<div class="profilePannel">
<!-- <form action="signUpProcess.jsp" method="POST"> -->
<form action = "signUpProcess.jsp" method = "POST" enctype = "multipart/form-data">
<div class="uploadImg">
<input type="file" name="img" onchange="uploadedImg.call(this)">
<span>Upload</span>
</div>
<input type="submit" value="Finish!">
</form>
</div>
</div>
</div>
</body>
<script>
function CompareOTP()
{
var actualPassword = document.getElementsByName('actualPassword')[0].value;
var enteredPassword = document.getElementsByName('enteredPassword')[0].value;
document.getElementById('otpForm').style.display = "none";
if(!actualPassword.localeCompare(enteredPassword))
{
var profilePannel = document.getElementsByClassName('profilePannel')[0].style;
profilePannel.marginTop = "0";
}
else
{
window.setTimeout(function(){
window.location.replace("authentication.jsp");
}, 2000);
document.getElementById('errorMsg').style.display = "block";
}
return false;
}
function uploadedImg()
{
var file = this.files[0]
if(file)
{
var reader = new FileReader();
reader.onload = function(data){
var imageDiv = document.getElementsByClassName('uploadImg')[0];
imageDiv.style.backgroundImage = "url('"+data.target.result+"')";
imageDiv.style.backgroundSize = "cover";
imageDiv.style.backgroundPosition = "top";
}
reader.readAsDataURL(this.files[0])
}
}
</script>
</html>