-
Notifications
You must be signed in to change notification settings - Fork 0
/
index1111.html
302 lines (258 loc) · 8.64 KB
/
index1111.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
292
293
294
295
296
297
298
299
300
301
302
<html>
<head>
<style>
body{
}
</style>
<title>
Database Connection
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Full-width input fields */
input[type=text], input[type=password] {
width: 30%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
/* Set a style for all buttons */
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 30%;
}
button:hover {
opacity: 0.8;
}
/* Extra styles for the cancel button */
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
/* Center the image and position the close button */
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
position: relative;
}
.container {
padding: 0px;
}
span.psw {
float: right;
padding-top: 50px;
}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
padding-top: 60px;
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}
/* The Close Button (x) */
.close {
position: absolute;
right: 25px;
top: 0;
color: #000;
font-size: 35px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
/* Add Zoom Animation */
.animate {
-webkit-animation: animatezoom 0.6s;
animation: animatezoom 0.6s
}
@-webkit-keyframes animatezoom {
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 50%;
}
}
h1{font-family: Calibri,Candara,Segoe,Segoe UI,Optima,Arial,sans-serif;
font-size: 70px;
font-style: normal;
font-variant: normal;
font-weight: 500;
line-height: 26.4px;
padding:180px 0px 0px 0px;
}
h3{font-family: Calibri,Candara,Segoe,Segoe UI,Optima,Arial,sans-serif;
font size:60px;}
</style>
</head>
<body>
<h1><center>#WeCode</center></h1>
<h3><center><b>LOGIN</b></center></h3>
<div class="container">
<center>
<label><b>Username</b></label>
<input type="text" placeholder="Enter Username" id="uname" name="uname" required>
<br>
<label><b>Password</b></label>
<input type="password" placeholder="Enter Password" id="psw" name="psw" required>
<BR>
<button type="button" id="main" onclick="getLocation()">Login</button>
</center>
</div>
<!-- <div class="container" style="background-color:#f1f1f1">
<button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
</div>-->
</form>
</div>
<!--<button onclick="getLocation()">Try It</button>-->
<p id="demo"></p>
<!--<div id="floating-panel">-->
<input id="latlng" type="hidden" value="">
<!-- <input id="submit" type="button" value="Reverse Geocode">
</div>-->
<div id="Address"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#main').click(function(){
var obj1, dbParam, xmlhttp, myObj, x, txt = "";
console.log((document.getElementById('uname').value));
console.log((document.getElementById('psw').value));
obj1 = {
"Username":"" +(document.getElementById('uname').value),
"Password":"" +(document.getElementById('psw').value)};
console.log("getLocation");
dbParam = JSON.stringify(obj1);
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
// console.log("Hi");
console.log("error");
console.log(this.responseText);
console.log(JSON.parse(this.responseText));
console.log("error1");
myObj = JSON.parse(this.responseText);
//document.getElementById('main').innerHTML += myObj[1].uname;
}
};
xmlhttp.open("POST", "checkloginpwd.php", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send("x=" + dbParam);
})
});
var x = document.getElementById("demo");
var ab,xy;
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
xy=position.coords.latitude;
ab=position.coords.longitude;
//xy=;
//ab=124.07939014;
var cd=xy+","+ab;
document.getElementById('latlng').value=cd;
var geocoder = new google.maps.Geocoder;
var infowindow = new google.maps.InfoWindow;
geocodeLatLng(geocoder,infowindow);
var ef= new Date().toLocaleTimeString();
document.getElementById('time').innerHTML ="" +ef;
}
function geocodeLatLng(geocoder, infowindow) {
var input = document.getElementById('latlng').value;
var latlngStr = input.split(',', 2);
var latlng = {lat: parseFloat(latlngStr[0]), lng: parseFloat(latlngStr[1])};
geocoder.geocode({'location': latlng}, function(results, status) {
if (status === 'OK') {
if (results[0]) {
/*
var obj;
// dbParam, xmlhttp, myObj, x, txt = "";
obj = {
"name":"Hello",
"latitude":36.53372445,
//xy
"longitude":124.07939014,
//ab,
"Address":""+(results[0].formatted_address)};
console.log("getLocation");
dbParam = JSON.stringify(obj);
$(document).ready()
xmlhttp = new XMLHttpRequest();
/* xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// console.log("Hi");
// console.log(this.responseText);
// console.log((this.responseText));
// console.log(JSON.parse(this.responseText));
// myObj1 = JSON.parse(this.responseText);
//document.getElementById("Address").innerHTML += myObj.username;
//console.log("hi");
/* for (x in myObj) {
txt += myObj[x].name + "<br>";*/
/* for(i=0; i<myObj.length; i++)
{
//console.log("Hi");
}
}};*//*
xmlhttp.open("POST", "json_demo_db_post_copy_triak.php", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send("x=" + dbParam);*/
window.location = "./json_demo_db_post_copy_triak.php?lat="+ xy + "&long=" + ab;
}
else {
window.alert('No results found');
}
} else {
window.alert('Geocoder failed due to: ' + status);
}
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAfFR4DlkAe9x1eBBbw6ssLDMcPxGDzrjw">
</script>
<div id="text"></div>
<div id="time"></div>
</body>