-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenewFees.php
62 lines (56 loc) · 1.98 KB
/
RenewFees.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
55
56
57
58
59
60
61
62
<?php
include_once "Car.php";
class Renewfees extends Car{
private $TotalFees;
private $yearsNo;
public function YearsCalc($yearsNo,$startDate,$endDate){
$startDate=substr("$startDate",-8,2);
$endDate=substr("$endDate",-8,2);
return $yearsNo=(int)$endDate-(int)$startDate;
}
public function FeesCalc($TotalFees,$motorCapacity,$fuelType,$yearsNo){
if($motorCapacity<1000){
switch($fuelType){
case "Petrol":
return $TotalFees=$yearsNo*225;
break;
case "Gasoline":
return $TotalFees=$yearsNo*450;
break;
}
}
else if($motorCapacity>1000){
if($motorCapacity>1600){
switch($fuelType){
case "Petrol":
return $TotalFees=$yearsNo*3000;
break;
case "Gasoline":
return $TotalFees=$yearsNo*6000;
break;
}
}
else if($motorCapacity>1300){
switch($fuelType){
case "Petrol":
return $TotalFees=$yearsNo*750;
break;
case "Gasoline":
return $TotalFees=$yearsNo*1500;
break;
}
}
else {
switch($fuelType){
case "Petrol":
return $TotalFees=$yearsNo*350;
break;
case "Gasoline":
return $TotalFees=$yearsNo*700;
break;
}
}
}
}
}
?>