-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlierGroupe.php
More file actions
56 lines (53 loc) · 1.89 KB
/
lierGroupe.php
File metadata and controls
56 lines (53 loc) · 1.89 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
<?php include("topPage.php"); ?>
<html>
<?php include("head.php"); ?>
<body>
<?php include("enTete.php");?>
<form method="post" name="formulaire" action="lierGroupeFonction.php">
<?php if(isSet($_GET['ok'])){ ?>
<span class=success>Les groupes ont bien été liés à <?php $_GET['ok'] ?></span>
<?php } ?>
<?php if(isSet($_GET['errPasFils'])){ ?>
<span class=erreur>Il faut choisir au moins un enfant pour le groupe père</span>
<?php } ?>
<table class=form>
<tr>
<td><label for="pere">Nom du groupe parent</label></td>
<td>
<select name="pere">
<?php
$req = $bdd->prepare('SELECT nom, ID
FROM utilisateur_groupe AS UG
INNER JOIN groupe ON UG.ID_groupe = groupe.ID
WHERE groupe.typePersonne =?');
$req->execute(array(0));
while($donnee = $req->fetch()){
echo "<option value='".$donnee['ID']."'>".$donnee['nom']."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>
<label for="enfants[]">Nom des groupes enfants</label></td>
<td>
<select name="enfants[]" multiple="multiple">
<?php
$req = $bdd->prepare('SELECT nom, ID
FROM utilisateur_groupe AS UG
INNER JOIN groupe ON UG.ID_groupe = groupe.ID');
$req->execute();
while($donnee = $req->fetch()){
echo "<option value='".$donnee['ID']."'>".$donnee['nom']."</option>";
}
?>
</select>
</td>
</tr>
<table>
<a href="#" onClick=formulaire.submit()><span class="logo valider">W</span></a></td>
</form>
<?php include("footer.php"); ?>
</body>
</html>