<?php $__env->startSection('container_content'); ?>
    <section class="box valign profile">
        <div class="container-fluid">
            <div class="content">
                <h3 class="title mb-5 wow fadeInUp">Profile
                    <strong class="float-right"><a href="<?php echo e(route('user.editProfile')); ?>" class="butn small"><span>Edit</span></a>
                    </strong>
                </h3>
                <div class="row">
                    <?php echo $__env->make('web.layouts.messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <div class="col-lg-9">
                        <div class="info">
                            <div class="img">
                                <img src="<?php echo e(asset('assets/web/images/user.png')); ?>" alt="">
                            </div>
                            <div class="user-info">
                                <strong class="sub-color d-block"><?php echo e($name); ?></strong>
                                <small class="sub-color d-block"></small>
                                <ul>
                                    <li><a href="<?php echo e($facebook); ?>"><small class="main-color"><i class="fab fa-facebook-square"></i> <?php echo e(trim(parse_url($facebook)['path'] ?? '', '/') == '' ? 'Facebook' : trim(parse_url($facebook)['path'] ?? '', '/')); ?></small></a></li>
                                    <li><a href="<?php echo e($twitter); ?>"><small class="main-color"><i class="fab fa-twitter"></i> <?php echo e(trim(parse_url($twitter)['path'] ?? '', '/') == '' ? 'Twitter' : trim(parse_url($twitter)['path'] ?? '', '/')); ?></small></a></li>
                                    <li><a href="<?php echo e($instagram); ?>"><small class="main-color"><i class="fab fa-instagram"></i> <?php echo e(trim(parse_url($instagram)['path'] ?? '', '/') == '' ? 'Instagram' : trim(parse_url($instagram)['path'] ?? '', '/')); ?></small></a></li>
                                </ul>
                            </div>
                            <p class="sub-color">
                                <?php echo e($about_me); ?>

                            </p>
                        </div>
                    </div>
                    <div class="col-lg-3">
                        <div class="strength text-center">
                            <h6>Profile Strength</h6>
                            <ul>
                                <li></li>
                                <li></li>
                                <li></li>
                                <li></li>
                                <li></li>
                                <li></li>
                            </ul>
                            <p>100% Intermediate</p>
                        </div>
                    </div>
                </div>

                <div class="loops mt-5">
                    <div class="row">
                        <div class="col-lg-4">
                            <div class="items">
                                <h6>Remaining to collect</h6>
                                <ul class="countdown-date">
                                    <li><span id="days">0</span>D : </li>
                                    <li><span id="hours">0</span>H : </li>
                                    <li><span id="minutes">0</span>M : </li>
                                    <li><span id="seconds">0</span>S</li>
                                </ul>
                            </div>
                        </div>

                        <div class="col-lg-4">
                            <div class="items">
                                <h6>Joined Loops</h6>
                                <div class="d-flex justify-content-between">
                                    <div class="cur-loops">

                                        <?php
                                            $i = 0;
                                        ?>

                                        <?php $__currentLoopData = $loops; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $loopDetails): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                                if(++$i > 3) break;
                                            ?>
                                            <a href="<?php echo e(route('loops.details', [ 'loop_id'=> $loopDetails['loop_id'] ])); ?>">
                                                <span><?php echo e(date('M', strtotime($loopDetails['loop']['date']))); ?></span>
                                            </a>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                    <?php if(count($loops) > 3): ?>
                                        <div class="join-loops">
                                            <span>+(<?php echo e(count($loops)-3); ?>)</span>
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>

                        <div class="col-lg-4">
                            <div class="items valign">
                                <p><i class="fas fa-phone-volume"></i> <?php echo e($phone ?? '050025453'); ?></p>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

        </div>
    </section>

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

<?php $__env->startSection('container_js'); ?>
    <?php if($nearestEncashmentMonth): ?>
    <script>
        $(document).ready(function () {
            // date countdown -----------------
            const second = 1000,
                minute = second * 60,
                hour = minute * 60,
                day = hour * 24,
                week = hour * 24 * 7;

            // let countDown = new Date('Nov 29, 2020 12:30:00').getTime(),
            let countDown = new Date('<?php echo e($nearestEncashmentMonth); ?>').getTime(),
            x = setInterval(function() {

                let now = new Date().getTime(),
                    distance = countDown - now;

                document.getElementById('days').innerText = Math.floor(distance / (day)),
                    document.getElementById('hours').innerText = Math.floor((distance % (day)) / (hour)),
                    document.getElementById('minutes').innerText = Math.floor((distance % (hour)) / (minute)),
                    document.getElementById('seconds').innerText = Math.floor((distance % (minute)) / second);
            }, second)
        });
    </script>
    <?php endif; ?>

    <script>
        $(document).ready(function () {
            let verify_button = $('.verify_button'),
                verification_code = $('.verification_code');

            verify_button.attr('disabled', true).addClass("gray");

            verify_button.click(function () {
                if (verification_code.val() === ''){
                    return false;
                }
            });


            let error = [];
            $('.code').keyup(function() {

                if ($(this).val().length === 1){
                    $(this).next().focus();
                }

                let verification_code = '';

                $('.code').each(function () {

                    if ($(this).val().length === 0){
                        error.push(true);
                    }
                    verification_code += $(this).val();
                });

                if (error.length === 0){
                    $('.verify_button').attr('disabled', false).removeClass("gray");
                } else {
                    $('.verify_button').attr('disabled', true).addClass("gray");
                }
                error = [];

                $('.verification_code').val(verification_code);
            });

        })
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\wamp64\www\gam3iea\resources\views/web/users/profile.blade.php ENDPATH**/ ?>