-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-final-reading.php
54 lines (48 loc) · 1.72 KB
/
update-final-reading.php
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
<?php
include 'database.php';
session_start();
date_default_timezone_set('Asia/Kolkata');
$currentdatetime = date('Y-m-d H:i:s');
/*if(isset($_POST['idd'])){
$id = $_POST['idd']; */
if(isset($_SESSION['userID'])){
$id = $_SESSION['userID'] ;
if(isset($_POST['done'])){
$speed = $_POST['Final-speed'];
$q = " UPDATE completed_ride_list SET Final_Reading='$speed',Final_Reading_Timestamp = '$currentdatetime'where ID_no=$id ";
$query = mysqli_query($conn,$q);
echo '<script>
window.location.href = "ride-end.php";
alert("Ride is now completed!")
</script>';
header('location:ride-end.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>Retype ID No.: </label>
<input type="text" name="idd" class="form-control"> <br> -->
<label>Final Speedometer Reading: </label>
<input type="text" name="Final-speed" class="form-control"> <br>
<button class="btn btn-success" type="submit" name="done"> Submit </button><br>
</div>
</form>
</div>
</body>
</html>