-
Notifications
You must be signed in to change notification settings - Fork 0
/
teams.php
executable file
·61 lines (56 loc) · 1.81 KB
/
teams.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
<?php
require_once('includes/init.php');
$teams = Team::getAll('name');
echoHTMLHead('Liste des équipes');
?>
<body>
<div class="container">
<?php echoMenu(); ?>
<h1>Liste des équipes</h1>
<?php if (!empty($_SESSION['user'])) { ?>
<button type="button" class="btn btn-primary nyroModal" href="<?=APPLICATION_URL?>ajax/add_team.php">Ajouter une équipe</button>
<button type="button" class="btn btn-primary nyroModal" href="<?=APPLICATION_URL?>ajax/add_team_category.php">Ajouter une catégorie</button>
<?php } ?>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="col-sm-3">Nom</th>
<th class="col-sm-3">Catégorie</th>
<th class="col-sm-3">Noms alternatifs</th>
<th class="col-sm-2">Logo</th>
<th class="col-sm-1">Actions</th>
</tr>
</thead>
<tbody>
<?php if (count($teams) != 0): ?>
<?php $i=0 ?>
<?php foreach ($teams as $team): ?>
<?php $cat = $team->getTeamCategory(); ?>
<tr>
<td><?php echo $team->name ?></td>
<td><?php echo ($cat ? $cat->name : '') ?></td>
<td><?php echo $team->aliases ?></td>
<td>
<?php
if ($team->has_logo)
echo $team->getLogo();
else
echo ' ';
?>
</td>
<td class="center">
<?php if (!empty($_SESSION['user'])) { ?>
<a href="<?=APPLICATION_URL?>ajax/add_team.php?id=<?php echo $team->id ?>" class="nyroModal" rev="modal"><img src="<?=APPLICATION_URL?>images/edit.png" alt="[edit]" /></a>
<?php } ?>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="3">Aucune équipe trouvée</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php echoHTMLFooter(); ?>
</body>
</html>