-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterface.php
More file actions
128 lines (101 loc) · 3.35 KB
/
Copy pathInterface.php
File metadata and controls
128 lines (101 loc) · 3.35 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
123
124
125
126
127
128
<?php
interface infoturnament {
public function infotour ();
}
abstract class turnament {
public $nama;
private $feeregist;
public $timeregist,
$TM,
$matchday,
$rule,
$payment;
protected $disc;
public function __construct ($nama = "nama", $feeregist = "harga", $timeregist = "tanggal", $TM = "tanggal", $matchday = "tanggal", $rule = "peraturan", $payment= "OVO, DANA, GO-PAY, BRI", $disc=0){
$this->nama=$nama;
$this->feeregist=$feeregist;
$this->timeregist=$timeregist;
$this->TM=$TM;
$this->matchday=$matchday;
$this->rule=$rule;
$this->payment=$payment;
$this->disc=$disc;
}
public function getlabel (){
return "$this->nama, $this->feeregist, $this->timeregist";
}
abstract public function tourinfo ();
public function setdisc ($disc){
$this->disc = $disc;
}
public function getfee (){
return $this->feeregist-$this->disc;
}
}
//class child
class MC extends turnament implements infoturnament {
public $nick;
public function __construct ($nama = "nama", $feeregist = "harga", $timeregist = "tanggal", $TM = "tanggal", $matchday = "tanggal", $rule = "peraturan", $nick, $payment= "OVO, DANA, GO-PAY, BRI"){
parent::__construct($nama, $feeregist, $timeregist, $TM, $matchday, $rule, $payment);
$this->nick=$nick;
}
public function tourinfo () {
$str = "{$this->getlabel()} | {$this->TM} | {$this->matchday} <br> (peraturan : {$this->rule} | {$this->payment}";
return "$str";
}
public function infotour(){
$str = "{$this->tourinfo()} <br> kategori tourney : individu <br> peserta : {$this->nick}";
return "$str";
}
}
class ML extends turnament implements infoturnament {
public $tim;
public function __construct ($nama = "nama", $feeregist = "harga", $timeregist = "tanggal", $TM = "tanggal", $matchday = "tanggal", $rule = "peraturan", $tim, $payment= "OVO, DANA, GO-PAY, BRI"){
parent::__construct($nama, $feeregist, $timeregist, $TM, $matchday, $rule, $payment);
$this->tim=$tim;
}
public function tourinfo () {
$str = "{$this->getlabel()} | {$this->TM} | {$this->matchday} <br> (peraturan : {$this->rule} | {$this->payment}";
return "$str";
}
public function infotour(){
$str = "{$this->tourinfo()} <br> kategori tourney : tim <br> peserta : {$this->tim}";
return "$str";
}
}
//object type
class cetakinfotour {
public $listtour = array ();
public function tambahtour (turnament $tour){
$this->listtour[]=$tour;
}
public function cetak(){
$str = "list tourney : <br>";
$ak = 1;
foreach ($this->listtour as $lt){
$str .= $ak++. ". {$lt->infotour()} <br>";
}
return $str;
}
}
//cetak
$MCML = new MC ("MAGIC CHESS TOURNEY", 15000, "21-29 juni 2020", "30-6-2020", "1-3 juli 2020", "BO4 ke babak selanjutnya", "lemon");
$ML = new ML("MOBILE LEGENDS TOURNEY",40000,"21-29 juni 2020", "30-60-2020", "3-5 juli 2020", "BO1, semifinala dan final BO3", "RRQ");
echo "<hr>";
echo $MCML->getlabel();
echo "<br>";
echo $ML->getlabel();
echo "<hr>";
$info = new cetakinfotour();
echo $info->cetak ($MCML);
echo "<hr>";
echo $info->cetak ($ML);
echo "<hr>";
$MCML->setdisc(1000);
echo $MCML->getfee();
echo "<hr>";
$ctk = new cetakinfotour;
$ctk->tambahtour ($MCML);
$ctk->tambahtour ($ML);
echo $ctk->cetak ();
?>