<?php
use App\Models\Package;

$packages = Package::where('status', 'active')->get();
?>
<html>
 <head> 
  <meta charset="utf-8"> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
  <title>bet_System</title> 
  <link rel="stylesheet" href="/mamber/layui.css"> 
  <link rel="stylesheet" href="/mamber/common.css"> 
  <link rel="stylesheet" href="/mamber/swiper-bundle.min.css"> 
  <style>
			.index_balance_item {
				width: 150px;
				text-align: center;
				padding: 0 15px;
			}

			.index_balance_label {
				font-family: Arial, Arial;
				font-weight: 400;
				font-size: 16px;
				color: #3D3D3D;
				line-height: 18px;
				text-align: left;
				font-style: normal;
				text-transform: none;
			}

			.index_balance_value {
				margin-top: 10px;
				font-family: Arial, Arial;
				font-weight: 400;
				font-size: 24px;
				color: #3D3D3D;
				line-height: 28px;
				text-align: left;
				font-style: normal;
				text-transform: none;
			}

			.step_btn {
				width: 120px !important;
			}

			.product_image {
				width: 105px;
				height: 105px !important;
				background: #ffffff;
				border-radius: 8px;
				padding-bottom: 0px !important;
			}

			.product_image img {
				width: 105px;
				height: 105px;

				border-radius: 8px;
			}

			.product_card .product_content {
				padding: 15px 0px 0px 15px !important;
			}

			.product_vip_btn {
				width: 70px;
				height: 26px;
				background: #F5ECD8;
				font-family: DingTalk JinBuTi, DingTalk JinBuTi;
				font-weight: 400;
				font-size: 16px;
				color: #DB9800;
				text-align: center;
				font-style: normal;
				text-transform: none;
				border-radius: 8px;
			}

			.product_vip_btn {
				position: absolute;
				top: 0px;
				right: 0px;
				border-radius: 0 12px 0 12px;
			}

			.product_card .product_content .product_title .product_info {
				padding: 0px;
			}

			.product_name {
				font-family: Arial, Arial;
				font-weight: 700;
				font-size: 16px;
				color: #3D3D3D !important;
				line-height: 16px;
				text-align: left;
				margin-bottom: 0px !important;
			}

			.product_info {
				padding-right: 15px !important;
			}

			.product_card .product_content .price {
				font-weight: 700;
				color: #181818;
				font-size: 14px !important;
				line-height: 14px !important;
			}

			.unit {
				color: #181818 !important;
				position: unset !important;
				font-weight: 700;
			}

			.product_item .label {
				font-weight: 400;
				font-size: 12px;
				color: #666666;
				line-height: 14px;
			}

			.product_item .value {
				margin-left: 0px !important;
				color: #51595D !important;
				font-weight: 400 !important;
			}

			.buy_btn {
			
				height: 38px;
				background: #fff;
				border-radius: 15px;
				padding: 0 10px;
				font-family: Arial, Arial;
				font-weight: 600;
				font-size: 16px;
				color: #053c8f;
				border: 2px solid #053c8f;
				line-height: 32px;
				text-align: center;
				font-style: normal;
				text-transform: none;
			}

			.dialog_product_image {
				text-align: center;
				width: 100%;
				padding-bottom: 20px;
				border-bottom: 1px solid #E9E9E9;
			}

			.product_type_content {
				height: 75px;
			}

			.dialog_product_image {
				text-align: center;
				width: 100%;
				padding-bottom: 20px;
				border-bottom: 1px solid #E9E9E9;
			}

			.product_details_dialog .dialog_unit {
				position: absolute;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 14px;
				color: #CFD0D9;
				top: -1px !important;
				left: -40px !important;
			}

			.product_card .product_item .label {
				color: #818393 !important;
			}

			.product_card .product_item .value {
				color: #0C4282 !important;
				font-weight: 700;
			}

			.product_nav_list {
				position: sticky;
				top: 5px;
				z-index: 9998;
				box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.41);
			}

			.product_title {
				margin-bottom: 10px
			}

			.sticky-header {
				position: -webkit-sticky;
				/* For Safari */
				position: sticky;
				top: 0;
				background: none;
				padding: 10px;
				z-index: 9999999999;
			}

			.product_item .value {
				padding-left: 10px;
			}
			body{
			    font-family: "Varela Round", sans-serif, sans-serif, Georgia, serif !important;
			}
.product_list {
  display: none;
}
.product_list.active {
  display: block;
}

		</style> 
 </head> 
 <body class="common_body" style="position: relative;"> 
  <div style="position: relative;"> 
   <div class="banner" style="background-image: url(/mamber/img/i1.png); background-size: 100% 167px;"> 
    <p style="color:#fff; opacity:0.8; font-size:22px;"> Always delivering great profits to users </p> 
    <h3 style="color:#fff; font-size:32px; font-weight:bolder; margin-top:10px;"> R.Co </h3> 
   </div> 
  </div> 
  <div class="common_position " style="margin-top: -80px;"> 
   <div class="sticky-header" id="stickyElement" style="position:fixed;top:18%;left:0px;padding: 10px 5px 10px 0;background-color: rgba(255, 255, 255, 0.5);"> 
    <div class="product_type_list flex_space" style="padding: 0; display: flex; flex-direction: column;"> 
     <div class="product_type_nav product_type_nav_active" data-type="1" data-image="fixed" onclick="setActiveTab(1)">
      <p class="title">Monthly</p> 
     </div> 
     <div class="product_type_nav" data-type="2" data-image="welfare" onclick="setActiveTab(2)">
      <p class="title">Daily</p> 
     </div> 
     <div class="product_type_nav" data-type="3" data-image="activity" onclick="setActiveTab(3)">
      <p class="title">Point Rewards</p> 
     </div> 
    </div> 
   </div> 
   <div style="padding: 45px 0px 0px 33%;">
        <div class="product_type_1 product_list active" id="fixed_fund">
   @foreach ($packages as $package)
      @if ($package->category == 'fixed')
     <a onclick="window.location.href='{{route('vip.details', $package->id)}}'" class="product_card position"> 
      <!--<img class="product_vip" src="/mamber/img/vip/v0_icon.png" />--> 
      <div class="product_content"> 
       <div class="product_title flex_space"> 
        <div class="product_info" style="width: 100%"> 
         <div class="product_name flex_left" style="white-space: nowrap;overflow: hidden;">
           Initial Fund 1 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Price per Unit:</p> 
          <p class="value position" style="font-weight: 700; color:#d2aa69; font-size:22px;"> <span style="color:#d2aa69;">R&nbsp;{{ ($package->price) }}</span> </p> 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Revenue Duration:</p> 
          <p class="value position" style="font-weight: 700; margin-left: 0;"> <span>{{ $package->validity }} days</span> </p> 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Daily Income:</p> 
          <p class="value position" style="font-weight: 700;"> <span>R&nbsp; {{($package->commission_with_avg_amount / $package->validity)}}</span> </p> 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Total Income:</p> 
          <p class="value position" style="font-weight: 700;"> <span>R&nbsp; {{ ($package->commission_with_avg_amount) }} </span> </p> 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Maximum Quantity:</p> 
          <p class="value position" style="font-weight: 700;"> <span>5 copies</span> </p> 
         </div> 
        </div> 
       </div>
      </div> 
      <div class="flex_space buy_card" style="background:#fff;border-radius:25%;"> 
       <div style="font-weight: 700;font-size: 18px;color: #104B91;line-height: 38px;text-align: left;background:#fff;padding-left:30px;border-radius:45px;"> 
        <img class="" src="/mamber/img/lv0.svg" style="height:45px;padding-right:20px;"> 
       </div> 
       <div style="background:#F4F4F4;padding:10px 15px 4px 10px;border-top-left-radius:25%;"> 
        <div class="layui-btn layui-btn-fluid layui-btn-radius buy_btn" onclick="buyDialog('31','Initial Fund 1','/public/uploads/product/20250703070716384643.png','350.00','42','105','4410','100')">
          Investing 
        </div> 
       </div> 
      </div> </a>@endif
    @endforeach
     <div class="none_data  hide"> 
      <img class="none_image" src="/mamber/img/none_order.png"> 
      <p class="none_text"> There are no investment items available. </p> 
     </div> 
    </div>
    <div class="product_type_2 product_list" id="welfare_fund">
        @foreach ($packages as $package)
      @if ($package->category == 'welfare')
     <a onclick="window.location.href='{{route('vip.details', $package->id)}}'" class="product_card position"> 
      <div class="product_content"> 
       <div class="product_title flex_space"> 
        <div class="product_info" style="width: 100%"> 
         <div class="product_name flex_left" style="white-space: nowrap;overflow: hidden;">
           VIP Fund 1 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Price per Unit:</p> 
          <p class="value position" style="font-weight: 700; color:#d2aa69; font-size:22px;"> <span style="color:#d2aa69;">R&nbsp;{{ ($package->price) }}</span> </p> 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Daily Salary:</p> 
          <p class="value position" style="font-weight: 700;"> <span>R&nbsp;&nbsp; {{($package->commission_with_avg_amount / $package->validity)}}</span> </p> 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Revenue Duration:</p> 
          <p class="value position" style="font-weight: 700; margin-left: 0;"> <span> days</span> </p> 
         </div> 
         <div class="product_item flex_left"> 
          <p class="label">Total Return:</p> 
          <p class="value position" style="font-weight: 700;"> <span>R&nbsp;{{ ($package->commission_with_avg_amount) }}</span> </p> 
         </div> 
        </div> 
       </div> 
       <!--<div class="flex_space buy_card">--> 
       <!--    <div style="font-weight: 700;font-size: 18px;color: #104B91;line-height: 38px;text-align: left;background:#fff;">--> 
       <!--        <img class="" src="/mamber/img/index/lv1.svg" style="height:45px;" />--> 
       <!--    </div>--> 
       <!--    <div class="layui-btn layui-btn-fluid layui-btn-radius buy_btn"--> 
       <!--        onclick="buyDialog('39','VIP Fund 1','/public/uploads/product/20250703072458670999.png','350.00','5','175','875','1')">--> 
       <!--        Invest Now--> 
       <!--    </div>--> 
       <!--</div>--> 
      </div> 
      <div class="flex_space buy_card" style="background:#fff;border-radius:25%;"> 
       <div style="font-weight: 700;font-size: 18px;color: #104B91;line-height: 38px;text-align: left;background:#fff;padding-left:30px;border-radius:45px;"> 
        <img class="" src="/mamber/img/lv1.svg" style="height:45px;padding-right:20px;"> 
       </div> 
       <div style="background:#F4F4F4;padding:10px 15px 4px 10px;border-top-left-radius:25%;"> 
        <div class="layui-btn layui-btn-fluid layui-btn-radius buy_btn" onclick="buyDialog('39','VIP Fund 1','/public/uploads/product/20250703072458670999.png','350.00','5','175','875','1')">
          Investing 
        </div> 
       </div> 
      </div> </a>@endif
    @endforeach
     <div class="none_data  hide"> 
      <img class="none_image" src="/mamber/img/none_order.png"> 
      <p class="none_text">There are no investment items available.</p> 
     </div> 
    </div> 



    <!--div class="product_type_3 product_list hide">-->
    <div class="product_type_3 product_list" id="activity_fund">
     <div class="none_data "> 
      <img class="none_image" src="/mamber/img/none_order.png"> 
      <p class="none_text">There are no investment items available.</p> 
     </div> 
    </div> 
   </div> 
  </div> 
  <div class="index_main" style="margin-top: 40px"> 
   <textarea style="height: 1px;opacity: 0" name="copyTxt" id="copyTxt" readonly>https://t.me/the_mamber001</textarea> 
  </div> 
  <div class="product_details_dialog" id="product_details_dialog"> 
   <div class="product_details_dialog_content layui-form"> 
    <input type="hidden" class="data_id" name="product_id"> 
    <div class="dialog_close_icon"> 
     <i class="layui-icon layui-icon-close layui-font-28" style="color: #C6C6C6"></i> 
    </div> 
    <div class="dialog_product_image"> 
     <!--<img class="product_img" src="/mamber/img/product/product.png"--> 
     <!--    style="width: 80px;height: 80px;border-radius: 50%">--> 
     <p class="product_name" style="text-align: center;margin-top: 5px;"></p> 
    </div> 
    <div class="product_details_item flex_space"> 
     <p class="label">Product Price</p> 
     <p class="value position"> <span class="dialog_unit">₱</span> <span class="price data_price">28000</span> </p> 
    </div> 
    <div class="product_details_item flex_space"> 
     <p class="label">Daily Income</p> 
     <p class="value position"> <span class="dialog_unit">₱</span> <span class="data_daily_income">1000</span> </p> 
    </div> 
    <div class="product_details_item flex_space"> 
     <p class="label">Income Duration</p> 
     <p class="value position"> <span class="data_revenue_days">30</span> <span class="days">days</span> </p> 
    </div> 
    <div class="product_details_item flex_space"> 
     <p class="label">Total Revenue</p> 
     <p class="value position"> <span class="dialog_unit">₱</span> <span class="data_total_income">28000</span> </p> 
    </div> 
    <div class="product_details_item flex_space" style="padding-bottom: 0px"> 
     <p class="label">Total number</p> 
     <p class="value position buy_content" style="width: 100px"> </p>
     <div class="layui-input-wrap">
      <input type="number" name="buy_share" id="buy_num" value="1" lay-precision="0" lay-affix="number" lay-filter="number" readonly placeholder="Total number" step="1" min="1" class="layui-input" style="height: 44px;line-height: 44px">
      <div class="layui-input-affix layui-input-split layui-input-number layui-input-suffix">
       <i class="layui-icon layui-icon-up"></i>
       <i class="layui-icon layui-icon-down"></i>
      </div>
     </div> 
     <p></p> 
    </div> 
    <div class="product_details_item flex_left" style="padding-top: 0px"> 
     <span class="label">Balance:</span> 
     <p class="value position" style="margin-left: 12px"> 
      <!--<span class="dialog_unit">₱</span>--> <span class="dialog_unit"></span> <span class="data_balance">0.00</span> </p> 
    </div> 
    <button class="layui-btn layui-btn-fluid product_details_buy_btn" type="submit" lay-submit="" lay-filter="buy_product" style="font-weight:700;"> Invest Now </button> 
   </div> 
  </div> 
  <div id="service" style="width: 60px;height: 60px;background: rgba(255,255,255,0.7);box-shadow: 0px 4px 16px 0px rgba(0,0,0,0.15);border-radius: 100px 100px 100px 100px;"> 
   <a href="/help"> <img src="/mamber/img/OnlineService.png" style="width: 60px;height: 60px;border-radius:50%;"> </a> 
  </div> 
  <div class="footer_menu"> 
   <div class="content"> 
    <a href="/" class="item "> <img src="/mamber/img/logo.svg"> <p>About</p> </a> 
    <a href="/invest" class="item active"> <img src="/mamber/img/INCEST.svg"> <p>Investments</p> </a> 
    <a href="/club" class="item "> <img src="/mamber/img/clbu.jpg" style="width:28px;"> <p>Club</p> </a> 
    <a href="/myTeam" class="item "> <img src="/mamber/img/GIFTBOS.svg"> <p>Welfare</p> </a> 
    <a href="/account" class="item "> <img src="/mamber/img/Account.svg"> <p>Account</p> </a> 
   </div> 
  </div> 
 

<!-- Snackbar container -->
<div id="snackbar"></div>

<!-- CSRF Token for AJAX Requests -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<div class="lay"></div>

<script>
  // Function to close the modal
  function closeModal() {
    document.getElementById('accd').style.display = 'none';
    document.querySelector('.lay').style.display = 'none';
  }

  // Close modal on background click
  document.querySelector('.lay').addEventListener('click', closeModal);

  // Function to set the active product tab
  function setActiveTab(type) {
    // Remove active class from all product_type_nav
    var navItems = document.querySelectorAll('.product_type_nav');
    navItems.forEach(function(nav) {
      nav.classList.remove('product_type_nav_active');
    });

    // Add active class to the clicked tab
    var activeNav = document.querySelector('.product_type_nav[data-type="' + type + '"]');
    if (activeNav) {
      activeNav.classList.add('product_type_nav_active');
    }

    // Hide all product list sections
    var productLists = document.querySelectorAll('.product_list');
    productLists.forEach(function(list) {
      list.classList.remove('active');
    });

    // Show selected section based on type
    var sectionId = type === 1 ? 'fixed_fund' : (type === 2 ? 'welfare_fund' : 'activity_fund');
    var activeProductList = document.getElementById(sectionId);
    if (activeProductList) {
      activeProductList.classList.add('active');
    }
  }
</script>


</body>
</html>
 