<?php $__env->startSection('content'); ?>
   
<div id="appCapsule">
    <div class="section-sm pricing-section">
        <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 -->
                    <br>
                     <div class="stat-box">
 <div class="box">
     <img src="https://i.ibb.co/WsJPsxW/award-9142083.png" height="60px" width="60px"><br>
        <h2>আমাদের মেম্বারশিপ প্ল্যান</h2>
        <p class="description"> <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('বর্তমান প্যাকেজ'); ?></button>
                                    <?php else: ?>
                                        <button class="btn btn-link btn btn-dark buyBtn" data-plan="<?php echo e($plan); ?>">
                                            <?php echo app('translator')->get('কিনুন'); ?>
                                        </button>
                                    <?php endif; ?>
                                </div>
                                <div class="balance">
                                    <span class="label text-black">প্ল্যানের নাম: <?php echo e(__($plan->name)); ?> 
                                    <?php if($plan->highlight == 1): ?>
                                        <span class="fontsize-caption px-1 rounded bg-success"><?php echo app('translator')->get('পপুলার'); ?></span>
                                    <?php endif; ?>
                                    </span>
                                </div>
                                <div class="in">
                                    <div class="card-number">
                                        <span class="label text-danger">মূল্য : <?php echo e(__(showAmount($plan->price))); ?> <?php echo e($general->cur_text); ?></span>
                                        
                                    </div>
                                    <div class="bottom">
                                        <div class="card-expiry"><span class="label text-success"><?php echo app('translator')->get('মেয়াদ'); ?> : <?php echo e($plan->validity); ?> <?php echo app('translator')->get('দিন'); ?></span> </div>
                                        <div class="card-expiry"><span class="label text-warning"><?php echo app('translator')->get('রেফার বোনাস'); ?> <?php echo app('translator')->get('সর্বচ্চো'); ?> <?php echo e($plan->ref_level); ?> <?php echo app('translator')->get('লেভেল'); ?></span></div>
                                        <div class="card-ccv"><span class="label text-black"><?php echo app('translator')->get('দৈনিক কাজ'); ?> <?php echo e($plan->daily_limit); ?> <?php echo app('translator')->get('টি'); ?> </span></div>
                                    </div>
                                </div>
                                
                            
                        </div></p>
    </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>
<div class="my-5 py-5">&nbsp;<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/lotteryx/public_html/shopx.77lottery.xyz/core/resources/views/templates/smartlab/plans.blade.php ENDPATH**/ ?>