<?php $__env->startSection('content'); ?>

    <section class="our-teams">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-3 col-sm-12">
                    <aside>
                        <div class="title">
                            <h4>Search</h4>
                        </div>
                        
                        <form action=<?php echo e(route('team.filter')); ?> method="GET">
                            <!--@csrf-->
                            <div class="form-group">
                                <label for="email-id">Email/Login ID</label>
                                <input type="text" name="email" class="form-control" id="email-id" placeholder="Email/Login ID">
                            </div>
                            <div class="form-group">
                                <label for="about">Select Team</label>
                                <select class="form-control" id="about" name="team_id">
                                    <option value="" selected>Please Select</option>
                                    <?php $__currentLoopData = $joinAsTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $event): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($event->id); ?>"><?php echo e($event->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="about">Select Events</label>
                                <select class="form-control" id="about" name="event_id">
                                    <option value="" selected>Please Select</option>
                                    <?php $__currentLoopData = $events; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $event): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($event->id); ?>"><?php echo e($event->session['title']); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="about">Select Division</label>
                                <select class="form-control" name="division_id" id="division">
                                    <option value="" selected>Please Select</option>
                                    <?php $__currentLoopData = $divisions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $divission): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($divission->id); ?>"><?php echo e($divission->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="about">Select District</label>
                                <select name="district_id" id="district" class="form-control">
                                    <option value="">Select District</option>
                                </select>
                            </div>
                            <div class="search-btn">
                                <button class="btn">Search</button>
                            </div>
                        </form>
                    </aside>
                </div>
                
                <div class="col-lg-9 col-sm-12">
                    <div class="teams">
                        <?php $__currentLoopData = $mentors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $team): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="team-member" style="background-image: url(<?php echo e(asset('public/best2.jpg')); ?>)">
                            <div class="image">
                                <img src="<?php echo e(URL::to('storage/app/public/' . $team->profile_image)); ?>"/>
                            </div>
                            <div class="informations">
                                <span><?php echo e($team->join['name']); ?></span>
                                <h4><?php echo e($team->full_name); ?></h4>
                                <h5><?php echo e($team->class_level_designation); ?></h5>
                                <p><?php echo e($team->institute); ?></p>
                                <p><?php echo str_limit($team->address, 25); ?></p>
                            </div>
                        </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </div>
            </div>
        </div>
        
    </section>

<?php $__env->stopSection(); ?>
<style>
    section.rewards .contact-forms .contact-form button {
    background: #bf7b24;
    border-radius: 8px;
    display: inline-block;
    padding: 13px 28px;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    height: 50px !important;
    line-height: normal;
    outline: none;
}
section.rewards .contact-forms {
    background: #10182f;
    padding: 25px;
    border-radius: 10px;
    height: auto !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 60px;
    align-items: center;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
    const divisionSelect = document.getElementById('division');
    const districtSelect = document.getElementById('district');

    divisionSelect.addEventListener('change', function() {
        let divisionId = this.value;
        
        // Clear previous options
        districtSelect.innerHTML = '<option value="">Select District</option>';

        if(divisionId) {
            fetch(`/get-districts/${divisionId}`)
                .then(response => response.json())
                .then(data => {
                    data.forEach(district => {
                        let option = document.createElement('option');
                        option.value = district.id;
                        option.text = district.name;
                        districtSelect.appendChild(option);
                    });
                })
                .catch(error => console.error('Error:', error));
        }
    });
});
</script>


<?php $__env->startSection('footer'); ?>
    <?php echo $__env->make('layouts.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>