<!-- Modal Visualiser Appro -->
<div class="modal fade" id="visualiserApproModal<?= $appro['id'] ?>" tabindex="-1" aria-labelledby="visualiserApproModalLabel<?= $appro['id'] ?>" aria-hidden="true">
   <div class="modal-dialog modal-lg">
     <div class="modal-content">

        <div class="modal-header bg-primary text-white">
          <h5 class="modal-title" id="visualiserApproModalLabel<?= $appro['id'] ?>">Détails de l' entrée de stock #<?= $appro['id'] ?></h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Fermer"></button>
         </div>

          <div class="modal-body">
          
                <div class="col-md-6">
                    <p><strong>Date :</strong> <?= $appro['date_appro'] ?></p>
                </div>
          

              <table class="table table-bordered table-striped">
                <thead class="table-dark">
                    <tr>
                        <th>Produit</th>
                        <th>Quantité</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($details as $d): ?>
                        <tr>
                            <td><?= htmlspecialchars($d['produit'], ENT_QUOTES, 'UTF-8') ?></td>
                            <td><?= $d['quantite'] ?></td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>  
            </table>
        </div>
              <!-- Footer -->
              <div class="modal-footer">
                <a href="/eagle_client_istanbulcups/api/appro/imprimer.php?id=<?= $appro['id'] ?>" target="_blank" class="btn btn-success btn-sm">
                  <i class="fa fa-print"></i>
                </a>
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
              </div>
      </div> 
   </div> 
</div> 
