-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrevenue.php
More file actions
41 lines (32 loc) · 1.02 KB
/
Copy pathrevenue.php
File metadata and controls
41 lines (32 loc) · 1.02 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
<?php include 'inc/header.php';
include "config.php";
include "Database.php";
?>
<?php
$db = new Database();
$query = "SELECT distinct vehicle.model,vehicle.ppday*count(*) as revenue from vehicle,booking where booking.vehicle_id=vehicle.vehicle_id group by booking.vehicle_id";
$read = $db-> select($query);
?>
<?php
if(isset($_GET['msg'])){
echo "<span style = 'color:green' > ".$_GET['msg']."</span>";
}
?>
<table class = "tblone">
<tr>
<th width=50%>Vehicle Model</th>
<th width=50%>Revenue</th>
</tr>
<?php if($read) {?>
<?php while($row = $read -> fetch_assoc()) { ?>
<tr>
<td><?php echo $row ['model'];?></td>
<td><?php echo $row ['revenue'];?></td>
</tr>
<?php }?>
<?php } else{?>
<p> Data is not available!!> </p>
<?php } ?>
</table>
<button type="button" class="btn btn-secondary btn-sm" onclick="location.href='vehicle.php'">Go back</button>
<?php include 'inc/footer.php'; ?>