-
Notifications
You must be signed in to change notification settings - Fork 0
/
show-animals.php
65 lines (54 loc) · 2.54 KB
/
show-animals.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
<?php foreach($animals as $animal): ?>
<div class="row animal-table">
<table class="table-responsive-lg table">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Ime</th>
<th scope="col">Oznaka</th>
<th scope="col">Vrsta</th>
<th scope="col">Pasma</th>
<th scope="col">Spol</th>
<?php if($animal['tag'] == 'F'): ?>
<th scope="col">Brejost</th>
<?php endif; ?>
<th scope="col">Zdravje</th>
<th scope="col">Mati</th>
<th scope="col">Oče</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center"><img src="<?=$animal['url']?>" style="max-height: 125px;"></td>
<td><?=$animal['name']?></td></a>
<td><?=$animal['ear_tag']?></td>
<td><?=$animal['type']?></td>
<td><?=$animal['breed']?></td>
<td><?=$animal['sex']?></td>
<?php if($animal['tag'] == 'F'): ?>
<?php if(!empty($animal['fk_idpregnancies'])): ?>
<td><?=$animal["pregnancy"]?></td>
<?php else: ?>
<td>N/A</td>
<?php endif;?>
<?php endif; ?>
<td><?=$animal['status']?></td>
<td><?php if(isset($animal['idmother'])): ?>
<a href="./index.php?page=animal&id=<?=$animal['idmother']?>"><?=get_animal($animal['idmother'])?></a>
<?php else: echo"N/A"; endif; ?>
</td>
<td><?php if(isset($animal['idfather'])): ?>
<a href="./index.php?page=animal&id=<?=$animal['idfather']?>"><?=get_animal($animal['idfather'])?></a>
<?php else: echo"N/A"; endif; ?></td>
</tr>
</tbody>
</table>
<div class="controls">
<a href="./index.php?page=animal&id=<?=$animal['idanimals']?>" class="btn btn-primary">Pogled</a>
<?php if(is_admin() || $_SESSION['user_id'] == $animal['fk_idusers']): ?>
<a href="./index.php?page=animal-edit&id=<?=$animal['idanimals']?>" class="btn btn-primary">Uredi</a>
<a href="./inc/animal-delete.inc.php?id=<?=$animal['idanimals']?>" onclick="return confirm('Prepričani');" class="btn btn-primary">Izbriši</a>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>