Salut à tous, je suis sur une application web qui doit gérer les demandes de produit(s).
j'ai pu la réaliser à part quelques points qui me complique la vie.
dans le formulaire j'ai mis 2 bouttons Javacript(ajouter une ligne et supprimer la dernière ligne)

1- modifier la fiche de demande de produits:
je doit permettre à l'utilisateur de modifier mais j'ai des erreurs. lors de la modification le User doit pouvoir Ajouter ou supprimer une ligne ainsi que mettre à jour les lignes existantes.

2- En bas de page, il ya une zone de signature avec les attributs css
Code css : Sélectionner tout - Visualiser dans une fenêtre à part
position:fixed et buttom:0
; Mais s'il ya plusieurs produits dans le tableau la zone de signature se voit superposé sur le tableau. à l'impression tout vas bien mais la superposition me derange beaucoup.

3- J'ai utilisé des conditions pour restreindre l'apparution de certaines pages, bouttons et informations via
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
if($_SESSION['user'])
, ca marche mais lorque je transmet la page par url, l'utilisateur connecté qui n'est pas sensé avoir accès à cette page peut y acceder.

4- je veux mettre en place un système de notification avec les options "Approuver et Réfuser". Et le demandeur en sera également notifié. Une fois Approuver, rendre toutes modification impossible.

Voici les codes:
Nouvelle demande
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
 
    require_once('Identification.php');
 
    include('Connexiondb.php');
    include('Entete.php');
 
 
    $requeteC = "select * from Categorie";
    $resultatC = $pdo->query($requeteC);
 
    $requeteD = "select * from Direction";
    $resultatD = $pdo->query($requeteD);
?>
 
 
<!DOCTYPE HTML>
<HTML>
    <HEAD>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
            <script>
                $(document).ready(function(){
                    var counter = 2;
 
                    $("#addButton").click(function () {
                        if(counter>10){
                            alert("Vous avez atteint la limite de 10 produits");
                            return false;
                        }   
 
                        var newProductRow = '<tr class = "product-row">' +
                                                '<td>' +
                                                    '<select name="categorie' + counter + '" class="Combobox" required>' +
                                                        '<option value="">Choisissez une Catégorie</option>' +
                                                        '<?php while($categorie = $resultatC->fetch()){ ?>' +
                                                            '<option value="<?php echo $categorie['idCategorie'] ?>"><?php echo $categorie['nomCategorie'] ?></option>' +
                                                        '<?php } ?>' +
                                                    '</select>' +
                                                '</td>' +
                                                '<td><input type="text" name="produit' + counter + '"></td>' +
                                                '<td><input type="number" name="quantite' + counter + '"></td>' +
                                            '</tr>';
 
                        $("#productTable").append(newProductRow);
 
                        counter++;
                    });
 
                    $("#removeButton").click(function () {
                        if(counter == 2){
                            alert("Il doit y avoir au moins un produit");
                            return false;
                        }   
 
                        counter--;
 
 
                            $("#productTable tr.product-row:last-child").remove();
                        
                    });
                });
            </script>
    </HEAD>
    <BODY>
    <?php include("Menu.php"); ?>
        <div class="table-responsive">
            <form action="InsertFiche.php" method="post">
                <table id = "productTable">
 
                    <thead>
                        <tr>
                            <th>Catégorie</th>
                            <th>Produit demandé</th>
                            <th>Quantité</th>
                        </tr>
                    </thead>
                    <tbody>
 
                            <tr class="product-row">
                                <div>
                                    <td>                           
                                        <select name="categorie1" class = "Combobox" required>
 
                                            <option value="">Choisissez une Catégorie</option>
                                            <?php 
                                                $resultatC = $pdo->query("select * from Categorie");
                                                while($categorie = $resultatC->fetch()){ ?>
                                            <option value="<?php echo $categorie['idCategorie'] ?>">
                                                <?php echo $categorie['nomCategorie'] ?>
                                            </option>
                                            <?php } ?>
                                        </select>
                                    </td>
                                </div>
                                <div>
                                    <td><input type="text" name="produit1"></td>
                                </div>
                                <div>
                                    <td><input type="number" name="quantite1"></td>
                                </div>
                            </tr>
 
 
                    </tbody>
                </table>
            <br>
            <div class = "submit">
                <button type="button" id="addButton">Ajouter une ligne <span class="glyphicon glyphicon-plus" style="color:green"></span> </button>
                &nbsp;&nbsp;&nbsp;
                <button type="button" id="removeButton">Supprimer la dernière ligne <span class="glyphicon glyphicon-minus" style="color:red"></span> </button>
            </div>
        </div>
 
 
        <br><br>
 
        <div class="form-group">
            <label class = "taillePlus" for="commentaire">Commentaire :</label> <br>
            <textarea class="form-control" id="commentaire" name="commentaire" rows="3"></textarea>
        </div>
 
            <br><br>
 
            <div class = "flex-container">
                <label class = "taillePlus">Direction : </label>
 
 
                       <label class = "taillePlus"> <?php echo $_SESSION['user']['nomDirection'] ?></label> 
                </select>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <label class = "taillePlus">Directeur général adjoint : </label>
                <select class = "taillePlus" style = "width: 350px;" name="dga" required>
                    <option value="">Choisissez un DGA</option>
                    <option value="technique">
                                Technique
                    </option>
                    <option value="chargé des operations">
                               Chargé des opérations
                    </option>
 
                </select>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <label class = "taillePlus">Direction destinataire: </label>
                <select class = "taillePlus" style = "width: 350px;" name="destination" required>
                    <option value="">Choisissez une direction destinataire</option>
                    <?php 
                        $resultatD = $pdo->query("select * from Direction");
                        while($direction = $resultatD->fetch()){ ?>
                            <option value="<?php echo $direction['nomDirection'] ?>">
                                <?php echo $direction['nomDirection'] ?>
                            </option>
                                <?php } ?>
                </select>
 
            </div>
 
 
 
        <br>
        <br>
        <div class="submit">
            <input type="submit"  name = "submit" class="btn btn-success" value="Envoyer la demande">
                <a href = "Fiches.php" >            
                    <button class="btn btn-danger" onclick='location.href="Fiches.php"'>
                        <span class="glyphicon glyphicon-trash"></span>
                        Annuler
                    </button>
                </a>
        </div>
        </form>
    </BODY>
</HTML>

Affichage de la demande:
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
    require_once('Identification.php');
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../css/DetailFiche.css">
        <link rel="stylesheet" type="text/css" href="../css/print.css" media="print">
        <script>
            // fonction pour cacher le bouton pendant l'impression
            function hideButtonDuringPrint() {
                var printButton = document.getElementById('print-button');
                printButton.style.display = 'none';
                window.print();
                printButton.style.display = 'block';
            }
            
            // événement de clic pour le bouton "Imprimer"
            var printButton = document.getElementById('print-button');
            printButton.addEventListener('click', hideButtonDuringPrint);
        </script>
<style>
  
  .signature-container {
    position: relative;
    bottom: 0;
    min-height: 170px; /* Hauteur de la fenêtre visible */
  }
 
  .signature {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 20px;
  }
 
  .signature div {
    border: 1px solid black;
    padding: 10px;
    text-align: center;
    width: 30%;
    font-size: 18px;
  }
  .signature-adjoint{
    font-size: 17px;
    white-space: nowrap;
    padding-right: 10px;
    text-indent: -8px;
  }
 
</style>
    </head>
    <body>
    <?php include("Menu.php"); ?>
    <img src='../Images/LogoPMU.png' width = 320, heigth = 116/>
    <?php $idFiche = $_GET['idFiche']; ?>
        <div class = "marginright right" id="print-button">
                    <a href = "Fiches.php" id="print-button">            
                        <button id="print-button">
                            <span class="glyphicon glyphicon-arrow-left"></span>
                            Voir toutes les demandes
                        </button>
                    </a>
 
                    <a href = "ModifierFiche.php?idFiche=<?php echo $idFiche ?>" id="print-button">            
                        <button id="print-button">
                            <span class="glyphicon glyphicon-edit"></span>
                            Modifier la fiche
                        </button>
                    </a>
                <button onclick="hideButtonDuringPrint()" id="print-button">
                    <span class="glyphicon glyphicon-print"></span>
                    Imprimer
                </button>
 
        </div>
 
        <div class = "marginright right">       
 
        </div>
 
        <?php
            include('Connexiondb.php');
 
 
            // Récupérer l'idFiche depuis l'URL
            
 
            // Requête pour récupérer les informations de la fiche
            /*
            $requete = "SELECT f.idFiche, f.dateFiche, f.commentaire, d.sigleDirection, c.nomCategorie, p.nomProduit, p.quantite 
            FROM Fiche f where idFiche = '$idFiche'
            INNER JOIN Produit p ON p.idFiche = p.idFiche 
            INNER JOIN Categorie c ON p.idCategorie = c.idCategorie 
            INNER JOIN Direction d ON f.idDirection = d.idDirection";
            $requeteFiche = "SELECT * from Fiche where idFiche = $idFiche";
            $requeteProduit = "SELECT * from Produit as p, Fiche as f where p.idFiche = $idFiche";
            $requeteFicheProduit = "SELECT  * from FicheProduit as fp, Fiche as f where fp.idFiche = $idFiche";
 
            $requete = "SELECT f.idFiche, f.dateFiche, f.commentaire, p.nomProduit, p.quantite 
            FROM FicheProduit fp where idFiche = 3
            INNER JOIN Produit p ON p.idFiche = p.idFiche 
            INNER JOIN Fiche d ON fp.idFiche = f.idFiche";
            */
            $requetef = "SELECT idFiche, DATE_FORMAT(dateFiche, '%d-%m-%Y') as dateFiche, dga, destination, commentaire, nomDirection, sigleDirection from Fiche as f, Direction as d where f.idDirection = d.idDirection and idFiche = $idFiche";
            $requetep = "SELECT nomProduit, quantite, nomCategorie from Produit as p, Categorie as c where p.idCategorie = c.idCategorie and idFiche = $idFiche";
            $resultatf = $pdo->query($requetef);
            $resultatp = $pdo->query($requetep);
 
            // Afficher les informations de la fiche
            if($resultatf) {
                $fiche = $resultatf->fetch();
                ?>
                <div class = "marginleft">
                    <h3 class = "EnteteDetail">Fiche de besoin N°<?php echo $fiche['idFiche']; ?>/ Direction: &nbsp;<?php echo $fiche['sigleDirection']; ?> </h3>
                        <tr>
                            <label>Date : &nbsp;<?php echo $fiche['dateFiche']; ?></label>
                        </tr>
                        <br>
                        <tr>
                            <label>Commentaire : &nbsp;<?php echo $fiche['commentaire']; ?></label>
                        </tr>
                </div>
 
                    <div class="table-responsive">
                    <div class="table-responsive">
  <table class="margetop">
    <thead>
      <tr>
        <th>Catégorie</th>
        <th>Désignation</th>
        <th>Quantité</th>
        <th style="width: 15%;">Destination</th>
      </tr>
    </thead>
    <tbody>
      <?php 
        $count = 0;
        while ($produit = $resultatp->fetch()) { 
          $count++;
      ?>
        <tr>
          <td><?php echo $produit['nomCategorie']; ?></td>
          <td><?php echo $produit['nomProduit']; ?></td>
          <td><?php echo $produit['quantite']; ?></td>
          <?php if ($resultatp->rowCount() == 1) { ?>
            <td><?php echo $fiche['destination']; ?></td>
          <?php } else if ($resultatp->rowCount() > 1) {
            if ($count == 1) { ?>
              <td rowspan="<?php echo $resultatp->rowCount(); ?>"><?php echo $fiche['destination']; ?></td>
            <?php }
          } ?>
        </tr>
      <?php } ?>
    </tbody>
 
                    </table>
 
                    <div class="signature-container">
  <div class="signature">
    <div>
      <label>Le chef de service <br> demandeur</label><br><br>
    </div>
    <div>
      <label class="signature-adjoint">Directeur général adjoint &nbsp;<br><?php echo $fiche['dga']; ?></label><br><br>
    </div>
    <div>
      <label>Directeur <br>général</label><br><br>
    </div>
  </div>
</div>
 
 
                </div>
                <?php
            } else {
                echo "Erreur : la fiche demandée n'existe pas.";
            }
        ?>
 
   </body>

Modification de la demande:
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<?php
    require_once('Identification.php');
    include('Connexiondb.php');
  $idFiche = $_GET['idFiche'];
 
    $requetef = "SELECT idFiche, DATE_FORMAT(dateFiche, '%d-%m-%Y') as dateFiche, dga, destination, commentaire, nomDirection, sigleDirection from Fiche as f, Direction as d where f.idDirection = d.idDirection and idFiche = $idFiche";
            $requetep = "SELECT * from Produit as p, Categorie as c where p.idCategorie = c.idCategorie and idFiche = $idFiche";
            $requeteC = "select * from Categorie";
 
            $resultatC = $pdo->query($requeteC);
            
            $resultatf = $pdo->query($requetef);
            $resultatp = $pdo->query($requetep);
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
 
        <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../css/DetailFiche.css">
        <link rel="stylesheet" type="text/css" href="../css/print.css" media="print">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
        <script>
            // fonction pour cacher le bouton pendant l'impression
            function hideButtonDuringPrint() {
                var printButton = document.getElementById('print-button');
                printButton.style.display = 'none';
                window.print();
                printButton.style.display = 'block';
            }
            
            // événement de clic pour le bouton "Imprimer"
            var printButton = document.getElementById('print-button');
            printButton.addEventListener('click', hideButtonDuringPrint);
        </script>
        <script>
                $(document).ready(function(){
                    var counter = <?php echo $resultatp->rowCount(); ?>+1;
 
                    $("#addButton").click(function () {
                        if(counter>10){
                            alert("Vous avez atteint la limite de 10 produits");
                            return false;
                        }   
 
                        var newProductRow = '<tr class = "product-row">' +
                                                '<td>' +
                                                    '<select name="categorie' + counter + '" class="Combobox" required>' +
                                                        '<option value="">Choisissez une Catégorie</option>' +
                                                        '<?php while($categorie = $resultatC->fetch()){ ?>' +
                                                            '<option value="<?php echo $categorie['idCategorie'] ?>"><?php echo $categorie['nomCategorie'] ?></option>' +
                                                        '<?php } ?>' +
                                                    '</select>' +
                                                '</td>' +
                                                '<td><input type="text" name="produit' + counter + '"></td>' +
                                                '<td><input type="number" name="quantite' + counter + '"></td>' +
                                            '</tr>';
 
                        $("#productTable").append(newProductRow);
 
                        counter++;
                    });
 
                    $("#removeButton").click(function () {
                        if(counter == 2){
                            alert("Il doit y avoir au moins un produit");
                            return false;
                        }   
 
                        counter--;
 
 
                            $("#productTable tr.product-row:last-child").remove();
                        
                    });
                });
            </script>
<style>
  
  .signature-container {
    position: relative;
    bottom: 0;
    min-height: 170px; /* Hauteur de la fenêtre visible */
  }
 
  .signature {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 20px;
  }
 
  .signature div {
    border: 1px solid black;
    padding: 10px;
    text-align: center;
    width: 30%;
    font-size: 18px;
  }
  .signature-adjoint{
    font-size: 17px;
    white-space: nowrap;
    padding-right: 10px;
    text-indent: -8px;
  }
 
</style>
    </head>
    <body>
    <?php include("Menu.php"); ?>
    <img src='../Images/LogoPMU.png' width = 320, heigth = 116/>
    <?php $idFiche = $_GET['idFiche']; ?>
        <div class = "marginright right" id="print-button">
                    <a href = "Fiches.php" id="print-button">            
                        <button id="print-button">
                            <span class="glyphicon glyphicon-arrow-left"></span>
                            Voir toutes les demandes
                        </button>
                    </a>
 
                    <a href = "ModifierFiche.php?idFiche=<?php echo $idFiche ?>" id="print-button">            
                        <button id="print-button">
                            <span class="glyphicon glyphicon-edit"></span>
                            Modifier la fiche
                        </button>
                    </a>
                <button onclick="hideButtonDuringPrint()" id="print-button">
                    <span class="glyphicon glyphicon-print"></span>
                    Imprimer
                </button>
 
        </div>
 
        <div class = "marginright right">       
 
        </div>
 
        <?php
            
 
 
            // Récupérer l'idFiche depuis l'URL
            
 
            // Requête pour récupérer les informations de la fiche
            /*
            $requete = "SELECT f.idFiche, f.dateFiche, f.commentaire, d.sigleDirection, c.nomCategorie, p.nomProduit, p.quantite 
            FROM Fiche f where idFiche = '$idFiche'
            INNER JOIN Produit p ON p.idFiche = p.idFiche 
            INNER JOIN Categorie c ON p.idCategorie = c.idCategorie 
            INNER JOIN Direction d ON f.idDirection = d.idDirection";
            $requeteFiche = "SELECT * from Fiche where idFiche = $idFiche";
            $requeteProduit = "SELECT * from Produit as p, Fiche as f where p.idFiche = $idFiche";
            $requeteFicheProduit = "SELECT  * from FicheProduit as fp, Fiche as f where fp.idFiche = $idFiche";
 
            $requete = "SELECT f.idFiche, f.dateFiche, f.commentaire, p.nomProduit, p.quantite 
            FROM FicheProduit fp where idFiche = 3
            INNER JOIN Produit p ON p.idFiche = p.idFiche 
            INNER JOIN Fiche d ON fp.idFiche = f.idFiche";
            */
            
 
            // Afficher les informations de la fiche
            if($resultatf) {
                $fiche = $resultatf->fetch();
                ?>
                <div class = "marginleft">
                    <h3 class = "EnteteDetail">Fiche de besoin N°<?php echo $fiche['idFiche']; ?>/ Direction: &nbsp;<?php echo $fiche['sigleDirection']; ?> </h3>
                    <form method="post" action="UpdateFiche.php">
                    <?php $idFiche = $fiche['idFiche']; ?>
                        <tr>
                            <label>Date : &nbsp;<?php echo $fiche['dateFiche']; ?></label>
                        </tr>
                        <br>
                        <tr>
                            <label>Commentaire : &nbsp;</label><input type="text" name = "commentaire" value = "<?php echo $fiche['commentaire']; ?>">
                        </tr>
                </div>
 
                    <div class="table-responsive">
                    <div class="table-responsive">
 
  <table class="margetop" id = "productTable">
    <thead>
      <tr>
        <th>Catégorie</th>
        <th>Désignation</th>
        <th>Quantité</th>
        <th style="width: 15%;">Destination</th>
      </tr>
    </thead>
    <tbody>
      <?php 
        $count = 0;
        while ($produit = $resultatp->fetch()) { 
          $count++;
          $idCategorie=$produit['idCategorie'];
      ?>
        <tr class="product-row">
          <td>
          <select name = "categorie<?php echo $count; ?>">
              <?php 
                        $resultatC = $pdo->query("select * from Categorie");
                        while($categorie = $resultatC->fetch()){ ?>
                            <option value="<?php echo $categorie['nomCategorie']; ?>"
                               <?php if($categorie['nomCategorie']===$produit['nomCategorie']) echo "selected"; ?>>
                                <?php echo $categorie['nomCategorie'] ?>
                            </option>
                                <?php } ?>
                        </select>
        </td>
          <td><input type="text" name = "produit<?php echo $count; ?>" value ="<?php echo $produit['nomProduit']; ?>"></td>
          <td><input type="text" name = "quantite<?php echo $count; ?>" value ="<?php echo $produit['quantite']; ?>"></td>
          <?php if ($resultatp->rowCount() == 1) { ?>
            <td><select>
              <?php 
                        $resultatD = $pdo->query("select * from Direction");
                        while($direction = $resultatD->fetch()){ ?>
                            <option value="<?php echo $direction['nomDirection']; ?>"
                               <?php if($direction['nomDirection']===$fiche['destination']) echo "selected"; ?>>
                                <?php echo $direction['nomDirection'] ?>
                            </option>
                                <?php } ?>
                        </select></td>
          <?php } else if ($resultatp->rowCount() > 1) {
            if ($count == 1) { ?>
              <td rowspan="<?php echo $resultatp->rowCount(); ?>">
              <select>
              <?php 
                        $resultatD = $pdo->query("select * from Direction");
                        while($direction = $resultatD->fetch()){ ?>
                            <option value="<?php echo $direction['nomDirection']; ?>"
                               <?php if($direction['nomDirection']===$fiche['destination']) echo "selected"; ?>>
                                <?php echo $direction['nomDirection'] ?>
                            </option>
                                <?php } ?>
                        </select>
                    </td>
            <?php }
 
          } ?>
        </tr>
      <?php } ?>
    </tbody>
 
                    </table>
                    <div class = "submit">
                <button type="button" id="addButton">Ajouter une ligne <span class="glyphicon glyphicon-plus" style="color:green"></span> </button>
                &nbsp;&nbsp;&nbsp;
                <button type="button" id="removeButton">Supprimer la dernière ligne <span class="glyphicon glyphicon-minus" style="color:red"></span> </button>
            </div>
 
                    <div class="signature-container">
  <div class="signature">
    <div>
      <label>Le chef de service <br> demandeur</label><br><br>
    </div>
    <div>
      <label class="signature-adjoint">Directeur général adjoint &nbsp;<br>
        <select name="dga" required>
 
                    <option value="technique" <?php if($fiche['dga']=="technique"){ echo "selected";}?>>
                                Technique
                    </option>
 
 
 
                    <option value="chargé des operations"<?php if($fiche['dga']=="chargé des operations") echo "selected";?>>
                               Chargé des opérations
                    </option>
 
 
                </select></label><br><br>
 
    </div>
    <div>
      <label>Directeur <br>général</label><br><br>
    </div>
  </div>
</div>
 
 
                </div>
                <?php
            } else {
                echo "Erreur : la fiche demandée n'existe pas.";
            }
        ?>
        <div class="submit">
            <input type="submit"  name = "submit" class="btn btn-success" value="Envoyer la demande">
                <a href = "Fiches.php" >            
                    <button class="btn btn-danger" onclick='location.href="Fiches.php"'>
                        <span class="glyphicon glyphicon-trash"></span>
                        Annuler
                    </button>
                </a>
        </div>
    </form>
   </body>