-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome_driver.php
More file actions
249 lines (204 loc) Β· 8.21 KB
/
Copy pathhome_driver.php
File metadata and controls
249 lines (204 loc) Β· 8.21 KB
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
<?php
include("protect_driver.php");
include("dbconnect.php");
extract($_REQUEST);
$uname=$_SESSION['driver'];
$q3=mysqli_query($connect,"select * from cargo_driver where uname='$uname'");
$r3=mysqli_fetch_array($q3);
$truckno=$r3['truckno'];
if(isset($btn))
{
$loc=$lat.",".$lon;
$message="Location: $loc";
mysqli_query($connect,"update cargo_truck set lat='$lat',lon='$lon' where truckno='$truckno'");
?>
<script>
//Using setTimeout to execute a function after 5 seconds.
setTimeout(function () {
//Redirect with JavaScript
window.location.href= 'home_driver.php';
}, 6000);
</script>
<?php
}
$q4=mysqli_query($connect,"select * from cargo_truck where truckno='$truckno'");
$r4=mysqli_fetch_array($q4);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title><?php include("title.php"); ?></title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon">
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/animate.css/animate.min.css" rel="stylesheet">
<link href="assets/vendor/aos/aos.css" rel="stylesheet">
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<link href="assets/vendor/remixicon/remixicon.css" rel="stylesheet">
<link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
<!-- =======================================================
* Template Name: Anyar - v4.9.1
* Template URL: https://bootstrapmade.com/anyar-free-multipurpose-one-page-bootstrap-theme/
* Author: BootstrapMade.com
* License: https://bootstrapmade.com/license/
======================================================== -->
<script>
var x = document.getElementById("demo");
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;
document.form1.lat.value=position.coords.latitude;
document.form1.lon.value=position.coords.longitude;
}
</script>
</head>
<body onLoad="getLocation()">
<!-- ======= Top Bar ======= -->
<div id="topbar" class="fixed-top d-flex align-items-center topbar-inner-pages">
<div class="container d-flex align-items-center justify-content-center justify-content-md-between">
<div class="contact-info d-flex align-items-center">
<i class="bi bi-envelope-fill"></i><a href="mailto:contact@example.com">cargo@gmail.com</a>
<i class="bi bi-phone-fill phone-icon"></i> +1 5589 55488 55
</div>
<div class="cta d-none d-md-block">
<!--<a href="bus.php" class="scrollto">Track Bus</a>-->
</div>
</div>
</div>
<!-- ======= Header ======= -->
<header id="header" class="fixed-top d-flex align-items-center header-inner-pages">
<div class="container d-flex align-items-center justify-content-between">
<h1 class="logo"><a href="">Cargo Management</a></h1>
<!-- Uncomment below if you prefer to use an image logo -->
<!-- <a href=index.html" class="logo"><img src="assets/img/logo.png" alt="" class="img-fluid"></a>-->
<nav id="navbar" class="navbar">
<ul>
<li><a class="nav-link scrollto" href="home_driver.php">Home</a></li>
<li><a class="nav-link scrollto" href="logout.php">Logout</a></li>
<!--<li><a href="blog.html">Blog</a></li>
<li class="dropdown"><a href="#"><span>Drop Down</span> <i class="bi bi-chevron-down"></i></a>
<ul>
<li><a href="#">Drop Down 1</a></li>
<li class="dropdown"><a href="#"><span>Deep Drop Down</span> <i class="bi bi-chevron-right"></i></a>
<ul>
<li><a href="#">Deep Drop Down 1</a></li>
<li><a href="#">Deep Drop Down 2</a></li>
<li><a href="#">Deep Drop Down 3</a></li>
<li><a href="#">Deep Drop Down 4</a></li>
<li><a href="#">Deep Drop Down 5</a></li>
</ul>
</li>
<li><a href="#">Drop Down 2</a></li>
<li><a href="#">Drop Down 3</a></li>
<li><a href="#">Drop Down 4</a></li>
</ul>
</li>
<li><a class="nav-link scrollto" href="#contact">Contact</a></li>-->
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
</nav><!-- .navbar -->
</div>
</header><!-- End Header -->
<main id="main">
<section id="services" class="services">
<div class="container" data-aos="fade-up">
<p> </p>
<p> </p>
<p> </p>
<div class="section-title">
<h3> Driver: <?php echo $uname.": ".$r3['name']; ?></h3>
</div>
<form name="form1" method="post">
<div class="row">
<div class="col-md-6">
</div>
<div class="col-md-3">
<input type="hidden" name="lat">
<input type="hidden" name="lon">
<input type="submit" name="btn" value="Refresh" class="btn">
</div>
</div>
</form>
<h3 align="center"><?php echo $message; ?></h3>
<?php
if($truckno!="")
{
?>
<h3>Cargo Details</h3>
<div class="row">
<?php
$q1=mysqli_query($connect,"select * from cargo_details where truckno='$truckno'");
$n1=mysqli_num_rows($q1);
if($n1>0)
{
while($r1=mysqli_fetch_array($q1))
{
?>
<div class="col-md-6 d-flex align-items-stretch" data-aos="fade-up" data-aos-delay="100">
<div class="icon-box">
<i class="bi bi-card-checklist"></i>
<h4><a href=""><?php echo $r1['idno']; ?></a></h4>
<p>Loaded Weight: <?php echo $r1['ldweight']; ?></p>
<p>Loaded Petrol: <?php echo $r1['petrol']; ?></p>
<p>Place: <?php echo $r1['place']; ?></p>
<p>Amount: <?php echo $r1['amount']; ?></p>
<p>Customer: <?php echo $r1['user']; ?></p>
</div>
</div>
<?php
}
}
?>
</div>
<?php
}//bus
?>
</section><!-- End Services Section -->
</main><!-- End #main -->
<!-- ======= Footer ======= -->
<footer id="footer">
<div class="container">
<div class="copyright">
<?php include("title.php"); ?><strong><span></span></strong>
</div>
<div class="credits">
<!-- All the links in the footer should remain intact. -->
<!-- You can delete the links only if you purchased the pro version. -->
<!-- Licensing information: https://bootstrapmade.com/license/ -->
<!-- Purchase the pro version with working PHP/AJAX contact form: https://bootstrapmade.com/anyar-free-multipurpose-one-page-bootstrap-theme/ -->
<a href="https://bootstrapmade.com/"></a>
</div>
</div>
</footer><!-- End Footer -->
<div id="preloader"></div>
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/aos/aos.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/swiper/swiper-bundle.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
</body>
</html>