<div>
        <div class="row">
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="batchSearch" class="form-label">Search Batch</label>
                    <input wire:model.live="batchSearch" type="text" id="batchSearch" class="form-control" 
                           placeholder="Search by batch name...">
                    
                    <!--[if BLOCK]><![endif]--><?php if($batchSearch && $searchResults->count() > 0): ?>
                        <div class="mt-2 border rounded" style="max-height: 200px; overflow-y: auto;">
                            <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $searchResults; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $batch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="p-2 border-bottom cursor-pointer hover-bg-light" 
                                     wire:click="selectBatch(<?php echo e($batch->id); ?>)" 
                                     style="cursor: pointer;"
                                     onmouseover="this.style.backgroundColor='#f8f9fa'" 
                                     onmouseout="this.style.backgroundColor='white'">
                                    <strong><?php echo e($batch->name); ?></strong>
                                    <br><small class="text-muted"><?php echo e($batch->schoolClass->display_name); ?> (<?php echo e($batch->current_students); ?>/<?php echo e($batch->capacity); ?> students)</small>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                        </div>
                    <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                </div>
                <div class="mb-3">
                    <label for="batchId" class="form-label">Or Select from Dropdown</label>
                    <select wire:model.live="batchId" id="batchId" class="form-select">
                        <option value="">Select batch to promote</option>
                        <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $batches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $batch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($batch->id); ?>">
                                <?php echo e($batch->name); ?> (<?php echo e($batch->schoolClass->display_name); ?>)
                            </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                    </select>
                    <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['batchId'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                </div>
            </div>
            
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="toClassId" class="form-label">To Class</label>
                    <select wire:model.live="toClassId" id="toClassId" class="form-select">
                        <option value="">Select destination class</option>
                        <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $class): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($class->id); ?>"><?php echo e($class->display_name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                    </select>
                    <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['toClassId'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                </div>
                
                <div class="mb-3">
                    <div class="form-check">
                        <input wire:model.live="createNewBatch" class="form-check-input" type="checkbox" id="createNewBatch">
                        <label class="form-check-label" for="createNewBatch">
                            Create new batch
                        </label>
                    </div>
                </div>
                
                <!--[if BLOCK]><![endif]--><?php if(!$createNewBatch && !empty($availableBatches)): ?>
                    <div class="mb-3">
                        <label for="toBatchId" class="form-label">Select Destination Batch</label>
                        <select wire:model="toBatchId" id="toBatchId" class="form-select">
                            <option value="">Select destination batch</option>
                            <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $availableBatches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $batch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($batch->id); ?>">
                                    <?php echo e($batch->name); ?> (<?php echo e($batch->current_students); ?>/<?php echo e($batch->capacity); ?>)
                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
                        </select>
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['toBatchId'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="text-danger"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>
                <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
            </div>
        </div>
        
        <!--[if BLOCK]><![endif]--><?php if($demotionWarning): ?>
            <div class="alert alert-warning mb-3">
                <i class="fas fa-exclamation-triangle me-2"></i><?php echo e($demotionWarning); ?>

            </div>
        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
        
        <!--[if BLOCK]><![endif]--><?php if($selectedBatch): ?>
            <div class="card mb-3">
                <div class="card-header">
                    <h6 class="mb-0">Batch Information</h6>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-6">
                            <p><strong>Batch Name:</strong> <?php echo e($selectedBatch->name); ?></p>
                            <p><strong>Current Class:</strong> <?php echo e($selectedBatch->schoolClass->display_name); ?></p>
                        </div>
                        <div class="col-md-6">
                            <p><strong>Total Students:</strong> <?php echo e($selectedBatch->students->count()); ?></p>
                            <!--[if BLOCK]><![endif]--><?php if($onlyEligible && $eligibleCount > 0): ?>
                                <p><strong>Eligible Students:</strong> <span class="text-success"><?php echo e($eligibleCount); ?></span></p>
                            <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                            <p><strong>Capacity:</strong> <?php echo e($selectedBatch->capacity); ?></p>
                        </div>
                    </div>
                </div>
            </div>
        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
        
        <div class="mb-3">
            <div class="form-check form-switch">
                <input wire:model.live="onlyEligible" class="form-check-input" type="checkbox" id="onlyEligible">
                <label class="form-check-label" for="onlyEligible">
                    Only promote eligible students (those who meet pass percentage criteria)
                </label>
            </div>
        </div>
        
        <div class="d-flex justify-content-end">
            <button type="button" wire:click="confirmPromotion" class="btn btn-primary" 
                    <?php if(!$batchId || !$toClassId || (!$createNewBatch && !$toBatchId)): ?> disabled <?php endif; ?>>
                <i class="fas fa-arrow-up me-2"></i>Promote Batch
            </button>
        </div>
</div><?php /**PATH C:\wamp64\www\edu-p\resources\views/livewire/promotion-by-batch.blade.php ENDPATH**/ ?>