-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
86 lines (81 loc) · 2.38 KB
/
index.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/*
Author: Tiago A C Pereira
Project:
*/
require_once 'SelectorGame.php';
$sg = new SelectorGame();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Gerador de números</title>
</head>
<body>
<!-- As a heading -->
<nav class="navbar navbar-light bg-light">
<span class="navbar-brand mx-auto h1">Gerador de Números Aleatórios</span>
</nav>
<div class="container">
<div class="row">
<div class="col-sm-3"></div>
<div class="col-sm-6">
<div class="row">
<div class="col-md-4 col-xs-4">
<div class="form-group">
<label for="game">Jogo</label>
<select class="form-select" aria-label="Default select example" id="game" name="game">
<option selected>Selecione o jogo</option>
<?php foreach($sg->games as $key => $game){ ?>
<option value=<?php echo $key ?>><?php echo $game ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-4 col-xs-4">
<div class="form-group">
<label for="scorer">Quant. Números</label>
<input type="text" class="form-control" id="scorer" name="scorer" placeholder="Opcional">
</div>
</div>
<div class="col-md-4 col-xs-4">
<div class="form-group">
<label for="ticket">Quant. Cartela</label>
<input type="text" class="form-control" id="ticket" name="ticket">
</div>
</div>
<br>
<br>
<br>
<button class="btn btn-primary" id="submit">Gerar</button>
<hr>
<div class="panel panel-default">
<div class="panel-body" id="output">
</div>
</div>
</div>
<div class="col-sm-3"></div>
</div>
</div>
</body>
</html>
<script>
$("#submit").click(function(){
var game=$("#game").val();
var ticket=$("#ticket").val();
var scorer=$("#scorer").val();
$.post("Game.php",
{
game:game,
scorer:scorer,
ticket:ticket
},function(data){
$("#output").html(data);
});
});
</script>