<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.tailwindcss.com"></script>
    <title>My Package</title>
    <style>
        .bg-gray-base {
            --tw-bg-opacity: 1;
            background-color: rgb(247 247 247/var(--tw-bg-opacity));
        }

        .cM_ihtwPBhH2IrB_w6pz {
            background-image: url('/public/img/e1a9e3411767a56988cb.png');
            min-height: 8rem;
            background-size: cover;
            background-position: center;
            padding-bottom: .5rem;
        }

        .C_F2sqWH5VN1hJSZLfHp {
            background-image: url(data:image/png;base64, ), linear-gradient(180deg, #087b36, #16a34a);
        }
        
        .g-button {
            height: 2.5rem;
            font-size: .875rem;
            font-weight: 600;
            line-height: 1.5rem;
            --tw-text-opacity: 1;
            color: rgb(255 255 255/var(--tw-text-opacity));
            text-transform: capitalize;
            border-radius: 2666.4vw;
        }
        
        .text-primary {
            --tw-text-opacity: 1;
            color: rgb(30 146 100/var(--tw-text-opacity));
        }
        
        .g-button-bg {
            background-image: linear-gradient(to bottom,var(--tw-gradient-stops));
            --tw-gradient-from: #017946 var(--tw-gradient-from-position);
            --tw-gradient-to: rgb(1 121 70 / 0) var(--tw-gradient-to-position);
            --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
            --tw-gradient-to: #0CAD49 var(--tw-gradient-to-position);
        }
        
        .\!bg-primary {
            --tw-bg-opacity: 1 !important;
            background-color: rgb(30 146 100/var(--tw-bg-opacity))!important;
        }
        
        .text-xss {
            font-size: .8125rem;
        }
        
        .pop{
            display: none;
        }
    </style>
</head>

<body>
    <?php
        use \App\Models\PackageCategory;
        use \App\Models\Package;
        $menu = PackageCategory::get()->toArray();
        $packageOne = Package::where('Status', '!=','inactive')->whereNull('package_id')->get();
        $packagetwo = Package::where('Status', '!=','inactive')->where('tab', 'fixed')->get();
        $packagethree = Package::where('Status', '!=','inactive')->where('tab', 'event')->get();
    ?>  

    <div>
        
            
        <div class="min-h-dvh pb-[52px] bg-gray-base">
            <header class="g-navigation grid grid-cols-12 overflow-hidden backdrop-blur bg-white/95 ">
                <div class="col-span-2 flex items-center justify-center">
                    <a href="/mine" class="px-2 py-1"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"
                            class="w-5 h-5 font-bold">
                            <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5"></path>
                        </svg></a>
                </div>
                <div class="col-span-8 flex items-center justify-center">
                    <div class="text-ellipsis overflow-hidden whitespace-nowrap">  বিনিয়োগ</div>
                </div>
                <div class="col-span-2 flex items-center justify-end pr-5 text-sm text-right font-medium"></div>
            </header>

            <div class="px-5">
                <?php if($packageOne->count() > 0): ?>
                    <h3 class="font-semibold mt-3"><?php echo e($menu[0]['name']); ?></h3>
                    <?php $__currentLoopData = $packageOne; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                           <?php
                                $myVip = \App\Models\Purchase::where('user_id', auth()->id())->where('package_id', $element->id)->where('status', 'active')->first();
                                $ddIncome = $element->commission_with_avg_amount != 0 ? $element->commission_with_avg_amount / $element->validity : 0;
                            ?>
                        <?php if($myVip): ?>        
                        <a class="buyitems block mt-5 p-4 rounded-lg  bg-emerald-400">
                            <div class="flex">
                                <div class="mr-4 w-16 h-16 bg-gray-50 rounded-md overflow-hidden"><img
                                        src="<?php echo e(asset($element->photo)); ?>"
                                        class="w-full h-full" alt="img"></div>
                                <div class="flex-1 flex flex-col justify-between">
                                    <h3 class="font-semibold"><?php echo e($element->name); ?></h3>
                                    <div class="flex flex-col text-xs text-gray-500">
                                        <p class="mb-1">বিনিয়োগ চক্র(দিন<!---->):<strong class="ml-1 text-primary"><?php echo e($element->validity); ?></strong>
                                        </p>
                                        <p>উপলব্ধ: 10<!---->/10</p>
                                    </div>
                                </div>
                            </div>
                            <div
                                class="my-4 rounded-md py-5 text-gray-600 grid grid-cols-2 text-center capitalize text-xs font-semibold bg-white bg-opacity-50">
                                <div>
                                    <h4 class="mb-2 text-base text-red-500"><?php echo e(price($ddIncome)); ?></h4>
                                    <p>দৈনিক স্পিন</p>
                                </div>
                                <div>
                                    <h4 class="mb-2 text-base text-red-500"><?php echo e($element->income_range); ?></h4>
                                    <p>দৈনিক আয়(BDT<!---->)</p>
                                </div>
                            </div>
                            <div class="flex items-center justify-between">
                                <div class="flex">দাম(BDT<!---->)<span class="relative"><strong
                                            class="ml-1 text-red-500"><?php echo e(price($element->price)); ?></strong></span></div>
                                            
                                <?php if($myVip): ?>
                                    <button class="g-button flex items-center justify-center px-8 bg-white text-black">সফল</button>
                                <?php else: ?>
                                    <?php if($element->status == 'coming'): ?>
                                        
                                        <button class="g-button flex items-center justify-center px-8 bg-white text-black">Coming</button>
                                    <?php else: ?>
                                        <button class="g-button flex items-center justify-center px-8 g-button-bg text-white buynow">বিনিয়োগ</button>
                                    <?php endif; ?>
                                <?php endif; ?>            
                                
                            </div>
                            
                            <div class="hidden buyitem" id="popup-<?php echo e($element->id); ?>">
                                <div class="fixed top-0 right-0 bottom-0 left-0 bg-black bg-opacity-60 touch-none transform-gpu transition-all ease-in-out fade-default fade-enter"
                                    style="z-index: 40; transition-duration: 300ms;"></div>
                                <div class="fixed min-h-5 max-h-full overflow-y-auto bottom-0 left-0 w-full w-4/5 p-5 bg-white max-h-40 rounded-t-xl transform-gpu transition-all ease-in-out bottom-default bottom-enter"
                                    style="z-index: 40; transition-duration: 300ms;">
                                    
                                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
                                        stroke-width="2.2" class="absolute top-4 right-4 w-6 h-6 text-gray-600 z-30 closeitem">
                                        <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path>
                                    </svg>
                                    
                                    <div class="flex">
                                        <div class="mr-4 w-14 h-14 bg-gray-100 rounded-md overflow-hidden">
                                            <img src="<?php echo e(asset($element->photo)); ?>" class="w-full h-full" alt="img" /></div>
                                            
                                        <div class="flex-1 flex flex-col justify-between">
                                            <h3 class="font-semibold"> <?php echo e($element->name); ?></h3>
                                            <div class="flex flex-col text-sm text-gray-500">
                                                <p><span>দাম(BDT<!---->):</span><strong class="ml-1 text-red-500"><?php echo e(price($element->price)); ?></strong></p>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <p class="mt-4 mb-3 text-sm text-gray-500">ক্রয়ের পরিমাণ</p>
                                    <div class="grid grid-cols-3 gap-2.5">
                                        <div class="h-10 flex items-center justify-center rounded-lg text-gray-800 !text-white !bg-primary"
                                            style="background-color: rgb(245, 249, 247);">1</div>
                                    </div>
                                    
                                    <div class="mt-4 grid gap-2 text-sm text-gray-500">
                                        <div class="flex items-center justify-between"><span>দৈনিক স্পিন :</span><strong><?php echo e(price($ddIncome)); ?></strong></div>
                                        <div class="flex items-center justify-between"><span>দৈনিক আয়:</span><strong><?php echo e($element->income_range); ?></strong></div>
                                        <div class="flex items-center justify-between"><span>উপলব্ধ:</span><strong>1</strong></div>
                                        <div class="flex items-center justify-between"><span class="text-black">প্রদান করতে হবে:</span><strong
                                                class="text-red-500"><?php echo e(price($element->price)); ?></strong></div><button onclick="window.location.href='<?php echo e(url('purchase/confirmation')); ?>/<?php echo e($element->id); ?>'"
                                            class="g-button flex items-center justify-center g-button-bg mt-4">এখনই বিনিয়োগ করুন</button>
                                        <div class="text-xs mt-2">আপনি প্রতি ঘন্টায় আপনার বিনিয়োগ আয় পেতে পারেন৷ বিনিয়োগ চক্র শেষ হয়ে গেলে,
                                            আপনার প্রধান স্বয়ংক্রিয়ভাবে আপনার ব্যালেন্সে ফেরত দেবেন এবং প্রত্যাহার করা যাবে৷</div>
                                    </div>
                                    <div class="safe-inset-bottom box-border"></div>
                                </div>
                            </div>
                        </a>
                        <?php endif; ?>
                        
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
                
            </div>
            
            <div class="px-5 mt-3">
                <?php if($packagetwo->count() > 0): ?>
                    <h3 class="font-semibold mt-3"><?php echo e($menu[1]['name']); ?></h3>
                    <?php $__currentLoopData = $packagetwo; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                           <?php
                                $myVip = \App\Models\Purchase::where('user_id', auth()->id())->where('package_id', $element->id)->where('status', 'active')->first();
                                $ddIncome = $element->commission_with_avg_amount != 0 ? $element->commission_with_avg_amount / $element->validity : 0;
                            ?>
                         
                        <?php if($myVip): ?>    
                        <a class="block mt-5 p-4 rounded-lg  bg-emerald-400">
                            <div class="flex">
                                <div class="mr-4 w-16 h-16 bg-gray-50 rounded-md overflow-hidden"><img
                                        src="<?php echo e(asset($element->photo)); ?>"
                                        class="w-full h-full" alt="img"></div>
                                <div class="flex-1 flex flex-col justify-between">
                                    <h3 class="font-semibold"><?php echo e($element->name); ?></h3>
                                    <div class="flex flex-col text-xs text-gray-500">
                                        <p class="mb-1">বিনিয়োগ চক্র(দিন<!---->):<strong class="ml-1 text-primary"><?php echo e($element->validity); ?></strong>
                                        </p>
                                        <p>উপলব্ধ: 10<!---->/10</p>
                                    </div>
                                </div>
                            </div>
                            <div
                                class="my-4 rounded-md py-5 text-gray-600 grid grid-cols-2 text-center capitalize text-xs font-semibold bg-white bg-opacity-50">
                                <div>
                                    <h4 class="mb-2 text-base text-red-500"><?php echo e(price($ddIncome)); ?></h4>
                                    <p>দৈনিক আয়(BDT<!---->)</p>
                                </div>
                                <div>
                                    <h4 class="mb-2 text-base text-red-500"><?php echo e(price($element->commission_with_avg_amount)); ?></h4>
                                    <p>মোট আয়(BDT<!---->)</p>
                                </div>
                            </div>
                            <div class="flex items-center justify-between">
                                <div class="flex">দাম(BDT<!---->)<span class="relative"><strong
                                            class="ml-1 text-red-500"><?php echo e(price($element->price)); ?></strong></span></div>
                                            
                                <?php if($myVip): ?>
                                    <button class="g-button flex items-center justify-center px-8 bg-white text-black">সফল</button>
                                <?php else: ?>
                                    <?php if($element->status == 'coming'): ?>
                                        
                                        <button class="g-button flex items-center justify-center px-8 bg-white text-black">Coming</button>
                                    <?php else: ?>
                                        <button onclick="openPop('<?php echo e($element->id); ?>', '<?php echo e($element->name); ?>', '<?php echo e(price($element->price)); ?>', '<?php echo e(price($element->commission_with_avg_amount)); ?>')" class="g-button flex items-center justify-center px-8 g-button-bg text-white">বিনিয়োগ</button>
                                    <?php endif; ?>
                                <?php endif; ?>            
                                
                            </div>
                        </a>
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
                
            </div>
            <div class="px-5 mt-3">
                <?php if($packagethree->count() > 0): ?>
                    <h3 class="font-semibold mt-3"><?php echo e($menu[2]['name']); ?></h3>
                    <?php $__currentLoopData = $packagethree; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                           <?php
                                $myVip = \App\Models\Purchase::where('user_id', auth()->id())->where('package_id', $element->id)->where('status', 'active')->first();
                                $ddIncome = $element->commission_with_avg_amount != 0 ? $element->commission_with_avg_amount / $element->validity : 0;
                            ?>
                        <?php if($myVip): ?>        
                        <a class="block mt-5 p-4 rounded-lg  bg-emerald-400">
                            <div class="flex">
                                <div class="mr-4 w-16 h-16 bg-gray-50 rounded-md overflow-hidden"><img
                                        src="<?php echo e(asset($element->photo)); ?>"
                                        class="w-full h-full" alt="img"></div>
                                <div class="flex-1 flex flex-col justify-between">
                                    <h3 class="font-semibold"><?php echo e($element->name); ?></h3>
                                    <div class="flex flex-col text-xs text-gray-500">
                                        <p class="mb-1">বিনিয়োগ চক্র(দিন<!---->):<strong class="ml-1 text-primary"><?php echo e($element->validity); ?></strong>
                                        </p>
                                        <p>উপলব্ধ: 10<!---->/10</p>
                                    </div>
                                </div>
                            </div>
                            <div
                                class="my-4 rounded-md py-5 text-gray-600 grid grid-cols-2 text-center capitalize text-xs font-semibold bg-white bg-opacity-50">
                                <div>
                                    <h4 class="mb-2 text-base text-red-500"><?php echo e(price($ddIncome)); ?></h4>
                                    <p>দৈনিক আয়(BDT<!---->)</p>
                                </div>
                                <div>
                                    <h4 class="mb-2 text-base text-red-500"><?php echo e(price($element->commission_with_avg_amount)); ?></h4>
                                    <p>মোট আয়(BDT<!---->)</p>
                                </div>
                            </div>
                            <div class="flex items-center justify-between">
                                <div class="flex">দাম(BDT<!---->)<span class="relative"><strong
                                            class="ml-1 text-red-500"><?php echo e(price($element->price)); ?></strong></span></div>
                                            
                                <?php if($myVip): ?>
                                    <button class="g-button flex items-center justify-center px-8 bg-white text-black">সফল</button>
                                <?php else: ?>
                                    <?php if($element->status == 'coming'): ?>
                                        
                                        <button class="g-button flex items-center justify-center px-8 bg-white text-black">Coming</button>
                                    <?php else: ?>
                                        <button onclick="openPop('<?php echo e($element->id); ?>', '<?php echo e($element->name); ?>', '<?php echo e(price($element->price)); ?>', '<?php echo e(price($element->commission_with_avg_amount)); ?>')" class="g-button flex items-center justify-center px-8 g-button-bg text-white">বিনিয়োগ</button>
                                    <?php endif; ?>
                                <?php endif; ?>            
                                
                            </div>
                        </a>
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
                
            </div>

            
          

        
        
    </div>
    
    <?php echo $__env->make('alert-message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    
    <script>
        $(".buynow").click(function(){
            $(this).parents('.buyitems').find('.buyitem').show();
        });
        
        $(".closeitem").click(function(){
            $(this).parents('.buyitem').hide();
        });

        function copyLink(text)
        {
            const body = document.body;
            const input = document.createElement("input");
            body.append(input);
            input.style.opacity = 0;
            input.value = text.replaceAll(' ', '');
            input.select();
            input.setSelectionRange(0, input.value.length);
            document.execCommand("Copy");
            input.blur();
            input.remove();
            message('Copied success..')
        }
        
        
        function closePop() {
            let element = document.querySelector('.pop');
            element.style.display = 'none'
        }
    
        function openPop(packageId, packageName, packagePrice, packageTotalCommission, ) {
            document.querySelector('.pname').innerHTML = packageName;
            document.querySelector('.ppprice').innerHTML = packagePrice;
            document.querySelector('.ppTotalPrice').innerHTML = packageTotalCommission;
            let element = document.querySelector('.pop');
            element.style.display = 'block';
    
            document.querySelector('#sufferBtn').innerHTML = `
                    <a class="packageBuyBtn popBtn" style="display:block;text-align:center;text-decoration:none;" href="<?php echo e(url('purchase/confirmation')); ?>/${packageId}">Confirm</a>
                `
            
        }
    </script>
</body>

</html><?php /**PATH /home/brightfuture/test.bright-future.top/resources/views/app/main/myvip.blade.php ENDPATH**/ ?>