SCDNG PELER
Server IP : 144.76.124.212  /  Your IP : 216.73.216.138
Web Server : LiteSpeed
System : Linux l4cp.vnetindia.com 4.18.0-553.40.1.lve.el8.x86_64 #1 SMP Wed Feb 12 18:54:57 UTC 2025 x86_64
User : rakcha ( 1356)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home5/rakcha/public_html/app/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home5/rakcha/public_html/app/index1.php
<?php error_reporting(0); ?>

<?php session_start();?>

<?php 

 if (!isset($_SESSION['distributor_id'])) {

    header("location: login.php");

  }

 else {

  include("includes/database.php");

       $page_user = $_SESSION['distributor_id'];

       $select_query = "select * from member where user_id='$page_user'";

       $run = mysqli_query($con,$select_query);

       $serial = 1;

       while ($row = mysqli_fetch_array($run)) {

        $s_num = $serial++;

        $member_id = $row['member_id'];

        $profile = $row['profile'];

        $title = $row['title'];

        $dob = $row['dob'];

        $name = $row['name'];

        $gender = $row['gender'];

        $address_1 = $row['address_1'];

        $address_2 = $row['address_2'];

        $town_area = $row['town_area'];

        $city_district = $row['city_district'];

        $state = $row['state'];

        $country = $row['country'];

        $pincode = $row['pincode'];

        $mobile_number = $row['mobile_number'];

        $email = $row['email'];

        $aadhaar_card = $row['aadhaar_card'];

        $pan_card = $row['pan_card'];

        $nominee_name = $row['nominee_name'];

        $nominee_relationship = $row['nominee_relationship'];

        $account_name = $row['account_name'];

        $account_number = $row['account_number'];

        $ifsc_code = $row['ifsc_code'];

        $bank_name = $row['bank_name'];

        $branch_name = $row['branch_name'];

        $date_of_join =$row['date_of_join'];

        $member_no = $row['member_no'];

        $user_id = $row['user_id'];

        $rank = $row['rank'];

        

        $password = $row['password'];

        $elite_board = $row['elite_board'];

        $onhold_payment = $row['onhold_payment'];



        $aadhaar_card_image = $row['aadhaar_card_image'];

        $pan_card_image = $row['pan_card_image'];

        $bank_proof_image = $row['bank_proof_image'];

        $document_status = $row['document_status'];

        $activity_level = $row['activity_level'];

        $activity_referral = $row['activity_referral'];

        $activity_date = $row['activity_date'];

        $activity_month = $row['activity_month'];

        $member_fess = $row['member_fess']; 

        $product_eligible = $row['product_eligible'];

        $network_bonus_data = $row['network_bonus']; 

        $current_release_data = $row['current_release'];

        $profile = $row['profile']; 

        $login_status = $row['login_status']; 

        $select_query_main = "select * from roi_tree where member_no='$member_no' ORDER BY tree_id ASC limit 1";

        $run_main = mysqli_query($con,$select_query_main);

         

         while ($row_main = mysqli_fetch_array($run_main)) {

          $tree_id_main = $row_main['tree_id'];                                    

          $group_number_main = $row_main['group_number'];

          $member_no_main = $row_main['member_no'];

          $user_id_main = $row_main['user_id'];

          $sponsor_no_main = $row_main['sponsor_no'];

          $relation_ship_no_main = $row_main['relation_ship_no'];

          $level_no_main = $row_main['level_no'];

          $x_position_main = $row_main['x_position']+1;

          $y_position_main = $row_main['y_position'];

          $roi_amount_main = $row_main['roi_amount'];

          $roi_status_main = $row_main['roi_status'];

          $product_amount_main = $row_main['product_amount'];

          $total_bv_main = $row_main['total_bv'];

          }



          if ($member_no == '024') {

            $extra_amount_bv = 0;

          }

          else {

            $extra_amount_bv = 0;

          }







          if ($roi_status_main == 0) {

             $personal_pv_join_1 = $roi_amount_main;

          }

          else {

            $personal_pv_join_1 = 0;

          }



          $personal_pv_join = $personal_pv_join_1+$extra_amount_bv;







          



        $select_query_total_team_pv = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%'";

          $run_total_team_pv = mysqli_query($con,$select_query_total_team_pv);

          while($row_total_team_pv = mysqli_fetch_array($run_total_team_pv)){

                $total_team_pv_1 = $row_total_team_pv['SUM(roi_amount)'];

                $total_percent_amount_1 = $row_total_team_pv['SUM(percent_amount)'];

                

          }



          //products



          $select_query_total_team_pv_pro = "select SUM(level_roi), SUM(binary_income), SUM(referral_income), SUM(car_bonus), SUM(total_amount), SUM(manager_bonus), SUM(tour_bonus), SUM(leader_bonus), SUM(growth_bonus), SUM(ups_bonus), SUM(house_bonus) from week_payout where member_no = '$member_no'";

          $run_total_team_pv_pro = mysqli_query($con,$select_query_total_team_pv_pro);

          while($row_total_team_pv_pro = mysqli_fetch_array($run_total_team_pv_pro)){

                $total_team_pv_pro_1 = $row_total_team_pv_pro['SUM(level_roi)'];

                $total_team_pv_old_binary = $row_total_team_pv_pro['SUM(binary_income)']; 

                $total_team_pv_car_bonus = $row_total_team_pv_pro['SUM(car_bonus)'];

                $total_team_pv_total_amount = $row_total_team_pv_pro['SUM(total_amount)'];



                $total_team_pv_manager_bonus = $row_total_team_pv_pro['SUM(manager_bonus)'];

                $total_team_pv_tour_bonus = $row_total_team_pv_pro['SUM(tour_bonus)'];

                $total_team_pv_leader_bonus = $row_total_team_pv_pro['SUM(leader_bonus)'];

                $total_team_pv_proold_ref = $row_total_team_pv_pro['SUM(growth_bonus)'];

                $total_team_pv_ups_bonus = $row_total_team_pv_pro['SUM(ups_bonus)'];

                $total_team_pv_house_bonus = $row_total_team_pv_pro['SUM(house_bonus)'];

                

          }



          $select_query_total_team_old_wallet = "select SUM(binary_income), SUM(referral_income), SUM(roi_income), SUM(total_amount), SUM(processing_amount), SUM(net_payment), SUM(ups_bonus) from wallet_payout where member_no = '$member_no' AND status='0'";

              $run_total_team_old_wallet = mysqli_query($con,$select_query_total_team_old_wallet);

              while($row_total_team_old_wallet = mysqli_fetch_array($run_total_team_old_wallet)){

                    $total_team_old_binary_income = $row_total_team_old_wallet['SUM(binary_income)'];

                    $total_team_old_referral_income = $row_total_team_old_wallet['SUM(referral_income)'];

                    $total_team_old_roi_income = $row_total_team_old_wallet['SUM(roi_income)'];

                    $total_team_old_total_amount = $row_total_team_old_wallet['SUM(total_amount)'];

                    $total_team_old_processing_amount = $row_total_team_old_wallet['SUM(processing_amount)'];

                    $total_team_old_net_payment = $row_total_team_old_wallet['SUM(net_payment)'];

                    $total_team_old_ups_bonus = $row_total_team_old_wallet['SUM(ups_bonus)'];

                    

                    

              }





               $select_query_total_tour_bonus = "select SUM(amount), SUM(tds), SUM(netpay) from tour_bonus where member_no = '$member_no'";

                $run_total_tour_bonus = mysqli_query($con,$select_query_total_tour_bonus);

                while($row_total_tour_bonus = mysqli_fetch_array($run_total_tour_bonus)){

                      $total_team_old_amount = $row_total_tour_bonus['SUM(amount)'];

                      $total_team_old_tds = $row_total_tour_bonus['SUM(tds)'];

                      $total_team_old_netpay = $row_total_tour_bonus['SUM(netpay)']; 

                      

                      

                }



          





          $arr1_10a_pro = array();

          $select_query_findempty_pay_10a_pro = "select * from product_member where member_no = '$member_no_main'";

          $run_findempty_pay_10a_pro = mysqli_query($con,$select_query_findempty_pay_10a_pro);

          while ($row_findempty_pay_10a_pro = mysqli_fetch_array($run_findempty_pay_10a_pro)) {

           $arr1_10a_pro[] = $row_findempty_pay_10a_pro['used_no'];

          }



          //get_product_bv



          $select_query_per_product_x1_10a = "select SUM(product_amount) from product_tree where member_no='$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).")";

          $run_per_product_x1_10a = mysqli_query($con,$select_query_per_product_x1_10a);

          while($row_per_product_x1_10a = mysqli_fetch_array($run_per_product_x1_10a)){

                $p_per_product_x1_10a = $row_per_product_x1_10a['SUM(product_amount)'];

          }



          $select_query_cur_product_x1_10a = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_cur_product_x1_10a = mysqli_query($con,$select_query_cur_product_x1_10a);

          while($row_cur_product_x1_10a = mysqli_fetch_array($run_cur_product_x1_10a)){

                $p_cur_product_x1_10a = $row_cur_product_x1_10a['SUM(product_amount)'];

          }

          



          $select_query_product_x1_10a = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%'";

          $run_product_x1_10a = mysqli_query($con,$select_query_product_x1_10a);

          while($row_product_x1_10a = mysqli_fetch_array($run_product_x1_10a)){

                $p_product_x1_10a = $row_product_x1_10a['SUM(product_amount)'];

          }



          //get_product_bv



          $total_team_pv = $total_team_pv_1+$p_product_x1_10a+$extra_amount_bv+$total_percent_amount_1;

          $total_team_pvs = $total_team_pv_1+$p_product_x1_10a+$extra_amount_bv;



          //products







        $arr1 = array();

        $select_query_findempty_pay = "select * from roi_member where member_no = '$member_no_main'";

        $run_findempty_pay = mysqli_query($con,$select_query_findempty_pay);

        while ($row_findempty_pay = mysqli_fetch_array($run_findempty_pay)) {

         $arr1[] = $row_findempty_pay['used_no'];

        }



        $select_query_third_level_team = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

              $run_third_level_team = mysqli_query($con,$select_query_third_level_team);

              while($row_third_level_team = mysqli_fetch_array($run_third_level_team)){

                    $total_single_leg_1 = $row_third_level_team['SUM(roi_amount)'];

                    

              }



          $total_single_leg_current_view = $total_single_leg_1+$personal_pv_join+$p_cur_product_x1_10a;

            





          $select_query_main_1 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='1' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_1 = mysqli_query($con,$select_query_main_1);

          $check_level_1 = mysqli_num_rows($run_main_1);

          while ($row_main_1 = mysqli_fetch_array($run_main_1)) {

          $tree_id_main_1 = $row_main_1['tree_id'];

          $group_number_main_1 = $row_main_1['group_number'];

          $member_no_main_1 = $row_main_1['member_no'];

          $sponsor_no_main_1 = $row_main_1['sponsor_no'];

          $level_no_main_1 = $row_main_1['level_no'];

          $relation_ship_no_main_1 = $row_main_1['relation_ship_no'];

          $x_position_main_1 = $row_main_1['x_position'];

        }



        if ($check_level_1 > 0) {

          



        $select_query_total_x1 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_1}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x1 = mysqli_query($con,$select_query_total_x1);

          while($row_total_x1 = mysqli_fetch_array($run_total_x1)){

                $total_x1 = $row_total_x1['SUM(product_amount)'];

                

          }



          $select_query_total_x1a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_1}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x1a = mysqli_query($con,$select_query_total_x1a);

          while($row_total_x1a = mysqli_fetch_array($run_total_x1a)){

                $total_x1a_1 = $row_total_x1a['SUM(roi_amount)'];

                

          }



          $select_query_group_t_1 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_1}%' AND member_no <> '$member_no_main'";

          $run_group_t_1 = mysqli_query($con,$select_query_group_t_1);

          while($row_group_t_1 = mysqli_fetch_array($run_group_t_1)){

                $total_group_t_1 = $row_group_t_1['SUM(product_amount)'];

                

          }



          $select_query_group_t_1a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_1}%' AND tree_id > '$tree_id_main'";

          $run_group_t_1a = mysqli_query($con,$select_query_group_t_1a);

          while($row_group_t_1a = mysqli_fetch_array($run_group_t_1a)){

                $total_group_t_1a = $row_group_t_1a['SUM(roi_amount)'];

                $total_percent_amount_1a = $row_group_t_1a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_1 = $total_group_t_1+$total_group_t_1a+$total_percent_amount_1a;



          $total_x1a = $total_x1a_1+$total_x1;



          $select_query_growth_1 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_1}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_1 = mysqli_query($con,$select_query_growth_1);

          $check_level_growth_1 = mysqli_num_rows($run_growth_1);



          if ($check_level_growth_1 == 0) {

             $total_cur_1 = $total_x1a_1+$total_x1;

             $growth_leg_1=0;

          }

          else {

            $total_cur_1 = 0;

            $growth_leg_1=1;

          }



        }else {

          $total_x1 =0;

          $total_x1a=0;

          $total_oagrbv_1 = 0;

        }





          $select_query_main_2 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='2' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_2 = mysqli_query($con,$select_query_main_2);

          $check_level_2 = mysqli_num_rows($run_main_2);

          while ($row_main_2 = mysqli_fetch_array($run_main_2)) {

          $tree_id_main_2 = $row_main_2['tree_id'];

          $group_number_main_2 = $row_main_2['group_number'];

          $member_no_main_2 = $row_main_2['member_no'];

          $sponsor_no_main_2 = $row_main_2['sponsor_no'];

          $level_no_main_2 = $row_main_2['level_no'];

          $relation_ship_no_main_2 = $row_main_2['relation_ship_no'];

          $x_position_main_2 = $row_main_2['x_position'];

        }



        if ($check_level_2 > 0) {



        $select_query_total_x2 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_2}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x2 = mysqli_query($con,$select_query_total_x2);

          while($row_total_x2 = mysqli_fetch_array($run_total_x2)){

                $total_x2 = $row_total_x2['SUM(product_amount)'];

                

          }

          $select_query_total_x2a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_2}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x2a = mysqli_query($con,$select_query_total_x2a);

          while($row_total_x2a = mysqli_fetch_array($run_total_x2a)){

                $total_x2a_1 = $row_total_x2a['SUM(roi_amount)'];

                

          }



          $select_query_group_t_2 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_2}%' AND member_no <> '$member_no_main'";

          $run_group_t_2 = mysqli_query($con,$select_query_group_t_2);

          while($row_group_t_2 = mysqli_fetch_array($run_group_t_2)){

                $total_group_t_2 = $row_group_t_2['SUM(product_amount)'];

                

          }



          $select_query_group_t_2a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_2}%' AND tree_id > '$tree_id_main'";

          $run_group_t_2a = mysqli_query($con,$select_query_group_t_2a);

          while($row_group_t_2a = mysqli_fetch_array($run_group_t_2a)){

                $total_group_t_2a = $row_group_t_2a['SUM(roi_amount)'];

                $total_percent_amount_2a = $row_group_t_2a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_2 = $total_group_t_2+$total_group_t_2a+$total_percent_amount_2a;





          $total_x2a = $total_x2a_1+$total_x2;



          $select_query_growth_2 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_2}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_2 = mysqli_query($con,$select_query_growth_2);

          $check_level_growth_2 = mysqli_num_rows($run_growth_2);



            if ($check_level_growth_2 == 0) {

               $total_cur_2 = $total_x2a_1+$total_x2;

               $growth_leg_2=0;

            }

            else {

              $total_cur_2 = 0;

              $growth_leg_2=1;

            }

        }

        else {

             $total_x2 =0;

             $total_x2a=0;

             $total_oagrbv_2 = 0;

        }



        $select_query_main_3 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='3' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_3 = mysqli_query($con,$select_query_main_3);

          $check_level_3 = mysqli_num_rows($run_main_3);

          while ($row_main_3 = mysqli_fetch_array($run_main_3)) {

          $tree_id_main_3 = $row_main_3['tree_id'];

          $group_number_main_3 = $row_main_3['group_number'];

          $member_no_main_3 = $row_main_3['member_no'];

          $sponsor_no_main_3 = $row_main_3['sponsor_no'];

          $level_no_main_3 = $row_main_3['level_no'];

          $relation_ship_no_main_3 = $row_main_3['relation_ship_no'];

          $x_position_main_3 = $row_main_3['x_position'];

        }



        if ($check_level_3 > 0) {



        $select_query_total_x3 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_3}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x3 = mysqli_query($con,$select_query_total_x3);

          while($row_total_x3 = mysqli_fetch_array($run_total_x3)){

                $total_x3 = $row_total_x3['SUM(product_amount)'];

                

          }



          $select_query_total_x3a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_3}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x3a = mysqli_query($con,$select_query_total_x3a);

          while($row_total_x3a = mysqli_fetch_array($run_total_x3a)){

                $total_x3a_1 = $row_total_x3a['SUM(roi_amount)'];

                

          }



          $select_query_group_t_3 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_3}%' AND member_no <> '$member_no_main'";

          $run_group_t_3 = mysqli_query($con,$select_query_group_t_3);

          while($row_group_t_3 = mysqli_fetch_array($run_group_t_3)){

                $total_group_t_3 = $row_group_t_3['SUM(product_amount)'];

                

          }



          $select_query_group_t_3a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_3}%' AND tree_id > '$tree_id_main'";

          $run_group_t_3a = mysqli_query($con,$select_query_group_t_3a);

          while($row_group_t_3a = mysqli_fetch_array($run_group_t_3a)){

                $total_group_t_3a = $row_group_t_3a['SUM(roi_amount)'];

                $total_percent_amount_3a = $row_group_t_3a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_3 = $total_group_t_3+$total_group_t_3a+$total_percent_amount_3a;





          $total_x3a = $total_x3a_1+$total_x3;



          $select_query_growth_3 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_3}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_3 = mysqli_query($con,$select_query_growth_3);

          $check_level_growth_3 = mysqli_num_rows($run_growth_3);



          if ($check_level_growth_3 == 0) {

             $total_cur_3 = $total_x3a_1+$total_x3;

             $growth_leg_3=0;

          }

          else {

            $total_cur_3 = 0;

            $growth_leg_3=1;

          }

        }

        else {



          $total_x3 =0;

             $total_x3a=0;

             $total_oagrbv_3 = 0;



        }





          $select_query_main_4 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='4' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_4 = mysqli_query($con,$select_query_main_4);

          $check_level_4 = mysqli_num_rows($run_main_4);

          while ($row_main_4 = mysqli_fetch_array($run_main_4)) {

          $tree_id_main_4 = $row_main_4['tree_id'];

          $group_number_main_4 = $row_main_4['group_number'];

          $member_no_main_4 = $row_main_4['member_no'];

          $sponsor_no_main_4 = $row_main_4['sponsor_no'];

          $level_no_main_4 = $row_main_4['level_no'];

          $relation_ship_no_main_4 = $row_main_4['relation_ship_no'];

          $x_position_main_4 = $row_main_4['x_position'];

        }



        if ($check_level_4 > 0) {



        $select_query_total_x4 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_4}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x4 = mysqli_query($con,$select_query_total_x4);

          while($row_total_x4 = mysqli_fetch_array($run_total_x4)){

                $total_x4 = $row_total_x4['SUM(product_amount)'];

                

          }



          $select_query_total_x4a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_4}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x4a = mysqli_query($con,$select_query_total_x4a);

          while($row_total_x4a = mysqli_fetch_array($run_total_x4a)){

                $total_x4a_1 = $row_total_x4a['SUM(roi_amount)'];

                

          }



          $select_query_group_t_4 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_4}%' AND member_no <> '$member_no_main'";

          $run_group_t_4 = mysqli_query($con,$select_query_group_t_4);

          while($row_group_t_4 = mysqli_fetch_array($run_group_t_4)){

                $total_group_t_4 = $row_group_t_4['SUM(product_amount)'];

                

          }



          $select_query_group_t_4a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_4}%' AND tree_id > '$tree_id_main'";

          $run_group_t_4a = mysqli_query($con,$select_query_group_t_4a);

          while($row_group_t_4a = mysqli_fetch_array($run_group_t_4a)){

                $total_group_t_4a = $row_group_t_4a['SUM(roi_amount)'];

                $total_percent_amount_4a = $row_group_t_4a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_4 = $total_group_t_4+$total_group_t_4a+$total_percent_amount_4a;





          $total_x4a = $total_x4a_1+$total_x4;



           $select_query_growth_4 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_4}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_4 = mysqli_query($con,$select_query_growth_4);

          $check_level_growth_4 = mysqli_num_rows($run_growth_4);



          if ($check_level_growth_4 == 0) {

             $total_cur_4 = $total_x4a_1+$total_x4;

             $growth_leg_4=0;

          }

          else {

            $total_cur_4 = 0;

            $growth_leg_4=1;

          }



        }else {



          $total_x4 =0;

             $total_x4a=0;

             $total_oagrbv_4 = 0;



        }





          $select_query_main_5 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='5' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_5 = mysqli_query($con,$select_query_main_5);

          $check_level_5 = mysqli_num_rows($run_main_5);

          while ($row_main_5 = mysqli_fetch_array($run_main_5)) {

          $tree_id_main_5 = $row_main_5['tree_id'];

          $group_number_main_5 = $row_main_5['group_number'];

          $member_no_main_5 = $row_main_5['member_no'];

          $sponsor_no_main_5 = $row_main_5['sponsor_no'];

          $level_no_main_5 = $row_main_5['level_no'];

          $relation_ship_no_main_5 = $row_main_5['relation_ship_no'];

          $x_position_main_5 = $row_main_5['x_position'];

        }



        if ($check_level_5 > 0) {



        $select_query_total_x5 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_5}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x5 = mysqli_query($con,$select_query_total_x5);

          while($row_total_x5 = mysqli_fetch_array($run_total_x5)){

                $total_x5 = $row_total_x5['SUM(product_amount)'];

          }



          $select_query_total_x5a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_5}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x5a = mysqli_query($con,$select_query_total_x5a);

          while($row_total_x5a = mysqli_fetch_array($run_total_x5a)){

                $total_x5a_1 = $row_total_x5a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_5 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_5}%' AND member_no <> '$member_no_main'";

          $run_group_t_5 = mysqli_query($con,$select_query_group_t_5);

          while($row_group_t_5 = mysqli_fetch_array($run_group_t_5)){

                $total_group_t_5 = $row_group_t_5['SUM(product_amount)'];

                

          }



          $select_query_group_t_5a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_5}%' AND tree_id > '$tree_id_main'";

          $run_group_t_5a = mysqli_query($con,$select_query_group_t_5a);

          while($row_group_t_5a = mysqli_fetch_array($run_group_t_5a)){

                $total_group_t_5a = $row_group_t_5a['SUM(roi_amount)'];

                $total_percent_amount_5a = $row_group_t_5a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_5 = $total_group_t_5+$total_group_t_5a+$total_percent_amount_5a;





          $total_x5a = $total_x5a_1+$total_x5;



          $select_query_growth_5 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_5}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_5 = mysqli_query($con,$select_query_growth_5);

          $check_level_growth_5 = mysqli_num_rows($run_growth_5);



          if ($check_level_growth_5 == 0) {

             $total_cur_5 = $total_x5a_1+$total_x5;

             $growth_leg_5=0;

          }

          else {

            $total_cur_5 = 0;

            $growth_leg_5=1;

          }



        }else {



          $total_x5 =0;

             $total_x5a=0;

             $total_oagrbv_5 = 0;



        }



        $select_query_main_6 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='6' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_6 = mysqli_query($con,$select_query_main_6);

          $check_level_6 = mysqli_num_rows($run_main_6);

          while ($row_main_6 = mysqli_fetch_array($run_main_6)) {

          $tree_id_main_6 = $row_main_6['tree_id'];

          $group_number_main_6 = $row_main_6['group_number'];

          $member_no_main_6 = $row_main_6['member_no'];

          $sponsor_no_main_6 = $row_main_6['sponsor_no'];

          $level_no_main_6 = $row_main_6['level_no'];

          $relation_ship_no_main_6 = $row_main_6['relation_ship_no'];

          $x_position_main_6 = $row_main_6['x_position'];

        }



        if ($check_level_6 > 0) {



        $select_query_total_x6 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_6}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x6 = mysqli_query($con,$select_query_total_x6);

          while($row_total_x6 = mysqli_fetch_array($run_total_x6)){

                $total_x6 = $row_total_x6['SUM(product_amount)'];

          }



          $select_query_total_x6a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_6}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x6a = mysqli_query($con,$select_query_total_x6a);

          while($row_total_x6a = mysqli_fetch_array($run_total_x6a)){

                $total_x6a_1 = $row_total_x6a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_6 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_6}%' AND member_no <> '$member_no_main'";

          $run_group_t_6 = mysqli_query($con,$select_query_group_t_6);

          while($row_group_t_6 = mysqli_fetch_array($run_group_t_6)){

                $total_group_t_6 = $row_group_t_6['SUM(product_amount)'];

                

          }



          $select_query_group_t_6a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_6}%' AND tree_id > '$tree_id_main'";

          $run_group_t_6a = mysqli_query($con,$select_query_group_t_6a);

          while($row_group_t_6a = mysqli_fetch_array($run_group_t_6a)){

                $total_group_t_6a = $row_group_t_6a['SUM(roi_amount)'];

                $total_percent_amount_6a = $row_group_t_6a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_6 = $total_group_t_6+$total_group_t_6a+$total_percent_amount_6a;





          $total_x6a = $total_x6a_1+$total_x6;



          $select_query_growth_6 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_6}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_6 = mysqli_query($con,$select_query_growth_6);

          $check_level_growth_6 = mysqli_num_rows($run_growth_6);



          if ($check_level_growth_6 == 0) {

             $total_cur_6 = $total_x6a_1+$total_x6;

             $growth_leg_6=0;

          }

          else {

            $total_cur_6 = 0;

            $growth_leg_6=1;

          }



        }else {



          $total_x6 =0;

             $total_x6a=0;

             $total_oagrbv_6 = 0;



        }



        $select_query_main_7 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='7' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_7 = mysqli_query($con,$select_query_main_7);

          $check_level_7 = mysqli_num_rows($run_main_7);

          while ($row_main_7 = mysqli_fetch_array($run_main_7)) {

          $tree_id_main_7 = $row_main_7['tree_id'];

          $group_number_main_7 = $row_main_7['group_number'];

          $member_no_main_7 = $row_main_7['member_no'];

          $sponsor_no_main_7 = $row_main_7['sponsor_no'];

          $level_no_main_7 = $row_main_7['level_no'];

          $relation_ship_no_main_7 = $row_main_7['relation_ship_no'];

          $x_position_main_7 = $row_main_7['x_position'];

        }



        if ($check_level_7 > 0) {



        $select_query_total_x7 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_7}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x7 = mysqli_query($con,$select_query_total_x7);

          while($row_total_x7 = mysqli_fetch_array($run_total_x7)){

                $total_x7 = $row_total_x7['SUM(product_amount)'];

          }



          $select_query_total_x7a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_7}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x7a = mysqli_query($con,$select_query_total_x7a);

          while($row_total_x7a = mysqli_fetch_array($run_total_x7a)){

                $total_x7a_1 = $row_total_x7a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_7 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_7}%' AND member_no <> '$member_no_main'";

          $run_group_t_7 = mysqli_query($con,$select_query_group_t_7);

          while($row_group_t_7 = mysqli_fetch_array($run_group_t_7)){

                $total_group_t_7 = $row_group_t_7['SUM(product_amount)'];

                

          }



          $select_query_group_t_7a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_7}%' AND tree_id > '$tree_id_main'";

          $run_group_t_7a = mysqli_query($con,$select_query_group_t_7a);

          while($row_group_t_7a = mysqli_fetch_array($run_group_t_7a)){

                $total_group_t_7a = $row_group_t_7a['SUM(roi_amount)'];

                $total_percent_amount_7a = $row_group_t_7a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_7 = $total_group_t_7+$total_group_t_7a+$total_percent_amount_7a;





          $total_x7a = $total_x7a_1+$total_x7;



          $select_query_growth_7 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_7}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_7 = mysqli_query($con,$select_query_growth_7);

          $check_level_growth_7 = mysqli_num_rows($run_growth_7);



          if ($check_level_growth_7 == 0) {

             $total_cur_7 = $total_x7a_1+$total_x7;

             $growth_leg_7=0;

          }

          else {

            $total_cur_7 = 0;

            $growth_leg_7=1;

          }



        }else {



          $total_x7 =0;

             $total_x7a=0;

             $total_oagrbv_7 = 0;



        }



        $select_query_main_8 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='8' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_8 = mysqli_query($con,$select_query_main_8);

          $check_level_8 = mysqli_num_rows($run_main_8);

          while ($row_main_8 = mysqli_fetch_array($run_main_8)) {

          $tree_id_main_8 = $row_main_8['tree_id'];

          $group_number_main_8 = $row_main_8['group_number'];

          $member_no_main_8 = $row_main_8['member_no'];

          $sponsor_no_main_8 = $row_main_8['sponsor_no'];

          $level_no_main_8 = $row_main_8['level_no'];

          $relation_ship_no_main_8 = $row_main_8['relation_ship_no'];

          $x_position_main_8 = $row_main_8['x_position'];

        }



        if ($check_level_8 > 0) {



        $select_query_total_x8 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_8}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x8 = mysqli_query($con,$select_query_total_x8);

          while($row_total_x8 = mysqli_fetch_array($run_total_x8)){

                $total_x8 = $row_total_x8['SUM(product_amount)'];

          }



          $select_query_total_x8a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_8}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x8a = mysqli_query($con,$select_query_total_x8a);

          while($row_total_x8a = mysqli_fetch_array($run_total_x8a)){

                $total_x8a_1 = $row_total_x8a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_8 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_8}%' AND member_no <> '$member_no_main'";

          $run_group_t_8 = mysqli_query($con,$select_query_group_t_8);

          while($row_group_t_8 = mysqli_fetch_array($run_group_t_8)){

                $total_group_t_8 = $row_group_t_8['SUM(product_amount)'];

                

          }



          $select_query_group_t_8a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_8}%' AND tree_id > '$tree_id_main'";

          $run_group_t_8a = mysqli_query($con,$select_query_group_t_8a);

          while($row_group_t_8a = mysqli_fetch_array($run_group_t_8a)){

                $total_group_t_8a = $row_group_t_8a['SUM(roi_amount)'];

                $total_percent_amount_8a = $row_group_t_8a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_8 = $total_group_t_8+$total_group_t_8a+$total_percent_amount_8a;





          $total_x8a = $total_x8a_1+$total_x8;



          $select_query_growth_8 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_8}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_8 = mysqli_query($con,$select_query_growth_8);

          $check_level_growth_8 = mysqli_num_rows($run_growth_8);



          if ($check_level_growth_8 == 0) {

             $total_cur_8 = $total_x8a_1+$total_x8;

             $growth_leg_8=0;

          }

          else {

            $total_cur_8 = 0;

            $growth_leg_8=1;

          }



        }else {



          $total_x8 =0;

             $total_x8a=0;

             $total_oagrbv_8 = 0;



        }



        $select_query_main_9 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='9' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_9 = mysqli_query($con,$select_query_main_9);

          $check_level_9 = mysqli_num_rows($run_main_9);

          while ($row_main_9 = mysqli_fetch_array($run_main_9)) {

          $tree_id_main_9 = $row_main_9['tree_id'];

          $group_number_main_9 = $row_main_9['group_number'];

          $member_no_main_9 = $row_main_9['member_no'];

          $sponsor_no_main_9 = $row_main_9['sponsor_no'];

          $level_no_main_9 = $row_main_9['level_no'];

          $relation_ship_no_main_9 = $row_main_9['relation_ship_no'];

          $x_position_main_9 = $row_main_9['x_position'];

        }



        if ($check_level_9 > 0) {



        $select_query_total_x9 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_9}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x9 = mysqli_query($con,$select_query_total_x9);

          while($row_total_x9 = mysqli_fetch_array($run_total_x9)){

                $total_x9 = $row_total_x9['SUM(product_amount)'];

          }



          $select_query_total_x9a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_9}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x9a = mysqli_query($con,$select_query_total_x9a);

          while($row_total_x9a = mysqli_fetch_array($run_total_x9a)){

                $total_x9a_1 = $row_total_x9a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_9 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_9}%' AND member_no <> '$member_no_main'";

          $run_group_t_9 = mysqli_query($con,$select_query_group_t_9);

          while($row_group_t_9 = mysqli_fetch_array($run_group_t_9)){

                $total_group_t_9 = $row_group_t_9['SUM(product_amount)'];

                

          }



          $select_query_group_t_9a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_9}%' AND tree_id > '$tree_id_main'";

          $run_group_t_9a = mysqli_query($con,$select_query_group_t_9a);

          while($row_group_t_9a = mysqli_fetch_array($run_group_t_9a)){

                $total_group_t_9a = $row_group_t_9a['SUM(roi_amount)'];

                $total_percent_amount_9a = $row_group_t_9a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_9 = $total_group_t_9+$total_group_t_9a+$total_percent_amount_9a;





          $total_x9a = $total_x9a_1+$total_x9;



           $select_query_growth_9 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_9}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_9 = mysqli_query($con,$select_query_growth_9);

          $check_level_growth_9 = mysqli_num_rows($run_growth_9);



          if ($check_level_growth_9 == 0) {

             $total_cur_9 = $total_x9a_1+$total_x9;

             $growth_leg_9=0;

          }

          else {

            $total_cur_9 = 0;

            $growth_leg_9=1;

          }

        }else {



          $total_x9 =0;

             $total_x9a=0;

             $total_oagrbv_9 = 0;



        }



        $select_query_main_10 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='10' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_10 = mysqli_query($con,$select_query_main_10);

          $check_level_10 = mysqli_num_rows($run_main_10);

          while ($row_main_10 = mysqli_fetch_array($run_main_10)) {

          $tree_id_main_10 = $row_main_10['tree_id'];

          $group_number_main_10 = $row_main_10['group_number'];

          $member_no_main_10 = $row_main_10['member_no'];

          $sponsor_no_main_10 = $row_main_10['sponsor_no'];

          $level_no_main_10 = $row_main_10['level_no'];

          $relation_ship_no_main_10 = $row_main_10['relation_ship_no'];

          $x_position_main_10 = $row_main_10['x_position'];

        }



        if ($check_level_10 > 0) {



        $select_query_total_x10 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_10}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x10 = mysqli_query($con,$select_query_total_x10);

          while($row_total_x10 = mysqli_fetch_array($run_total_x10)){

                $total_x10 = $row_total_x10['SUM(product_amount)'];

          }



          $select_query_total_x10a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_10}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x10a = mysqli_query($con,$select_query_total_x10a);

          while($row_total_x10a = mysqli_fetch_array($run_total_x10a)){

                $total_x10a_1 = $row_total_x10a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_10 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_10}%' AND member_no <> '$member_no_main'";

          $run_group_t_10 = mysqli_query($con,$select_query_group_t_10);

          while($row_group_t_10 = mysqli_fetch_array($run_group_t_10)){

                $total_group_t_10 = $row_group_t_10['SUM(product_amount)'];

                

          }



          $select_query_group_t_10a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_10}%' AND tree_id > '$tree_id_main'";

          $run_group_t_10a = mysqli_query($con,$select_query_group_t_10a);

          while($row_group_t_10a = mysqli_fetch_array($run_group_t_10a)){

                $total_group_t_10a = $row_group_t_10a['SUM(roi_amount)'];

                $total_percent_amount_10a = $row_group_t_10a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_10 = $total_group_t_10+$total_group_t_10a+$total_percent_amount_10a;





          $total_x10a = $total_x10a_1+$total_x10;



           $select_query_growth_10 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_10}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_10 = mysqli_query($con,$select_query_growth_10);

          $check_level_growth_10 = mysqli_num_rows($run_growth_10);



          if ($check_level_growth_10 == 0) {

             $total_cur_10 = $total_x10a_1+$total_x10;

             $growth_leg_10=0;

          }

          else {

            $total_cur_10 = 0;

            $growth_leg_10=1;

          }



        }else {



          $total_x10 =0;

             $total_x10a=0;

             $total_oagrbv_10 = 0;



        }







        $select_query_main_11 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='11' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_11 = mysqli_query($con,$select_query_main_11);

          $check_level_11 = mysqli_num_rows($run_main_11);

          while ($row_main_11 = mysqli_fetch_array($run_main_11)) {

          $tree_id_main_11 = $row_main_11['tree_id'];

          $group_number_main_11 = $row_main_11['group_number'];

          $member_no_main_11 = $row_main_11['member_no'];

          $sponsor_no_main_11 = $row_main_11['sponsor_no'];

          $level_no_main_11 = $row_main_11['level_no'];

          $relation_ship_no_main_11 = $row_main_11['relation_ship_no'];

          $x_position_main_11 = $row_main_11['x_position'];

        }



        if ($check_level_11 > 0) {

          



        $select_query_total_x11 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_11}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x11 = mysqli_query($con,$select_query_total_x11);

          while($row_total_x11 = mysqli_fetch_array($run_total_x11)){

                $total_x11 = $row_total_x11['SUM(product_amount)'];

                

          }



          $select_query_total_x11a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_11}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x11a = mysqli_query($con,$select_query_total_x11a);

          while($row_total_x11a = mysqli_fetch_array($run_total_x11a)){

                $total_x11a_11 = $row_total_x11a['SUM(roi_amount)'];

                

          }



          $select_query_group_t_11 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_11}%' AND member_no <> '$member_no_main'";

          $run_group_t_11 = mysqli_query($con,$select_query_group_t_11);

          while($row_group_t_11 = mysqli_fetch_array($run_group_t_11)){

                $total_group_t_11 = $row_group_t_11['SUM(product_amount)'];

                

          }



          $select_query_group_t_11a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_11}%' AND tree_id > '$tree_id_main'";

          $run_group_t_11a = mysqli_query($con,$select_query_group_t_11a);

          while($row_group_t_11a = mysqli_fetch_array($run_group_t_11a)){

                $total_group_t_11a = $row_group_t_11a['SUM(roi_amount)'];

                $total_percent_amount_11a = $row_group_t_11a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_11 = $total_group_t_11+$total_group_t_11a+$total_percent_amount_11a;





          $total_x11a = $total_x11a_11+$total_x11;



           $select_query_growth_11 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_11}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_11 = mysqli_query($con,$select_query_growth_11);

          $check_level_growth_11 = mysqli_num_rows($run_growth_11);



          if ($check_level_growth_11 == 0) {

             $total_cur_11 = $total_x11a_1+$total_x11;

             $growth_leg_11=0;

          }

          else {

            $total_cur_11 = 0;

            $growth_leg_11=1;

          }



        }else {

          $total_x11 =0;

          $total_x11a=0;

          $total_oagrbv_11 = 0;

        }





          $select_query_main_12 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='12' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_12 = mysqli_query($con,$select_query_main_12);

          $check_level_12 = mysqli_num_rows($run_main_12);

          while ($row_main_12 = mysqli_fetch_array($run_main_12)) {

          $tree_id_main_12 = $row_main_12['tree_id'];

          $group_number_main_12 = $row_main_12['group_number'];

          $member_no_main_12 = $row_main_12['member_no'];

          $sponsor_no_main_12 = $row_main_12['sponsor_no'];

          $level_no_main_12 = $row_main_12['level_no'];

          $relation_ship_no_main_12 = $row_main_12['relation_ship_no'];

          $x_position_main_12 = $row_main_12['x_position'];

        }



        if ($check_level_12 > 0) {



        $select_query_total_x12 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_12}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x12 = mysqli_query($con,$select_query_total_x12);

          while($row_total_x12 = mysqli_fetch_array($run_total_x12)){

                $total_x12 = $row_total_x12['SUM(product_amount)'];

                

          }

          $select_query_total_x12a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_12}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x12a = mysqli_query($con,$select_query_total_x12a);

          while($row_total_x12a = mysqli_fetch_array($run_total_x12a)){

                $total_x12a_1 = $row_total_x12a['SUM(roi_amount)'];

                

          }



          $select_query_group_t_12 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_12}%' AND member_no <> '$member_no_main'";

          $run_group_t_12 = mysqli_query($con,$select_query_group_t_12);

          while($row_group_t_12 = mysqli_fetch_array($run_group_t_12)){

                $total_group_t_12 = $row_group_t_12['SUM(product_amount)'];

                

          }



          $select_query_group_t_12a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_12}%' AND tree_id > '$tree_id_main'";

          $run_group_t_12a = mysqli_query($con,$select_query_group_t_12a);

          while($row_group_t_12a = mysqli_fetch_array($run_group_t_12a)){

                $total_group_t_12a = $row_group_t_12a['SUM(roi_amount)'];

                $total_percent_amount_12a = $row_group_t_12a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_12 = $total_group_t_12+$total_group_t_12a+$total_percent_amount_12a;



          $total_x12a = $total_x12a_1+$total_x12;



           $select_query_growth_12 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_12}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_12 = mysqli_query($con,$select_query_growth_12);

          $check_level_growth_12 = mysqli_num_rows($run_growth_12);



          if ($check_level_growth_12 == 0) {

             $total_cur_12 = $total_x12a_1+$total_x12;

             $growth_leg_12=0;

          }

          else {

            $total_cur_12 = 0;

            $growth_leg_12=1;

          }



        }

        else {

             $total_x12 =0;

             $total_x12a=0;

             $total_oagrbv_12 = 0;

        }



        $select_query_main_13 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='13' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_13 = mysqli_query($con,$select_query_main_13);

          $check_level_13 = mysqli_num_rows($run_main_13);

          while ($row_main_13 = mysqli_fetch_array($run_main_13)) {

          $tree_id_main_13 = $row_main_13['tree_id'];

          $group_number_main_13 = $row_main_13['group_number'];

          $member_no_main_13 = $row_main_13['member_no'];

          $sponsor_no_main_13 = $row_main_13['sponsor_no'];

          $level_no_main_13 = $row_main_13['level_no'];

          $relation_ship_no_main_13 = $row_main_13['relation_ship_no'];

          $x_position_main_13 = $row_main_13['x_position'];

        }



        if ($check_level_13 > 0) {



        $select_query_total_x13 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_13}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x13 = mysqli_query($con,$select_query_total_x13);

          while($row_total_x13 = mysqli_fetch_array($run_total_x13)){

                $total_x13 = $row_total_x13['SUM(product_amount)'];

                

          }



          $select_query_total_x13a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_13}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x13a = mysqli_query($con,$select_query_total_x13a);

          while($row_total_x13a = mysqli_fetch_array($run_total_x13a)){

                $total_x13a_1 = $row_total_x13a['SUM(roi_amount)'];

                

          }



          $select_query_group_t_13 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_13}%' AND member_no <> '$member_no_main'";

          $run_group_t_13 = mysqli_query($con,$select_query_group_t_13);

          while($row_group_t_13 = mysqli_fetch_array($run_group_t_13)){

                $total_group_t_13 = $row_group_t_13['SUM(product_amount)'];

                

          }



          $select_query_group_t_13a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_13}%' AND tree_id > '$tree_id_main'";

          $run_group_t_13a = mysqli_query($con,$select_query_group_t_13a);

          while($row_group_t_13a = mysqli_fetch_array($run_group_t_13a)){

                $total_group_t_13a = $row_group_t_13a['SUM(roi_amount)'];

                $total_percent_amount_13a = $row_group_t_13a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_13 = $total_group_t_13+$total_group_t_13a+$total_percent_amount_13a;





          $total_x13a = $total_x13a_1+$total_x13;



           $select_query_growth_13 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_13}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_13 = mysqli_query($con,$select_query_growth_13);

          $check_level_growth_13 = mysqli_num_rows($run_growth_13);



          if ($check_level_growth_13 == 0) {

             $total_cur_13 = $total_x13a_1+$total_x13;

             $growth_leg_13=0;

          }

          else {

            $total_cur_13 = 0;

            $growth_leg_13=1;

          }



        }

        else {



          $total_x13 =0;

             $total_x13a=0;

             $total_oagrbv_13 = 0;



        }





          $select_query_main_14 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='14' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_14 = mysqli_query($con,$select_query_main_14);

          $check_level_14 = mysqli_num_rows($run_main_14);

          while ($row_main_14 = mysqli_fetch_array($run_main_14)) {

          $tree_id_main_14 = $row_main_14['tree_id'];

          $group_number_main_14 = $row_main_14['group_number'];

          $member_no_main_14 = $row_main_14['member_no'];

          $sponsor_no_main_14 = $row_main_14['sponsor_no'];

          $level_no_main_14 = $row_main_14['level_no'];

          $relation_ship_no_main_14 = $row_main_14['relation_ship_no'];

          $x_position_main_14 = $row_main_14['x_position'];

        }



        if ($check_level_14 > 0) {



        $select_query_total_x14 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_14}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x14 = mysqli_query($con,$select_query_total_x14);

          while($row_total_x14 = mysqli_fetch_array($run_total_x14)){

                $total_x14 = $row_total_x14['SUM(product_amount)'];

                

          }



          $select_query_total_x14a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_14}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x14a = mysqli_query($con,$select_query_total_x14a);

          while($row_total_x14a = mysqli_fetch_array($run_total_x14a)){

                $total_x14a_1 = $row_total_x14a['SUM(roi_amount)'];

                

          }



          $select_query_group_t_14 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_14}%' AND member_no <> '$member_no_main'";

          $run_group_t_14 = mysqli_query($con,$select_query_group_t_14);

          while($row_group_t_14 = mysqli_fetch_array($run_group_t_14)){

                $total_group_t_14 = $row_group_t_14['SUM(product_amount)'];

                

          }



          $select_query_group_t_14a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_14}%' AND tree_id > '$tree_id_main'";

          $run_group_t_14a = mysqli_query($con,$select_query_group_t_14a);

          while($row_group_t_14a = mysqli_fetch_array($run_group_t_14a)){

                $total_group_t_14a = $row_group_t_14a['SUM(roi_amount)'];

                $total_percent_amount_14a = $row_group_t_14a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_14 = $total_group_t_14+$total_group_t_14a+$total_percent_amount_14a;





          $total_x14a = $total_x14a_1+$total_x14;



           $select_query_growth_14 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_14}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_14 = mysqli_query($con,$select_query_growth_14);

          $check_level_growth_14 = mysqli_num_rows($run_growth_14);



          if ($check_level_growth_14 == 0) {

             $total_cur_14 = $total_x14a_1+$total_x14;

             $growth_leg_14=0;

          }

          else {

            $total_cur_14 = 0;

            $growth_leg_14=1;

          }



        }else {



          $total_x14 =0;

             $total_x14a=0;

             $total_oagrbv_14 = 0;



        }





          $select_query_main_15 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='15' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_15 = mysqli_query($con,$select_query_main_15);

          $check_level_15 = mysqli_num_rows($run_main_15);

          while ($row_main_15 = mysqli_fetch_array($run_main_15)) {

          $tree_id_main_15 = $row_main_15['tree_id'];

          $group_number_main_15 = $row_main_15['group_number'];

          $member_no_main_15 = $row_main_15['member_no'];

          $sponsor_no_main_15 = $row_main_15['sponsor_no'];

          $level_no_main_15 = $row_main_15['level_no'];

          $relation_ship_no_main_15 = $row_main_15['relation_ship_no'];

          $x_position_main_15 = $row_main_15['x_position'];

        }



        if ($check_level_15 > 0) {



        $select_query_total_x15 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_15}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x15 = mysqli_query($con,$select_query_total_x15);

          while($row_total_x15 = mysqli_fetch_array($run_total_x15)){

                $total_x15 = $row_total_x15['SUM(product_amount)'];

          }



          $select_query_total_x15a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_15}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x15a = mysqli_query($con,$select_query_total_x15a);

          while($row_total_x15a = mysqli_fetch_array($run_total_x15a)){

                $total_x15a_1 = $row_total_x15a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_15 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_15}%' AND member_no <> '$member_no_main'";

          $run_group_t_15 = mysqli_query($con,$select_query_group_t_15);

          while($row_group_t_15 = mysqli_fetch_array($run_group_t_15)){

                $total_group_t_15 = $row_group_t_15['SUM(product_amount)'];

                

          }



          $select_query_group_t_15a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_15}%' AND tree_id > '$tree_id_main'";

          $run_group_t_15a = mysqli_query($con,$select_query_group_t_15a);

          while($row_group_t_15a = mysqli_fetch_array($run_group_t_15a)){

                $total_group_t_15a = $row_group_t_15a['SUM(roi_amount)'];

                $total_percent_amount_15a = $row_group_t_15a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_15 = $total_group_t_15+$total_group_t_15a+$total_percent_amount_15a;





          $total_x15a = $total_x15a_1+$total_x15;



           $select_query_growth_15 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_15}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_15 = mysqli_query($con,$select_query_growth_15);

          $check_level_growth_15 = mysqli_num_rows($run_growth_15);



          if ($check_level_growth_15 == 0) {

             $total_cur_15 = $total_x15a_1+$total_x15;

             $growth_leg_15=0;

          }

          else {

            $total_cur_15 = 0;

            $growth_leg_15=1;

          }



        }else {



          $total_x15 =0;

             $total_x15a=0;

             $total_oagrbv_15 = 0;



        }



        $select_query_main_16 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='16' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_16 = mysqli_query($con,$select_query_main_16);

          $check_level_16 = mysqli_num_rows($run_main_16);

          while ($row_main_16 = mysqli_fetch_array($run_main_16)) {

          $tree_id_main_16 = $row_main_16['tree_id'];

          $group_number_main_16 = $row_main_16['group_number'];

          $member_no_main_16 = $row_main_16['member_no'];

          $sponsor_no_main_16 = $row_main_16['sponsor_no'];

          $level_no_main_16 = $row_main_16['level_no'];

          $relation_ship_no_main_16 = $row_main_16['relation_ship_no'];

          $x_position_main_16 = $row_main_16['x_position'];

        }



        if ($check_level_16 > 0) {



        $select_query_total_x16 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_16}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x16 = mysqli_query($con,$select_query_total_x16);

          while($row_total_x16 = mysqli_fetch_array($run_total_x16)){

                $total_x16 = $row_total_x16['SUM(product_amount)'];

          }



          $select_query_total_x16a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_16}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x16a = mysqli_query($con,$select_query_total_x16a);

          while($row_total_x16a = mysqli_fetch_array($run_total_x16a)){

                $total_x16a_1 = $row_total_x16a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_16 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_16}%' AND member_no <> '$member_no_main'";

          $run_group_t_16 = mysqli_query($con,$select_query_group_t_16);

          while($row_group_t_16 = mysqli_fetch_array($run_group_t_16)){

                $total_group_t_16 = $row_group_t_16['SUM(product_amount)'];

                

          }



          $select_query_group_t_16a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_16}%' AND tree_id > '$tree_id_main'";

          $run_group_t_16a = mysqli_query($con,$select_query_group_t_16a);

          while($row_group_t_16a = mysqli_fetch_array($run_group_t_16a)){

                $total_group_t_16a = $row_group_t_16a['SUM(roi_amount)'];

                $total_percent_amount_16a = $row_group_t_16a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_16 = $total_group_t_16+$total_group_t_16a+$total_percent_amount_16a;





          $total_x16a = $total_x16a_1+$total_x16;



           $select_query_growth_16 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_16}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_16 = mysqli_query($con,$select_query_growth_16);

          $check_level_growth_16 = mysqli_num_rows($run_growth_16);



          if ($check_level_growth_16 == 0) {

             $total_cur_16 = $total_x16a_1+$total_x16;

             $growth_leg_16=0;

          }

          else {

            $total_cur_16 = 0;

            $growth_leg_16=1;

          }



        }else {



          $total_x16 =0;

             $total_x16a=0;

             $total_oagrbv_16 = 0;



        }



        $select_query_main_17 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='17' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_17 = mysqli_query($con,$select_query_main_17);

          $check_level_17 = mysqli_num_rows($run_main_17);

          while ($row_main_17 = mysqli_fetch_array($run_main_17)) {

          $tree_id_main_17 = $row_main_17['tree_id'];

          $group_number_main_17 = $row_main_17['group_number'];

          $member_no_main_17 = $row_main_17['member_no'];

          $sponsor_no_main_17 = $row_main_17['sponsor_no'];

          $level_no_main_17 = $row_main_17['level_no'];

          $relation_ship_no_main_17 = $row_main_17['relation_ship_no'];

          $x_position_main_17 = $row_main_17['x_position'];

        }



        if ($check_level_17 > 0) {



        $select_query_total_x17 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_17}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x17 = mysqli_query($con,$select_query_total_x17);

          while($row_total_x17 = mysqli_fetch_array($run_total_x17)){

                $total_x17 = $row_total_x17['SUM(product_amount)'];

          }



          $select_query_total_x17a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_17}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x17a = mysqli_query($con,$select_query_total_x17a);

          while($row_total_x17a = mysqli_fetch_array($run_total_x17a)){

                $total_x17a_1 = $row_total_x17a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_17 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_17}%' AND member_no <> '$member_no_main'";

          $run_group_t_17 = mysqli_query($con,$select_query_group_t_17);

          while($row_group_t_17 = mysqli_fetch_array($run_group_t_17)){

                $total_group_t_17 = $row_group_t_17['SUM(product_amount)'];

                

          }



          $select_query_group_t_17a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_17}%' AND tree_id > '$tree_id_main'";

          $run_group_t_17a = mysqli_query($con,$select_query_group_t_17a);

          while($row_group_t_17a = mysqli_fetch_array($run_group_t_17a)){

                $total_group_t_17a = $row_group_t_17a['SUM(roi_amount)'];

                $total_percent_amount_17a = $row_group_t_17a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_17 = $total_group_t_17+$total_group_t_17a+$total_percent_amount_17a;





          $total_x17a = $total_x17a_1+$total_x17;



           $select_query_growth_17 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_17}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_17 = mysqli_query($con,$select_query_growth_17);

          $check_level_growth_17 = mysqli_num_rows($run_growth_17);



          if ($check_level_growth_17 == 0) {

             $total_cur_17 = $total_x17a_1+$total_x17;

             $growth_leg_17=0;

          }

          else {

            $total_cur_17 = 0;

            $growth_leg_17=1;

          }





        }else {



          $total_x17 =0;

             $total_x17a=0;

             $total_oagrbv_17 = 0;



        }



        $select_query_main_18 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='18' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_18 = mysqli_query($con,$select_query_main_18);

          $check_level_18 = mysqli_num_rows($run_main_18);

          while ($row_main_18 = mysqli_fetch_array($run_main_18)) {

          $tree_id_main_18 = $row_main_18['tree_id'];

          $group_number_main_18 = $row_main_18['group_number'];

          $member_no_main_18 = $row_main_18['member_no'];

          $sponsor_no_main_18 = $row_main_18['sponsor_no'];

          $level_no_main_18 = $row_main_18['level_no'];

          $relation_ship_no_main_18 = $row_main_18['relation_ship_no'];

          $x_position_main_18 = $row_main_18['x_position'];

        }



        if ($check_level_18 > 0) {



        $select_query_total_x18 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_18}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x18 = mysqli_query($con,$select_query_total_x18);

          while($row_total_x18 = mysqli_fetch_array($run_total_x18)){

                $total_x18 = $row_total_x18['SUM(product_amount)'];

          }



          $select_query_total_x18a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_18}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x18a = mysqli_query($con,$select_query_total_x18a);

          while($row_total_x18a = mysqli_fetch_array($run_total_x18a)){

                $total_x18a_1 = $row_total_x18a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_18 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_18}%' AND member_no <> '$member_no_main'";

          $run_group_t_18 = mysqli_query($con,$select_query_group_t_18);

          while($row_group_t_18 = mysqli_fetch_array($run_group_t_18)){

                $total_group_t_18 = $row_group_t_18['SUM(product_amount)'];

                

          }



          $select_query_group_t_18a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_18}%' AND tree_id > '$tree_id_main'";

          $run_group_t_18a = mysqli_query($con,$select_query_group_t_18a);

          while($row_group_t_18a = mysqli_fetch_array($run_group_t_18a)){

                $total_group_t_18a = $row_group_t_18a['SUM(roi_amount)'];

                $total_percent_amount_18a = $row_group_t_18a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_18 = $total_group_t_18+$total_group_t_18a+$total_percent_amount_18a;





          $total_x18a = $total_x18a_1+$total_x18;





           $select_query_growth_18 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_18}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_18 = mysqli_query($con,$select_query_growth_18);

          $check_level_growth_18 = mysqli_num_rows($run_growth_18);



          if ($check_level_growth_18 == 0) {

             $total_cur_18 = $total_x18a_1+$total_x18;

             $growth_leg_18=0;

          }

          else {

            $total_cur_18 = 0;

            $growth_leg_18=1;

          }





        }else {



          $total_x18 =0;

             $total_x18a=0;

             $total_oagrbv_18 = 0;



        }



        $select_query_main_19 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='19' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_19 = mysqli_query($con,$select_query_main_19);

          $check_level_19 = mysqli_num_rows($run_main_19);

          while ($row_main_19 = mysqli_fetch_array($run_main_19)) {

          $tree_id_main_19 = $row_main_19['tree_id'];

          $group_number_main_19 = $row_main_19['group_number'];

          $member_no_main_19 = $row_main_19['member_no'];

          $sponsor_no_main_19 = $row_main_19['sponsor_no'];

          $level_no_main_19 = $row_main_19['level_no'];

          $relation_ship_no_main_19 = $row_main_19['relation_ship_no'];

          $x_position_main_19 = $row_main_19['x_position'];

        }



        if ($check_level_19 > 0) {



        $select_query_total_x19 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_19}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x19 = mysqli_query($con,$select_query_total_x19);

          while($row_total_x19 = mysqli_fetch_array($run_total_x19)){

                $total_x19 = $row_total_x19['SUM(product_amount)'];

          }



          $select_query_total_x19a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_19}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x19a = mysqli_query($con,$select_query_total_x19a);

          while($row_total_x19a = mysqli_fetch_array($run_total_x19a)){

                $total_x19a_1 = $row_total_x19a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_19 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_19}%' AND member_no <> '$member_no_main'";

          $run_group_t_19 = mysqli_query($con,$select_query_group_t_19);

          while($row_group_t_19 = mysqli_fetch_array($run_group_t_19)){

                $total_group_t_19 = $row_group_t_19['SUM(product_amount)'];

                

          }



          $select_query_group_t_19a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_19}%' AND tree_id > '$tree_id_main'";

          $run_group_t_19a = mysqli_query($con,$select_query_group_t_19a);

          while($row_group_t_19a = mysqli_fetch_array($run_group_t_19a)){

                $total_group_t_19a = $row_group_t_19a['SUM(roi_amount)'];

                $total_percent_amount_19a = $row_group_t_19a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_19 = $total_group_t_19+$total_group_t_19a+$total_percent_amount_19a;



          $total_x19a = $total_x19a_1+$total_x19;



           $select_query_growth_19 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_19}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_19 = mysqli_query($con,$select_query_growth_19);

          $check_level_growth_19 = mysqli_num_rows($run_growth_19);



          if ($check_level_growth_19 == 0) {

             $total_cur_19 = $total_x19a_1+$total_x19;

             $growth_leg_19=0;

          }

          else {

            $total_cur_19 = 0;

            $growth_leg_19=1;

          }



        }else {



          $total_x19 =0;

             $total_x19a=0;

             $total_oagrbv_19 = 0;



        }



        $select_query_main_20 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='20' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_20 = mysqli_query($con,$select_query_main_20);

          $check_level_20 = mysqli_num_rows($run_main_20);

          while ($row_main_20 = mysqli_fetch_array($run_main_20)) {

          $tree_id_main_20 = $row_main_20['tree_id'];

          $group_number_main_20 = $row_main_20['group_number'];

          $member_no_main_20 = $row_main_20['member_no'];

          $sponsor_no_main_20 = $row_main_20['sponsor_no'];

          $level_no_main_20 = $row_main_20['level_no'];

          $relation_ship_no_main_20 = $row_main_20['relation_ship_no'];

          $x_position_main_20 = $row_main_20['x_position'];

        }



        if ($check_level_20 > 0) {



        $select_query_total_x20 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_20}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x20 = mysqli_query($con,$select_query_total_x20);

          while($row_total_x20 = mysqli_fetch_array($run_total_x20)){

                $total_x20 = $row_total_x20['SUM(product_amount)'];

          }



          $select_query_total_x20a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_20}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x20a = mysqli_query($con,$select_query_total_x20a);

          while($row_total_x20a = mysqli_fetch_array($run_total_x20a)){

                $total_x20a_1 = $row_total_x20a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_20 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_20}%' AND member_no <> '$member_no_main'";

          $run_group_t_20 = mysqli_query($con,$select_query_group_t_20);

          while($row_group_t_20 = mysqli_fetch_array($run_group_t_20)){

                $total_group_t_20 = $row_group_t_20['SUM(product_amount)'];

                

          }



          $select_query_group_t_20a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_20}%' AND tree_id > '$tree_id_main'";

          $run_group_t_20a = mysqli_query($con,$select_query_group_t_20a);

          while($row_group_t_20a = mysqli_fetch_array($run_group_t_20a)){

                $total_group_t_20a = $row_group_t_20a['SUM(roi_amount)'];

                $total_percent_amount_20a = $row_group_t_20a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_20 = $total_group_t_20+$total_group_t_20a+$total_percent_amount_20a;



          $total_x20a = $total_x20a_1+$total_x20;



           $select_query_growth_20 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_20}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_20 = mysqli_query($con,$select_query_growth_20);

          $check_level_growth_20 = mysqli_num_rows($run_growth_20);



          if ($check_level_growth_20 == 0) {

             $total_cur_20 = $total_x20a_1+$total_x20;

             $growth_leg_20=0;

          }

          else {

            $total_cur_20 = 0;

            $growth_leg_20=1;

          }



        }else {



          $total_x20 =0;

             $total_x20a=0;

             $total_oagrbv_20 = 0;



        }



        $select_query_main_21 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='21' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_21 = mysqli_query($con,$select_query_main_21);

          $check_level_21 = mysqli_num_rows($run_main_21);

          while ($row_main_21 = mysqli_fetch_array($run_main_21)) {

          $tree_id_main_21 = $row_main_21['tree_id'];

          $group_number_main_21 = $row_main_21['group_number'];

          $member_no_main_21 = $row_main_21['member_no'];

          $sponsor_no_main_21 = $row_main_21['sponsor_no'];

          $level_no_main_21 = $row_main_21['level_no'];

          $relation_ship_no_main_21 = $row_main_21['relation_ship_no'];

          $x_position_main_21 = $row_main_21['x_position'];

        }



        if ($check_level_21 > 0) {



        $select_query_total_x21 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_21}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x21 = mysqli_query($con,$select_query_total_x21);

          while($row_total_x21 = mysqli_fetch_array($run_total_x21)){

                $total_x21 = $row_total_x21['SUM(product_amount)'];

          }



          $select_query_total_x21a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_21}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x21a = mysqli_query($con,$select_query_total_x21a);

          while($row_total_x21a = mysqli_fetch_array($run_total_x21a)){

                $total_x21a_1 = $row_total_x21a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_21 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_21}%' AND member_no <> '$member_no_main'";

          $run_group_t_21 = mysqli_query($con,$select_query_group_t_21);

          while($row_group_t_21 = mysqli_fetch_array($run_group_t_21)){

                $total_group_t_21 = $row_group_t_21['SUM(product_amount)'];

                

          }



          $select_query_group_t_21a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_21}%' AND tree_id > '$tree_id_main'";

          $run_group_t_21a = mysqli_query($con,$select_query_group_t_21a);

          while($row_group_t_21a = mysqli_fetch_array($run_group_t_21a)){

                $total_group_t_21a = $row_group_t_21a['SUM(roi_amount)'];

                $total_percent_amount_21a = $row_group_t_21a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_21 = $total_group_t_21+$total_group_t_21a+$total_percent_amount_21a;



          $total_x21a = $total_x21a_1+$total_x21;



           $select_query_growth_21 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_21}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_21 = mysqli_query($con,$select_query_growth_21);

          $check_level_growth_21 = mysqli_num_rows($run_growth_21);



          if ($check_level_growth_21 == 0) {

             $total_cur_21 = $total_x21a_1+$total_x21;

             $growth_leg_21=0;

          }

          else {

            $total_cur_21 = 0;

            $growth_leg_21=1;

          }



        }else {



          $total_x21 =0;

             $total_x21a=0;

             $total_oagrbv_21 = 0;



        }







        $select_query_main_22 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='22' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_22 = mysqli_query($con,$select_query_main_22);

          $check_level_22 = mysqli_num_rows($run_main_22);

          while ($row_main_22 = mysqli_fetch_array($run_main_22)) {

          $tree_id_main_22 = $row_main_22['tree_id'];

          $group_number_main_22 = $row_main_22['group_number'];

          $member_no_main_22 = $row_main_22['member_no'];

          $sponsor_no_main_22 = $row_main_22['sponsor_no'];

          $level_no_main_22 = $row_main_22['level_no'];

          $relation_ship_no_main_22 = $row_main_22['relation_ship_no'];

          $x_position_main_22 = $row_main_22['x_position'];

        }



        if ($check_level_22 > 0) {



        $select_query_total_x22 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_22}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x22 = mysqli_query($con,$select_query_total_x22);

          while($row_total_x22 = mysqli_fetch_array($run_total_x22)){

                $total_x22 = $row_total_x22['SUM(product_amount)'];

          }



          $select_query_total_x22a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_22}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x22a = mysqli_query($con,$select_query_total_x22a);

          while($row_total_x22a = mysqli_fetch_array($run_total_x22a)){

                $total_x22a_1 = $row_total_x22a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_22 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_22}%' AND member_no <> '$member_no_main'";

          $run_group_t_22 = mysqli_query($con,$select_query_group_t_22);

          while($row_group_t_22 = mysqli_fetch_array($run_group_t_22)){

                $total_group_t_22 = $row_group_t_22['SUM(product_amount)'];

                

          }



          $select_query_group_t_22a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_22}%' AND tree_id > '$tree_id_main'";

          $run_group_t_22a = mysqli_query($con,$select_query_group_t_22a);

          while($row_group_t_22a = mysqli_fetch_array($run_group_t_22a)){

                $total_group_t_22a = $row_group_t_22a['SUM(roi_amount)'];

                $total_percent_amount_22a = $row_group_t_22a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_22 = $total_group_t_22+$total_group_t_22a+$total_percent_amount_22a;



          $total_x22a = $total_x22a_1+$total_x22;



           $select_query_growth_22 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_22}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_22 = mysqli_query($con,$select_query_growth_22);

          $check_level_growth_22 = mysqli_num_rows($run_growth_22);



          if ($check_level_growth_22 == 0) {

             $total_cur_22 = $total_x22a_1+$total_x22;

             $growth_leg_22=0;

          }

          else {

            $total_cur_22 = 0;

            $growth_leg_22=1;

          }



        }else {



          $total_x22 =0;

             $total_x22a=0;

             $total_oagrbv_22 = 0;



        }







        $select_query_main_23 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='23' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_23 = mysqli_query($con,$select_query_main_23);

          $check_level_23 = mysqli_num_rows($run_main_23);

          while ($row_main_23 = mysqli_fetch_array($run_main_23)) {

          $tree_id_main_23 = $row_main_23['tree_id'];

          $group_number_main_23 = $row_main_23['group_number'];

          $member_no_main_23 = $row_main_23['member_no'];

          $sponsor_no_main_23 = $row_main_23['sponsor_no'];

          $level_no_main_23 = $row_main_23['level_no'];

          $relation_ship_no_main_23 = $row_main_23['relation_ship_no'];

          $x_position_main_23 = $row_main_23['x_position'];

        }



        if ($check_level_23 > 0) {



        $select_query_total_x23 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_23}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x23 = mysqli_query($con,$select_query_total_x23);

          while($row_total_x23 = mysqli_fetch_array($run_total_x23)){

                $total_x23 = $row_total_x23['SUM(product_amount)'];

          }



          $select_query_total_x23a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_23}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x23a = mysqli_query($con,$select_query_total_x23a);

          while($row_total_x23a = mysqli_fetch_array($run_total_x23a)){

                $total_x23a_1 = $row_total_x23a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_23 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_23}%' AND member_no <> '$member_no_main'";

          $run_group_t_23 = mysqli_query($con,$select_query_group_t_23);

          while($row_group_t_23 = mysqli_fetch_array($run_group_t_23)){

                $total_group_t_23 = $row_group_t_23['SUM(product_amount)'];

                

          }



          $select_query_group_t_23a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_23}%' AND tree_id > '$tree_id_main'";

          $run_group_t_23a = mysqli_query($con,$select_query_group_t_23a);

          while($row_group_t_23a = mysqli_fetch_array($run_group_t_23a)){

                $total_group_t_23a = $row_group_t_23a['SUM(roi_amount)'];

                $total_percent_amount_23a = $row_group_t_23a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_23 = $total_group_t_23+$total_group_t_23a+$total_percent_amount_23a;



          $total_x23a = $total_x23a_1+$total_x23;



           $select_query_growth_23 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_23}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_23 = mysqli_query($con,$select_query_growth_23);

          $check_level_growth_23 = mysqli_num_rows($run_growth_23);



          if ($check_level_growth_23 == 0) {

             $total_cur_23 = $total_x23a_1+$total_x23;

             $growth_leg_23=0;

          }

          else {

            $total_cur_23 = 0;

            $growth_leg_23=1;

          }



        }else {



          $total_x23 =0;

             $total_x23a=0;

             $total_oagrbv_23 = 0;



        }







        $select_query_main_24 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='24' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_24 = mysqli_query($con,$select_query_main_24);

          $check_level_24 = mysqli_num_rows($run_main_24);

          while ($row_main_24 = mysqli_fetch_array($run_main_24)) {

          $tree_id_main_24 = $row_main_24['tree_id'];

          $group_number_main_24 = $row_main_24['group_number'];

          $member_no_main_24 = $row_main_24['member_no'];

          $sponsor_no_main_24 = $row_main_24['sponsor_no'];

          $level_no_main_24 = $row_main_24['level_no'];

          $relation_ship_no_main_24 = $row_main_24['relation_ship_no'];

          $x_position_main_24 = $row_main_24['x_position'];

        }



        if ($check_level_24 > 0) {



        $select_query_total_x24 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_24}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x24 = mysqli_query($con,$select_query_total_x24);

          while($row_total_x24 = mysqli_fetch_array($run_total_x24)){

                $total_x24 = $row_total_x24['SUM(product_amount)'];

          }



          $select_query_total_x24a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_24}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x24a = mysqli_query($con,$select_query_total_x24a);

          while($row_total_x24a = mysqli_fetch_array($run_total_x24a)){

                $total_x24a_1 = $row_total_x24a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_24 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_24}%' AND member_no <> '$member_no_main'";

          $run_group_t_24 = mysqli_query($con,$select_query_group_t_24);

          while($row_group_t_24 = mysqli_fetch_array($run_group_t_24)){

                $total_group_t_24 = $row_group_t_24['SUM(product_amount)'];

                

          }



          $select_query_group_t_24a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_24}%' AND tree_id > '$tree_id_main'";

          $run_group_t_24a = mysqli_query($con,$select_query_group_t_24a);

          while($row_group_t_24a = mysqli_fetch_array($run_group_t_24a)){

                $total_group_t_24a = $row_group_t_24a['SUM(roi_amount)'];

                $total_percent_amount_24a = $row_group_t_24a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_24 = $total_group_t_24+$total_group_t_24a+$total_percent_amount_24a;



          $total_x24a = $total_x24a_1+$total_x24;



           $select_query_growth_24 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_24}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_24 = mysqli_query($con,$select_query_growth_24);

          $check_level_growth_24 = mysqli_num_rows($run_growth_24);



          if ($check_level_growth_24 == 0) {

             $total_cur_24 = $total_x24a_1+$total_x24;

             $growth_leg_24=0;

          }

          else {

            $total_cur_24 = 0;

            $growth_leg_24=1;

          }



        }else {



          $total_x24 =0;

             $total_x24a=0;

             $total_oagrbv_24 = 0;



        }







        $select_query_main_25 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='25' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_25 = mysqli_query($con,$select_query_main_25);

          $check_level_25 = mysqli_num_rows($run_main_25);

          while ($row_main_25 = mysqli_fetch_array($run_main_25)) {

          $tree_id_main_25 = $row_main_25['tree_id'];

          $group_number_main_25 = $row_main_25['group_number'];

          $member_no_main_25 = $row_main_25['member_no'];

          $sponsor_no_main_25 = $row_main_25['sponsor_no'];

          $level_no_main_25 = $row_main_25['level_no'];

          $relation_ship_no_main_25 = $row_main_25['relation_ship_no'];

          $x_position_main_25 = $row_main_25['x_position'];

        }



        if ($check_level_25 > 0) {



        $select_query_total_x25 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_25}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x25 = mysqli_query($con,$select_query_total_x25);

          while($row_total_x25 = mysqli_fetch_array($run_total_x25)){

                $total_x25 = $row_total_x25['SUM(product_amount)'];

          }



          $select_query_total_x25a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_25}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x25a = mysqli_query($con,$select_query_total_x25a);

          while($row_total_x25a = mysqli_fetch_array($run_total_x25a)){

                $total_x25a_1 = $row_total_x25a['SUM(roi_amount)'];





                

          }





          $select_query_group_t_25 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_25}%' AND member_no <> '$member_no_main'";

          $run_group_t_25 = mysqli_query($con,$select_query_group_t_25);

          while($row_group_t_25 = mysqli_fetch_array($run_group_t_25)){

                $total_group_t_25 = $row_group_t_25['SUM(product_amount)'];

                

          }



          $select_query_group_t_25a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_25}%' AND tree_id > '$tree_id_main'";

          $run_group_t_25a = mysqli_query($con,$select_query_group_t_25a);

          while($row_group_t_25a = mysqli_fetch_array($run_group_t_25a)){

                $total_group_t_25a = $row_group_t_25a['SUM(roi_amount)'];

                $total_percent_amount_25a = $row_group_t_25a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_25 = $total_group_t_25+$total_group_t_25a+$total_percent_amount_25a;





          $total_x25a = $total_x25a_1+$total_x25;



           $select_query_growth_25 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_25}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_25 = mysqli_query($con,$select_query_growth_25);

          $check_level_growth_25 = mysqli_num_rows($run_growth_25);



          if ($check_level_growth_25 == 0) {

             $total_cur_25 = $total_x25a_1+$total_x25;

             $growth_leg_25=0;

          }

          else {

            $total_cur_25 = 0;

            $growth_leg_25=1;

          }



        }else {



          $total_x25 =0;

             $total_x25a=0;

             $total_oagrbv_25 = 0;



        }







        $select_query_main_26 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='26' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_26 = mysqli_query($con,$select_query_main_26);

          $check_level_26 = mysqli_num_rows($run_main_26);

          while ($row_main_26 = mysqli_fetch_array($run_main_26)) {

          $tree_id_main_26 = $row_main_26['tree_id'];

          $group_number_main_26 = $row_main_26['group_number'];

          $member_no_main_26 = $row_main_26['member_no'];

          $sponsor_no_main_26 = $row_main_26['sponsor_no'];

          $level_no_main_26 = $row_main_26['level_no'];

          $relation_ship_no_main_26 = $row_main_26['relation_ship_no'];

          $x_position_main_26 = $row_main_26['x_position'];

        }



        if ($check_level_26 > 0) {



        $select_query_total_x26 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_26}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x26 = mysqli_query($con,$select_query_total_x26);

          while($row_total_x26 = mysqli_fetch_array($run_total_x26)){

                $total_x26 = $row_total_x26['SUM(product_amount)'];

          }



          $select_query_total_x26a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_26}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x26a = mysqli_query($con,$select_query_total_x26a);

          while($row_total_x26a = mysqli_fetch_array($run_total_x26a)){

                $total_x26a_1 = $row_total_x26a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_26 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_26}%' AND member_no <> '$member_no_main'";

          $run_group_t_26 = mysqli_query($con,$select_query_group_t_26);

          while($row_group_t_26 = mysqli_fetch_array($run_group_t_26)){

                $total_group_t_26 = $row_group_t_26['SUM(product_amount)'];

                

          }



          $select_query_group_t_26a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_26}%' AND tree_id > '$tree_id_main'";

          $run_group_t_26a = mysqli_query($con,$select_query_group_t_26a);

          while($row_group_t_26a = mysqli_fetch_array($run_group_t_26a)){

                $total_group_t_26a = $row_group_t_26a['SUM(roi_amount)'];

                $total_percent_amount_26a = $row_group_t_26a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_26 = $total_group_t_26+$total_group_t_26a+$total_percent_amount_26a;



          $total_x26a = $total_x26a_1+$total_x26;



           $select_query_growth_26 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_26}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_26 = mysqli_query($con,$select_query_growth_26);

          $check_level_growth_26 = mysqli_num_rows($run_growth_26);



          if ($check_level_growth_26 == 0) {

             $total_cur_26 = $total_x26a_1+$total_x26;

             $growth_leg_26=0;

          }

          else {

            $total_cur_26 = 0;

            $growth_leg_26=1;

          }





        }else {



          $total_x26 =0;

             $total_x26a=0;

             $total_oagrbv_26 = 0;



        }







        $select_query_main_27 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='27' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_27 = mysqli_query($con,$select_query_main_27);

          $check_level_27 = mysqli_num_rows($run_main_27);

          while ($row_main_27 = mysqli_fetch_array($run_main_27)) {

          $tree_id_main_27 = $row_main_27['tree_id'];

          $group_number_main_27 = $row_main_27['group_number'];

          $member_no_main_27 = $row_main_27['member_no'];

          $sponsor_no_main_27 = $row_main_27['sponsor_no'];

          $level_no_main_27 = $row_main_27['level_no'];

          $relation_ship_no_main_27 = $row_main_27['relation_ship_no'];

          $x_position_main_27 = $row_main_27['x_position'];

        }



        if ($check_level_27 > 0) {



        $select_query_total_x27 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_27}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x27 = mysqli_query($con,$select_query_total_x27);

          while($row_total_x27 = mysqli_fetch_array($run_total_x27)){

                $total_x27 = $row_total_x27['SUM(product_amount)'];

          }



          $select_query_total_x27a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_27}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x27a = mysqli_query($con,$select_query_total_x27a);

          while($row_total_x27a = mysqli_fetch_array($run_total_x27a)){

                $total_x27a_1 = $row_total_x27a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_27 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_27}%' AND member_no <> '$member_no_main'";

          $run_group_t_27 = mysqli_query($con,$select_query_group_t_27);

          while($row_group_t_27 = mysqli_fetch_array($run_group_t_27)){

                $total_group_t_27 = $row_group_t_27['SUM(product_amount)'];

                

          }



          $select_query_group_t_27a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_27}%' AND tree_id > '$tree_id_main'";

          $run_group_t_27a = mysqli_query($con,$select_query_group_t_27a);

          while($row_group_t_27a = mysqli_fetch_array($run_group_t_27a)){

                $total_group_t_27a = $row_group_t_27a['SUM(roi_amount)'];

                $total_percent_amount_27a = $row_group_t_27a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_27 = $total_group_t_27+$total_group_t_27a+$total_percent_amount_27a;

          $total_x27a = $total_x27a_1+$total_x27;



           $select_query_growth_27 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_27}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_27 = mysqli_query($con,$select_query_growth_27);

          $check_level_growth_27 = mysqli_num_rows($run_growth_27);



          if ($check_level_growth_27 == 0) {

             $total_cur_27 = $total_x27a_1+$total_x27;

             $growth_leg_27=0;

          }

          else {

            $total_cur_27 = 0;

            $growth_leg_27=1;

          }



        }else {



          $total_x27 =0;

             $total_x27a=0;

             $total_oagrbv_27 = 0;



        }







        $select_query_main_28 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='28' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_28 = mysqli_query($con,$select_query_main_28);

          $check_level_28 = mysqli_num_rows($run_main_28);

          while ($row_main_28 = mysqli_fetch_array($run_main_28)) {

          $tree_id_main_28 = $row_main_28['tree_id'];

          $group_number_main_28 = $row_main_28['group_number'];

          $member_no_main_28 = $row_main_28['member_no'];

          $sponsor_no_main_28 = $row_main_28['sponsor_no'];

          $level_no_main_28 = $row_main_28['level_no'];

          $relation_ship_no_main_28 = $row_main_28['relation_ship_no'];

          $x_position_main_28 = $row_main_28['x_position'];

        }



        if ($check_level_28 > 0) {



        $select_query_total_x28 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_28}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x28 = mysqli_query($con,$select_query_total_x28);

          while($row_total_x28 = mysqli_fetch_array($run_total_x28)){

                $total_x28 = $row_total_x28['SUM(product_amount)'];

          }



          $select_query_total_x28a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_28}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x28a = mysqli_query($con,$select_query_total_x28a);

          while($row_total_x28a = mysqli_fetch_array($run_total_x28a)){

                $total_x28a_1 = $row_total_x28a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_28 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_28}%' AND member_no <> '$member_no_main'";

          $run_group_t_28 = mysqli_query($con,$select_query_group_t_28);

          while($row_group_t_28 = mysqli_fetch_array($run_group_t_28)){

                $total_group_t_28 = $row_group_t_28['SUM(product_amount)'];

                

          }



          $select_query_group_t_28a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_28}%' AND tree_id > '$tree_id_main'";

          $run_group_t_28a = mysqli_query($con,$select_query_group_t_28a);

          while($row_group_t_28a = mysqli_fetch_array($run_group_t_28a)){

                $total_group_t_28a = $row_group_t_28a['SUM(roi_amount)'];

                $total_percent_amount_28a = $row_group_t_28a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_28 = $total_group_t_28+$total_group_t_28a+$total_percent_amount_28a;



          $total_x28a = $total_x28a_1+$total_x28;



           $select_query_growth_28 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_28}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_28 = mysqli_query($con,$select_query_growth_28);

          $check_level_growth_28 = mysqli_num_rows($run_growth_28);



          if ($check_level_growth_28 == 0) {

             $total_cur_28 = $total_x28a_1+$total_x28;

             $growth_leg_28=0;

          }

          else {

            $total_cur_28 = 0;

            $growth_leg_28=1;

          }



        }else {



          $total_x28 =0;

             $total_x28a=0;

             $total_oagrbv_28 = 0;



        }





        $select_query_main_29 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='29' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_29 = mysqli_query($con,$select_query_main_29);

          $check_level_29 = mysqli_num_rows($run_main_29);

          while ($row_main_29 = mysqli_fetch_array($run_main_29)) {

          $tree_id_main_29 = $row_main_29['tree_id'];

          $group_number_main_29 = $row_main_29['group_number'];

          $member_no_main_29 = $row_main_29['member_no'];

          $sponsor_no_main_29 = $row_main_29['sponsor_no'];

          $level_no_main_29 = $row_main_29['level_no'];

          $relation_ship_no_main_29 = $row_main_29['relation_ship_no'];

          $x_position_main_29 = $row_main_29['x_position'];

        }



        if ($check_level_29 > 0) {



        $select_query_total_x29 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_29}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x29 = mysqli_query($con,$select_query_total_x29);

          while($row_total_x29 = mysqli_fetch_array($run_total_x29)){

                $total_x29 = $row_total_x29['SUM(product_amount)'];

          }



          $select_query_total_x29a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_29}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x29a = mysqli_query($con,$select_query_total_x29a);

          while($row_total_x29a = mysqli_fetch_array($run_total_x29a)){

                $total_x29a_1 = $row_total_x29a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_29 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_29}%' AND member_no <> '$member_no_main'";

          $run_group_t_29 = mysqli_query($con,$select_query_group_t_29);

          while($row_group_t_29 = mysqli_fetch_array($run_group_t_29)){

                $total_group_t_29 = $row_group_t_29['SUM(product_amount)'];

                

          }



          $select_query_group_t_29a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_29}%' AND tree_id > '$tree_id_main'";

          $run_group_t_29a = mysqli_query($con,$select_query_group_t_29a);

          while($row_group_t_29a = mysqli_fetch_array($run_group_t_29a)){

                $total_group_t_29a = $row_group_t_29a['SUM(roi_amount)'];

                $total_percent_amount_29a = $row_group_t_29a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_29 = $total_group_t_29+$total_group_t_29a+$total_percent_amount_29a;



          $total_x29a = $total_x29a_1+$total_x29;



           $select_query_growth_29 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_29}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_29 = mysqli_query($con,$select_query_growth_29);

          $check_level_growth_29 = mysqli_num_rows($run_growth_29);



          if ($check_level_growth_29 == 0) {

             $total_cur_29 = $total_x29a_1+$total_x29;

             $growth_leg_29=0;

          }

          else {

            $total_cur_29 = 0;

            $growth_leg_29=1;

          }



        }else {



          $total_x29 =0;

             $total_x29a=0;

             $total_oagrbv_29 = 0;



        }







        $select_query_main_30 = "select * from roi_tree where group_number = '$group_number_main' AND x_position = '$x_position_main' AND y_position='30' AND relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main'";

          $run_main_30 = mysqli_query($con,$select_query_main_30);

          $check_level_30 = mysqli_num_rows($run_main_30);

          while ($row_main_30 = mysqli_fetch_array($run_main_30)) {

          $tree_id_main_30 = $row_main_30['tree_id'];

          $group_number_main_30 = $row_main_30['group_number'];

          $member_no_main_30 = $row_main_30['member_no'];

          $sponsor_no_main_30 = $row_main_30['sponsor_no'];

          $level_no_main_30 = $row_main_30['level_no'];

          $relation_ship_no_main_30 = $row_main_30['relation_ship_no'];

          $x_position_main_30 = $row_main_30['x_position'];

        }



        if ($check_level_30 > 0) {



        $select_query_total_x30 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_30}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND status='0'";

          $run_total_x30 = mysqli_query($con,$select_query_total_x30);

          while($row_total_x30 = mysqli_fetch_array($run_total_x30)){

                $total_x30 = $row_total_x30['SUM(product_amount)'];

          }



          $select_query_total_x30a = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_30}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).")";

          $run_total_x30a = mysqli_query($con,$select_query_total_x30a);

          while($row_total_x30a = mysqli_fetch_array($run_total_x30a)){

                $total_x30a_1 = $row_total_x30a['SUM(roi_amount)'];





                

          }



          $select_query_group_t_30 = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main_30}%' AND member_no <> '$member_no_main'";

          $run_group_t_30 = mysqli_query($con,$select_query_group_t_30);

          while($row_group_t_30 = mysqli_fetch_array($run_group_t_30)){

                $total_group_t_30 = $row_group_t_30['SUM(product_amount)'];

                

          }



          $select_query_group_t_30a = "select SUM(roi_amount), SUM(percent_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_30}%' AND tree_id > '$tree_id_main'";

          $run_group_t_30a = mysqli_query($con,$select_query_group_t_30a);

          while($row_group_t_30a = mysqli_fetch_array($run_group_t_30a)){

                $total_group_t_30a = $row_group_t_30a['SUM(roi_amount)'];

                $total_percent_amount_30a = $row_group_t_30a['SUM(percent_amount)'];

                

          }



          $total_oagrbv_30 = $total_group_t_30+$total_group_t_30a+$total_percent_amount_30a;



          $total_x30a = $total_x30a_1+$total_x30;



           $select_query_growth_30 = "select * from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main_30}%' AND tree_id > '$tree_id_main' AND rank > '0'";

          $run_growth_30 = mysqli_query($con,$select_query_growth_30);

          $check_level_growth_30 = mysqli_num_rows($run_growth_30);



          if ($check_level_growth_30 == 0) {

             $total_cur_30 = $total_x30a_1+$total_x30;

             $growth_leg_30=0;

          }

          else {

            $total_cur_30 = 0;

            $growth_leg_30=1;

          }



        }else {



          $total_x30 =0;

             $total_x30a=0;

             $total_oagrbv_30 = 0;



        }





          $bigest_value = max($total_x5a, $total_x4a, $total_x3a, $total_x2a, $total_x1a, $total_x6a, $total_x7a, $total_x8a, $total_x9a, $total_x10a, $total_x15a, $total_x14a, $total_x13a, $total_x12a, $total_x11a, $total_x16a, $total_x17a, $total_x18a, $total_x19a, $total_x20a, $total_x25a, $total_x24a, $total_x23a, $total_x22a, $total_x21a, $total_x26a, $total_x27a, $total_x28a, $total_x29a, $total_x30a);



          if ($total_team_pv < 30000) {

               $percent_amount = 6;

               $next_level_amount = 30000;

               $next_ve_per = 9; 

             }

             elseif ($total_team_pv < 75000) {

               $percent_amount = 9;

               $next_level_amount = 75000; 

               $next_ve_per = 14;

             }

             

             else {

               $percent_amount = 14;

             }





             //get level position1a amount



             if ($total_oagrbv_1 < 30000) {

               $level_1a_percent = 6; 

             }

             elseif ($total_oagrbv_1 < 75000) {

               $level_1a_percent = 9; 

             }

             else {

               $level_1a_percent = 14;

             }



             if ($percent_amount == $level_1a_percent) {



                $level_1a_release_percent = 0;

                $level_1a_amount = 0;

                $step1_amount = 0;



                

             }else {



                if ($check_level_1 == 0) {

                  $level_1a_release_percent = 0;

                  $level_1a_amount = $total_x1a;

                  $step1_amount = 0;

                }

                else {

                  $level_1a_release_percent = $percent_amount - $level_1a_percent;

                  $level_1a_amount = $total_x1a;



                  $percentin_tds_roi_process_step1 = $level_1a_release_percent / 100;       

                 //Get the result.

                  $step1_amount = $percentin_tds_roi_process_step1 * $level_1a_amount;

                }



                

             }



             //get level position1a amount



             //get level position2a amount



             if ($total_oagrbv_2 < 30000) {

               $level_2a_percent = 6; 

             }

             elseif ($total_oagrbv_2 < 75000) {

               $level_2a_percent = 9; 

             }

             else {

               $level_2a_percent = 14;

             }



             if ($percent_amount == $level_2a_percent) {



                $level_2a_release_percent = 0;

                $level_2a_amount = 0;

                $step2_amount = 0;



                

             }else {



                if ($check_level_2 == 0) {

                  $level_2a_release_percent = 0;

                  $level_2a_amount = $total_x2a;

                  $step2_amount=0;

                }

                else {

                  $level_2a_release_percent = $percent_amount - $level_2a_percent;

                  $level_2a_amount = $total_x2a;



                  $percentin_tds_roi_process_step2 = $level_2a_release_percent / 100;       

                 //Get the result.

                  $step2_amount = $percentin_tds_roi_process_step2 * $level_2a_amount;

                }

             }



             //get level position2a amount

             //get level position3a amount



             if ($total_oagrbv_3 < 30000) {

               $level_3a_percent = 6; 

             }

             elseif ($total_oagrbv_3 < 75000) {

               $level_3a_percent = 9; 

             }

             else {

               $level_3a_percent = 14;

             }



             if ($percent_amount == $level_3a_percent) {



                $level_3a_release_percent = 0;

                $level_3a_amount = 0;

                $step3_amount = 0;



                

             }else {



                if ($check_level_3 == 0) {

                  $level_3a_release_percent = 0;

                  $level_3a_amount = $total_x3a;

                  $step3_amount = 0;

                }

                else {

                  $level_3a_release_percent = $percent_amount - $level_3a_percent;

                  $level_3a_amount = $total_x3a;



                  $percentin_tds_roi_process_step3 = $level_3a_release_percent / 100;       

                 //Get the result.

                  $step3_amount = $percentin_tds_roi_process_step3 * $level_3a_amount;





                }

             }



             //get level position3a amount

             //get level position4a amount



             if ($total_oagrbv_4 < 30000) {

               $level_4a_percent = 6; 

             }

             elseif ($total_oagrbv_4 < 75000) {

               $level_4a_percent = 9; 

             }

             else {

               $level_4a_percent = 14;

             }



             if ($percent_amount == $level_4a_percent) {



                $level_4a_release_percent = 0;

                $level_4a_amount = 0;

                $step4_amount = 0;



                

             }else {



                if ($check_level_4 == 0) {

                  $level_4a_release_percent = 0;

                  $level_4a_amount = $total_x4a;

                  $step4_amount = 0;

                }

                else {

                  $level_4a_release_percent = $percent_amount - $level_4a_percent;

                  $level_4a_amount = $total_x4a;

                  $percentin_tds_roi_process_step4 = $level_4a_release_percent / 100;       

                 //Get the result.

                  $step4_amount = $percentin_tds_roi_process_step4 * $level_4a_amount;

                }

             }



             //get level position4a amount

             //get level position5a amount



             if ($total_oagrbv_5 < 30000) {

               $level_5a_percent = 6; 

             }

             elseif ($total_oagrbv_5 < 75000) {

               $level_5a_percent = 9; 

             }

             else {

               $level_5a_percent = 14;

             }



             if ($percent_amount == $level_5a_percent) {



                $level_5a_release_percent = 0;

                $level_5a_amount = 0;

                $step5_amount = 0;



                

             }else {



                if ($check_level_5 == 0) {

                  $level_5a_release_percent = 0;

                  $level_5a_amount = $total_x5a;

                  $step5_amount = 0;

                }

                else {

                  $level_5a_release_percent = $percent_amount - $level_5a_percent;

                  $level_5a_amount = $total_x5a;

                  $percentin_tds_roi_process_step5 = $level_5a_release_percent / 100;       

                 //Get the result.

                  $step5_amount = $percentin_tds_roi_process_step5 * $level_5a_amount;

                }

             }



             //get level position5a amount

             //get level position6a amount



             if ($total_oagrbv_6 < 30000) {

               $level_6a_percent = 6; 

             }

             elseif ($total_oagrbv_6 < 75000) {

               $level_6a_percent = 9; 

             }

             else {

               $level_6a_percent = 14;

             }



             if ($percent_amount == $level_6a_percent) {



                $level_6a_release_percent = 0;

                $level_6a_amount = 0;

                $step6_amount = 0;



                

             }else {



                if ($check_level_6 == 0) {

                  $level_6a_release_percent = 0;

                  $level_6a_amount = $total_x6a;

                  $step6_amount = 0;

                }

                else {

                  $level_6a_release_percent = $percent_amount - $level_6a_percent;

                  $level_6a_amount = $total_x6a;

                  $percentin_tds_roi_process_step6 = $level_6a_release_percent / 100;       

                 //Get the result.

                  $step6_amount = $percentin_tds_roi_process_step6 * $level_6a_amount;

                }

             }



             //get level position6a amount

             //get level position7a amount



             if ($total_oagrbv_7 < 30000) {

               $level_7a_percent = 6; 

             }

             elseif ($total_oagrbv_7 < 75000) {

               $level_7a_percent = 9; 

             }

             else {

               $level_7a_percent = 14;

             }



             if ($percent_amount == $level_7a_percent) {



                $level_7a_release_percent = 0;

                $level_7a_amount = 0;

                $step7_amount = 0;



                

             }else {



                if ($check_level_7 == 0) {

                  $level_7a_release_percent = 0;

                  $level_7a_amount = $total_x7a;

                  $step7_amount = 0;

                }

                else {

                  $level_7a_release_percent = $percent_amount - $level_7a_percent;

                  $level_7a_amount = $total_x7a;

                  $percentin_tds_roi_process_step7 = $level_7a_release_percent / 100;       

                 //Get the result.

                  $step7_amount = $percentin_tds_roi_process_step7 * $level_7a_amount;

                }

             }



             //get level position7a amount



             //get level position8a amount



             if ($total_oagrbv_8 < 30000) {

               $level_8a_percent = 6; 

             }

             elseif ($total_oagrbv_8 < 75000) {

               $level_8a_percent = 9; 

             }

             else {

               $level_8a_percent = 14;

             }



             if ($percent_amount == $level_8a_percent) {



                $level_8a_release_percent = 0;

                $level_8a_amount = 0;

                $step8_amount = 0;



                

             }else {



                if ($check_level_8 == 0) {

                  $level_8a_release_percent = 0;

                  $level_8a_amount = $total_x8a;

                  $step8_amount = 0;

                }

                else {

                  $level_8a_release_percent = $percent_amount - $level_8a_percent;

                  $level_8a_amount = $total_x8a;

                  $percentin_tds_roi_process_step8 = $level_8a_release_percent / 100;       

                 //Get the result.

                  $step8_amount = $percentin_tds_roi_process_step8 * $level_8a_amount;

                }

             }



             //get level position8a amount

             //get level position9a amount



             if ($total_oagrbv_9 < 30000) {

               $level_9a_percent = 6; 

             }

             elseif ($total_oagrbv_9 < 75000) {

               $level_9a_percent = 9; 

             }

             else {

               $level_9a_percent = 14;

             }



             if ($percent_amount == $level_9a_percent) {



                $level_9a_release_percent = 0;

                $level_9a_amount = 0;

                $step9_amount = 0;



                

             }else {



                if ($check_level_9 == 0) {

                  $level_9a_release_percent = 0;

                  $level_9a_amount = $total_x9a;

                  $step9_amount = 0;

                }

                else {

                  $level_9a_release_percent = $percent_amount - $level_9a_percent;

                  $level_9a_amount = $total_x9a;

                  $percentin_tds_roi_process_step9 = $level_9a_release_percent / 100;       

                 //Get the result.

                  $step9_amount = $percentin_tds_roi_process_step9 * $level_9a_amount;

                }

             }



             //get level position9a amount



             //get level position10a amount



             if ($total_oagrbv_10 < 30000) {

               $level_10a_percent = 6; 

             }

             elseif ($total_oagrbv_10 < 75000) {

               $level_10a_percent = 9; 

             }

             else {

               $level_10a_percent = 14;

             }



             if ($percent_amount == $level_10a_percent) {



                $level_10a_release_percent = 0;

                $level_10a_amount = 0;

                $step10_amount = 0;



                

             }else {



                if ($check_level_10 == 0) {

                  $level_10a_release_percent = 0;

                  $level_10a_amount = $total_x10a;

                  $step10_amount = 0;

                }

                else {

                  $level_10a_release_percent = $percent_amount - $level_10a_percent;

                  $level_10a_amount = $total_x10a;

                  $percentin_tds_roi_process_step10 = $level_10a_release_percent / 100;       

                 //Get the result.

                  $step10_amount = $percentin_tds_roi_process_step10 * $level_10a_amount;

                }

             }



             //get level position10a amount





             //get level position11a amount



             if ($total_oagrbv_11 < 30000) {

               $level_11a_percent = 6; 

             }

             elseif ($total_oagrbv_11 < 75000) {

               $level_11a_percent = 9; 

             }

             else {

               $level_11a_percent = 14;

             }



             if ($percent_amount == $level_11a_percent) {



                $level_11a_release_percent = 0;

                $level_11a_amount = 0;

                $step11_amount = 0;



                

             }else {



                if ($check_level_11 == 0) {

                  $level_11a_release_percent = 0;

                  $level_11a_amount = $total_x11a;

                  $step11_amount = 0;

                }

                else {

                  $level_11a_release_percent = $percent_amount - $level_11a_percent;

                  $level_11a_amount = $total_x11a;

                  $percentin_tds_roi_process_step11 = $level_11a_release_percent / 100;       

                 //Get the result.

                  $step11_amount = $percentin_tds_roi_process_step11 * $level_11a_amount;

                }

             }



             //get level position11a amount



             //get level position12a amount



             if ($total_oagrbv_12 < 30000) {

               $level_12a_percent = 6; 

             }

             elseif ($total_oagrbv_12 < 75000) {

               $level_12a_percent = 9; 

             }

             else {

               $level_12a_percent = 14;

             }



             if ($percent_amount == $level_12a_percent) {



                $level_12a_release_percent = 0;

                $level_12a_amount = 0;

                $step12_amount = 0;



                

             }else {



                if ($check_level_12 == 0) {

                  $level_12a_release_percent = 0;

                  $level_12a_amount = $total_x12a;

                  $step12_amount = 0;

                }

                else {

                  $level_12a_release_percent = $percent_amount - $level_12a_percent;

                  $level_12a_amount = $total_x12a;

                  $percentin_tds_roi_process_step12 = $level_12a_release_percent / 100;       

                 //Get the result.

                  $step12_amount = $percentin_tds_roi_process_step12 * $level_12a_amount;

                }

             }



             //get level position12a amount

             //get level position13a amount



             if ($total_oagrbv_13 < 30000) {

               $level_13a_percent = 6; 

             }

             elseif ($total_oagrbv_13 < 75000) {

               $level_13a_percent = 9; 

             }

             else {

               $level_13a_percent = 14;

             }



             if ($percent_amount == $level_13a_percent) {



                $level_13a_release_percent = 0;

                $level_13a_amount = 0;

                $step13_amount = 0;



                

             }else {



                if ($check_level_13 == 0) {

                  $level_13a_release_percent = 0;

                  $level_13a_amount = $total_x13a;

                  $step13_amount = 0;

                }

                else {

                  $level_13a_release_percent = $percent_amount - $level_13a_percent;

                  $level_13a_amount = $total_x13a;

                  $percentin_tds_roi_process_step13 = $level_13a_release_percent / 100;       

                 //Get the result.

                  $step13_amount = $percentin_tds_roi_process_step13 * $level_13a_amount;

                }

             }



             //get level position13a amount

             //get level position14a amount



             if ($total_oagrbv_14 < 30000) {

               $level_14a_percent = 6; 

             }

             elseif ($total_oagrbv_14 < 75000) {

               $level_14a_percent = 9; 

             }

             else {

               $level_14a_percent = 14;

             }



             if ($percent_amount == $level_14a_percent) {



                $level_14a_release_percent = 0;

                $level_14a_amount = 0;

                $step14_amount = 0;



                

             }else {



                if ($check_level_14 == 0) {

                  $level_14a_release_percent = 0;

                  $level_14a_amount = $total_x14a;

                  $step14_amount = 0;

                }

                else {

                  $level_14a_release_percent = $percent_amount - $level_14a_percent;

                  $level_14a_amount = $total_x14a;

                  $percentin_tds_roi_process_step14 = $level_14a_release_percent / 100;       

                 //Get the result.

                  $step14_amount = $percentin_tds_roi_process_step14 * $level_14a_amount;

                }

             }



             //get level position14a amount

             //get level position15a amount



             if ($total_oagrbv_15 < 30000) {

               $level_15a_percent = 6; 

             }

             elseif ($total_oagrbv_15 < 75000) {

               $level_15a_percent = 9; 

             }

             else {

               $level_15a_percent = 14;

             }



             if ($percent_amount == $level_15a_percent) {



                $level_15a_release_percent = 0;

                $level_15a_amount = 0;

                $step15_amount = 0;



                

             }else {



                if ($check_level_15 == 0) {

                  $level_15a_release_percent = 0;

                  $level_15a_amount = $total_x15a;

                  $step15_amount = 0;

                }

                else {

                  $level_15a_release_percent = $percent_amount - $level_15a_percent;

                  $level_15a_amount = $total_x15a;

                  $percentin_tds_roi_process_step15 = $level_15a_release_percent / 100;       

                 //Get the result.

                  $step15_amount = $percentin_tds_roi_process_step15 * $level_15a_amount;

                }

             }



             //get level position15a amount

             //get level position16a amount



             if ($total_oagrbv_16 < 30000) {

               $level_16a_percent = 6; 

             }

             elseif ($total_oagrbv_16 < 75000) {

               $level_16a_percent = 9; 

             }

             else {

               $level_16a_percent = 14;

             }



             if ($percent_amount == $level_16a_percent) {



                $level_16a_release_percent = 0;

                $level_16a_amount = 0;

                $step16_amount = 0;



                

             }else {



                if ($check_level_16 == 0) {

                  $level_16a_release_percent = 0;

                  $level_16a_amount = $total_x16a;

                  $step16_amount = 0;

                }

                else {

                  $level_16a_release_percent = $percent_amount - $level_16a_percent;

                  $level_16a_amount = $total_x16a;

                  $percentin_tds_roi_process_step16 = $level_16a_release_percent / 100;       

                 //Get the result.

                  $step16_amount = $percentin_tds_roi_process_step16 * $level_16a_amount;

                }

             }



             //get level position16a amount

             //get level position17a amount



             if ($total_oagrbv_17 < 30000) {

               $level_17a_percent = 6; 

             }

             elseif ($total_oagrbv_17 < 75000) {

               $level_17a_percent = 9; 

             }

             else {

               $level_17a_percent = 14;

             }



             if ($percent_amount == $level_17a_percent) {



                $level_17a_release_percent = 0;

                $level_17a_amount = 0;

                $step17_amount = 0;



                

             }else {



                if ($check_level_17 == 0) {

                  $level_17a_release_percent = 0;

                  $level_17a_amount = $total_x17a;

                  $step17_amount = 0;

                }

                else {

                  $level_17a_release_percent = $percent_amount - $level_17a_percent;

                  $level_17a_amount = $total_x17a;

                  $percentin_tds_roi_process_step17 = $level_17a_release_percent / 100;       

                 //Get the result.

                  $step17_amount = $percentin_tds_roi_process_step17 * $level_17a_amount;

                }

             }



             //get level position17a amount



             //get level position18a amount



             if ($total_oagrbv_18 < 30000) {

               $level_18a_percent = 6; 

             }

             elseif ($total_oagrbv_18 < 75000) {

               $level_18a_percent = 9; 

             }

             else {

               $level_18a_percent = 14;

             }



             if ($percent_amount == $level_18a_percent) {



                $level_18a_release_percent = 0;

                $level_18a_amount = 0;

                $step18_amount = 0;



                

             }else {



                if ($check_level_18 == 0) {

                  $level_18a_release_percent = 0;

                  $level_18a_amount = $total_x18a;

                  $step18_amount = 0;

                }

                else {

                  $level_18a_release_percent = $percent_amount - $level_18a_percent;

                  $level_18a_amount = $total_x18a;

                  $percentin_tds_roi_process_step18 = $level_18a_release_percent / 100;       

                 //Get the result.

                  $step18_amount = $percentin_tds_roi_process_step18 * $level_18a_amount;

                }

             }



             //get level position18a amount

             //get level position19a amount



             if ($total_oagrbv_19 < 30000) {

               $level_19a_percent = 6; 

             }

             elseif ($total_oagrbv_19 < 75000) {

               $level_19a_percent = 9; 

             }

             else {

               $level_19a_percent = 14;

             }



             if ($percent_amount == $level_19a_percent) {



                $level_19a_release_percent = 0;

                $level_19a_amount = 0;

                $step19_amount = 0;



                

             }else {



                if ($check_level_19 == 0) {

                  $level_19a_release_percent = 0;

                  $level_19a_amount = $total_x19a;

                  $step19_amount = 0;

                }

                else {

                  $level_19a_release_percent = $percent_amount - $level_19a_percent;

                  $level_19a_amount = $total_x19a;



                  $percentin_tds_roi_process_step19 = $level_19a_release_percent / 100;       

                 //Get the result.

                  $step19_amount = $percentin_tds_roi_process_step19 * $level_19a_amount;

                }

             }



             //get level position19a amount



             //get level position20a amount



             if ($total_oagrbv_20 < 30000) {

               $level_20a_percent = 6; 

             }

             elseif ($total_oagrbv_20 < 75000) {

               $level_20a_percent = 9; 

             }

             else {

               $level_20a_percent = 14;

             }



             if ($percent_amount == $level_20a_percent) {



                $level_20a_release_percent = 0;

                $level_20a_amount = 0;

                $step20_amount = 0;



                

             }else {



                if ($check_level_20 == 0) {

                  $level_20a_release_percent = 0;

                  $level_20a_amount = $total_x20a;

                  $step20_amount = 0;

                }

                else {

                  $level_20a_release_percent = $percent_amount - $level_20a_percent;

                  $level_20a_amount = $total_x20a;

                  $percentin_tds_roi_process_step20 = $level_20a_release_percent / 100;       

                 //Get the result.

                  $step20_amount = $percentin_tds_roi_process_step20 * $level_20a_amount;

                }

             }



             //get level position21a amount



             if ($total_oagrbv_21 < 30000) {

               $level_21a_percent = 6; 

             }

             elseif ($total_oagrbv_21 < 75000) {

               $level_21a_percent = 9; 

             }

             else {

               $level_21a_percent = 14;

             }



             if ($percent_amount == $level_21a_percent) {



                $level_21a_release_percent = 0;

                $level_21a_amount = 0;

                $step21_amount = 0;



                

             }else {



                if ($check_level_21 == 0) {

                  $level_21a_release_percent = 0;

                  $level_21a_amount = $total_x21a;

                  $step21_amount = 0;

                }

                else {

                  $level_21a_release_percent = $percent_amount - $level_21a_percent;

                  $level_21a_amount = $total_x21a;

                  $percentin_tds_roi_process_step21 = $level_21a_release_percent / 100;       

                 //Get the result.

                  $step21_amount = $percentin_tds_roi_process_step21 * $level_21a_amount;

                }

             }



             //get level position22a amount



             if ($total_oagrbv_22 < 30000) {

               $level_22a_percent = 6; 

             }

             elseif ($total_oagrbv_22 < 75000) {

               $level_22a_percent = 9; 

             }

             else {

               $level_22a_percent = 14;

             }



             if ($percent_amount == $level_22a_percent) {



                $level_22a_release_percent = 0;

                $level_22a_amount = 0;

                $step22_amount = 0;



                

             }else {



                if ($check_level_22 == 0) {

                  $level_22a_release_percent = 0;

                  $level_22a_amount = $total_x22a;

                  $step22_amount = 0;

                }

                else {

                  $level_22a_release_percent = $percent_amount - $level_22a_percent;

                  $level_22a_amount = $total_x22a;

                  $percentin_tds_roi_process_step22 = $level_22a_release_percent / 100;       

                 //Get the result.

                  $step22_amount = $percentin_tds_roi_process_step22 * $level_22a_amount;

                }

             }



             //get level position23a amount



             if ($total_oagrbv_23 < 30000) {

               $level_23a_percent = 6; 

             }

             elseif ($total_oagrbv_23 < 75000) {

               $level_23a_percent = 9; 

             }

             else {

               $level_23a_percent = 14;

             }



             if ($percent_amount == $level_23a_percent) {



                $level_23a_release_percent = 0;

                $level_23a_amount = 0;

                $step23_amount = 0;



                

             }else {



                if ($check_level_23 == 0) {

                  $level_23a_release_percent = 0;

                  $level_23a_amount = $total_x23a;

                  $step23_amount = 0;

                }

                else {

                  $level_23a_release_percent = $percent_amount - $level_23a_percent;

                  $level_23a_amount = $total_x23a;

                  $percentin_tds_roi_process_step23 = $level_23a_release_percent / 100;       

                 //Get the result.

                  $step23_amount = $percentin_tds_roi_process_step23 * $level_23a_amount;

                }

             }



             //get level position24a amount



            if ($total_oagrbv_24 < 30000) {

               $level_24a_percent = 6; 

             }

             elseif ($total_oagrbv_24 < 75000) {

               $level_24a_percent = 9; 

             }

             else {

               $level_24a_percent = 14;

             }



             if ($percent_amount == $level_24a_percent) {



                $level_24a_release_percent = 0;

                $level_24a_amount = 0;

                $step24_amount = 0;



                

             }else {



                if ($check_level_24 == 0) {

                  $level_24a_release_percent = 0;

                  $level_24a_amount = $total_x24a;

                  $step24_amount = 0;

                }

                else {

                  $level_24a_release_percent = $percent_amount - $level_24a_percent;

                  $level_24a_amount = $total_x24a;

                  $percentin_tds_roi_process_step24 = $level_24a_release_percent / 100;       

                 //Get the result.

                  $step24_amount = $percentin_tds_roi_process_step24 * $level_24a_amount;

                }

             }



             //get level position25a amount



             if ($total_oagrbv_25 < 30000) {

               $level_25a_percent = 6; 

             }

             elseif ($total_oagrbv_25 < 75000) {

               $level_25a_percent = 9; 

             }

             else {

               $level_25a_percent = 14;

             }



             if ($percent_amount == $level_25a_percent) {



                $level_25a_release_percent = 0;

                $level_25a_amount = 0;

                $step25_amount = 0;



                

             }else {



                if ($check_level_25 == 0) {

                  $level_25a_release_percent = 0;

                  $level_25a_amount = $total_x25a;

                  $step25_amount = 0;

                }

                else {

                  $level_25a_release_percent = $percent_amount - $level_25a_percent;

                  $level_25a_amount = $total_x25a;

                  $percentin_tds_roi_process_step25 = $level_25a_release_percent / 100;       

                 //Get the result.

                  $step25_amount = $percentin_tds_roi_process_step25 * $level_25a_amount;

                }

             }



             //get level position26a amount



             if ($total_oagrbv_26 < 30000) {

               $level_26a_percent = 6; 

             }

             elseif ($total_oagrbv_26 < 75000) {

               $level_26a_percent = 9; 

             }

             else {

               $level_26a_percent = 14;

             }



             if ($percent_amount == $level_26a_percent) {



                $level_26a_release_percent = 0;

                $level_26a_amount = 0;

                $step26_amount = 0;



                

             }else {



                if ($check_level_26 == 0) {

                  $level_26a_release_percent = 0;

                  $level_26a_amount = $total_x26a;

                  $step26_amount = 0;

                }

                else {

                  $level_26a_release_percent = $percent_amount - $level_26a_percent;

                  $level_26a_amount = $total_x26a;

                  $percentin_tds_roi_process_step26 = $level_26a_release_percent / 100;       

                 //Get the result.

                  $step26_amount = $percentin_tds_roi_process_step26 * $level_26a_amount;

                }

             }



             //get level position27a amount



             if ($total_oagrbv_27 < 30000) {

               $level_27a_percent = 6; 

             }

             elseif ($total_oagrbv_27 < 75000) {

               $level_27a_percent = 9; 

             }

             else {

               $level_27a_percent = 14;

             }



             if ($percent_amount == $level_27a_percent) {



                $level_27a_release_percent = 0;

                $level_27a_amount = 0;

                $step27_amount = 0;



                

             }else {



                if ($check_level_27 == 0) {

                  $level_27a_release_percent = 0;

                  $level_27a_amount = $total_x27a;

                  $step27_amount = 0;

                }

                else {

                  $level_27a_release_percent = $percent_amount - $level_27a_percent;

                  $level_27a_amount = $total_x27a;

                  $percentin_tds_roi_process_step27 = $level_27a_release_percent / 100;       

                 //Get the result.

                  $step27_amount = $percentin_tds_roi_process_step27 * $level_27a_amount;

                }

             }



             //get level position28a amount



             if ($total_oagrbv_28 < 30000) {

               $level_28a_percent = 6; 

             }

             elseif ($total_oagrbv_28 < 75000) {

               $level_28a_percent = 9; 

             }

             else {

               $level_28a_percent = 14;

             }



             if ($percent_amount == $level_28a_percent) {



                $level_28a_release_percent = 0;

                $level_28a_amount = 0;

                $step28_amount = 0;



                

             }else {



                if ($check_level_28 == 0) {

                  $level_28a_release_percent = 0;

                  $level_28a_amount = $total_x28a;

                  $step28_amount = 0;

                }

                else {

                  $level_28a_release_percent = $percent_amount - $level_28a_percent;

                  $level_28a_amount = $total_x28a;

                  $percentin_tds_roi_process_step28 = $level_28a_release_percent / 100;       

                 //Get the result.

                  $step28_amount = $percentin_tds_roi_process_step28 * $level_28a_amount;

                }

             }



             //get level position29a amount



             if ($total_oagrbv_29 < 30000) {

               $level_29a_percent = 6; 

             }

             elseif ($total_oagrbv_29 < 75000) {

               $level_29a_percent = 9; 

             }

             else {

               $level_29a_percent = 14;

             }



             if ($percent_amount == $level_29a_percent) {



                $level_29a_release_percent = 0;

                $level_29a_amount = 0;

                $step29_amount = 0;



                

             }else {



                if ($check_level_29 == 0) {

                  $level_29a_release_percent = 0;

                  $level_29a_amount = $total_x29a;

                  $step29_amount = 0;

                }

                else {

                  $level_29a_release_percent = $percent_amount - $level_29a_percent;

                  $level_29a_amount = $total_x29a;

                  $percentin_tds_roi_process_step29 = $level_29a_release_percent / 100;       

                 //Get the result.

                  $step29_amount = $percentin_tds_roi_process_step29 * $level_29a_amount;

                }

             }



             //get level position30a amount



             if ($total_oagrbv_30 < 30000) {

               $level_30a_percent = 6; 

             }

             elseif ($total_oagrbv_30 < 75000) {

               $level_30a_percent = 9; 

             }

             else {

               $level_30a_percent = 14;

             }



             if ($percent_amount == $level_30a_percent) {



                $level_30a_release_percent = 0;

                $level_30a_amount = 0;

                $step30_amount = 0;



                

             }else {



                if ($check_level_30 == 0) {

                  $level_30a_release_percent = 0;

                  $level_30a_amount = $total_x30a;

                  $step30_amount = 0;

                }

                else {

                  $level_30a_release_percent = $percent_amount - $level_30a_percent;

                  $level_30a_amount = $total_x30a;

                  $percentin_tds_roi_process_step30 = $level_30a_release_percent / 100;       

                 //Get the result.

                  $step30_amount = $percentin_tds_roi_process_step30 * $level_30a_amount;

                }

             }



             //total_percent_to_getstep1_amount



             $final_step_amount = $step1_amount+$step2_amount+$step3_amount+$step4_amount+$step5_amount+$step6_amount+$step7_amount+$step8_amount+$step9_amount+$step10_amount+$step11_amount+$step12_amount+$step13_amount+$step14_amount+$step15_amount+$step16_amount+$step17_amount+$step18_amount+$step19_amount+$step20_amount+$step21_amount+$step22_amount+$step23_amount+$step24_amount+$step25_amount+$step26_amount+$step27_amount+$step28_amount+$step29_amount+$step30_amount;



             



             



             $total_single_leg = $personal_pv_join+$p_per_product_x1_10a;



             //total_percent_to_get







             //get level position20a amount



          $current_sv = $total_cur_1+$total_cur_2+$total_cur_3+$total_cur_4+$total_cur_6+$total_cur_7+$total_cur_8+$total_cur_9+$total_cur_10+$total_cur_11+$total_cur_12+$total_cur_13+$total_cur_14+$total_cur_15+$total_cur_16+$total_cur_17+$total_cur_18+$total_cur_19+$total_cur_20+$total_cur_21+$total_cur_22+$total_cur_23+$total_cur_24+$total_cur_25+$total_cur_26+$total_cur_27+$total_cur_28+$total_cur_29+$total_cur_30;



          $current_sv_final = $current_sv+$total_single_leg;





             $percentin_tds_roi_process = $percent_amount / 100;       

             //Get the result.

             $current_release_step = $percentin_tds_roi_process * $total_single_leg;



             $current_release = $current_release_step+$final_step_amount;



            $current_xposition_1 = $x_position_main;

             $select_query_level_1 = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).") AND x_position = '$current_xposition_1' AND roi_amount >= '300'";

                $run_level_1 = mysqli_query($con,$select_query_level_1);

                while($row_level_1 = mysqli_fetch_array($run_level_1)){

                      $level_1_income_1 = $row_level_1['SUM(roi_amount)'];

                      

                }

              $select_query_level_1_products = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND x_position = '$current_xposition_1' AND product_amount >= '300' AND status='0'";

                $run_level_1_products = mysqli_query($con,$select_query_level_1_products);

                while($row_level_1_products = mysqli_fetch_array($run_level_1_products)){

                      $level_1_income_products_1 = $row_level_1_products['SUM(product_amount)'];

                      

                }

                $level_1_income = $level_1_income_products_1+$level_1_income_1;



            $current_xposition_2 = $x_position_main+1;

             $select_query_level_2 = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).") AND x_position = '$current_xposition_2' AND roi_amount >= '300'";

                $run_level_2 = mysqli_query($con,$select_query_level_2);

                while($row_level_2 = mysqli_fetch_array($run_level_2)){

                      $level_2_income_1 = $row_level_2['SUM(roi_amount)'];

                      

                }



                $select_query_level_2_products = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND x_position = '$current_xposition_2' AND product_amount >= '300' AND status='0'";

                $run_level_2_products = mysqli_query($con,$select_query_level_2_products);

                while($row_level_2_products = mysqli_fetch_array($run_level_2_products)){

                      $level_2_income_products_1 = $row_level_2_products['SUM(product_amount)'];

                      

                }



                $level_2_income = $level_2_income_1+$level_2_income_products_1;



           $current_xposition_3 = $x_position_main+1;



           $current_xposition_3a = $x_position_main+12;



             $select_query_level_3 = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).") AND x_position > '$current_xposition_3' AND roi_amount >= '300' AND x_position < '$current_xposition_3a'";

                $run_level_3 = mysqli_query($con,$select_query_level_3);

                while($row_level_3 = mysqli_fetch_array($run_level_3)){

                      $level_3_income_1 = $row_level_3['SUM(roi_amount)'];

                      

                }

                $select_query_level_3_products = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND x_position > '$current_xposition_3' AND product_amount >= '300' AND x_position < '$current_xposition_3a' AND status='0'";

                $run_level_3_products = mysqli_query($con,$select_query_level_3_products);

                while($row_level_3_products = mysqli_fetch_array($run_level_3_products)){

                      $level_3_income_1_products = $row_level_3_products['SUM(product_amount)'];

                      

                }



                $level_3_income = $level_3_income_1+$level_3_income_1_products;



                $current_xposition_4 = $x_position_main+11;



                 $current_xposition_4a = $x_position_main+21;



                   $select_query_level_4 = "select SUM(roi_amount) from roi_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND tree_id > '$tree_id_main' AND member_no not in (".implode(',', $arr1).") AND x_position > '$current_xposition_4' AND roi_amount >= '300' AND x_position < '$current_xposition_4a'";

                      $run_level_4 = mysqli_query($con,$select_query_level_4);

                      while($row_level_4 = mysqli_fetch_array($run_level_4)){

                            $level_4_income_1 = $row_level_4['SUM(roi_amount)'];

                            

                      }



                      $select_query_level_4_products = "select SUM(product_amount) from product_tree where relation_ship_no LIKE '%{$relation_ship_no_main}%' AND member_no <> '$member_no_main' AND product_no not in (".implode(',', $arr1_10a_pro).") AND x_position > '$current_xposition_4' AND product_amount >= '300' AND x_position < '$current_xposition_4a' AND status='0'";

                      $run_level_4_products = mysqli_query($con,$select_query_level_4_products);

                      while($row_level_4_products = mysqli_fetch_array($run_level_4_products)){

                            $level_4_income_1_products = $row_level_4_products['SUM(product_amount)'];

                            

                      }



                      $level_4_income = $level_4_income_1+$level_4_income_1_products;

                        

                         $network_bonus_per_1 = 3;



                         $percentin_network_1 = $network_bonus_per_1 / 100;       

                         //Get the result.

                         $current_1_income_1 = $percentin_network_1 * $level_1_income;





                         $network_bonus_per_2 = 1.5;



                         $percentin_network_2 = $network_bonus_per_2 / 100;       

                         //Get the result.

                         $current_2_income_2 = $percentin_network_2 * $level_2_income;





                         $network_bonus_per_3 = 1;



                         $percentin_network_3 = $network_bonus_per_3 / 100;       

                         //Get the result.

                         $current_3_income_3 = $percentin_network_3 * $level_3_income;





                         $network_bonus_per_4 = 0.5;



                         $percentin_network_4 = $network_bonus_per_4 / 100;       

                         //Get the result.

                         $current_4_income_4 = $percentin_network_4 * $level_4_income;





                         if ($total_single_leg > 300) {



                          $final_hold_net = $total_single_leg-300;



                          $current_net_bo_bv = floor($final_hold_net / 300);



                          $final_percent_bv = $current_net_bo_bv*300;





                          $network_bonus_per_5 = 3;



                         $percentin_network_5 = $network_bonus_per_5 / 100;       

                         //Get the result.

                         $current_5_income_5 = $percentin_network_5 * $final_percent_bv;

                            

                         }

                         else {



                           $current_5_income_5 = 0;



                         }



                        $total_network_bonus = 0;





                        





                        switch ($rank) {

                          case '0':

                            $title_user= "CONSULTANT";

                            break;

                          case '1':

                            $title_user= "CON.MANAGER";

                            break;

                         case '2':

                            $title_user= "CON.SENIOR MANAGER";

                            break;



                          case '3':

                            $title_user= "CON.DIRECTOR";

                            break;

                        case '4':

                            $title_user= "CON.SENIOR DIRECTOR";

                            break;

                        case '5':

                            $title_user= "CON.VICE PRESIDENT";

                            break;

                        case '6':

                            $title_user= "CON.SENIOR VICE PRESIDENT";

                            break;

                        case '7':

                            $title_user= "CON.PRESIDENT";

                            break;

                          

                          default:

                            # code...

                            break;

                        }



                        $select_query_12 = "select * from admin";

                                      $run_12 = mysqli_query($con,$select_query_12);

                                       while ($row_12 = mysqli_fetch_array($run_12)) { 

                                        $network_12 = $row_12['network']; 

                                    }





                        $select_query_net_tree = "select * from net_tree where member_no = '$member_no' AND status = '$network_12'";

                        $run_net_tree = mysqli_query($con,$select_query_net_tree);

                        $check_net_tree = mysqli_num_rows($run_net_tree);







                        //voucher bonus



                        $select_query_voucher_bonus = "select SUM(total_amount) from wallet_payout where member_no = '$member_no' AND status='0'";

                          $run_voucher_bonus = mysqli_query($con,$select_query_voucher_bonus);

                          while($row_voucher_bonus = mysqli_fetch_array($run_voucher_bonus)){ 



                                $total_voucher_bonus = $row_voucher_bonus['SUM(total_amount)']; 

                                

                          }



                          $select_query_voucher_balance = "select SUM(amount) from cart_balance where member_no = '$member_no'";

                          $run_voucher_balance = mysqli_query($con,$select_query_voucher_balance);

                          while($row_voucher_balance = mysqli_fetch_array($run_voucher_balance)){ 



                                $total_voucher_balance = $row_voucher_balance['SUM(amount)']; 

                                

                          } 



                          $available_balance_amt = $total_voucher_bonus+$total_voucher_balance;



                          $select_query_paid_title = "select * from title where member_no = '$member_no'";

                          $run_paid_title = mysqli_query($con,$select_query_paid_title);

                          $check_paid_title = mysqli_num_rows($run_paid_title);





                          $total_grouwth_leg = $growth_leg_1+$growth_leg_2+$growth_leg_3+$growth_leg_4+$growth_leg_5+$growth_leg_6+$growth_leg_7+$growth_leg_8+$growth_leg_9+$growth_leg_10+$growth_leg_11+$growth_leg_12+$growth_leg_13+$growth_leg_14+$growth_leg_15+$growth_leg_16+$growth_leg_17+$growth_leg_18+$growth_leg_19+$growth_leg_20+$growth_leg_21+$growth_leg_22+$growth_leg_23+$growth_leg_24+$growth_leg_25+$growth_leg_26+$growth_leg_27+$growth_leg_28+$growth_leg_29+$growth_leg_30;



                        //voucher bonus





                      





          



        ?> 

        <!DOCTYPE html>

<html lang="en">



<head>

  <meta charset="UTF-8">

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" name="viewport">

  <title>RAKCHABLOOMING</title>

  <!-- General CSS Files -->

  <link rel="stylesheet" href="assets/css/app.min.css">

  <link rel="stylesheet" href="assets/bundles/jqvmap/dist/jqvmap.min.css">

  <link rel="stylesheet" href="assets/bundles/weather-icon/css/weather-icons.min.css">

  <link rel="stylesheet" href="assets/bundles/weather-icon/css/weather-icons-wind.min.css">

  <link rel="stylesheet" href="assets/bundles/summernote/summernote-bs4.css">

  <!-- Template CSS -->

  <link rel="stylesheet" href="assets/css/style.css">

  <link rel="stylesheet" href="assets/css/components.css">

  <!-- Custom style CSS -->

  <link rel="stylesheet" href="assets/css/custom.css">

  <link rel='shortcut icon' type='image/x-icon' href='assets/img/favicon.ico' />

  <style type="text/css">

    .card {

      border-radius: 0 !important;

    }

  </style>

</head>



<body>

  <div class="loader"></div>

  <div id="app">

    <div class="main-wrapper main-wrapper-1">

      <div class="navbar-bg"></div>

      <?php include("includes/header.php"); ?>

      <!-- Main Content -->

      <div class="main-content">

        <section class="section">



          <div class="row">

              <div class="col-xl-12 col-lg-12">

                        <div class="card" style="border-top: 2px solid green;border-bottom: 2px solid green;background-color:#08a7d6;">

                          <div style="font-size: 15px;margin: 0;padding-top: 10px;padding-bottom: 6px;color:#fff;">

                            

                            <div class="card-content">

                              <marquee id="test5" behavior="scroll" direction="left" scrolldelay="200" scrollamount="6" onMouseOver="document.all.test5.stop()" onMouseOut="document.all.test5.start()">



                                  <?php  

                                    $select_query_s2 = "select * from daily";

                                    $run_s2 = mysqli_query($con,$select_query_s2);

                                    $sponser_count_spons = mysqli_num_rows($run_s2);

                                    if ($sponser_count_spons > 0) {

                                       

                                   ?>

                                  <span style="padding-right: 5px;padding-left: 5px;"> *</span>

                                  <?php                                    



                                                    $select_query_s1 = "select * from daily";

                                                    $run_s1 = mysqli_query($con,$select_query_s1);

                                                     

                                                     

                                                     while ($row_s1 = mysqli_fetch_array($run_s1)) {

                                                     

                                                      $id_s1 = $row_s1['id'];

                                                      $date_s1 = $row_s1['date'];

                                                      $category_s1 = $row_s1['category'];

                                                      $message_s1 = $row_s1['message'];



                                              ?>  



                                             <?= $message_s1; ?> 



                                              



                                              

                                              <span style="padding-right: 5px;padding-left: 5px;"> *</span>

                                              <?php } ?>

                                               

                                            <?php }else {

                                              ?>



                                              WELCOME TO RAKCHABLOOMING !!!



                                              <?php

                                            } ?>

                                    </marquee>

                                

                               

                               

                            </div>

                          </div>

                        </div>

                      </div>

          </div>



          <div class="row">

            <div class="col-md-6">



                  

                <div class="card profile-widget card-primary" style="background-color: green;">

                  <div class="profile-widget-header">



                    <?php if ($profile == '') {

                                  ?>

                            <img alt="image" src="img/profiles.png" class="rounded-circle profile-widget-picture">

                        <?php }else {

                            ?>

                            

                           <img alt="image" src="../user_profile/<?= $profile; ?>" class="rounded-circle profile-widget-picture">

                            <?php

                        } ?>





                        <div class="profile-widget-items" >

                            <div class="profile-widget-item">

                              <div class="profile-widget-item-label" style="color: #fff !important;"><?= $name; ?></div>

                              <div class="profile-widget-item-value" style="color: #ffc20f !important;"><?= $user_id; ?></div>

                            </div>

                             <div class="profile-widget-item">



                              <div class="profile-widget-item-label" style="color: #fff !important;">Percentage</div>

                         

                                <div class="profile-widget-item-value" style="color: #ffc20f !important;"><?= $percent_amount; ?>%</div>

                              </div>

                               

                          </div>



                     



                     

                  </div>

                  <div class="profile-widget-description pb-0">

                     

                    <p class="clearfix" style="color: #fff;">

                        <span class="float-left">

                          Paid Title

                        </span>

                        <span class="float-right">

                          <b> <?= $title_user; ?></b> 

                        </span>

                      </p>

                    



                      <p class="clearfix" style="color: #fff;">

                        <span class="float-left">

                          Star Title

                        </span>

                        <span class="float-right">

                           <b> -</b> 

                        </span>

                      </p>



                      <p class="clearfix" style="color: #fff;">

                        <span class="float-left">

                          Founder Title

                        </span>

                        <span class="float-right">

                          <b> -</b> 

                        </span>

                      </p>

                      

                      <p class="clearfix" style="color: #fff;">

                        <span class="float-left">

                          Rolling Title

                        </span>

                        <span class="float-right">

                          <b>



                            <?php if ($check_paid_title > 0) {



                              $select_query_main_aq = "select * from title where member_no = '$member_no'";

                              $run_main_aq = mysqli_query($con,$select_query_main_aq);

                               

                               while ($row_main_aq = mysqli_fetch_array($run_main_aq)) {

                                $title_main_aq = $row_main_aq['title'];                                    

                                 

                                }

                                echo $title_main_aq;





                             } else { ?>



                           <?= $title_user; ?>



                         <?php } ?>

                             



                           </b> 

                        </span>

                      </p>



                      <!-- <?php if ($total_team_pvs < 75000) { ?>



                      <p class="clearfix" style="color: #fff;">

                        <span class="float-left">

                          Remaining Bv For Next Level 

                        </span>

                        <span class="float-right">

                           <b> <?= $next_level_amount-$total_team_pvs; ?> -  <?= $next_ve_per; ?>% </b> 

                        </span>

                      </p>



                      <?php } ?> -->

                    

                  </div>

                  

                </div>

                 

               

            </div>

             

             

            <div class="col-md-6">

                

                <div class="row" style="margin-top: 39px;">

                        <div class="col-xl-6 col-lg-6">

                          <?php if ($login_status == 1) { ?>

                          <div class="card" style="background-color: red !important;">

                          <?php } else { ?>



                            <div class="card" style="background-color: #03799c !important;">



                           <?php } ?>

                            <div class="card-statistic-3">

                               

                              <div class="card-content" style="padding-bottom: 15px;">

                                

                                <span>PERSONAL BV</span>

                                                   <h4 class="card-title" style="margin-top:15px;"><?php 

                                                      echo $total_single_leg+0;

                                                   ?></h4>

                                

                              </div>

                            </div>

                          </div>

                        </div>

                        <div class="col-xl-6 col-lg-6">

                          <div class="card" style="background-color: #03799c !important;">

                            <div class="card-statistic-3">

                               

                              <div class="card-content" style="padding-bottom: 15px;">

                                

                                <span>GROUP BV</span>

                                                   <h4 class="card-title" style="margin-top:15px;"><?php 

                                                     

                                                       echo $total_single_leg_current_view+0;

                                                     

                                                      

                                                   ?></h4>

                                 

                              </div>

                            </div>

                          </div>

                        </div>



                        <?php if ($percent_amount < 14) { ?>

                       

                        <div class="col-xl-6 col-lg-6">

                          <div class="card" style="background-color: #03799c !important;">

                            <div class="card-statistic-3">

                               

                              <div class="card-content" style="padding-bottom: 15px;">

                                

                                <span>AGBV</span>

                                                   <h4 class="card-title" style="margin-top:15px;"><?php 

                                                      echo $total_team_pvs+0;

                                                   ?></h4>

                                

                              </div>

                            </div>

                          </div>

                        </div>

                      <?php } ?>

                        

                        <div class="col-xl-6 col-lg-6">

                          <div class="card" style="background-color: #03799c !important;">

                            <div class="card-statistic-3">

                               

                              <div class="card-content" style="padding-bottom: 15px;">

                                

                                <span>SIDE VOLUME</span>

                                                   <h4 class="card-title" style="margin-top:15px;"><?php



                                                    if ($total_grouwth_leg > 0) {



                                                      



                                                     

                                                      echo $current_sv+0;

                                                    

                                                  }

                                                  else {

                                                    echo "0";

                                                  }



                                                      

                                                   ?></h4>

                                 

                              </div>

                            </div>

                          </div>

                        </div>

                      </div>



                       

            </div>

          </div>



          <div class="row ">

                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      

                                      <span>TOTAL EARNINGS</span>

                                      <h4 class="card-title">Rs. <?= $current_release+$total_network_bonus+0; ?> <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-purple" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                         <span class="mr-2">Rs.                        <?= $current_release+$total_network_bonus+$total_team_pv_total_amount+$total_team_pv_car_bonus+$network_bonus_data+$current_release_data+$total_team_old_total_amount+$total_team_old_amount; ?></span>

                                        

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>

                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span>PERFORMANCE BONUS</span>

                                      <h4 class="card-title">  Rs. 0 <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-orange" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2">Rs.                        <?= $current_release+$total_team_pv_old_binary+0+$current_release_data+$total_team_old_binary_income; ?></span>

                                         

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>

                              <?php if ($check_net_tree > 0) { ?>

                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                     

                                    <div class="card-content">

                                      <span>NETWORK BONUS</span>

                                      <h4 class="card-title" style="color: #fff;font-size: 14px;"><span class="text-nowrap" >this month



                                          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-circle"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg> Qualified

                                          </span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-cyan" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                         

                                        Rs.                        <?= $total_team_pv_proold_ref+0; ?>



                                         

                                          



                                         

                                           



                                         

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>

                              <?php } else {

                                ?>



                                <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                     

                                    <div class="card-content">

                                      <span>NETWORK BONUS</span>

                                      <h4 class="card-title" style="color: #fff;font-size: 14px;">  <span class="text-nowrap" >this month



                                          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg> Pending

                                          </span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-cyan" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                         

                                        Rs.                        <?= $total_team_pv_proold_ref+0; ?>



                                         

                                        



                                         

                                           



                                         

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                                <?php

                              } ?>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span>MANAGER BONUS</span>

                                      <h4 class="card-title"> Rs. 0  <span class="text-nowrap" style="font-size: 14px;">This Month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2">Rs.                        <?= $total_team_pv_manager_bonus+0; ?></span>

                                       

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>

                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span>TOUR BONUS</span>

                                      <h4 class="card-title"> Rs.                          <?= $total_team_old_netpay+0; ?> <span class="text-nowrap" style="font-size: 14px;">Available</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2">Rs.                        <?= $total_team_old_amount+0; ?></span>

                                        

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span>CAR BONUS</span>

                                      <h4 class="card-title">Rs. 0 <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2">Rs. <?= $total_team_pv_car_bonus+0; ?> </span>

                                        

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span>LEADERSHIP BONUS</span>

                                      <h4 class="card-title"> Rs. 0 <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2">Rs. <?= $total_team_pv_leader_bonus+0; ?> </span>

                                        

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span>HOUSE BONUS</span>

                                      <h4 class="card-title"> Rs. 0 <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2">Rs. <?= $total_team_pv_house_bonus+0; ?></span>

                                        

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span>COMMITTEE BONUS</span>

                                      <h4 class="card-title"> Rs. 0 <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2">Rs. <?= $total_team_pv_ups_bonus+$total_team_old_ups_bonus+0; ?> </span>

                                        

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span>PAID AS PRESIDENT BONUS</span>

                                      <h4 class="card-title">Rs. 0 <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2"> Rs. 0 </span>

                                        

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span style="text-transform: uppercase;">Guaranteed Royalty Bonus</span>

                                      <h4 class="card-title">Rs. 0 <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2"> Rs. 0 </span>

                                        

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span style="text-transform: uppercase;">FOUNDER PRESIDENT BONUS</span>

                                      <h4 class="card-title">Rs. 0 <span class="text-nowrap" style="font-size: 14px;">this month</span></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2"> Rs. 0 </span>

                                         

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>



                              <div class="col-xl-3 col-lg-6">

                                <div class="card" style="background-color: #08a7d6;">

                                  <div class="card-statistic-3">

                                    

                                    <div class="card-content">

                                      <span style="text-transform: uppercase;">Voucher Bonus</span>

                                      <h4 class="card-title">Rs. <?= $available_balance_amt+0; ?></h4>

                                      

                                      <div class="progress mt-1 mb-1" data-height="1">

                                        <div class="progress-bar l-bg-green" role="progressbar" data-width="100%" aria-valuenow="100"

                                          aria-valuemin="0" aria-valuemax="100"></div>

                                      </div>

                                      <p class="mb-0 text-sm">

                                        <span class="mr-2"> </span>

                                        <span class="text-nowrap">available</span>

                                      </p>

                                    </div>

                                  </div>

                                </div>

                              </div>

         </div>



          



           

          

          





           

          

           

           

        </section>

        

      </div>

      <footer class="main-footer">

        <div class="footer-left">

          Copyright &copy; 2021 <div class="bullet"></div> All Rights Reserved.

        </div>

        

      </footer>

    </div>

  </div>

  <!-- General JS Scripts -->

  <script src="assets/js/app.min.js"></script>

  <!-- JS Libraies -->

  <script src="assets/bundles/echart/echarts.js"></script>

  <script src="assets/bundles/chartjs/chart.min.js"></script>

  <!-- Page Specific JS File -->

  <script src="assets/js/page/index.js"></script>

  <!-- Template JS File -->

  <script src="assets/js/scripts.js"></script>

  <!-- Custom JS File -->

  <script src="assets/js/custom.js"></script>

</body>



</html>



<?php } } ?>

Anon7 - 2022
SCDN GOK