<?php
    $layout = auth()->user()->role === 'super_admin' ? 'layouts.admin' : 'layouts.app';
?>



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

<?php $__env->startSection('content'); ?>
<div class="container-fluid px-4 py-3">
    <div class="dashboard-header">
        <div class="container-fluid">
            <div class="row align-items-center dashboard-header-content">
                <div class="col-lg-6">
                    <h1 class="dashboard-title">
                        <i class="fas fa-upload" style="color: var(--dhis2-blue-primary);"></i>
                        Import Groups from Excel
                    </h1>
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="javascript:history.back()">Back</a></li>
                            <li class="breadcrumb-item"><a href="<?php echo e(route('component1.groups.index')); ?>">Groups</a></li>
                            <li class="breadcrumb-item active">Import</li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="container py-4">
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <div class="card border-secondary border-2 shadow-lg rounded-3">
                <div class="card-body p-4 p-md-5">
                    <div class="alert alert-info">
                        <i class="fas fa-info-circle me-2"></i>
                        <strong>Instructions:</strong>
                        <ul class="mt-2 mb-0">
                            <li>Download the template format from the button below</li>
                            <li>Ensure your Excel file has columns: VSLA Group Name, Category, State, County, Payam, Total Female, Total Male, Adolesent Girls, Total Members</li>
                            <li>The system will create new groups or update existing ones based on group name</li>
                        </ul>
                    </div>

                    <div class="text-center mb-4">
                        <a href="<?php echo e(route('component1.groups.template')); ?>" class="btn btn-outline-primary">
                            <i class="fas fa-download me-2"></i> Download Excel Template
                        </a>
                    </div>

                    <form action="<?php echo e(route('component1.groups.import.store')); ?>" method="POST" enctype="multipart/form-data">
                        <?php echo csrf_field(); ?>
                        
                        <div class="mb-4">
                            <label class="form-label fw-bold">Excel File <span class="text-danger">*</span></label>
                            <input type="file" name="excel_file" class="form-control <?php $__errorArgs = ['excel_file'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                                   accept=".xlsx,.xls,.csv" required>
                            <small class="text-muted">Allowed formats: .xlsx, .xls, .csv (Max size: 10MB)</small>
                            <?php $__errorArgs = ['excel_file'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid-feedback"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="mt-4 pt-3 border-top border-secondary text-end">
                            <a href="<?php echo e(route('component1.groups.index')); ?>" class="btn btn-outline-secondary me-2">
                                <i class="fas fa-times me-1"></i> Cancel
                            </a>
                            <button type="submit" class="btn btn-success">
                                <i class="fas fa-upload me-1"></i> Import Groups
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make($layout, array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\wampserver64\www\sswseepcomponents\resources\views/component1/groups/import.blade.php ENDPATH**/ ?>