|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Klass Omgang. |
|
5
|
|
|
* @author Niklas Dougherty |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
declare(strict_types=1); |
|
9
|
|
|
|
|
10
|
|
|
namespace Tips\Moduler\FANN; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Klass Omgang. |
|
14
|
|
|
*/ |
|
15
|
|
|
class Omgang extends Matchtabell { |
|
16
|
|
|
/** |
|
17
|
|
|
* Omgångsdata för modul. |
|
18
|
|
|
*/ |
|
19
|
|
|
protected function fannomgång(): string { |
|
20
|
|
|
$matchtabell = ''; |
|
21
|
|
|
|
|
22
|
|
|
foreach (array_keys($this->odds->sannolikheter) as $index) { |
|
23
|
|
|
$vinsttecken = $this->utdelning->har_tipsrad ? $this->utdelning->tipsrad[$index] : ''; |
|
24
|
|
|
$fanntecken = siffror_till_symboler($this->utdata[$index]); |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* Markera med färg om vinst eller förlust. |
|
28
|
|
|
*/ |
|
29
|
|
|
$fannstil = match (true) { |
|
30
|
|
|
!$this->utdelning->har_tipsrad => ' class="center"', |
|
31
|
|
|
str_contains($fanntecken, $this->utdelning->tipsrad[$index]) => ' class="vinst center"', |
|
32
|
|
|
default => ' class="storförlust center"', |
|
33
|
|
|
}; |
|
34
|
|
|
|
|
35
|
|
|
$matchtabell .= $this->matchtabell($index, $fannstil, $fanntecken, $vinsttecken); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Eka ut data. |
|
40
|
|
|
*/ |
|
41
|
|
|
return <<< EOT |
|
42
|
|
|
<p><select id="fann_min"> |
|
43
|
|
|
{$this->generatorsträng(7)} </select></p> |
|
44
|
|
|
<table id="fanntabell"> |
|
45
|
|
|
<tr> |
|
46
|
|
|
<th class="match">#</th> |
|
47
|
|
|
<th colspan="2" class="match mindre">FANN/{$this->fann_rätt}</th> |
|
48
|
|
|
<th class="match">Rad</th> |
|
49
|
|
|
<th colspan="2" class="match">Match</th> |
|
50
|
|
|
<th class="match">Res</th> |
|
51
|
|
|
<th colspan="3" class="odds">Odds</th> |
|
52
|
|
|
<th colspan="3" class="odds">Justerade</th> |
|
53
|
|
|
<th colspan="3" class="streck">Streck</th> |
|
54
|
|
|
<th colspan="3" class="streck">Justerade</th> |
|
55
|
|
|
<th colspan="4" class="match">Historik</th> |
|
56
|
|
|
</tr> |
|
57
|
|
|
$matchtabell </table> |
|
58
|
|
|
EOT; |
|
59
|
|
|
} |
|
60
|
|
|
} |
|
61
|
|
|
|