<div class="modal fade" id="permissionModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="permissionModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div class="modal-header alert-info">
                <h5 class="modal-title" id="permissionModalLabel">Add New Permission</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
          <form method="POST" id="permissionForm">
            <?= csrf_field(); ?>
          <div class="modal-body">
        <!-- Form !-->
        
            <input type="hidden" name="id">
            <div class="row">
                <div class="col-md-12 mb-2">
                    <label for="name" class="form-label mb-0 fw-bold fs-6">Name</label>
                    <input type="text" name="name" id="name" class="form-control" required>
                </div>
                <div class="col-lg-6 mb-2">
                    <label for="parent" class="form-label mb-0 fw-bold fs-6">Parent</label>
                    <select name="parent_id" id="parent" class="form-select">
                        <option value="">Select Parent</option>
                        <?php foreach($perms as $p):?>
                            <option value="<?= $p->id; ?>"><?= $p->name; ?></option>
                        <?php endforeach;?>
                    </select>
                </div>
                <div class="col-lg-6 mb-2">
                    <label for="module_section" class="form-label mb-0 fw-bold fs-6">Module Section</label>
                    <select name="module_section_id" id="module_section" class="form-select" required>
                        <option value="">Select Section</option>
                        <?php foreach($sections as $s):?>
                            <option value="<?= $s->id; ?>"><?= $s->name; ?></option>
                        <?php endforeach;?>
                    </select>
                </div>
                <div class="col-md-12 mb-2">
                    <label for="modi" class="form-label mb-0 fw-bold fs-6">Module</label>
                    <input type="text" name="module" id="modi" placeholder="controllerName.methodName" class="form-control" required>
                </div>
                <div class="col-md-12 mb-2">
                    <label for="descr" class="form-label mb-0 fw-bold fs-6">Description </label>
                    <textarea name="description" class="form-control" id="descr" rows="3"></textarea>
                </div>
            </div>
        <!-- End Form !-->
      </div>
      <div class="modal-footer border-0">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-danger sbtn">Update</button>
      </div>
      </form>
    </div>
  </div>
</div>