-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
145 lines (125 loc) · 3.97 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/default.css" />
<title>SmartCells</title>
<script language="javascript">
function SelectRedirect() {
switch (document.getElementById('Cell').value) {
case "IdentityMailCell":
window.location = "Commanders/IdentityMailCell.html";
break;
case "GetIPCell":
window.location = "Commanders/GetIPCell.html";
break;
case "GetGeoProfileCell":
window.location = "Commanders/GetGeoProfileCell.html";
break;
case "SendMailCell":
window.location = "Commanders/SendMailCell.html";
break;
default:
window.location = "../"; // if no selection matches then redirected to home page
break;
}// end of switch
}
function hide() {
var el = document.getElementById('commander');
var e2 = document.getElementById('hidden');
var e3 = document.getElementById('agreement');
var e4 = document.getElementById('submit');
var e5 = document.getElementById('dataTable');
el.style.display = 'none';
e2.style.display = 'block';
e3.style.display = 'none';
e4.style.display = 'none';
e5.style.display = 'block';
}
var attempt = 5; // Variable to count number of attempts.
//Below function Executes on click of login button.
function validate() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username == "smartcells" && password == "2015") {
alert("Login successfully");
//window.location = "success.html"; // Redirecting to other page.
return false;
} else {
attempt--;// Decrementing by one.
alert("You have left " + attempt + " attempt;");
//Disabling fields after 3 attempts.
if (attempt == 0) {
document.getElementById("username").disabled = true;
document.getElementById("password").disabled = true;
document.getElementById("submit").disabled = true;
return false;
}
}
}
</script>
</head>
<body>
<div class="register" method="POST">
<p style="float: right">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="infopages/contact.html">Contact</a></li>
<li><a href="infopages/About.html">About</a></li>
</ul>
</p>
<h1>SmartCells</h1>
<fieldset class="row1">
<legend>Cell Commander</legend>
<p id="commander">
<label>Commander name </label> <input id="username" name="username"
required="required" type="text" /> <label>Commander
Password </label> <input id="password" name="password" required="required"
type="text" />
</p>
<p id="hidden" name="hidden" style="display: none; float: right">
<label>Hi Cell Commander</label>
</p>
<div class="clear"></div>
</fieldset>
<fieldset class="row2">
<legend>Cell Collection</legend>
<p></p>
<table style="display: none" id="dataTable" class="form" border="1">
<tbody>
<tr>
<img src="images/SmartCells.jpg" />
</tr>
<tr>
<p>
<td><label>Select Cell</label> <select id="Cell" name="Cell"
onChange="SelectRedirect();">
<option value=""></option>
<option value="IdentityMailCell">IdentityMailCell</option>
<option value="GetIPCell">GetIPCell</option>
<option value="GetGeoProfileCell">GetGeoProfileCell</option>
<option value="SendMailCell">SendMailCell</option>
</select></td>
</tr>
</tbody>
</table>
<div class="clear"></div>
</fieldset>
<fieldset class="row4" id="agreement">
<div>
<legend>Terms and Mailing</legend>
<p class="agreement">
<input id="checkbox" type="checkbox" value="" /> <label>*
I accept the <a href="#">Terms and Conditions</a>
</label>
</p>
</div>
<div class="clear"></div>
</fieldset>
<input id="submit" class="submit" type="submit"
value="Confirm »" onClick="validate();hide();" />
<div class="clear"></div>
<div id="copyright" style=" width:700px; height:50px;text-align: center;margin:40px;">Copyright© <br>Ahmad Karawash 2015</div>
</div>
</body>
</html>