-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Game.php
72 lines (65 loc) · 1.67 KB
/
Game.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
63
64
65
66
67
68
69
70
71
72
<?php
include __DIR__ ."/vendor/autoload.php";
use Tigo\Lottery\LotteryBr;
/**
* Game
* @author Tiago A C Pereira
*/
class Game
{
/**
* instance
*
* @var LotteryBr
*/
protected $lot;
/**
* ticket
*
* @var array
*/
public $ticket = [];
public function __construct()
{
$this->lot = new LotteryBr();
}
public function make($game, $scorer, $qtd)
{
switch($game){
case 1:
$this->ticket = $this->lot->megaSena($scorer,$qtd);
break;
case 2:
$this->ticket = $this->lot->quina($scorer,$qtd);
break;
case 3:
$this->ticket = $this->lot->lotoFacil($scorer,$qtd);
break;
case 4:
$this->ticket = $this->lot->LotoMania($scorer,$qtd);
break;
case 5:
$this->ticket = $this->lot->superSete($scorer,$qtd);
break;
default:
echo "<div class='alert alert-danger'>Jogo não selecionado</div>";
break;
}
}
}
$game = new Game();
$game->make($_POST['game'], $_POST['scorer'], $_POST['ticket']);
foreach ($game->ticket as $key1 => $item1) {
echo "<h5><label class='rounded border text-danger'>".($key1+1).".ª Cartela</label></h5>";
echo "<h5>";
$i = 0;
foreach ($item1 as $key2 => $value) {
$i += 1;
if($i > 10){
echo "<br><br>";
$i = 1;
}
echo "<span class='rounded border border-primary '>".$value."</span> ";
}
echo "</h5><hr>";
}