-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainpage.html
114 lines (96 loc) · 3.81 KB
/
mainpage.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
{% load static %}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="https://apis.mapmyindia.com/advancedmaps/v1/qdxayapl4jql4j47pmgkzzqgee9oce12/map_load?v=1.3"></script>
<script src=" jquery-2.1.4.js; "></script>
<meta charset="utf-8">
<title>Carpool</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type ="text/css" href="{% static 'style.css' %}">
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
</head>
<body>
<nav>
<input type="checkbox" id="check">
<label for="check" class="checkbtn">
<i class="fas fa-bars"></i>
</label>
<label class="logo">Carpool<i class="fas fa-car"></i></label>
<ul>
{% csrf_token %}
<li> HELLO {{ user.first_name }} </li>
<li><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Feedback</a></li>
<li><a href='logout'>Logout</a></li>
</ul>
</nav>
<div class="container">
<div class="leftside">
<form action="usersearch" method="POST">
{% csrf_token %}
<div>
<label id="l1">SOURCE</label>
<select type="text" name="source" >
{% for s in src %}
<option selected>{{s.source}}</option>
{% endfor %}
</select>
</div>
<div>
<label id="l2">DESTINATION</label>
<select type="text" name="destination" >
{% for d in des %}
<option selected>{{d.destination}}</option>
{% endfor %}
</select>
</div>
<button >SUBMIT</button>
<label >available drivers</label>
<select type="text" name="driver1" >
{% for d in dnames %}
<option selected>{{d.name}}</option>
{% endfor %}
</select>
</form>
<form action="mainpage.html"><button type="submit"> HISTORY</button>
<div id="popup"></div></form>
</div>
<div class="rightside">
<p>Click the button to get your coordinates.</p>
<button onclick="getLocation()"> USER</button>
<form><button>DRIVER</button>
{% csrf_token %}
<input type="hidden" id="value" value=""
<input type="hidden" id="23" value="">
</form>
<p id="demo"></p>
<div id="firstmap"></div>
</div>
</div>
</div>
</body>
<script>
var
var x = document.getElementById("demo");
var a=0.0;
var b=0.0;
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;
a= position.coords.latitude;
b= position.coords.longitude;
var map=new MapmyIndia.Map("firstmap",{ center:[position.coords.latitude,position.coords.longitude],zoomControl: true,hybrid:true });
L.marker([position.coords.latitude, position.coords.longitude]).addTo(map);
}
</script>
</html>