-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
58 lines (56 loc) · 1.87 KB
/
index.php
File metadata and controls
58 lines (56 loc) · 1.87 KB
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
<?php
include "template/nav.php";
include "template/header.php";
include "data/acounts.php";
?>
<?php
if (sizeof(array_diff($connexion, $ID)) === 0):
?>
<section class="container">
<h2 class="text-center my-4">Tous vos comptes</h2>
<div class="row">
<?php
//we retrieve the data in $accounts
$accounts = get_accounts();
//create three bootstrap cards
for ($i=0; $i < sizeof($accounts); $i++) :
?>
<div class="card col-10 col-md-5 col-lg-3 mx-auto my-4" style="width: 18rem;">
<!-- for each key called name we put them in the head of the card -->
<div class="card-header col-10 mx-auto">
<?php foreach ($accounts[$i] as $key => $value): ?>
<?php if ($key === "name") : ?>
<?php echo $value ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
<ul class="list-group list-group-flush">
<!--attention for the li it is necessary to pass them in echo so that it is added to the card-->
<?php foreach ($accounts[$i] as $keys => $values): ?>
<?php if ($keys !== "name") : ?>
<?php echo '<li class="list-group-item col-10 mx-auto">'.$keys.' : '.$values.'</li>' ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="card-body d-flex justify-content-center align-items-center">
<a href="showaccount.php?<?php foreach ($accounts[$i] as $keyss => $parameter): ?><?php echo "$keyss=$parameter&"; ?><?php endforeach; ?>
" class="btn btn-primary">Voir mon compte
</a>
</div>
</div>
<?php
endfor;
?>
</div>
</section>
<?php
else:
echo '<p class="text-center">Regardez en haut de la page à droite pour vous connecter et afficher vos comptes</p>';
?>
<?php
endif;
?>
<script src="js/main.js"></script>
<?php
include "template/footer.php";
?>