<?php $__env->startSection('title', 'Guides'); ?>

<?php $__env->startSection('content'); ?>
<div class="page-content">
    <div class="container-fluid">
        <!-- Page Title -->
        <div class="row">
            <div class="col-12">
                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                    <h4 class="mb-sm-0">Guides</h4>
                    <div class="page-title-right">
                        <ol class="breadcrumb m-0">
                            <li class="breadcrumb-item"><a href="<?php echo e(route('home')); ?>">Home</a></li>
                            <li class="breadcrumb-item active">Guides</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <?php if(session('success')): ?>
            <div class="alert alert-success alert-dismissible fade show" role="alert">
                <i class="ri-check-line me-2"></i><?php echo e(session('success')); ?>

                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        <?php endif; ?>

        <?php if(session('error')): ?>
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <i class="ri-error-warning-line me-2"></i><?php echo e(session('error')); ?>

                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        <?php endif; ?>

        <!-- Prayer Guide Section -->
        <div class="row mb-4">
            <div class="col-lg-12">
                <div class="card border-0 shadow-sm">
                    <div class="card-header bg-transparent border-bottom" style="background: linear-gradient(135deg, #10b981 0%, #059669 100%);">
                        <h5 class="card-title mb-0 text-white">
                            <i class="ri-book-open-line me-2"></i> Prayer Guide
                        </h5>
                    </div>
                    <div class="card-body">
                        <form method="POST" action="<?php echo e(route('guides.store')); ?>" enctype="multipart/form-data">
                            <?php echo csrf_field(); ?>
                            <input type="hidden" name="type" value="prayer_guide">
                            
                            <div class="row">
                                <div class="col-md-4 mb-3">
                                    <label for="prayer_title" class="form-label">Title</label>
                                    <input type="text" class="form-control" id="prayer_title" name="title" required>
                                </div>
                                <div class="col-md-4 mb-3">
                                    <label for="prayer_pdf" class="form-label">PDF File</label>
                                    <input type="file" class="form-control" id="prayer_pdf" name="pdf_file" accept="application/pdf" required>
                                </div>
                                <div class="col-md-4 mb-3">
                                    <label class="form-label">&nbsp;</label>
                                    <button type="submit" class="btn btn-success w-100">
                                        <i class="ri-upload-line me-1"></i> Upload
                                    </button>
                                </div>
                            </div>
                        </form>
                        
                        <div class="mt-3">
                            <h6 class="mb-2">Uploaded PDFs:</h6>
                            <div class="table-responsive">
                                <table class="table table-sm">
                                    <thead>
                                        <tr>
                                            <th>Title</th>
                                            <th>PDF</th>
                                            <th>Actions</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__empty_1 = true; $__currentLoopData = $guides->where('type', 'prayer_guide'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $guide): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                        <tr>
                                            <td><?php echo e($guide->title); ?></td>
                                            <td>
                                                <a href="<?php echo e(asset($guide->pdf_file)); ?>" target="_blank" class="btn btn-sm btn-outline-primary">
                                                    <i class="ri-file-pdf-line me-1"></i>View
                                                </a>
                                            </td>
                                            <td>
                                                <form action="<?php echo e(route('guides.destroy', $guide->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Delete this PDF?');">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="btn btn-sm btn-danger">
                                                        <i class="ri-delete-bin-line"></i>
                                                    </button>
                                                </form>
                                            </td>
                                        </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                        <tr>
                                            <td colspan="3" class="text-muted">No PDFs uploaded yet</td>
                                        </tr>
                                        <?php endif; ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- More Zikar Section -->
        <div class="row mb-4">
            <div class="col-lg-12">
                <div class="card border-0 shadow-sm">
                    <div class="card-header bg-transparent border-bottom" style="background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);">
                        <h5 class="card-title mb-0 text-white">
                            <i class="ri-bookmark-line me-2"></i> More Zikar
                        </h5>
                    </div>
                    <div class="card-body">
                        <form method="POST" action="<?php echo e(route('guides.store')); ?>" enctype="multipart/form-data">
                            <?php echo csrf_field(); ?>
                            <input type="hidden" name="type" value="more_zikar">
                            
                            <div class="row">
                                <div class="col-md-4 mb-3">
                                    <label for="zikar_title" class="form-label">Title</label>
                                    <input type="text" class="form-control" id="zikar_title" name="title" required>
                                </div>
                                <div class="col-md-4 mb-3">
                                    <label for="zikar_pdf" class="form-label">PDF File</label>
                                    <input type="file" class="form-control" id="zikar_pdf" name="pdf_file" accept="application/pdf" required>
                                </div>
                                <div class="col-md-4 mb-3">
                                    <label class="form-label">&nbsp;</label>
                                    <button type="submit" class="btn btn-primary w-100">
                                        <i class="ri-upload-line me-1"></i> Upload
                                    </button>
                                </div>
                            </div>
                        </form>
                        
                        <div class="mt-3">
                            <h6 class="mb-2">Uploaded PDFs:</h6>
                            <div class="table-responsive">
                                <table class="table table-sm">
                                    <thead>
                                        <tr>
                                            <th>Title</th>
                                            <th>PDF</th>
                                            <th>Actions</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__empty_1 = true; $__currentLoopData = $guides->where('type', 'more_zikar'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $guide): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                        <tr>
                                            <td><?php echo e($guide->title); ?></td>
                                            <td>
                                                <a href="<?php echo e(asset($guide->pdf_file)); ?>" target="_blank" class="btn btn-sm btn-outline-primary">
                                                    <i class="ri-file-pdf-line me-1"></i>View
                                                </a>
                                            </td>
                                            <td>
                                                <form action="<?php echo e(route('guides.destroy', $guide->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Delete this PDF?');">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="btn btn-sm btn-danger">
                                                        <i class="ri-delete-bin-line"></i>
                                                    </button>
                                                </form>
                                            </td>
                                        </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                        <tr>
                                            <td colspan="3" class="text-muted">No PDFs uploaded yet</td>
                                        </tr>
                                        <?php endif; ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Hajj & Umrah Section -->
        <div class="row mb-4">
            <div class="col-lg-12">
                <div class="card border-0 shadow-sm">
                    <div class="card-header bg-transparent border-bottom" style="background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);">
                        <h5 class="card-title mb-0 text-white">
                            <i class="ri-building-line me-2"></i> Hajj & Umrah
                        </h5>
                    </div>
                    <div class="card-body">
                        <form method="POST" action="<?php echo e(route('guides.store')); ?>" enctype="multipart/form-data">
                            <?php echo csrf_field(); ?>
                            <input type="hidden" name="type" value="hajj_umrah">
                            
                            <div class="row">
                                <div class="col-md-4 mb-3">
                                    <label for="hajj_title" class="form-label">Title</label>
                                    <input type="text" class="form-control" id="hajj_title" name="title" required>
                                </div>
                                <div class="col-md-4 mb-3">
                                    <label for="hajj_pdf" class="form-label">PDF File</label>
                                    <input type="file" class="form-control" id="hajj_pdf" name="pdf_file" accept="application/pdf" required>
                                </div>
                                <div class="col-md-4 mb-3">
                                    <label class="form-label">&nbsp;</label>
                                    <button type="submit" class="btn btn-warning w-100">
                                        <i class="ri-upload-line me-1"></i> Upload
                                    </button>
                                </div>
                            </div>
                        </form>
                        
                        <div class="mt-3">
                            <h6 class="mb-2">Uploaded PDFs:</h6>
                            <div class="table-responsive">
                                <table class="table table-sm">
                                    <thead>
                                        <tr>
                                            <th>Title</th>
                                            <th>PDF</th>
                                            <th>Actions</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__empty_1 = true; $__currentLoopData = $guides->where('type', 'hajj_umrah'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $guide): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                        <tr>
                                            <td><?php echo e($guide->title); ?></td>
                                            <td>
                                                <a href="<?php echo e(asset($guide->pdf_file)); ?>" target="_blank" class="btn btn-sm btn-outline-primary">
                                                    <i class="ri-file-pdf-line me-1"></i>View
                                                </a>
                                            </td>
                                            <td>
                                                <form action="<?php echo e(route('guides.destroy', $guide->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Delete this PDF?');">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="btn btn-sm btn-danger">
                                                        <i class="ri-delete-bin-line"></i>
                                                    </button>
                                                </form>
                                            </td>
                                        </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                        <tr>
                                            <td colspan="3" class="text-muted">No PDFs uploaded yet</td>
                                        </tr>
                                        <?php endif; ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/macbookpro/Downloads/mulikat/resources/views/dashboard/guides/index.blade.php ENDPATH**/ ?>