
<?php $__env->startSection('title'); ?> User Basic Info Update <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>

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

<div class="container h-100 mt-2">
    <form method="POST" action="<?php echo e(route('webuser.change-info-update')); ?>"
        class="needs-validation card custom-testpaper-form" novalidate enctype="multipart/form-data">
        <?php echo csrf_field(); ?>

        <h3 class="text-center heading_text pb-3">Change Info</h3>

        <div class="form-group custom-form-group">
            <label class="custom-form-label" for="name">Name <span class="custom-danger">(requierd)</span></label>
            <div class="single_input custom-form-field">
                <span class="material-symbols-outlined">
                    person
                </span>
                <input class="form-control" type="text" placeholder="Name" value="<?php echo e(Auth::user()->name); ?>"
                    name="name" id="name">

                <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <span class="custom-text-danger custom-text-danger-position"><?php echo e($message); ?></span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>

        <div class="form-group custom-form-group">
            <label class="custom-form-label" for="email">Email <span class="custom-danger">(requierd)</span></label>
            <div class="single_input custom-form-field">
                <span class="material-symbols-outlined">
                    email
                </span>
                <input type="email" placeholder="Email" name="email" id="email"
                    value="<?php echo e(Auth::user()->email); ?>" class="form-control">

                <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <span class="custom-text-danger custom-text-danger-position"><?php echo e($message); ?></span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>

        <div class="form-group custom-form-group">
            <label class="custom-form-label" for="gender">Gender <span class="custom-danger">(requierd)</span></label>
            <div class="single_input custom-form-field d-flex align-items-center gap-2 gender">
                <input type="text" name="gender" id="genderValue" value="male">
                <a onclick="genderToggle('male_btn','female_btn','male_btn')" id="male_btn"
                    class="primary_btn d-flex align-items-center justify-content-center m-0
                    <?php echo e(Auth::user()->gender == 'male' ? 'active' : ''); ?>

                    " for="male">
                    <i class="fa-solid fa-mars"></i>Male
                </a>
            
                <a onclick="genderToggle('male_btn','female_btn','female_btn')" id="female_btn"
                    class="primary_btn d-flex align-items-center justify-content-center m-0
                    <?php echo e(Auth::user()->gender == 'female' ? 'active' : ''); ?>

                    " for="female">
                    <i class="fa-solid fa-venus"></i>Female
                </a>
            
            </div>
        </div>

        <?php
        //To get all the class data...
        $getActiveClassData = App\Models\Classname::getActiveClassData();
        ?>
        
        <div class="form-group custom-form-group">
            <label class="custom-form-label" for="classname_id">Class <span class="custom-danger">(requierd)</span></label>
            <div class="single_input custom-select2-dropdown">
                <span class="material-symbols-outlined">
                    school
                </span>
                <select name="classname_id" id="classname_id" required class="form-control">
                    <option value="" selected disabled>Select Class</option>
                    <?php $__currentLoopData = $getActiveClassData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($item) && $item != null): ?>
                    <option value="<?php echo e($item->id); ?>" <?php echo e($item->id == Auth::user()->classname_id ? 'selected' : ''); ?>><?php echo e($item->class_name); ?></option>
                    <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>

        <div class="form-group custom-form-group">
            <label class="custom-form-label" for="address">Address <span class="custom-danger">(requierd)</span></label>
            <div class="single_input custom-form-field">
                <span class="material-symbols-outlined">
                    location_on
                </span>
                <input name="address" type="text" id="address" placeholder="Address" value="<?php echo e(Auth::user()->address); ?>"
                    class="form-control">

                <?php $__errorArgs = ['address'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                <span class="custom-text-danger custom-text-danger-position"><?php echo e($message); ?></span>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>

        <div class="condition mt-3">
            <button type="submit" class="primary_btn">Update</button>
        </div>
    </form>

</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
    $(document).ready(function() {
        $('#classname_id').select2();
    });

    //To change user gender...
    function genderToggle(male,female,selected){
        const array = [male,female];
        const selectedElement = document.getElementById(selected);
        const gender = document.getElementById('genderValue');
        gender.value = ''
        array.forEach((gender) => {
            const element = document.getElementById(gender)
            element.classList.remove('active')
        })
        selectedElement.classList.add('active')
        if(selected === 'male_btn'){
            $("#genderValue").val('male');
        }else{
            $("#genderValue").val('female');
        }
    }
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('frontend.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Personal-Project\Office-Project\update\test-paper-final\resources\views/frontend/profile/changeInfo.blade.php ENDPATH**/ ?>