-
Notifications
You must be signed in to change notification settings - Fork 0
/
reg_test.html
291 lines (265 loc) · 8.55 KB
/
reg_test.html
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!DOCTYPE html>
<html
style="overflow-y: scroll; overflow-x: scroll; font: 75% 'Lucida Sans Unicode', 'Lucida Grande', arial, helvetica, sans-serif; background: #e2e2e2;">
<head>
<title>Registration Screen</title>
<link href="styles/kendo.common.css" rel="stylesheet">
<link href="styles/kendo.blueopal.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/kendo.web.min.js"></script>
<script src="shared/js/console.js"></script>
</head>
<body style="margin: 0; padding: 0;" onload="populateUse()">
<div id="top"
style="height: 75px; background-image: url('images/Top.png');"></div>
<div id="mid" class="k-content">
<div id="reg-screen" class="k-header">
<div id="loading" class="k-header">
<img src="styles/BlueOpal/loading-image.gif"
style="border-style: none;" width="100" height="100" />
</div>
<h2>Registration Form</h2>
<form id="regForm" method="post" action="insert.php">
<table align="center">
<tr>
<th align="left">Email:</th>
<th><span style=""
class="k-widget k-autocomplete k-header k-state-default">
<input id="email" name="email" class="k-input" type="text"
value="" style="width: 100%"/><span class="coupontooltip">Content 1</span>
</span></th>
</tr>
<tr>
<th align="left">Password:</th>
<th><span style=""
class="k-widget k-autocomplete k-header k-state-default">
<input id="passw" name="passw" class="k-input" type="password"
value="" style="width: 100%" />
</span></th>
</tr>
<tr>
<th align="left">Confirm Password:</th>
<th><span style=""
class="k-widget k-autocomplete k-header k-state-default">
<input name="passw2" id="passw2" onkeyup="checkPass(); return false;" class="k-input" type="password"
value="" style="width: 100%" />
<span id="confirmMessage" class="confirmMessage"></span>
</span></th>
</tr>
<tr>
<th align="left">First Name:</th>
<th><span style=""
class="k-widget k-autocomplete k-header k-state-default">
<input id="fname" name="fname" class="k-input" type="text"
value="" style="width: 100%" />
</span></th>
</tr>
<tr>
<th align="left">Last Name:</th>
<th><span style=""
class="k-widget k-autocomplete k-header k-state-default">
<input id="lname" name="lname" class="k-input" type="text"
value="" style="width: 100%" />
</span></th>
</tr>
<tr>
<th align="left">Use:</th>
<th><span style=""
class="k-widget k-autocomplete k-header k-state-default">
<div id="usediv"> </div>
</span></th>
</tr>
</table>
</form>
<p align="center">
<button class="k-button" id="reg">Register</button>
</p>
</div>
<script>
$("#loading").hide();
$("#email").keyup(function(event){
if(event.keyCode == 13){
$("#reg").click();
}
});
$("#passw").keyup(function(event){
if(event.keyCode == 13){
$("#reg").click();
}
});
function checkPass()
{
//Store the password field objects into variables ...
var pass1 = document.getElementById('passw');
var pass2 = document.getElementById('passw2');
//Store the Confimation Message Object ...
var message = document.getElementById('confirmMessage');
//Set the colors we will be using ...
var goodColor = "#66cc66";
var badColor = "#ff6666";
//Compare the values in the password field
//and the confirmation field
if(pass1.value == pass2.value){
//The passwords match.
//Set the color to the good color and inform
//the user that they have entered the correct password
pass2.style.backgroundColor = goodColor;
//message.style.color = goodColor;
//message.innerHTML = "Passwords Match!"
}else{
//The passwords do not match.
//Set the color to the bad color and
//notify the user.
pass2.style.backgroundColor = badColor;
//message.style.color = badColor;
//message.innerHTML = "Passwords Do Not Match!"
}
}
function createRequest() {
var res;
if (window.XMLHttpRequest) {
// FireFox, Safari, etc.
res = new XMLHttpRequest();
//result.overrideMimeType('text/plain'); // Or anything else
}
else if (window.ActiveXObject) {
// MSIE
res = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
// No known mechanism -- consider aborting the application
alert("Non-Compatible Browser!");
}
return res;
}
//ht = "<select id='use' name='use' style='width: 100%'><option value='volvo'>Volvo</option><option value='saab'>Saab</option><option value='opel'>Opel</option><option value='audi'>Audi</option></select>";
function populateUse() {
// function below will run clear.php?h=michael
$.ajax({
type: "GET",
url: "use_types.php" ,
complete : function(data) {
//alert(data);
$("#usediv").html(data);
if (jQuery.isEmptyObject(data)) {
alert("Failed to get use_types.php data...!");
}
else {
$("#usediv").html(data);
}
}
});
}
$("#reg").click(function() {
if ( $("#email").val()=="" || $("#pswrd").val()=="" )
{
alert("Please fill in your Credentials!");
return false;
}
$("#loading").fadeIn("slow");
var valReq = createRequest();
var servURL = "rest";
var classURL = "/webServ/accVal";
var paramsURL = "?accID=" + $("#accID").val() + "&username=" + $("#username").val() + "&pswrd=" + $("#pswrd").val();
var getUrl = servURL + classURL + paramsURL;
var putUrl = servURL + classURL;
valReq.open("put", putUrl, true);
valReq.setRequestHeader("Content-type","text/xml");
var putTxt = "<credentials><accountID>" + $("#accID").val() + "</accountID><username>" + $("#username").val() + "</username><password>" + $("#pswrd").val() + "</password></credentials>";
valReq.send(putTxt);
valReq.onreadystatechange = function() {
if (valReq.readyState != 4) {
return;
}
if (valReq.status != 200) {
alert("Error: " + valReq.status);
$("#loading").fadeOut("slow");
return;
}
$("#loading").fadeOut("slow");
if (valReq.responseText == "false") {
alert("Registration: " + valReq.responseText);
return;
}
$("#regForm").submit();
};
});
</script>
<style scoped>
#mid {
margin: 0px 0;
padding: 0px 0;
border: solid #999;
border-width: 1px 0;
height: 500px;
background-color: #e2e2e2;
}
#loading {
font-size: x-large;
font-weight: bold;
text-align: center;
text-decoration: blink;
position: absolute;
border-radius: 10px 10px 10px 10px;
border-style: solid;
border-width: 0px;
height: 150px;
width: 260px;
z-index: 1;
padding: 20px 20px 0 20px;
background-image: none;
}
.coupontooltip {
height: auto;
display: block;
background: #C8C8C8;
bottom: auto;
top: 0;
left: 100%;
padding: 10px;
position: absolute;
z-index: 1000;
width: auto;
-webkit-transition: opacity 0.3s ease-out;
opacity: 1;
overflow: hidden;
}
.k-widget.k-autocomplete.k-header.k-state-default:hover .coupontooltip {
opacity: 1;
}
#reg-screen {
border-radius: 10px 10px 10px 10px;
border-style: solid;
border-width: 1px;
overflow: visible;
width: 300px;
margin: 30px auto;
padding: 20px 20px 10px 20px;
background-position: 0 -15px;
opacity: 0.85;
}
#reg-screen h2 {
font-weight: bold;
text-align: center;
}
#reg {
width: 100px;
height: 30px;
font-size: 14px;
background-image: url('images/logbutton.png');
color: black;
}
.k-button:hover {
color: lightblue !important;
}
.k-button:active {
background-image: url('images/logbuttonclck.png') !important;
color: lightblue !important;
}
</style>
</div>
<div id="bot"
style="height: 90px; background-image: url('images/bottom-bg.png')">
</div>
</body>
</html>