|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Klass Oddstabellrad. |
|
5
|
|
|
* @author Niklas Dougherty |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
declare(strict_types=1); |
|
9
|
|
|
|
|
10
|
|
|
namespace Tips\Moduler\System; |
|
11
|
|
|
|
|
12
|
|
|
use Tips\Klasser\Prediktioner; |
|
13
|
|
|
use Tips\Klasser\Matcher; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Klass Oddstabellrad. |
|
17
|
|
|
* Undre tabell med matcher, odds, streck och historik. |
|
18
|
|
|
*/ |
|
19
|
|
|
final class Oddstabellrad { |
|
20
|
|
|
/** |
|
21
|
|
|
* Initiera. |
|
22
|
|
|
*/ |
|
23
|
|
|
public function __construct( |
|
24
|
|
|
protected Prediktioner $odds, |
|
25
|
|
|
protected Prediktioner $streck, |
|
26
|
|
|
protected Matcher $matcher |
|
27
|
|
|
) { |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Tabellrad för prediktionsdata. |
|
32
|
|
|
* @param string[] $o_stil |
|
33
|
|
|
* @param string[] $s_stil |
|
34
|
|
|
* @param array<int, string[]> $odds |
|
35
|
|
|
*/ |
|
36
|
|
|
public function oddstabellrad(int $index, array $o_stil, array $odds, array $s_stil): string { |
|
37
|
|
|
$matchindex = $index + 1; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* SKicka till Matchtabeller. |
|
41
|
|
|
*/ |
|
42
|
|
|
return <<< EOT |
|
43
|
|
|
<tr> |
|
44
|
|
|
<td class="match höger ix2">$matchindex</td> |
|
45
|
|
|
<td{$this->odds->sorteringsstil[$index]} class="vänster">{$this->matcher->match[$index]}</td> |
|
46
|
|
|
<td class="mindre">{$this->matcher->resultat[$index]}</td> |
|
47
|
|
|
<td{$o_stil[0]}>{$odds[$index][0]}</td> |
|
48
|
|
|
<td{$o_stil[1]}>{$odds[$index][1]}</td> |
|
49
|
|
|
<td{$o_stil[2]}>{$odds[$index][2]}</td> |
|
50
|
|
|
{$this->odds->stil_sannolikheter[$index][0]} |
|
51
|
|
|
{$this->odds->stil_sannolikheter[$index][1]} |
|
52
|
|
|
{$this->odds->stil_sannolikheter[$index][2]} |
|
53
|
|
|
<td{$s_stil[0]}>{$this->streck->prediktioner[$index][0]}</td> |
|
54
|
|
|
<td{$s_stil[1]}>{$this->streck->prediktioner[$index][1]}</td> |
|
55
|
|
|
<td{$s_stil[2]}>{$this->streck->prediktioner[$index][2]}</td> |
|
56
|
|
|
{$this->streck->stil_sannolikheter[$index][0]} |
|
57
|
|
|
{$this->streck->stil_sannolikheter[$index][1]} |
|
58
|
|
|
{$this->streck->stil_sannolikheter[$index][2]} |
|
59
|
|
|
<td class="höger">{$this->odds->utfallshistorik->utfallshistorik[$index][0]}</td> |
|
60
|
|
|
<td class="höger">{$this->odds->utfallshistorik->utfallshistorik[$index][1]}</td> |
|
61
|
|
|
<td class="höger">{$this->odds->utfallshistorik->utfallshistorik[$index][2]}</td> |
|
62
|
|
|
<td class="höger vinst10">{$this->odds->utfallshistorik->utfallshistorik[$index][3]}</td> |
|
63
|
|
|
</tr> |
|
64
|
|
|
|
|
65
|
|
|
EOT; |
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|