

<?php $__env->startSection('content'); ?>
<div id="appCapsule">
    <div class="container-fluid py-3 mb-2 bg-default">
        <div class="row align-items-center">
            <div class="col pt-1 ps-2">
                <h2 class="text-light">Membership Plan</h2>
                <h6 class="text-light mb-0">Join with us.</h6>
            </div>
            <div class="col-auto text-center">
                <img src="<?php echo e(asset('assets/images/2d-icon/2/locker-3.png')); ?>" width="100px">
            </div>
        </div>
    </div>
    <div class="section-sm pricing-section mb-2">
        <div class="container-xl">
            <div class="row g-3 justify-content-center">
                <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col-sm-6 col-lg-4">
                    <!-- card block -->
                        <div class="card-block bg--primary">
                            <div class="card-main">

                                <div class="card-button dropdown mt-2 me-1">
                                    <?php if(@auth()->user()->runningPlan && @auth()->user()->plan_id == $plan->id): ?>
                                        <button class="btn btn-link btn-icon disabled"><?php echo app('translator')->get('Current Package'); ?></button>
                                    <?php else: ?>
                                        <button class="btn btn-link btn btn-light buyBtn" data-plan="<?php echo e($plan); ?>">
                                            <?php echo app('translator')->get('Buy'); ?>
                                        </button>
                                    <?php endif; ?>
                                </div>
                                <div class="balance">
                                    <span class="label">Plan Name</span>
                                    <h1 class="title"><?php echo e(__($plan->name)); ?>

                                    <?php if($plan->highlight == 1): ?>
                                        <span class="fontsize-caption px-1 rounded bg-success"><?php echo app('translator')->get('Popular'); ?></span>
                                    <?php endif; ?>
                                    </h1>
                                </div>
                                <div class="in">
                                    <div class="card-number">
                                        <span class="label">Price</span>
                                        <?php echo e(__(showAmount($plan->price))); ?> <?php echo e($general->cur_text); ?>

                                    </div>
                                    <div class="bottom">
                                        <div class="card-expiry"><span class="label"><?php echo app('translator')->get('Validity'); ?></span> <?php echo e($plan->validity); ?> <?php echo app('translator')->get('Days'); ?></div>
                                        <div class="card-expiry"><span class="label"><?php echo app('translator')->get('Referral Bonus'); ?></span><?php echo app('translator')->get('Upto'); ?> <?php echo e($plan->ref_level); ?> <?php echo app('translator')->get('Level'); ?></div>
                                        <div class="card-ccv"><span class="label"><?php echo app('translator')->get('Daily Earning'); ?></span> <?php echo e($plan->daily_earning); ?> <?php echo e($general->cur_text); ?> </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <!-- end card block -->
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>

        <div class="modal custom--modal fade" id="BuyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">

                    <form method="post" action="<?php echo e(route('user.buyPlan')); ?>">
                        <?php echo csrf_field(); ?>
                        <input type="hidden" name="id">
                        <div class="modal-header">
                            <strong class="modal-title"> <?php echo app('translator')->get('Confirmation to purches  '); ?><span class="planName"></span></strong>

                            <button type="button" class="close btn btn-sm btn-close" data-bs-dismiss="modal"></button>
                        </div>
                        <div class="modal-body">

                            <?php if(auth()->guard()->check()): ?>
                                <div class="form-group">
                                    <?php if(auth()->user()->runningPlan): ?>
                                        <code class="d-block"><?php echo app('translator')->get('If you subscribe to this one. Your old limitation will reset according to this package.'); ?></code>
                                    <?php endif; ?>

                                    <h6 class="text-center dailyLimit"></h6>
                                    <p class="text-center refLevel"></p>
                                    <p class="text-center mt-1 validity"></p>

                                    <label><?php echo app('translator')->get('Select Wallet'); ?></label>
                                    <select class="form-control  form-select" name="wallet_type" required>
                                        <option value=""><?php echo app('translator')->get('Select One'); ?></option>
                                        <?php if(auth()->user()->balance > 0): ?>
                                            <option value="deposit_wallet"><?php echo app('translator')->get('Deposit Wallet - ' . $general->cur_sym . showAmount(auth()->user()->balance)); ?></option>
                                        <?php endif; ?>

                                        <?php $__currentLoopData = $gatewayCurrency; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($data->id); ?>" <?php if(old('wallet_type') == $data->method_code): echo 'selected'; endif; ?> data-gateway="<?php echo e($data); ?>"><?php echo e($data->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                    <code class="gateway-info rate-info d-none"><?php echo app('translator')->get('Rate'); ?>: 1 <?php echo e($general->cur_text); ?>

                                        = <span class="rate"></span> <span class="method_currency"></span></code>
                                </div>
                                <div class="form-group">
                                    <label><?php echo app('translator')->get('Invest Amount'); ?></label>
                                    <div class="input-group">
                                        <input type="number" step="any" class="form-control form-control" name="amount" required>
                                        <span class="input-group-text text-white bg--primary px-1"><?php echo e($general->cur_text); ?></span>
                                    </div>
                                    <code class="gateway-info d-none"><?php echo app('translator')->get('Charge'); ?>: <span class="charge"></span>
                                        <?php echo e($general->cur_text); ?>. <?php echo app('translator')->get('Total amount'); ?>: <span class="total"></span>
                                        <?php echo e($general->cur_text); ?></code>
                                </div>
                            <?php else: ?>
                                <p><?php echo app('translator')->get('Please login to subscribe plan'); ?></p>
                            <?php endif; ?>
                        </div>
                        <div class="modal-footer">
                            <?php if(auth()->guard()->check()): ?>
                                <button type="button" class="btn btn-dark text-white" data-bs-dismiss="modal"><?php echo app('translator')->get('No'); ?></button>
                                <button type="submit" class="btn btn--base text-white "><?php echo app('translator')->get('Yes'); ?></button>
                            <?php else: ?>
                                <a href="<?php echo e(route('user.login')); ?>" class="btn btn--base text-white w-100"><?php echo app('translator')->get('Login'); ?></a>
                            <?php endif; ?>
                        </div>

                    </form>

                </div>
            </div>
        </div>

    </div>

</div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('style'); ?>
    <style>
        .package-disabled {
            opacity: 0.5;
        }
    </style>
<?php $__env->stopPush(); ?>
<?php $__env->startPush('script'); ?>
    <script type="text/javascript">
        (function($) {
            "use strict";
            $('.buyBtn').click(function() {
                let symbol = '<?php echo e($general->cur_sym); ?>';
                let currency = '<?php echo e($general->cur_text); ?>';
                $('.gateway-info').addClass('d-none');
                let modal = $('#BuyModal');
                let plan = $(this).data('plan')
                modal.find('.planName').text(plan.name)
                modal.find('[name=id]').val(plan.id)
                let planPrice = parseFloat(plan.price).toFixed(2);
                modal.find('[name=amount]').val(planPrice);
                modal.find('[name=amount]').attr('readonly', true);

                modal.find('.dailyLimit').html(`Daily Ads Limit:<span class="text-danger"> ${plan.daily_limit}</span>`)
                modal.find('.refLevel').html(`Referral Level: <span class="text-danger">${plan.ref_level} </span>`)
                modal.find('.validity').html(`Plan Validity:  <span class="text-danger"> ${plan.validity} Days </span>`)

                $('[name=amount]').on('input', function() {
                    $('[name=wallet_type]').trigger('change');
                })

                $('[name=wallet_type]').change(function() {
                    var amount = $('[name=amount]').val();
                    if ($(this).val() != 'deposit_wallet' && $(this).val() != 'interest_wallet' && amount) {
                        var resource = $('select[name=wallet_type] option:selected').data('gateway');
                        var fixed_charge = parseFloat(resource.fixed_charge);
                        var percent_charge = parseFloat(resource.percent_charge);
                        var charge = parseFloat(fixed_charge + (amount * percent_charge / 100)).toFixed(2);
                        $('.charge').text(charge);
                        $('.rate').text(parseFloat(resource.rate));
                        $('.gateway-info').removeClass('d-none');
                        if (resource.currency == '<?php echo e($general->cur_text); ?>') {
                            $('.rate-info').addClass('d-none');
                        } else {
                            $('.rate-info').removeClass('d-none');
                        }
                        $('.method_currency').text(resource.currency);
                        $('.total').text(parseFloat(charge) + parseFloat(amount));
                    } else {
                        $('.gateway-info').addClass('d-none');
                    }
                });
                modal.find('input[name=id]').val(plan.id);
                modal.modal('show');
            });
        })(jQuery);
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make($activeTemplate . 'layouts.frontend', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ptctheme/d4.superearning.online/core/resources/views/templates/dark_gold/plans.blade.php ENDPATH**/ ?>