<div class="modal fade" id="modifierArticleModal<?= $a['id'] ?>" tabindex="-1">
  <div class="modal-dialog">
    <form method="POST" action="/eagle_client_istanbulcups/api/production/modifier_matiere.php">
      <input type="hidden" name="id" value="<?= $a['id'] ?>">

      <div class="modal-content">
        <div class="modal-header bg-warning">
          <h5 class="modal-title">Modifier matière première</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
        </div>

        <div class="modal-body">

          <div class="mb-2">
            <label>Code</label>
            <input type="text" name="code" class="form-control"
                   value="<?= htmlspecialchars($a['code']) ?>">
          </div>

          <div class="mb-2">
            <label>Nom</label>
            <input type="text" name="nom" class="form-control"
                   value="<?= htmlspecialchars($a['nom']) ?>" required>
          </div>

          <div class="mb-2">
            <label>Unité</label>
            <select name="unite_id" class="form-select" required>
              <?php foreach ($unites as $u): ?>
                <option value="<?= $u['id'] ?>"
                  <?= $u['id'] == $a['unite_id'] ? 'selected' : '' ?>>
                  <?= htmlspecialchars($u['nom']) ?>
                </option>
              <?php endforeach; ?>
            </select>
          </div>

          <div class="mb-2">
            <label>Coût d’achat</label>
            <input type="number" step="0.01" name="cout_achat"
                   class="form-control" value="<?= $a['cout_achat'] ?>">
          </div>

          <div class="mb-2">
            <label>Seuil d’alerte</label>
            <input type="number" step="0.01" name="seuil_alerte"
                   class="form-control" value="<?= $a['seuil_alerte'] ?>">
          </div>

        </div>

        <div class="modal-footer">
          <button class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
          <button class="btn btn-warning">Enregistrer</button>
        </div>

      </div>
    </form>
  </div>
</div>
