 <?php $__env->startSection('content'); ?>
    <!-- ========User-Panel-Section Starte Here ========-->

    <div class="row">
        <div class="col-12">
            <h2 class="content-header"><?php echo e(__($page_title)); ?></h2>
        </div>
    </div>

    <section id="simple-table">
        <div class="row">
            <div class="col-sm-12">
                <div class="card">
                    <div class="card-body">
                        <div class="row justify-content-center mb-30-none mt-3 p-3">

                            <?php
                                $color = ['bg-1','bg-2','bg-3','bg-4','bg-5','bg-6','bg-7','bg-8'];
                            ?>

                            <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k => $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php
                                    $time_name = \App\TimeSetting::where('time', $data->times)->first();
                                ?>
                                <div class="col-md-6 col-lg-4">
                                    <div class="ticket-item <?php echo e($color[$k]); ?>">
                                        <h3 class="title"><?php echo e($data->name); ?></h3>
                                        <h6 class="sub-title"><?php echo e(__($data->interest)); ?> <?php if($data->interest_status == 1): ?> % <?php else: ?> <?php echo e(__($general->cur_text)); ?> <?php endif; ?></h6>
                                        <ul>
                                            <li><?php echo e(__($time_name->name)); ?> / <?php if($data->lifetime_status == 0): ?> <?php echo e(__($data->repeat_time)); ?> <?php echo app('translator')->get('Times'); ?> <?php else: ?> <?php echo app('translator')->get('Lifetime'); ?> <?php endif; ?></li>
                                            <?php if($data->capital_back_status == 1): ?>

                                                <li> <span class="badge badge-success"><?php echo app('translator')->get('Capital Will Return Back'); ?></span></li>
                                            <?php elseif($data->capital_back_status == 0): ?>
                                                <li> <span class="badge badge-warning"><?php echo app('translator')->get('Capital Will Store'); ?></span></li>
                                            <?php endif; ?>
                                            <li><?php echo app('translator')->get('24/7Support'); ?></li>


                                            <?php if($data->fixed_amount == 0): ?>
                                                <li class="plan_min"> <?php echo app('translator')->get('Min.'); ?> <?php echo e(__($general->cur_sym)); ?><?php echo e(__($data->minimum)); ?>  <span><?php echo app('translator')->get('Max:'); ?> <?php echo e(__($general->cur_sym)); ?><?php echo e(__($data->maximum)); ?></span></li>

                                            <?php else: ?>
                                                <li class="plan_min">  <span><?php echo app('translator')->get('Invest Amount'); ?>: <?php echo e(__($general->cur_sym)); ?><?php echo e(__($data->maximum)); ?></span></li>
                                            <?php endif; ?>
                                            <li class="plan_min">  <span><?php echo app('translator')->get('Coins'); ?>:  <?php echo e(__($data->coins)); ?></span></li>
                                            <li class="plan_min">  <span><?php echo app('translator')->get('Tokens'); ?>: <?php echo e(__($data->tokens)); ?></span></li>

                                        </ul>
                                        <a href="javascript:void(0)" data-toggle="modal" data-target="#depoModal" data-resource="<?php echo e($data); ?>"  class="custom-button custom-button-color investButton"><?php echo app('translator')->get('Invest Now'); ?></a>
                                    </div>
                                </div>

                                <?php
                                    array_push($color, $color[$k]);
                                ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- ========User-Panel-Section Ends Here ========-->
<?php $__env->stopSection(); ?>


<?php $__env->startPush('renderModal'); ?>
    <?php
        $wallets = \App\UserWallet::where('user_id', Auth::id())->get();
    ?>

    <!-- Modal -->
    <div class="modal fade" id="depoModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content ">
                <div class="modal-header">
                    <?php if(auth()->guard()->check()): ?>
                    <h5 class="modal-title" id="ModalLabel"><?php echo app('translator')->get('Confirm to invest on'); ?> <strong class="planName text-white"></strong></h5>
                    <?php endif; ?>
                    <?php if(auth()->guard()->guest()): ?>
                    <h5 class="modal-title" id="ModalLabel"><?php echo app('translator')->get('Need Sign In'); ?> </h5>
                    <?php endif; ?>
                </div>
                <form action="<?php echo e(route('user.buy.plan')); ?>" method="post">
                    <?php echo csrf_field(); ?>
                    <?php if(auth()->guard()->check()): ?>
                    <div class="modal-body">

                        <div class="form-group">
                            <h5 class="text-center investAmountRenge"></h5>

                            <p class="text-center interestDetails"></p>
                            <p class="text-center interestValidaty"></p>

                            <div class="form-group">
                                <strong><?php echo app('translator')->get('Select Wallet'); ?></strong>
                                <select class="form-control"  name="wallet_type">
                                    <?php $__currentLoopData = $wallets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k=>$data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($data->id); ?>"> <?php echo e(__(str_replace('_',' ',$data->type))); ?> (<?php echo e(formatter_money($data->balance)); ?> <?php echo e(__($general->currency)); ?>)</option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            <input type="hidden" name="plan_id" class="plan_id">


                            <div class="form-group">
                                <strong><?php echo app('translator')->get('Invest Amount'); ?></strong>
                                <input type="text" class="form-control fixedAmount" id="fixedAmount" name="amount" value="<?php echo e(old('amount')); ?>" onkeyup="this.value = this.value.replace (/^\.|[^\d\.]/g, '')">
                            </div>
                        </div>
                    </div>

                        <div class="modal-footer">
                            <button type="submit"  class="btn btn-success btn-block" ><?php echo app('translator')->get('Yes'); ?></button>
                            <button type="button" class="btn btn-danger btn-block" data-dismiss="modal"><?php echo app('translator')->get('No'); ?></button>
                        </div>
                    <?php endif; ?>

                    <?php if(auth()->guard()->guest()): ?>
                        <div class="modal-footer">
                            <a href="<?php echo e(route('user.login')); ?>" type="button" class="btn btn-success custom-success" ><?php echo app('translator')->get('Please, Signin your account at first'); ?></a>
                        </div>
                    <?php endif; ?>
                </form>
            </div>
        </div>
    </div>


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

<?php $__env->startPush('js'); ?>

    <script>
        $(document).ready(function () {
            $('.investButton').on('click', function () {
                var data =$(this).data('resource');
                var symbol = "<?php echo e(__($general->cur_sym)); ?>";
                var currency = "<?php echo e(__($general->cur_text)); ?>";

                if(data.fixed_amount == '0'){
                    $('.investAmountRenge').text(`<?php echo app('translator')->get('Invest'); ?>: ${symbol}${data.minimum} - ${symbol}${data.maximum}`);
                    $('.fixedAmount').val('');
                    $('#fixedAmount').attr('readonly', false);

                }else{
                    $('.investAmountRenge').text(`<?php echo app('translator')->get('Invest'); ?>: ${symbol}${data.fixed_amount}`);
                    $('.fixedAmount').val(data.fixed_amount);

                    $('#fixedAmount').attr('readonly', true);
                }

                if(data.interest_status == '1'){
                    $('.interestDetails').html(`<strong> <?php echo app('translator')->get('Interest'); ?>: ${data.interest} % </strong>`);
                }else{
                    $('.interestDetails').html(`<strong> <?php echo app('translator')->get('Interest'); ?>: ${data.interest} ${currency}  </strong>`);
                }
                if(data.lifetime_status == '0'){
                    $('.interestValidaty').html(`<strong>  <?php echo app('translator')->get('Per'); ?> ${data.times} <?php echo app('translator')->get('Hours'); ?> ,  ${data.repeat_time} <?php echo app('translator')->get('Times'); ?></strong>`);
                }else{
                    $('.interestValidaty').html(`<strong>  <?php echo app('translator')->get('Per'); ?> ${data.times} <?php echo app('translator')->get('Hours'); ?>,  <?php echo app('translator')->get('Lifetime'); ?> </strong>`);
                }

                $('.planName').text(data.name);
                $('.plan_id').val(data.id);
            });
        });
    </script>
<?php $__env->stopPush(); ?>


<?php echo $__env->make(activeTemplate() .'layouts.user', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\market\resources\views/templates/minimal/user/plan.blade.php ENDPATH**/ ?>