-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_as.php
More file actions
122 lines (90 loc) · 2.77 KB
/
Copy pathfunction_as.php
File metadata and controls
122 lines (90 loc) · 2.77 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
<html>
<body>
<head>
<center>
<style>
#box {
background-image: linear-gradient(rgb(121, 165, 135) , rgb(34, 48, 42));
background-position: right bottom, left top;
background-repeat: no-repeat, repeat;
padding: 15px;
border-radius: 15px;
width: 620px;
height: "auto"px;
box-shadow: 0 5px 15px 0 rgba(255, 255, 255, 0.2), 0 2px 15px 0 rgba(0, 0, 0, 0.30);
border-style: solid;
border-width: 5px;
border-color: rgb(255, 255, 255);
}
body {
color: white;
}
h1 {
color: rgb(255, 255, 255);
}
</style>
<div id="box">
<h1>TOTAL BILL CHECKER</h1>
<?php
$electricbill = $_GET ['electricbill'];
$waterbill = $_GET ['waterbill'];
$internetbill = $_GET ['internetbill'];
$garbagedisposal = $_GET ['garbagedisposal'];
//monthlyexpenses
$foodbill = $_GET ['foodbill'];
$rent = $_GET ['rent'];
$groceries = $_GET ['groceriesbill'];
$totalexpenses = $rent + $foodbill + $groceries;
//peoples
$totalofpplhide = $_GET ['sharingwith'];
$totalofppl = $totalofpplhide;
function totalbillamont ($electricbill , $waterbill , $internetbill , $garbagedisposal) {
$bills = $electricbill + $waterbill + $internetbill + $garbagedisposal;
return $bills;
}
echo " ". "Total for all bills = MVR " . totalbillamont($electricbill, $waterbill, $internetbill, $garbagedisposal);
echo "<br>";
echo "<br>";
function totalexpenses ($foodbill , $rent , $groceries){
$totalexpenses = $rent + $foodbill + $groceries;
return round($totalexpenses);
}
function dividemonthlyexpenses ($totalexpenses , $totalofppl){
$dividedtotalexpense = $totalexpenses / $totalofppl;
return ($dividedtotalexpense);
}
echo "Rent for each person (shared) = MVR " . dividemonthlyexpenses ($totalexpenses , $totalofppl);
echo ifAbove8000($totalexpenses , $totalofppl);
//echos
echo "<br>";
echo "<br>";
echo "TOTAL OF EXPENSES AND BILLS";
echo "<br>";
echo "<br>";
echo "ELECTRIC BILL : " . $electricbill;
echo "<br>";
echo "WATER BILL : " . $waterbill;
echo "<br>";
echo "INTERNET BILL : " . $internetbill;
echo "<br>";
echo "GARBAGE DISPOSAL : " . $garbagedisposal;
echo "<br>";
echo "FOOD BILL : " . $foodbill;
echo "<br>";
echo "RENT : " . $rent;
echo "<br>";
echo "GROCERIES : " . $groceries;
echo "<br>";
echo "<br>";
echo "<br>";
echo "Total expenses = MVR " . totalexpenses($foodbill , $rent , $groceries);
function ifAbove8000 ($totalexpenses , $totalofppl) {
if (dividemonthlyexpenses($totalexpenses , $totalofppl) > 8000) {
echo "!! KEEP YOUR EXPENSES DOWN 8000 FOR EACH PERSON THATS TOO HIGH !! ";
}
}
?>
</head>
</center>
</body>
</html>