-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-fare-journey.php
More file actions
47 lines (41 loc) · 1.55 KB
/
update-fare-journey.php
File metadata and controls
47 lines (41 loc) · 1.55 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
<?php
include 'database.php';
date_default_timezone_set('Asia/Kolkata');
$currentdatetime = date('Y-m-d H:i:s');
if(isset($_GET['ID_no'])){
$id = $_GET['ID_no'];
if(isset($_POST['done'])){
$speed = $_POST['init-speed'];
$q = " UPDATE accepted_rides SET Initial_Reading='$speed',Initial_Reading_Timestamp = '$currentdatetime'where ID_no=$id ";
$conn->query($q);
$q2 = " UPDATE completed_ride_list SET Initial_Reading='$speed',Initial_Reading_Timestamp = '$currentdatetime' where ID_no=$id ";
$conn->query($q2);
header('location:driver.php');
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="col-lg-6 m-auto">
<form method="post">
<br><br><div class="card">
<div class="card-header bg-dark">
<h1 class="text-white text-center">Speedometer Reading</h1>
</div><br>
<label>Initial Speedometer Reading: </label>
<input type="text" name="init-speed" class="form-control"> <br>
<button class="btn btn-success" type="submit" name="done"> Submit </button><br>
</div>
</form>
</div>
</body>
</html>