<div class="row">
    <?php foreach ( $plans as $plan ) : ?>
        <div class="col-12 col-md-6 col-lg-4 col-xl-3 mb-3">
            <div class="card text-center p-0" style="width:100%;">
                <?php if ( $user['superAdmin'] ) : ?>
                    <div class="rounded-circle bg-danger position-absolute top-0 end-0 p-1" style="z-index:1;">
                        <button type="button" class="btn-close btbDeletePlan" aria-label="Close" data-id="<?php echo $plan['id']; ?>" style="z-index:2;"></button>
                    </div>
                <?php endif; ?>
                <a href="<?php echo URL_PLANS; ?>/<?php echo str_replace(' ', '%20', rawurlencode($plan['filename'])); ?>" target="_blank">
                    <img src="<?php echo URL_ASSETS; ?>/images/pdf-icon.png" class="card-img-top" style="width:200px;">
                </a>
                <div class="card-body text-truncate">
                    <a href="<?php echo URL_PLANS; ?>/<?php echo str_replace(' ', '%20', rawurlencode($plan['filename'])); ?>" target="_blank">
                        <span class="small text-muted"><?php echo $plan['filename']; ?></span>
                    </a>
                </div>
                <div class="card-footer p-0">
                    <div class="btn-group w-100" role="group">
                        <a href="<?php echo URL_PLANS; ?>/<?php echo str_replace(' ', '%20', rawurlencode($plan['filename'])); ?>" target="_blank" type="button" class="btn btn-danger" style="border-top-left-radius:0px;">
                            <small>View<i class="bi bi-arrow-up-right ms-1"></i></small>
                        </a>
                        <!-- <a href="<?php echo URL_PLANS; ?>/<?php echo str_replace(' ', '%20', rawurlencode($plan['filename'])); ?>" data-fancybox data-type="pdf" type="button" class="btn btn-danger" style="border-top-left-radius:0px;">
                            <small>View<i class="bi bi-arrow-up-right ms-1"></i></small>
                        </a> -->
                        <a href="<?php echo URL_PLANS; ?>/<?php echo str_replace(' ', '%20', rawurlencode($plan['filename'])); ?>" download type="button" class="btn btn-danger" style="border-top-right-radius:0px;">
                            <small>Download<i class="bi bi-download ms-2"></i></small>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    <?php endforeach; ?>
</div>