<div class="modal fade" id="EditMenuModal" tabindex="-1" aria-labelledby="editModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
        <div class="modal-header">
            <div class="modal-title">Edit Menu </div>
        </div>
      <div class="modal-body">
        <form method="post" id="form-menu">
            <div class="mb-3">
                <label class="form-label fw-bold">Link Title</label>
                <input type="text" name="title" class="form-control">
            </div>
            <div class="mb-3">
                <label class="form-label fw-bold">Custom URL</label>
                <input type="text" name="url" class="form-control">
            </div>
            <div class="mb-3">
                <label class="form-label fw-bold">Level</label>
                <select name="level" class="form-select">
                    <option value="0" selected>0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                </select>
            </div>
            <div class="mb-3">
                <label class="form-label fw-bold">Parent Item</label>
                <select name="parent_id" class="form-select">
                    <option value="" >Menu Item Root</option>
                    <?php foreach($menu_items as $mi): ?>
                    <option value="<?= $mi->id; ?>"><?= $mi->title; ?></option>
                    <?php endforeach;?>
                </select>
            </div>
            <div class="mb-2">
                <input type="hidden" name="id">
                <input type="hidden" name="menutype_id">
                <input type="hidden" name="group_alias">
                <button type="submit" class="btn btn-success w-100" onclick="save_menu()"><i class="bi bi-plus-circle"></i> Update</button>
            </div>
        </form>
      </div>
      <div class="modal-footer">
      </div>
    </div>
  </div>
</div>