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/www/user/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home5/rakcha/www/user//main_home1.php
<?php error_reporting(0); ?>

<?php session_start();?>

<?php 

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

    header("location: ../index.html");

  }

 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'];

        $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) 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)'];

                

          }



          //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_proold_ref = $row_total_team_pv_pro['SUM(referral_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_growth_bonus = $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;



          //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) 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_oagrbv_1 = $total_group_t_1+$total_group_t_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) 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_oagrbv_2 = $total_group_t_2+$total_group_t_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) 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_oagrbv_3 = $total_group_t_3+$total_group_t_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) 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_oagrbv_4 = $total_group_t_4+$total_group_t_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) 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_oagrbv_5 = $total_group_t_5+$total_group_t_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) 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_oagrbv_6 = $total_group_t_6+$total_group_t_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) 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_oagrbv_7 = $total_group_t_7+$total_group_t_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) 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_oagrbv_8 = $total_group_t_8+$total_group_t_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) 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_oagrbv_9 = $total_group_t_9+$total_group_t_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) 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_oagrbv_10 = $total_group_t_10+$total_group_t_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) 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_oagrbv_11 = $total_group_t_11+$total_group_t_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) 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_oagrbv_12 = $total_group_t_12+$total_group_t_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) 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_oagrbv_13 = $total_group_t_13+$total_group_t_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) 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_oagrbv_14 = $total_group_t_14+$total_group_t_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) 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_oagrbv_15 = $total_group_t_15+$total_group_t_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) 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_oagrbv_16 = $total_group_t_16+$total_group_t_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) 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_oagrbv_17 = $total_group_t_17+$total_group_t_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) 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_oagrbv_18 = $total_group_t_18+$total_group_t_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) 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_oagrbv_19 = $total_group_t_19+$total_group_t_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) 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_oagrbv_20 = $total_group_t_20+$total_group_t_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) 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_oagrbv_21 = $total_group_t_21+$total_group_t_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) 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_oagrbv_22 = $total_group_t_22+$total_group_t_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) 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_oagrbv_23 = $total_group_t_23+$total_group_t_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) 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_oagrbv_24 = $total_group_t_24+$total_group_t_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) 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_oagrbv_25 = $total_group_t_25+$total_group_t_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) 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_oagrbv_26 = $total_group_t_26+$total_group_t_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) 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_oagrbv_27 = $total_group_t_27+$total_group_t_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) 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_oagrbv_28 = $total_group_t_28+$total_group_t_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) 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_oagrbv_29 = $total_group_t_29+$total_group_t_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) 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_oagrbv_30 = $total_group_t_30+$total_group_t_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 < 5000) {

               $percent_amount = 3;

               $next_level_amount = 5000;

               $next_ve_per = 6; 

             }

             elseif ($total_team_pv < 12000) {

               $percent_amount = 6;

               $next_level_amount = 12000; 

               $next_ve_per = 9;

             }



             elseif ($total_team_pv < 30000) {

               $percent_amount = 9;

               $next_level_amount = 30000; 

               $next_ve_per = 12;

             }



             elseif ($total_team_pv < 60000) {

               $percent_amount = 12; 

               $next_level_amount = 60000;

               $next_ve_per = 15;

             }



             elseif ($total_team_pv < 100000) {

               $percent_amount = 15; 

               $next_level_amount = 100000;

               $next_ve_per = 21;

             }



             

             else {

               $percent_amount = 21;

             }





             //get level position1a amount



             if ($total_oagrbv_1 < 5000) {

               $level_1a_percent = 3; 

             }

             elseif ($total_oagrbv_1 < 12000) {

               $level_1a_percent = 6; 

             }



             elseif ($total_oagrbv_1 < 30000) {

               $level_1a_percent = 9; 

             }



             elseif ($total_oagrbv_1 < 60000) {

               $level_1a_percent = 12; 

             }



             elseif ($total_oagrbv_1 < 100000) {

               $level_1a_percent = 15; 

             }



             

             else {

               $level_1a_percent = 21;

             }



             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 < 5000) {

               $level_2a_percent = 3; 

             }

             elseif ($total_oagrbv_2 < 12000) {

               $level_2a_percent = 6; 

             }



             elseif ($total_oagrbv_2 < 30000) {

               $level_2a_percent = 9; 

             }



             elseif ($total_oagrbv_2 < 60000) {

               $level_2a_percent = 12; 

             }



             elseif ($total_oagrbv_2 < 100000) {

               $level_2a_percent = 15; 

             }



             

             else {

               $level_2a_percent = 21;

             }



             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 < 5000) {

               $level_3a_percent = 3; 

             }

             elseif ($total_oagrbv_3 < 12000) {

               $level_3a_percent = 6; 

             }



             elseif ($total_oagrbv_3 < 30000) {

               $level_3a_percent = 9; 

             }



             elseif ($total_oagrbv_3 < 60000) {

               $level_3a_percent = 12; 

             }



             elseif ($total_oagrbv_3 < 100000) {

               $level_3a_percent = 15; 

             }



             

             else {

               $level_3a_percent = 21;

             }



             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 < 5000) {

               $level_4a_percent = 3; 

             }

             elseif ($total_oagrbv_4 < 12000) {

               $level_4a_percent = 6; 

             }



             elseif ($total_oagrbv_4 < 30000) {

               $level_4a_percent = 9; 

             }



             elseif ($total_oagrbv_4 < 60000) {

               $level_4a_percent = 12; 

             }



             elseif ($total_oagrbv_4 < 100000) {

               $level_4a_percent = 15; 

             }



             

             else {

               $level_4a_percent = 21;

             }



             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 < 5000) {

               $level_5a_percent = 3; 

             }

             elseif ($total_oagrbv_5 < 12000) {

               $level_5a_percent = 6; 

             }



             elseif ($total_oagrbv_5 < 30000) {

               $level_5a_percent = 9; 

             }



             elseif ($total_oagrbv_5 < 60000) {

               $level_5a_percent = 12; 

             }



             elseif ($total_oagrbv_5 < 100000) {

               $level_5a_percent = 15; 

             }



             

             else {

               $level_5a_percent = 21;

             }



             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 < 5000) {

               $level_6a_percent = 3; 

             }

             elseif ($total_oagrbv_6 < 12000) {

               $level_6a_percent = 6; 

             }



             elseif ($total_oagrbv_6 < 30000) {

               $level_6a_percent = 9; 

             }



             elseif ($total_oagrbv_6 < 60000) {

               $level_6a_percent = 12; 

             }



             elseif ($total_oagrbv_6 < 100000) {

               $level_6a_percent = 15; 

             }



             

             else {

               $level_6a_percent = 21;

             }



             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 < 5000) {

               $level_7a_percent = 3; 

             }

             elseif ($total_oagrbv_7 < 12000) {

               $level_7a_percent = 6; 

             }



             elseif ($total_oagrbv_7 < 30000) {

               $level_7a_percent = 9; 

             }



             elseif ($total_oagrbv_7 < 60000) {

               $level_7a_percent = 12; 

             }



             elseif ($total_oagrbv_7 < 100000) {

               $level_7a_percent = 15; 

             }



             

             else {

               $level_7a_percent = 21;

             }



             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 < 5000) {

               $level_8a_percent = 3; 

             }

             elseif ($total_oagrbv_8 < 12000) {

               $level_8a_percent = 6; 

             }



             elseif ($total_oagrbv_8 < 30000) {

               $level_8a_percent = 9; 

             }



             elseif ($total_oagrbv_8 < 60000) {

               $level_8a_percent = 12; 

             }



             elseif ($total_oagrbv_8 < 100000) {

               $level_8a_percent = 15; 

             }



             

             else {

               $level_8a_percent = 21;

             }



             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 < 5000) {

               $level_9a_percent = 3; 

             }

             elseif ($total_oagrbv_9 < 12000) {

               $level_9a_percent = 6; 

             }



             elseif ($total_oagrbv_9 < 30000) {

               $level_9a_percent = 9; 

             }



             elseif ($total_oagrbv_9 < 60000) {

               $level_9a_percent = 12; 

             }



             elseif ($total_oagrbv_9 < 100000) {

               $level_9a_percent = 15; 

             }



             

             else {

               $level_9a_percent = 21;

             }



             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 < 5000) {

               $level_10a_percent = 3; 

             }

             elseif ($total_oagrbv_10 < 12000) {

               $level_10a_percent = 6; 

             }



             elseif ($total_oagrbv_10 < 30000) {

               $level_10a_percent = 9; 

             }



             elseif ($total_oagrbv_10 < 60000) {

               $level_10a_percent = 12; 

             }



             elseif ($total_oagrbv_10 < 100000) {

               $level_10a_percent = 15; 

             }



             

             else {

               $level_10a_percent = 21;

             }



             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 < 5000) {

               $level_11a_percent = 3; 

             }

             elseif ($total_oagrbv_11 < 12000) {

               $level_11a_percent = 6; 

             }



             elseif ($total_oagrbv_11 < 30000) {

               $level_11a_percent = 9; 

             }



             elseif ($total_oagrbv_11 < 60000) {

               $level_11a_percent = 12; 

             }



             elseif ($total_oagrbv_11 < 100000) {

               $level_11a_percent = 15; 

             }



             

             else {

               $level_11a_percent = 21;

             }



             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 < 5000) {

               $level_12a_percent = 3; 

             }

             elseif ($total_oagrbv_12 < 12000) {

               $level_12a_percent = 6; 

             }



             elseif ($total_oagrbv_12 < 30000) {

               $level_12a_percent = 9; 

             }



             elseif ($total_oagrbv_12 < 60000) {

               $level_12a_percent = 12; 

             }



             elseif ($total_oagrbv_12 < 100000) {

               $level_12a_percent = 15; 

             }



             

             else {

               $level_12a_percent = 21;

             }



             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 < 5000) {

               $level_13a_percent = 3; 

             }

             elseif ($total_oagrbv_13 < 12000) {

               $level_13a_percent = 6; 

             }



             elseif ($total_oagrbv_13 < 30000) {

               $level_13a_percent = 9; 

             }



             elseif ($total_oagrbv_13 < 60000) {

               $level_13a_percent = 12; 

             }



             elseif ($total_oagrbv_13 < 100000) {

               $level_13a_percent = 15; 

             }



             

             else {

               $level_13a_percent = 21;

             }



             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 < 5000) {

               $level_14a_percent = 3; 

             }

             elseif ($total_oagrbv_14 < 12000) {

               $level_14a_percent = 6; 

             }



             elseif ($total_oagrbv_14 < 30000) {

               $level_14a_percent = 9; 

             }



             elseif ($total_oagrbv_14 < 60000) {

               $level_14a_percent = 12; 

             }



             elseif ($total_oagrbv_14 < 100000) {

               $level_14a_percent = 15; 

             }



             

             else {

               $level_14a_percent = 21;

             }



             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 < 5000) {

               $level_15a_percent = 3; 

             }

             elseif ($total_oagrbv_15 < 12000) {

               $level_15a_percent = 6; 

             }



             elseif ($total_oagrbv_15 < 30000) {

               $level_15a_percent = 9; 

             }



             elseif ($total_oagrbv_15 < 60000) {

               $level_15a_percent = 12; 

             }



             elseif ($total_oagrbv_15 < 100000) {

               $level_15a_percent = 15; 

             }



             

             else {

               $level_15a_percent = 21;

             }



             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 < 5000) {

               $level_16a_percent = 3; 

             }

             elseif ($total_oagrbv_16 < 12000) {

               $level_16a_percent = 6; 

             }



             elseif ($total_oagrbv_16 < 30000) {

               $level_16a_percent = 9; 

             }



             elseif ($total_oagrbv_16 < 60000) {

               $level_16a_percent = 12; 

             }



             elseif ($total_oagrbv_16 < 100000) {

               $level_16a_percent = 15; 

             }



             

             else {

               $level_16a_percent = 21;

             }



             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 < 5000) {

               $level_17a_percent = 3; 

             }

             elseif ($total_oagrbv_17 < 12000) {

               $level_17a_percent = 6; 

             }



             elseif ($total_oagrbv_17 < 30000) {

               $level_17a_percent = 9; 

             }



             elseif ($total_oagrbv_17 < 60000) {

               $level_17a_percent = 12; 

             }



             elseif ($total_oagrbv_17 < 100000) {

               $level_17a_percent = 15; 

             }



             

             else {

               $level_17a_percent = 21;

             }



             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 < 5000) {

               $level_18a_percent = 3; 

             }

             elseif ($total_oagrbv_18 < 12000) {

               $level_18a_percent = 6; 

             }



             elseif ($total_oagrbv_18 < 30000) {

               $level_18a_percent = 9; 

             }



             elseif ($total_oagrbv_18 < 60000) {

               $level_18a_percent = 12; 

             }



             elseif ($total_oagrbv_18 < 100000) {

               $level_18a_percent = 15; 

             }



             

             else {

               $level_18a_percent = 21;

             }



             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 < 5000) {

               $level_19a_percent = 3; 

             }

             elseif ($total_oagrbv_19 < 12000) {

               $level_19a_percent = 6; 

             }



             elseif ($total_oagrbv_19 < 30000) {

               $level_19a_percent = 9; 

             }



             elseif ($total_oagrbv_19 < 60000) {

               $level_19a_percent = 12; 

             }



             elseif ($total_oagrbv_19 < 100000) {

               $level_19a_percent = 15; 

             }



             

             else {

               $level_19a_percent = 21;

             }



             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 < 5000) {

               $level_20a_percent = 3; 

             }

             elseif ($total_oagrbv_20 < 12000) {

               $level_20a_percent = 6; 

             }



             elseif ($total_oagrbv_20 < 30000) {

               $level_20a_percent = 9; 

             }



             elseif ($total_oagrbv_20 < 60000) {

               $level_20a_percent = 12; 

             }



             elseif ($total_oagrbv_20 < 100000) {

               $level_20a_percent = 15; 

             }



             

             else {

               $level_20a_percent = 21;

             }



             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 < 5000) {

               $level_21a_percent = 3; 

             }

             elseif ($total_oagrbv_21 < 12000) {

               $level_21a_percent = 6; 

             }



             elseif ($total_oagrbv_21 < 30000) {

               $level_21a_percent = 9; 

             }



             elseif ($total_oagrbv_21 < 60000) {

               $level_21a_percent = 12; 

             }



             elseif ($total_oagrbv_21 < 100000) {

               $level_21a_percent = 15; 

             }



             

             else {

               $level_21a_percent = 21;

             }



             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 < 5000) {

               $level_22a_percent = 3; 

             }

             elseif ($total_oagrbv_22 < 12000) {

               $level_22a_percent = 6; 

             }



             elseif ($total_oagrbv_22 < 30000) {

               $level_22a_percent = 9; 

             }



             elseif ($total_oagrbv_22 < 60000) {

               $level_22a_percent = 12; 

             }



             elseif ($total_oagrbv_22 < 100000) {

               $level_22a_percent = 15; 

             }



             

             else {

               $level_22a_percent = 21;

             }



             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 < 5000) {

               $level_23a_percent = 3; 

             }

             elseif ($total_oagrbv_23 < 12000) {

               $level_23a_percent = 6; 

             }



             elseif ($total_oagrbv_23 < 30000) {

               $level_23a_percent = 9; 

             }



             elseif ($total_oagrbv_23 < 60000) {

               $level_23a_percent = 12; 

             }



             elseif ($total_oagrbv_23 < 100000) {

               $level_23a_percent = 15; 

             }



             

             else {

               $level_23a_percent = 21;

             }



             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 < 5000) {

               $level_24a_percent = 3; 

             }

             elseif ($total_oagrbv_24 < 12000) {

               $level_24a_percent = 6; 

             }



             elseif ($total_oagrbv_24 < 30000) {

               $level_24a_percent = 9; 

             }



             elseif ($total_oagrbv_24 < 60000) {

               $level_24a_percent = 12; 

             }



             elseif ($total_oagrbv_24 < 100000) {

               $level_24a_percent = 15; 

             }



             

             else {

               $level_24a_percent = 21;

             }



             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 < 5000) {

               $level_25a_percent = 3; 

             }

             elseif ($total_oagrbv_25 < 12000) {

               $level_25a_percent = 6; 

             }



             elseif ($total_oagrbv_25 < 30000) {

               $level_25a_percent = 9; 

             }



             elseif ($total_oagrbv_25 < 60000) {

               $level_25a_percent = 12; 

             }



             elseif ($total_oagrbv_25 < 100000) {

               $level_25a_percent = 15; 

             }



             

             else {

               $level_25a_percent = 21;

             }



             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 < 5000) {

               $level_26a_percent = 3; 

             }

             elseif ($total_oagrbv_26 < 12000) {

               $level_26a_percent = 6; 

             }



             elseif ($total_oagrbv_26 < 30000) {

               $level_26a_percent = 9; 

             }



             elseif ($total_oagrbv_26 < 60000) {

               $level_26a_percent = 12; 

             }



             elseif ($total_oagrbv_26 < 100000) {

               $level_26a_percent = 15; 

             }



             

             else {

               $level_26a_percent = 21;

             }



             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 < 5000) {

               $level_27a_percent = 3; 

             }

             elseif ($total_oagrbv_27 < 12000) {

               $level_27a_percent = 6; 

             }



             elseif ($total_oagrbv_27 < 30000) {

               $level_27a_percent = 9; 

             }



             elseif ($total_oagrbv_27 < 60000) {

               $level_27a_percent = 12; 

             }



             elseif ($total_oagrbv_27 < 100000) {

               $level_27a_percent = 15; 

             }



             

             else {

               $level_27a_percent = 21;

             }



             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 < 5000) {

               $level_28a_percent = 3; 

             }

             elseif ($total_oagrbv_28 < 12000) {

               $level_28a_percent = 6; 

             }



             elseif ($total_oagrbv_28 < 30000) {

               $level_28a_percent = 9; 

             }



             elseif ($total_oagrbv_28 < 60000) {

               $level_28a_percent = 12; 

             }



             elseif ($total_oagrbv_28 < 100000) {

               $level_28a_percent = 15; 

             }



             

             else {

               $level_28a_percent = 21;

             }



             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 < 5000) {

               $level_29a_percent = 3; 

             }

             elseif ($total_oagrbv_29 < 12000) {

               $level_29a_percent = 6; 

             }



             elseif ($total_oagrbv_29 < 30000) {

               $level_29a_percent = 9; 

             }



             elseif ($total_oagrbv_29 < 60000) {

               $level_29a_percent = 12; 

             }



             elseif ($total_oagrbv_29 < 100000) {

               $level_29a_percent = 15; 

             }



             

             else {

               $level_29a_percent = 21;

             }



             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 < 5000) {

               $level_30a_percent = 3; 

             }

             elseif ($total_oagrbv_30 < 12000) {

               $level_30a_percent = 6; 

             }



             elseif ($total_oagrbv_30 < 30000) {

               $level_30a_percent = 9; 

             }



             elseif ($total_oagrbv_30 < 60000) {

               $level_30a_percent = 12; 

             }



             elseif ($total_oagrbv_30 < 100000) {

               $level_30a_percent = 15; 

             }



             

             else {

               $level_30a_percent = 21;

             }



             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= "MANAGER";

                            break;

                         case '2':

                            $title_user= "SENIOR MANAGER";

                            break;



                          case '3':

                            $title_user= "DIRECTOR";

                            break;

                        case '4':

                            $title_user= "SENIOR DIRECTOR";

                            break;

                        case '5':

                            $title_user= "VICE PRESIDENT";

                            break;

                        case '6':

                            $title_user= "SENIOR VICE PRESIDENT";

                            break;

                        case '7':

                            $title_user= "PRESIDENT";

                            break;

                          

                          default:

                            # code...

                            break;

                        }





                      





          



        ?> 



 <!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    <meta name="description" content="">

    <meta name="author" content="">

    <link rel="icon" href="images/fave.png">



    <title>Welcome - <?= $title; ?><?= $name; ?></title>

    

  <!-- Bootstrap v4.0.0-beta -->

  <link rel="stylesheet" href="assets/vendor_components/bootstrap/dist/css/bootstrap.css">

  

  <!-- font awesome -->

  <link rel="stylesheet" href="assets/vendor_components/font-awesome/css/font-awesome.css">

  

  <!-- ionicons -->

  <link rel="stylesheet" href="assets/vendor_components/Ionicons/css/ionicons.css">

  

  <!-- theme style -->

  <link rel="stylesheet" href="css/master_style.css">

  

  <!-- maximum_admin skins. choose a skin from the css/skins folder instead of downloading all of them to reduce the load. -->

  <link rel="stylesheet" href="css/skins/_all-skins.css">

  

  <!-- morris chart -->

  <link rel="stylesheet" href="assets/vendor_components/morris.js/morris.css">

  

  <!-- jvectormap -->

  <link rel="stylesheet" href="assets/vendor_components/jvectormap/jquery-jvectormap.css">

  

  <!-- date picker -->

  <link rel="stylesheet" href="assets/vendor_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.css">

  

  <!-- daterange picker -->

  <link rel="stylesheet" href="assets/vendor_components/bootstrap-daterangepicker/daterangepicker.css">

  

  <!-- bootstrap wysihtml5 - text editor -->

  <link rel="stylesheet" href="assets/vendor_plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.css">

  



  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->

  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

  <!--[if lt IE 9]>

  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>

  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>

  <![endif]-->



  <!-- google font -->

  <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet">



  <style type="text/css">



   .font_s {

      font-size: 30px !important;

    } 

   

    @media(max-width: 768px){

      .padding_15 {

        padding-left: 5px !important;

        padding-right: 5px !important;

      }

      .font_s {

      font-size: 23px !important;

    }

    }



  </style>



     

  </head>



<body class="skin-purple fixed sidebar-mini sidebar-mini-expand-feature" style="background-image: url(img/bg.jpg);">

<div class="wrapper">



  <header class="main-header">

    <!-- Logo -->

    <a href="main_home.php" class="logo">

      <!-- mini logo for sidebar mini 50x50 pixels -->

      <span class="logo-mini"><img src="../images/resources/logo.png" style="max-width: 47px;padding-top: 3px;"></span>

      <!-- logo for regular state and mobile devices -->

      <span class="logo-lg"><img src="../images/resources/logo.png" style="max-width: 47px;padding-top: 3px;"></span>

    </a>

    <!-- Header Navbar: style can be found in header.less -->

    <nav class="navbar navbar-fixed-top">

      <!-- Sidebar toggle button-->

      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">

        <span class="sr-only">Toggle navigation</span>

      </a>



      <div class="navbar-custom-menu">

        <ul class="nav navbar-nav">

          

          

          <!-- Notifications: style can be found in dropdown.less -->

          <li class="dropdown messages-menu">

            <a href="my_cards.php" class="dropdown-toggle">

              <i class="fa fa-shopping-cart" style="font-size: 18px;"></i>

              <span class="label label-success" style="    position: absolute;top: -1px;margin-left: 15px;text-align: center;font-size: 8px;padding: 2px 3px;line-height: 12px;width: 15px;height: 15px;border-radius: 100%;font-weight: 400;display: grid;">

                <?php

                    $select_query_1_cart = "select * from cart where member_no='$member_no'";

                    $run_1_cart = mysqli_query($con,$select_query_1_cart);

                    $num_right_1_1_cart = mysqli_num_rows($run_1_cart);



                    echo $num_right_1_1_cart;

                ?>

                </span>

            </a>

            

          </li>

          

          <!-- Notifications: style can be found in dropdown.less -->

          <li class="dropdown notifications-menu label-warning">

            <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color: #000;font-weight: 700;">

              

              <span class="d-sm-inline-block "><?= $title; ?><?= $name; ?> - <?= $user_id; ?> <i class="fa fa-angle-down pull-right" style="margin-top:8px;font-size:14px;"></i></span>

            </a>

             

          </li>

          

          <li>

            <a href="logout.php" class="link" data-toggle="tooltip" title="" data-original-title="Logout"><i class="fa fa-power-off"></i></a>

          </li>

        </ul>

      </div>

    </nav>

  </header>

  

  <!-- Left side column. contains the logo and sidebar -->

   <aside class="main-sidebar"  style="background-image: url('img/bg.jpg');background-position: left;background-attachment: fixed;">

    <!-- sidebar: style can be found in sidebar.less -->

    <section class="sidebar">

      

      

      <!-- sidebar menu: : style can be found in sidebar.less -->

      <ul class="sidebar-menu" data-widget="tree">

        

        <li class="active"><a href="main_home.php"><i class="fa fa-dashboard"></i> <span>DASHBOARD</span></a></li>

        <li><a href="new_registeration.php"><i class="fa fa-user-o"></i> <span>ADVANCE REGISTRATION</span></a></li>

        <li class="treeview">

          <a href="#">

            <i class="fa fa-user-o"></i>

            <span>MY PROFILE</span>

            <span class="pull-right-container">

              <i class="fa fa-angle-left pull-right"></i>

            </span>

          </a>

          <ul class="treeview-menu">

            <li><a href="member_view.php"><i class="fa fa-circle-o"></i> <span>VIEW / EDIT PROFILE</span></a></li>

            <li><a href="kyc_upload.php"><i class="fa fa-circle-o"></i> <span>KYC DOCUMENTS</span></a></li>

            <li><a href="change_password.php"><i class="fa fa-circle-o"></i> CHANGE PASSWORD</a></li>

            

            <li><a href="change_e_password.php"><i class="fa fa-circle-o"></i> CHANGE TRANS.PWD</a></li>

            <li><a href="welcome_letter.php"><i class="fa fa fa-circle-o"></i> WELCOME LETTER</a></li>

             

            



         </ul>

        </li>

        

        <li class="treeview">

          <a href="#">

            <i class="fa fa-users"></i>

            <span>GENEALOGY TREE</span>

            <span class="pull-right-container">

              <i class="fa fa-angle-left pull-right"></i>

            </span>

          </a>

          <ul class="treeview-menu">

           

            <li><a href="downline.php"><i class="fa fa-circle-o"></i> GENEALOGY TREE</a></li>

            <li><a href="direct_referrals.php"><i class="fa fa-circle-o"></i> DIRECT LEG</a></li>

            

          </ul>

        </li>



        <li class="treeview">

          <a href="#">

            <i class="fa fa-money"></i>

            <span>PAYMENTS</span>

            <span class="pull-right-container">

              <i class="fa fa-angle-left pull-right"></i>

            </span>

          </a>

          <ul class="treeview-menu">

            

            <li><a href="week_payout.php"><i class="fa fa-circle-o"></i>PAYOUT HISTORY </a></li>

             

            

            

          </ul>

        </li>

        

        

        <li class="treeview">

          <a href="#">

            <i class="fa fa-database"></i>

            <span>KIT BANK</span>

            <span class="pull-right-container">

              <i class="fa fa-angle-left pull-right"></i>

            </span>

          </a>

          <ul class="treeview-menu">

            <li><a href="eproduct_details.php"><i class="fa fa-circle-o"></i> NEW JOIN / VIEW KIT </a></li>

            <li><a href="eproduct_transfer.php"><i class="fa fa-circle-o"></i> KIT TRANSFER</a></li>

            <li><a href="eproduct_request.php"><i class="fa fa-circle-o"></i> BUY KITS/KIT REQ</a></li>

            <li><a href="eproduct_history.php"><i class="fa fa-circle-o"></i> KIT TRANSFER LOG</a></li>            

            <li><a href="eproduct_wallet_history.php"><i class="fa fa-circle-o"></i> KIT REQ HISTORY</a></li>

          </ul>

        </li>

         

        

        <li class="treeview">

          <a href="#">

            <i class="fa fa-shopping-cart"></i>

            <span>SHOP</span>

            <span class="pull-right-container">

              <i class="fa fa-angle-left pull-right"></i>

            </span>

          </a>

          <ul class="treeview-menu">

           

            <li><a href="products.php"><i class="fa fa-circle-o"></i> PRODUCTS</a></li>

            <li><a href="my_orders.php"><i class="fa fa-circle-o"></i> MY ORDERS</a></li>

            

          </ul>

        </li> 

        

         

       

        

         

          

        <li><a href="logout.php"><i class="fa fa-sign-out"></i> <span>Logout</span></a></li>



        

        



      </ul>

    </section>

    

  </aside>



  <!-- Content Wrapper. Contains page content -->

  <div class="content-wrapper">

     



    <!-- Main content -->

    <section class="content">

      <!-- Small boxes (Stat box) -->

      <div class="row">







        <div class="col-md-12">

              <!-- Widget: user widget style 3 -->

              <div class="box box-widget widget-user-3" style="position: relative;">

                <!-- Add the bg color to the header using any of the bg-* classes -->

                <div class="widget-user-header bg-purple" style="background: url('img/profile_bg2.jpg');background-size: cover;min-height: 250px;">

                  <div class="info-user">

                  <p style="font-size: 18px;"><b><?= $name; ?> </b></p>

                  <p style="font-size: 18px;"><b><i class="fa fa-vcard-o" aria-hidden="true"></i> <?= $title_user; ?> - <?= $percent_amount; ?>%</b></p>



                  <p style="font-size: 16px;">PAID TITLE : <b> <?= $title_user; ?></b></p>



                  <p style="font-size: 16px;">STAR TITLE : -</p>



                  <p style="font-size: 16px;">FOUNDER TITLE : -</p>



                  <?php if ($total_team_pv < 100000) { ?>



                  <p style="font-size: 15px;">Remaining Bv For Next Level <?= $next_level_amount-$total_team_pv; ?> -  <?= $next_ve_per; ?>% </p>



                  <?php } ?> 

                   

                  </div>

                  

                  <!-- /.widget-user-image -->

                </div>

                <div class="widget-user-image clearfix" style="position: absolute;top: 3px;right:3px;">



                                               <?php if ($profile == '') {

                                                          ?>

                                                    <img class="img-circle" src="images/1.jpg" alt="">

                                                <?php }else {

                                                    ?>

                                                   <img src="../user_profile/<?= $profile; ?>" class="img-circle">

                                                    <?php

                                                } ?> 



                  </div>

                 

              </div>

              <!-- /.widget-user -->

            </div>



              <div class="col-3 col-xl-3 padding_15">

                        <a href="javascript:;">

                          <?php if ($login_status == 1) {



                            ?>



                            <div class="small-box bg-blue" style="background-color: red;">



                            <?php

                             

                          } else {

                            ?>



                            <div class="small-box bg-blue" style="background-color: green;">



                            <?php

                          }

                           ?>

                           

                              <div class="inner">                           

                                  <p>PERSONAL BV</p>

                                  <h3>

                                      <?php 

                                          echo $total_single_leg+0;

                                       ?>

                                  </h3>

                              </div>



                              <div class="icon">

                                 <i class="fa fa-user"></i>

                              </div>                  

                           </div>

                        </a>

                  </div>

              <div class="col-3 col-xl-3 padding_15">

                        <a href="javascript:;">

                           <div class="small-box bg-blue" style="background-color: green;">

                              <div class="inner">                           

                                  <p>TOTAL GROUP BV</p>

                                  <h3><?php 

                                          echo $total_team_pv+0;

                                       ?></h3>

                              </div>



                              <div class="icon">

                                 <i class="fa fa-users"></i>

                              </div>                  

                           </div>

                        </a>

                  </div>

                  <div class="col-3 col-xl-3 padding_15">

                        <a href="javascript:;">

                           <div class="small-box bg-blue" style="background-color: green;">

                              <div class="inner">                           

                                  <p>CM GROUP BV</p>

                                  <h3><?php 

                                         

                                           echo $total_single_leg_current_view+0;

                                         

                                          

                                       ?></h3>

                              </div>



                              <div class="icon">

                                 <i class="fa fa-users"></i>

                              </div>                  

                           </div>

                        </a>

                  </div>

                  <div class="col-3 col-xl-3 padding_15">

                        <a href="javascript:;">

                           <div class="small-box bg-blue" style="background-color: green;">

                              <div class="inner">                           

                                  <p>CM SIDE VOLUME</p>

                                  <h3>



                                    <?php



                                        if ($total_team_pv >= 0 && $rank > 0) {



                                          



                                        if ($current_sv_final < 75000) {

                                          echo "0";

                                        }

                                        else {

                                          echo $current_sv_final+0;

                                        }

                                      }

                                      else {

                                        echo "0";

                                      }



                                          

                                       ?></h3>

                              </div>



                              <div class="icon">

                                 <i class="fa fa-user-o"></i>

                              </div>                  

                           </div>

                        </a>

                  </div>

                  

             

                



              



           </div>

      <div class="row">

        

        

        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">TOTAL EARNINGS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        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; ?>

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs.  

                            <?= $current_release+$total_network_bonus+0; ?>

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>

        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">PERFORMANCE BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.

                        <?= $current_release+$total_team_pv_old_binary+0+$current_release_data+$total_team_old_binary_income; ?>

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. <?= $current_release+0; ?> 

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>





        <?php  $date = '2021-04-01'; if ($date_of_join < $date) { ?>



        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">NETWORK BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.

                        <?= $total_team_pv_proold_ref+0; ?>

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. 0 

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>



      <?php } ?>

        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">MANAGER BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.

                        <?= $total_team_pv_manager_bonus+0; ?>

                        

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs.

                            0

                          

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>

        

        

        

      </div>

      <div class="row">

        

        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">TOUR BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.

                        <?= $total_team_old_amount+0; ?>

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">Available</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs.

                          <?= $total_team_old_netpay+0; ?>

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>

        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">CAR BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.<?= $total_team_pv_car_bonus; ?>

                        

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. 0 

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>

        

        



        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">LEADERSHIP BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        <?= $total_team_pv_leader_bonus+0; ?>

                        

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. 0 

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>



        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">HOUSE BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.<?= $total_team_pv_house_bonus; ?>

                        

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. 0 

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>



        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">GROWTH LEG BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                       <?= $total_team_pv_growth_bonus+0; ?>

                        

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. 0 

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>



        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">UPS COMMITTEE BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.<?= $total_team_pv_ups_bonus+$total_team_old_ups_bonus; ?>

                        

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. 0 

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>

        

        

        

      </div>



      <div class="row">



        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">PAID AS PRESIDENT BONUS</h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.0

                        

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Month</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. 0 

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>

        

        

        

        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;text-transform: uppercase;">Guaranteed Royalty Bonus </h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.

                        0

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Year</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs. 0

                            

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>

        <div class="col-xl-4">

                <div class="box bg-purple">     

                  <div class="box-body">

                  <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">FOUNDER PRESIDENT BONUS </h5>              

                  </div>

                  <div class="box-footer">

                    <div class="row no-gutters">

                      <div class="col-6 col-sm-6" style="border-right: 1px solid #c7c7c7;">

                        <div class="description-block">

                        <span class="description-text" style="color: #212527;">Total</span>

                        <h5 class="description-header " style="color: #212527;margin-top: 1em;">

                        Rs.

                        0

                        </h5>

                        </div>

                      </div>

                      <div class="col-6 col-sm-6">

                        <div class="description-block">

                          <span class="description-text" style="color: #212527;">This Year</span>

                            <h5 class="description-header" style="color: #212527;margin-top: 1em;">

                            Rs.

                          0

                            </h5>

                        </div>

                      </div>

                    </div>

                  </div>

                </div>

        </div>

        

        

        

      </div>



      <div class="row">



        



        



            <div class="col-xl-1">



            </div>



            <div class="col-xl-5">



              



                 <!-- box -->



                  <div class="box bg-purple" style="background-color: gray !important;">     



                  <div class="box-body">



                    <h5 class="" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;"><img goomoji="1f3af" data-goomoji="1f3af" style="margin:0 0.2ex;vertical-align:middle;max-height:24px" alt="🎯" src="https://mail.google.com/mail/e/1f3af" class="CToWUd">BANK ACCOUNT FOR KIT PURCHASE:</h5>              



                    



                  </div>



                  <!-- /.box-body -->



                  <div class="box-footer">



                    <div class="row no-gutters">



                    <div class="col-12 col-sm-12">



                      <div class="description-block" style="height: 280px;">



                        <h5 style="color: #000;text-align: left;padding: 10px;line-height: 26px;">



                          



                          <u>Name:</u><br>RAKCHABLOOMING FMCG  PRIVATE LIMITED<br>

                          <u>Account Number:</u><br>38384700275<br>

                          <u>Bank Name:</u><br>SBI<br>

                          <u>Branch Name:</u><br>KANNANKURICHI<br>

                          <u>IFSC Code:</u><br>SBIN0017121



                        </h5>



                      



                      </div>



                      <!-- /.description-block -->



                    </div>



                    



                    <!-- /.col -->



                    </div>



                    <!-- /.row -->



                  </div>



                  <!-- /.box-footer -->



                  </div>



                  <!-- /.box -->



            </div>



            <div class="col-xl-5">



              



                 <!-- box -->



                  <div class="box bg-purple" style="background-color: gray !important;">     



                  <div class="box-body">



                    <h5 class="text-center" style="color: #fff;font-size: 18px;margin-top: 0px;margin-bottom: 4px;">Notification</h5>              



                    



                  </div>



                  <!-- /.box-body -->



                  <div class="box-footer">



                    <div class="row no-gutters">



                    <div class="col-12 col-sm-12">



                      <div class="description-block">



                      <marquee id="test1" behavior="scroll" direction="up" scrolldelay="200" scrollamount="6" onMouseOver="document.all.test1.stop()" onMouseOut="document.all.test1.start()" style="height: 280px;">



                       <?php                                    



                            $select_query_client_notify = "select * from daily ORDER BY id DESC";



                            $run_client_notify = mysqli_query($con,$select_query_client_notify);



                             while ($row_client_notify = mysqli_fetch_array($run_client_notify)) {                     



                                                  



                             $message_client_notify = $row_client_notify['message'];



                             



                      ?>  



                      <h5 style="color: #3f51b5;margin-top: 1em;padding-left: 10px;padding-right: 10px;">



                           



                         <?= $message_client_notify; ?> 



                      </h5>



                      <hr>



                      <?php } ?>







                     </marquee>



                      



                      </div>



                      <!-- /.description-block -->



                    </div>



                    



                    <!-- /.col -->



                    </div>



                    <!-- /.row -->



                  </div>



                  <!-- /.box-footer -->



                  </div>



                  <!-- /.box -->



            </div>



            <div class="col-xl-1">



            </div>



        



      </div>

      

       

      

      

     

      

      

      



    </section>

    <!-- /.content -->

  </div>

  <!-- /.content-wrapper -->

  <footer class="main-footer">

    <div class="pull-right d-none d-sm-inline-block">      

    </div>Copyright &copy; 2018. All Rights Reserved.

  </footer>



  

  

  <!-- Add the sidebar's background. This div must be placed immediately after the control sidebar -->

  <div class="control-sidebar-bg"></div>

  

</div>

<!-- ./wrapper -->

    

   

    

  <!-- jQuery 3 -->

  <script src="assets/vendor_components/jquery/dist/jquery.js"></script>

  

  <!-- jQuery UI 1.11.4 -->

  <script src="assets/vendor_components/jquery-ui/jquery-ui.js"></script>

  

  <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->

  <script>

    $.widget.bridge('uibutton', $.ui.button);

  </script>

  

  <!-- popper -->

  <script src="assets/vendor_components/popper/dist/popper.min.js"></script>

  

  <!-- Bootstrap v4.0.0-beta -->

  <script src="assets/vendor_components/bootstrap/dist/js/bootstrap.js"></script>

  

  <!-- Morris.js charts -->

  <script src="assets/vendor_components/raphael/raphael.js"></script>

  <script src="assets/vendor_components/morris.js/morris.js"></script>

  

  <!-- Sparkline -->

  <script src="assets/vendor_components/jquery-sparkline/dist/jquery.sparkline.js"></script>

  

  <!-- jvectormap -->

  <script src="assets/vendor_plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script> 

  <script src="assets/vendor_plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>

  

  <!-- jQuery Knob Chart -->

  <script src="assets/vendor_components/jquery-knob/js/jquery.knob.js"></script>

  

  <!-- daterangepicker -->

  <script src="assets/vendor_components/moment/min/moment.min.js"></script>

  <script src="assets/vendor_components/bootstrap-daterangepicker/daterangepicker.js"></script>

  

  <!-- datepicker -->

  <script src="assets/vendor_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js"></script>

  

  <!-- Bootstrap WYSIHTML5 -->

  <script src="assets/vendor_plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js"></script>

  

  <!-- Slimscroll -->

  <script src="assets/vendor_components/jquery-slimscroll/jquery.slimscroll.js"></script>

  

  <!-- FastClick -->

  <script src="assets/vendor_components/fastclick/lib/fastclick.js"></script>

  

  <!-- maximum_admin App -->

  <script src="js/template.js"></script>

  

  <!-- maximum_admin dashboard demo (This is only for demo purposes) -->

  <script src="js/pages/dashboard.js"></script>

  

  <!-- maximum_admin for demo purposes -->

  <script src="js/demo.js"></script>



  

</body>



</html>

<?php } } ?>


Anon7 - 2022
SCDN GOK