-
Notifications
You must be signed in to change notification settings - Fork 0
/
filiados.php
98 lines (86 loc) · 3.74 KB
/
filiados.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
87
88
89
90
91
92
93
94
95
96
97
98
<?php
require_once "config.php";
require_once "menu.php";
$ano= 2020;
if ( !empty($_GET['id'])) {
$ano = $_GET['id'];
}
?>
<!DOCTYPE html>
<html lang="en">
<body>
<head>
<style>
body {
background-image: url("stdp_atletas.jpg"), url("stdp_resultados02.jpg");
background-repeat: no-repeat, repeat;
background-size:100% auto;
}
</style>
</head>
<div class="container">
<div class="row">
<br>
<br>
<?php
echo '<h3 align="center">ATLETAS ABASUP '. $ano . '</h3>'
?>
</div>
<div class="row">
<table cellpadding=0 border=0 style=width:700px align=center class=table table-striped table-bordered >
<thead>
<tr>
<th>#</th>
<th>Nome</th>
<th>Sexo</th>
<th>Cidade</th>
<th>UF</th>
<th>Categoria</th>
<th>Sub-Categoria</th>
</tr>
</thead>
<tbody>
<?php
$count=1;
$sql = mysqli_query($con, "SELECT a.*, c.descricao
FROM filiacao f
JOIN atleta a ON f.atleta_cpf = a.cpf
JOIN categoria c ON f.categoria_idcategoria = c.idcategoria
WHERE f.ano = $ano
ORDER by nome, descricao");
$year = date("Y");
$jrkids = array('1','2','3','4');
$kahunalegend = array('113','114','115','116');
while ($row = mysqli_fetch_assoc($sql)){
echo '<tr>';
echo '<td>'. $count . '</td>';
echo '<td>'. ucwords(strtolower($row['nome'])) . '</td>';
echo '<td>'. $row['sexo'] . '</td>';
echo '<td>'. $row['cidade'] . '</td>';
echo '<td>'. $row['estado'] . '</td>';
echo '<td>'. $row['descricao'] . '</td>';
sscanf($row['data_nascimento'], '%d-%d-%d', $ano, $mes, $dia);
$idade = $year - $ano;
if ( ($idade>39) and ($idade<50) and (!in_array($row['categoria_idcategoria'], $kahunalegend )) ) {
echo '<td>'. "MASTER" . '</td>';
}
elseif ( ($idade>49) and (!in_array($row['categoria_idcategoria'], $kahunalegend )) ) {
echo '<td>'. "G-MASTER" . '</td>';
}
else {
if ( (in_array($row['categoria_idcategoria'],$jrkids)) or (in_array($row['categoria_idcategoria'],$kahunalegend)) ) {
echo '<td>'. "-" . '</td>';
} else {
echo '<td>'. 'OPEN' . '</td>';
}
}
echo '</tr>';
$count++;
}
?>
</tbody>
</table>
</div>
</div> <!-- /container -->
</body>
</html>