Subversion Repository Public Repository

gpstest

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
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%  
    String email=session.getAttribute("email").toString();  
    String password=session.getAttribute("password").toString();  
%>
<title>Nrusingh GPS</title>
<link href="css/main.css" rel="stylesheet" />
<link href="css/topmenu.css" rel="stylesheet" />
<link href="css/tablestyle.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<script type="text/javascript">
	$(function(){
		var eml = '<%= email%>';
		//alert(eml);
		$('#loader_map').hide();
		var url = '';
		//url = 'http://23.92.61.79:8082/api/devices/';
		var position_url = 'http://23.92.61.79:8082/api/positions/';
		var device_url = 'http://23.92.61.79:8082/api/devices';
		
		var username = "admin";
		var password = "admin";

		$('#loader_left').show();
		$.ajax({
			type: 'get',
			url: device_url,
			headers: {
				"Accept": "application/json",         
				"Content-Type": "application/json",
				"Authorization": "Basic " + btoa(username + ":" + password)
			},
			'dataType': 'json',
			success: function (response) {
				console.log('Success: '+JSON.stringify(response));
				var html =  '';
				html += '<div>';
				html += '<table id="mytable" style="width: 100%;">';
				html += '<tr>';
				html += '<th>Device Name</th>';
				html += '<th>SIM No.</th>';
				html += '<th>Status</th>';
				html += '<th>Unique id</th>';
				html += '<th>Category</th>';
				html += '</tr>';
				$.each(response, function(k,v){
					var id = v.id;
					var name = v.name;
					var uniqueId = v.uniqueId;
					var status = v.status;
					var category = v.category;
					var phone = v.phone;
					
					html += '<tr>';
					html += '<td><a href="#"><div class="device_details_name" style="color: grey;">'+name+'</div></a></td>';
					html += '<td><div class="device_details_othr">'+phone+'</div></td>';
					html += '<td><div class="device_details_othr">'+status+'</div></td>';
					html += '<td><div class="device_details_othr">'+uniqueId+'</div></td>';
					html += '<td><div class="device_details_othr">'+category+'</div></td>';
					html += '</tr>';
					//$("#ul_device_list").append($(" <li class='device_li' id='"+id+"^"+uniqueId+"^"+name+"^"+status+"'> ").html(html));
				});
				html += '</table>';
				html += '</div>';
				$('#div_device_list').html('');
				$('#div_device_list').html(html);
				$('#loader_left').hide();
			},
			error: function(response){
				alert('Error: '+JSON.stringify(response));
				$('#loader_left').hide();
			}
		});
		
		$(document).on("click", "#ul_device_list li", function(event) {
	      var li_id = $(this).attr('id');
	      var id = li_id.split('^')[0];
	      var uniqueId = li_id.split('^')[1];
	      var name = li_id.split('^')[2];
	      var status = li_id.split('^')[3];
	      $('#loader_map').show();
	      $.ajax({
				async:false,
				cache:false,
				dataType:"json",
				type: "POST",  
				url: "map.jsp",
				data:{id:id,uniqueId:uniqueId,name:name,status:status},
				success: function (response) {
					$('#loader_map').hide();
					console.log('Success: ');
					$('#div_map').html("");
					$('#div_map').html(response.responseText);
				},
				error: function (response) {
					$('#loader_map').hide();
					console.log('Error: ');
					$('#div_map').html("");
					$('#div_map').html(response.responseText);
				}
			});
	    });
		
	});
	
	
</script>

</head>
<body>
	<div class="container">
		<!-- top panel -->
		<header>
		<div><img src="images/logo1.png" style="width: 100px;"></div>
		<div style="margin-top: -95px; margin-left: 180px;"><h1><a href="login" style="text-decoration: none;color: white;">NRUSiNGH GPS TRACKER</a></h1></div>
		
		<div style="float: right; margin-top: -40px;">
			<span style="font-weight: 900; text-transform: uppercase; vertical-align: 7px;"><%=session.getAttribute("email")%></span>
			<a href="logout"><img src="images/logout.png" alt="logout" style="width: 22px; margin-right: 15px;"/></a>
		</div>
		<jsp:include page="menu.jsp" />
		</header>
		<!-- top panel ends -->

		<!-- left panel -->
		<nav> 
		
		</nav>
		<!-- left panel ends -->

		<!-- right panel -->
		<article> 
			<div id="loader_left">
				<img id="loader_img_left" alt="Loding ..." src="images/loader.gif" />
			</div>
			<!-- <ul id="ul_device_list"></ul> -->
			<div id="div_device_list"></div>
		</article>
		<!-- right panel ends -->

		<!-- buttom panel -->
		<footer><div style="text-align: center"> Copyright &copy; Nrusingha nath Nayak</div></footer>
		<!-- buttom panel ends -->
	</div>
</body>
</html>

Commits for gpstest/WebContent/_tracking_detail.jsp

Diff revisions: vs.
Revision Author Commited Message
1 lingaraj picture lingaraj Sat 24 Nov, 2018 13:04:59 +0000