-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
57 lines (39 loc) · 1.8 KB
/
index.php
File metadata and controls
57 lines (39 loc) · 1.8 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
<?php
require_once 'Helper/AutoLoader.php';
spl_autoload_register('AutoLoader::ClassLoader');
$factory = AutomobileFactory::getInstance();
//Time::checkIfBetween("15.06.2015", "15.07.2015");
//Time::checkIfBetween("15.12.2015", "15.01.2016");
$christmas = new OrdinaryDiscount("15.06.2015", "15.07.2016", 0.15, "Reducere cu ocazia sarbatorilor de iarna");
$vip = new VipDiscount();
Helper::displayBoldMessage("Creating A-Class Vehicle");
$newAClassCar = $factory->createVehicle("a");
$newAClassCar->viewAllSpecifications();
$newAClassCar->addDiscountOption($vip);
$newAClassCar->addDiscountOption($christmas);
$newAClassCar->viewDiscountOptions();
Helper::displayInfoMessage("Recalculated price: ".$newAClassCar->calculatePrice());
Helper::displayBoldMessage("Equipping optional specifications...");
$newAClassCar->equipOptionalSpec("xenon");
$newAClassCar->equipOptionalSpec("volan");
$newAClassCar->equipOptionalSpec("jante");
$newAClassCar->equipOptionalSpec("cruise");
$newAClassCar->viewOptionalSpecs();
Helper::displayInfoMessage("Recalculated price: ".$newAClassCar->calculatePrice());
$newAClassCar ->deleteSpec("xenon");
Helper::displayInfoMessage("Recalculated price: ".$newAClassCar->calculatePrice());
$newAClassCar ->deleteSpec("volan");
Helper::displayInfoMessage("Recalculated price: ".$newAClassCar->calculatePrice());
$newAClassCar ->deleteSpec("xenon");
Helper::displayInfoMessage("Recalculated price: ".$newAClassCar->calculatePrice());
//$newBClassCar = $factory->createVehicle("b");
//$newBClassCar->viewAllSpecifications();
//
//$newCClassCar = $factory->createVehicle("c");
//$newCClassCar->viewAllSpecifications();
//
//$newEClassCar = $factory->createVehicle("e");
//$newEClassCar->viewAllSpecifications();
//
//$newSClassCar = $factory->createVehicle("s");
//$newSClassCar->viewAllSpecifications();