-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbilling.php
More file actions
91 lines (89 loc) · 2.06 KB
/
billing.php
File metadata and controls
91 lines (89 loc) · 2.06 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
<!DOCTYPE html>
<html>
<head>
</head>
<title>Bill</title>
<style type="text/css">
table{
margin: 3 auto;
display: table-cell;
height: 20%;
width: 85%;
display: table;
border-collapse:collapse;
color:#d96459;
font-family:monospace;
font-size:20px;
text-align: left;
}
.heading {
background-color:#588c7e;
color:white;
}
.data{
background-color:white;
color:blue;
}
button{
padding: 5px;
border-radius: 5px;
margin: 2px;
display: block;
width: 80px;
border: 2px;
background-color: white;
color: blue;
font-family: sans-serif;
text-align: center;
}
button{
border: .5px solid black;
background-color: orange;
color: white;
}
body {
background-image:linear-gradient(rgba(0,0,0,0.8),rgba(0,0,0,0.8)),url(897814460-170667a.jpg);
background-size: cover;
font-size: 18px;
color: white;
}
h2{
color:orange;
text-align: center;
</style>
<table>
<center>
<h2> BILL RECEIPT</h2>
<?php
session_start();
$user=$_SESSION['user'];
$cn=new mysqli("localhost","root","","owner") or die("Connection failed");
$owner=$cn->query("SELECT * FROM OWNER WHERE USER='$user'");
$owner=$owner->fetch_array();
$vno=$owner['vehno'];
$date=date("d-M-Y");
echo "<tr><th>Username:".$user."</th><th></th><th>".$date."</th></tr><tr><th>VehicleNo:".$vno."</th></tr>";
?>
<tr class="heading">
<th>Type of Sevice</th>
<th>Subscribed</th>
<th>Rate</th>
</tr>
<?php
$services=$cn->query("SELECT engineservice,oilservice,waterservice,enginereplace FROM SERVIN WHERE VEHNO='$vno'");
echo $cn->error;
$services=$services->fetch_assoc();
$rate=array('engineservice'=>1200,'oilservice'=>800,'waterservice'=>400,'enginereplace'=>5000);
$sum=0;
foreach($services as $x=>$x_value){
$sum+=$cost=($x_value=="Yes")?$rate[$x]:0;
echo "<tr class='data'><td>".$x."</td><td>".$x_value."</td><td>".$cost."</td></tr>";
}
echo "<p><tr><td></td><td><p>Total =</p></td><td>".$sum."</td></tr>";
?>
</center>
<td><button><a href="servin.php">Back</a></button>
</td>
</table>
</body>
</html>