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/control/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home5/rakcha/www/control/billing_amount.php
<?php 

session_start();

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

    header("location: index.php");

 }

 else {

  include("includes/database.php");

  $page_user = $_SESSION['admin_name'];

  if (isset($_POST['product'])) {

      $member_no = $_POST['member_no'];



      $select_query_view = "select * from member where user_id='$member_no'";

      $run_view = mysqli_query($con,$select_query_view);



      $check_sposor_id = mysqli_num_rows($run_view);



       while ($row_view = mysqli_fetch_array($run_view)) {

        

        $user_id_view = $row_view['user_id'];

        $receiver_no = $row_view['member_no'];

      }



      $product1 = $_POST['1'];

      $cp1 = $_POST['cp1'];

      $bv1 = $_POST['bv1'];

      $mrp1 = $_POST['mrp1'];



      $total_amount_1 = $mrp1*$product1;

      $total_cp_1 = $cp1*$product1;

      $total_bv_1 = $bv1*$product1;



      $product2 = $_POST['2'];

      $cp2 = $_POST['cp2'];

      $bv2 = $_POST['bv2'];

      $mrp2 = $_POST['mrp2'];

      $total_amount_2 = $mrp2*$product2;

      $total_cp_2 = $cp2*$product2;

      $total_bv_2 = $bv2*$product2;



      $product3 = $_POST['3'];

      $cp3 = $_POST['cp3'];

      $bv3 = $_POST['bv3'];

      $mrp3 = $_POST['mrp3'];



      $total_amount_3 = $mrp3*$product3;

      $total_cp_3 = $cp3*$product3;

      $total_bv_3 = $bv3*$product3;



      $product4 = $_POST['4'];

      $cp4 = $_POST['cp4'];

      $bv4 = $_POST['bv4'];

      $mrp4 = $_POST['mrp4'];

      $total_amount_4 = $mrp4*$product4;

      $total_cp_4 = $cp4*$product4;

      $total_bv_4 = $bv4*$product4;



      $product5 = $_POST['5'];

      $cp5 = $_POST['cp5'];

      $bv5 = $_POST['bv5'];

      $mrp5 = $_POST['mrp5'];

      $total_amount_5 = $mrp5*$product5;

      $total_cp_5 = $cp5*$product5;

      $total_bv_5 = $bv5*$product5;



      $product6 = $_POST['6'];

      $cp6 = $_POST['cp6'];

      $bv6 = $_POST['bv6'];

      $mrp6 = $_POST['mrp6'];

      $total_amount_6 = $mrp6*$product6;

      $total_cp_6 = $cp6*$product6;

      $total_bv_6 = $bv6*$product6;



      $product7 = $_POST['7'];

      $cp7 = $_POST['cp7'];

      $bv7 = $_POST['bv7'];

      $mrp7 = $_POST['mrp7'];

      $total_amount_7 = $mrp7*$product7;

      $total_cp_7 = $cp7*$product7;

      $total_bv_7 = $bv7*$product7;



      $product8 = $_POST['8'];

      $cp8 = $_POST['cp8'];

      $bv8 = $_POST['bv8'];

      $mrp8 = $_POST['mrp8'];

      $total_amount_8 = $mrp8*$product8;

      $total_cp_8 = $cp8*$product8;

      $total_bv_8 = $bv8*$product8;



      $product9 = $_POST['9'];

      $cp9 = $_POST['cp9'];

      $bv9 = $_POST['bv9'];

      $mrp9 = $_POST['mrp9'];



      $total_amount_9 = $mrp9*$product9;

      $total_cp_9 = $cp9*$product9;

      $total_bv_9 = $bv9*$product9;



      $product10 = $_POST['10'];

      $cp10 = $_POST['cp10'];

      $bv10 = $_POST['bv10'];

      $mrp10 = $_POST['mrp10'];



      $total_amount_10 = $mrp10*$product10;

      $total_cp_10 = $cp10*$product10;

      $total_bv_10 = $bv10*$product10;





      $product11 = $_POST['11'];

      $cp11 = $_POST['cp11'];

      $bv11 = $_POST['bv11'];

      $mrp11 = $_POST['mrp11'];



      $total_amount_11 = $mrp11*$product11;

      $total_cp_11 = $cp11*$product11;

      $total_bv_11 = $bv11*$product11;



      $product12 = $_POST['12'];

      $cp12 = $_POST['cp12'];

      $bv12 = $_POST['bv12'];

      $mrp12 = $_POST['mrp12'];



      $total_amount_12 = $mrp12*$product12;

      $total_cp_12 = $cp12*$product12;

      $total_bv_12 = $bv12*$product12;



      $product13 = $_POST['13'];

      $cp13 = $_POST['cp13'];

      $bv13 = $_POST['bv13'];

      $mrp13 = $_POST['mrp13'];



      $total_amount_13 = $mrp13*$product13;

      $total_cp_13 = $cp13*$product13;

      $total_bv_13 = $bv13*$product13;



      $product14 = $_POST['14'];

      $cp14 = $_POST['cp14'];

      $bv14 = $_POST['bv14'];

      $mrp14 = $_POST['mrp14'];



      $total_amount_14 = $mrp14*$product14;

      $total_cp_14 = $cp14*$product14;

      $total_bv_14 = $bv14*$product14;





      $product15 = $_POST['15'];

      $cp15 = $_POST['cp15'];

      $bv15 = $_POST['bv15'];

      $mrp15 = $_POST['mrp15'];



      $total_amount_15 = $mrp15*$product15;

      $total_cp_15 = $cp15*$product15;

      $total_bv_15 = $bv15*$product15;





      $product16 = $_POST['16'];

      $cp16 = $_POST['cp16'];

      $bv16 = $_POST['bv16'];

      $mrp16 = $_POST['mrp16'];



      $total_amount_16 = $mrp16*$product16;

      $total_cp_16 = $cp16*$product16;

      $total_bv_16 = $bv16*$product16;





      $product17 = $_POST['17'];

      $cp17 = $_POST['cp17'];

      $bv17 = $_POST['bv17'];

      $mrp17 = $_POST['mrp17'];



      $total_amount_17 = $mrp17*$product17;

      $total_cp_17 = $cp17*$product17;

      $total_bv_17 = $bv17*$product17;



      $product18 = $_POST['18'];

      $cp18 = $_POST['cp18'];

      $bv18 = $_POST['bv18'];

      $mrp18 = $_POST['mrp18'];



      $total_amount_18 = $mrp18*$product18;

      $total_cp_18 = $cp18*$product18;

      $total_bv_18 = $bv18*$product18;





      $product19 = $_POST['19'];

      $cp19 = $_POST['cp19'];

      $bv19 = $_POST['bv19'];

      $mrp19 = $_POST['mrp19'];



      $total_amount_19 = $mrp19*$product19;

      $total_cp_19 = $cp19*$product19;

      $total_bv_19 = $bv19*$product19;





      $product20 = $_POST['20'];

      $cp20 = $_POST['cp20'];

      $bv20 = $_POST['bv20'];

      $mrp20 = $_POST['mrp20'];



      $total_amount_20 = $mrp20*$product20;

      $total_cp_20 = $cp20*$product20;

      $total_bv_20 = $bv20*$product20;





      

      $total_amount = $total_amount_1+$total_amount_2+$total_amount_3+$total_amount_4+$total_amount_5+$total_amount_6+$total_amount_7+$total_amount_8+$total_amount_9+$total_amount_10+$total_amount_11+$total_amount_12+$total_amount_13+$total_amount_14+$total_amount_15+$total_amount_16+$total_amount_17+$total_amount_18+$total_amount_19+$total_amount_20;



      $total_cp = $total_cp_1+$total_cp_2+$total_cp_3+$total_cp_4+$total_cp_5+$total_cp_6+$total_cp_7+$total_cp_8+$total_cp_9+$total_cp_10+$total_cp_11+$total_cp_12+$total_cp_13+$total_cp_14+$total_cp_15+$total_cp_16+$total_cp_17+$total_cp_18+$total_cp_19+$total_cp_20;



      $total_bv = $total_bv_1+$total_bv_2+$total_bv_3+$total_bv_4+$total_bv_5+$total_bv_6+$total_bv_7+$total_bv_8+$total_bv_9+$total_bv_10+$total_bv_11+$total_bv_12+$total_bv_13+$total_bv_14+$total_bv_15+$total_bv_16+$total_bv_17+$total_bv_18+$total_bv_19+$total_bv_20;





      $select_query_voucher_bonus = "select SUM(total_amount) from wallet_payout where member_no = '$receiver_no' AND status='0'";

      $run_voucher_bonus = mysqli_query($con,$select_query_voucher_bonus);

      while($row_voucher_bonus = mysqli_fetch_array($run_voucher_bonus)){ 



            $total_voucher_bonus = $row_voucher_bonus['SUM(total_amount)']; 

            

      }



      $select_query_voucher_balance = "select SUM(amount) from cart_balance where member_no = '$receiver_no'";

      $run_voucher_balance = mysqli_query($con,$select_query_voucher_balance);

      while($row_voucher_balance = mysqli_fetch_array($run_voucher_balance)){ 



            $total_voucher_balance = $row_voucher_balance['SUM(amount)']; 

            

      } 



      $available_balance_amt = $total_voucher_bonus+$total_voucher_balance;







      // voucher process



      $voucher_bal = $_POST['voucher'];



      if ($voucher_bal == 1) {



       

        $sub_total = $total_cp;



        $final_total_1 = $total_cp-$available_balance_amt;



        



        if ($final_total_1 < 1) {



          $final_total = 0;

          $total_voc = $total_cp;

           

        }

        else {

          $final_total = $final_total_1;

          $total_voc = $available_balance_amt;

        }



         

      }

      else {



        $sub_total = $total_cp;



        $final_total = $total_cp;



        $total_voc = 0;







      }



      //voucher process



      

  }



  ?>

  <!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="utf-8" />

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

    <meta content="width=device-width, initial-scale=1" name="viewport" />

    <meta name="description" content="RAKCHA | Dashboard" />

    <meta name="author" content="RAKCHA | Dashboard" />

    <title>RAKCHA | Dashboard</title>

    <!-- google font -->

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

  <!-- icons -->

    <link href="assets/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />

    <link href="assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>

  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

    <!-- bootstrap -->

  <link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

    <!-- data tables -->

    <link href="assets/plugins/datatables/plugins/bootstrap/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css"/>

  <!-- Material Design Lite CSS -->

  <link rel="stylesheet" href="assets/plugins/material/material.min.css">

  <link rel="stylesheet" href="assets/css/material_style.css">

  <!-- animation -->

  <link href="assets/css/pages/animate_page.css" rel="stylesheet">

  <!-- Theme Styles -->

    

    <link href="assets/css/style.css" rel="stylesheet" type="text/css" />

    <link href="assets/css/plugins.min.css" rel="stylesheet" type="text/css" />

    <link href="assets/css/responsive.css" rel="stylesheet" type="text/css" />

  <link href="assets/css/theme-color.css" rel="stylesheet" type="text/css" />

    <!--select2-->

    <link href="assets/plugins/select2/css/select2.css" rel="stylesheet" type="text/css" />

    <link href="assets/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />

  <!-- favicon -->

    <link rel="shortcut icon" href="assets/img/favicon.png" />

 </head>

<!-- END HEAD -->

<body class="page-header-fixed sidemenu-closed-hidelogo page-content-white page-md header-white dark-sidebar-color logo-dark">

    <div class="page-wrapper">

        <!-- start header -->

        <div class="page-header navbar navbar-fixed-top">

            <div class="page-header-inner ">

                <!-- logo start -->

                <div class="page-logo">

                    <a href="main_home.php">

                        <img src="../images/resources/logo.png">

                    </a>

                </div>

                <!-- logo end -->

                <ul class="nav navbar-nav navbar-left in">

                    <li><a href="#" class="menu-toggler sidebar-toggler"><i class="icon-menu"></i></a></li>

                </ul>

                

                <!-- start mobile menu -->

                <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">

                    <span></span>

                </a>

               <!-- end mobile menu -->

                <!-- start header menu -->

                <div class="top-menu">

                    <ul class="nav navbar-nav pull-right">

                        

                        <!-- start manage user dropdown -->

                        <li class="dropdown dropdown-user">

                            <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">

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

                                <span class="username username-hide-on-mobile"> Admin </span>

                                <i class="fa fa-angle-down"></i>

                            </a>

                            <ul class="dropdown-menu dropdown-menu-default animated jello">

                                

                                <li>

                                    <a href="logout.php">

                                        <i class="icon-logout"></i> Log Out </a>

                                </li>

                            </ul>

                        </li>

                       

                    </ul>

                </div>

            </div>

        </div>

        <!-- end header -->

        

        <!-- start page container -->

        <div class="page-container">

            <!-- start sidebar menu -->

            <div class="sidebar-container">

                <div class="sidemenu-container navbar-collapse collapse fixed-menu">

                    <div id="remove-scroll">

                        <ul class="sidemenu  page-header-fixed" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" style="padding-top: 20px">

                            <li class="sidebar-toggler-wrapper hide">

                                <div class="sidebar-toggler">

                                    <span></span>

                                </div>

                            </li>

                            

                            <li class="nav-item start active">

                                <a href="main_home.php" class="nav-link nav-toggle">

                                    <i class="material-icons">dashboard</i>

                                    <span class="title">Dashboard</span>

                                    

                                </a>

                                

                            </li>

                            



                            <li class="nav-item">

                                <a href="#" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Members</span> <span class="arrow"></span>

                                </a>

                                <ul class="sub-menu">

                                     

                                    <li class="nav-item">

                                        <a href="member_roi.php" class="nav-link "> <span class="title">Member List</span>

                                        </a>

                                    </li>



                                    <li class="nav-item">

                                        <a href="member_company.php" class="nav-link "> <span class="title">Company Member List</span>

                                        </a>

                                    </li>



                                    <li class="nav-item">

                                        <a href="member_adv.php" class="nav-link "> <span class="title">Advance Registeration</span>

                                        </a>

                                    </li>

                                    

                                </ul>

                            </li>



                             

                           

                             

                            <li class="nav-item">

                                <a href="#" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Payout</span> <span class="arrow"></span>

                                </a>

                                <ul class="sub-menu">

                                    <li class="nav-item">

                                        <a href="weekly_roi.php" class="nav-link "> <span class="title">Payout</span>

                                        </a>

                                    </li>

                                    <li class="nav-item">

                                        <a href="weekly_roi_history.php" class="nav-link "> <span class="title">Payout History</span>

                                        </a>

                                    </li>

                                    

                                </ul>

                            </li>



                            <li class="nav-item">

                                <a href="#" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Kit Bank</span> <span class="arrow"></span>

                                </a>

                                <ul class="sub-menu">

                                     

                                    <li class="nav-item">

                                        <a href="eproduct_request_roi.php" class="nav-link "> <span class="title">KIT Request</span>

                                        </a>

                                    </li>



                                    

                                </ul>

                            </li>



                             



                            

                            



                            



                             

                            



                            



                             

                            



                            <li class="nav-item">

                                <a href="#" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Product Management</span> <span class="arrow"></span>

                                </a>

                                <ul class="sub-menu">

                                    <li class="nav-item">

                                        <a href="invoice_address.php" class="nav-link "> <span class="title">Get Address</span>

                                        </a>

                                    </li>



                                    <li class="nav-item">

                                        <a href="invoice_address_1.php" class="nav-link "> <span class="title">Get Address I</span>

                                        </a>

                                    </li>

                                    

                                    <li class="nav-item">

                                        <a href="billing.php" class="nav-link "> <span class="title">New Billing</span>

                                        </a>

                                    </li>

                                    <li class="nav-item">

                                        <a href="company_binary.php" class="nav-link "> <span class="title">Product Details</span>

                                        </a>

                                    </li>

                                    <li class="nav-item">

                                        <a href="company_roi.php" class="nav-link "> <span class="title">New Orders</span>

                                        </a>

                                    </li>

                                    <li class="nav-item">

                                        <a href="company_roi_approve.php" class="nav-link "> <span class="title">Approved Orders</span>

                                        </a>

                                    </li>

                                    <li class="nav-item">

                                        <a href="company_roi_order.php" class="nav-link "> <span class="title">Orders History</span>

                                        </a>

                                    </li>

                                    

                                </ul>

                            </li>



                            <li class="nav-item">

                                <a href="daily.php" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Daily Updates</span> 

                                </a>

                            </li>

                            <li class="nav-item">

                                <a href="gallery.php" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Gallery</span> 

                                </a>

                            </li>



                             

                            <li class="nav-item">

                                <a href="reward_list.php" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Reward Eligible list</span> 

                                </a>

                            </li>

                            



                            

                             

                             

                             

                            <li class="nav-item">

                                <a href="kyc_documents.php" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">KYC Documents</span> 

                                </a>

                            </li>

                             

                            

                            <li class="nav-item">

                                <a href="change_password.php" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Change Password</span> 

                                </a>

                            </li>



                            <li class="nav-item">

                                <a href="change_trans_password.php" class="nav-link nav-toggle"> <i class="material-icons">event</i>

                                    <span class="title">Change Trans Password</span> 

                                </a>

                            </li>



                           

                        </ul>

                    </div>

                </div>

            </div>

            <!-- end sidebar menu --> 

      <!-- start page content -->

            <div class="page-content-wrapper">

                <div class="page-content">

                    <div class="page-bar">

                        <div class="page-title-breadcrumb">

                            <div class=" pull-left">

                                <div class="page-title">Billing</div>

                            </div>

                            <ol class="breadcrumb page-breadcrumb pull-right">

                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item"  href="index.php">Home</a>&nbsp;<i class="fa fa-angle-right"></i>

                                </li>

                                

                                <li class="active">Billing</li>

                            </ol>

                        </div>

                    </div>

                    



                    <div class="row">

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

                            <div class="card card-topline-aqua">

                                <div class="card-head">

                                    <header>Product Details</header>

                                     

                                </div>

                                <div class="card-body " style="overflow-x: scroll;">

                                   <form class="form-horizontal" method="post" action="billing_amount.php" enctype="multipart/form-data">



                                        

                                         <div class="row">

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

                                                 <div class="form-group">

                                                     <select class="form-control  select2" name="member_no" required>

                                                      <option value="">Enter RC ID</option>

                                                        

                                                           <?php



                                                             $select_query = "select * from member where member_no='$receiver_no'";

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

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

                                                            $s_num = $serial++;

                                                            

                                                            $name = $row['name'];

                                                            $user_id = $row['user_id'];

                                                            $member_no = $row['member_no'];

                                                            

                                                            ?>

                                                        <option selected value="<?= $user_id; ?>"><?= $user_id; ?> - <?= $name; ?></option>

                                                        <?php } ?>

                                                        

                                                     </select>

                                                 </div>

                                                 <div class="form-check">

                                                  <?php



                                                   if ($voucher_bal == 1) { 



                                                   ?>

                                                  <input class="form-check-input" type="checkbox" name="voucher" value="1" id="flexCheckDefault" checked>



                                                <?php } else { ?>



                                                  <input class="form-check-input" type="checkbox" name="voucher" value="1" id="flexCheckDefault">



                                                  <?php



                                                } ?>

                                                  <label class="form-check-label" for="flexCheckDefault">

                                                    Voucher Balance = Rs.<?= $available_balance_amt+0; ?>

                                                  </label>

                                                </div>

                                             </div>

                                         </div>

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

                                          <br>

                                              <table class="table table-striped table-bordered table-hover table-checkable order-column" style="width: 100%; scroll:auto;">

                                        <thead>

                                            <tr>

                                                

                                                <th>QTY</th>

                                                

                                                <th> Product Title </th>        

                                                <th> CP </th>

                                                <th>BV</th>

                                                <th> MRP </th>

                                                

                                                

                                                

                                            </tr>

                                        </thead>

                                        <tbody>

                                            <?php 

                                              $select_query = "select * from products";

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

                                               $serial = 1;

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

                                                $s_num = $serial++;

                                                $product_id = $row['product_id'];

                                                $product_title = $row['product_title'];

                                                $cp = $row['cp'];

                                                $bv = $row['bv'];

                                                $mrp = $row['mrp'];

                                                $image = $row['image'];

                                                



                                                

                                                

                                           ?>

                                            <tr class="odd gradeX">

                                                

                                              <td>

                                                 <input type="number" name="<?= $product_id; ?>" class="form-control" value="<?php echo $_POST[$product_id]; ?>">

                                                 <input type="hidden" name="cp<?= $product_id; ?>" class="form-control" value="<?= $cp; ?>">

                                                 <input type="hidden" name="bv<?= $product_id; ?>" class="form-control" value="<?= $bv; ?>">

                                                 <input type="hidden" name="mrp<?= $product_id; ?>" class="form-control" value="<?= $mrp; ?>"> 

                                              </td>

                                              <td style="text-transform: uppercase;"><?= $product_title; ?></td>

                                              

                                              <td><?= $cp; ?></td>

                                              <td><?= $bv; ?></td>

                                              <td><?= $mrp; ?></td>

                                              

                                              

                                              

                                              



                                                

                                            </tr>

                                            <?php } ?>

                                        </tbody>

                                    </table> 

                                         </div>



                                         <div class="form-group" style="max-width: 300px;">

                                          <label>Create By</label>

                                          <input type="text" name="create_by" value="OFFICE" class="form-control" required>

                                         </div>



                                         <div class="form-group" style="max-width: 300px;">

                                          <label>Payment Type</label>

                                          



                                          <select class="form-control" name="payment_method" required>



                                            <option value="CARD">CARD</option>

                                            <option value="ONLINE TRANSFER">ONLINE TRANSFER</option>

                                            <option selected value="CASH">CASH</option>

                                            <option value="DD">DD</option>

                                            <option value="PENDING">PENDING</option>

                                          </select>



                                         </div>



                                         <div class="form-group" style="max-width: 300px;">

                                          <label>Select Delivery Type</label>

                                          <select class="form-control" name="delivery_type" onchange="fetch_select1(this.value);" required>

                                            <option value="1">Registered Address</option>

                                            <option value="3">New Address</option>

                                            <option selected value="2">PICKED UP IN PERSON</option>

                                            <option value="4">COURIER</option>

                                          </select>

                                         </div>

                                         <div id="fetch_data"></div>



                                        



                                        <div class="form-group text-right">

                                            <div class="">

                                                <button class="btn btn-danger btn-block waves-effect waves-light" type="submit" style="max-width: 200px;" name="product">Check Bv</button>

                                                <button class="btn btn-success btn-block waves-effect waves-light" type="submit" style="max-width: 200px;" name="check">Checkout</button>

                                            </div>

                                        </div>



                                        

                                    </form>

                                </div>

                            </div>

                        </div>

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

                            <div class="card card-topline-aqua">

                                <div class="card-head">

                                    <span style="display: inline-block;width: 50%;padding-left: 20px;font-size: 16px;">TOTAL BV </span> : <span style="padding-left: 30px;"><?= $total_bv; ?></span>

                                    <span style="display: inline-block;width: 50%;padding-left: 20px;font-size: 16px;">TOTAL MRP </span>  : <span style="padding-left: 30px;"><?= $total_amount; ?></span>



                                    <hr>



                                    <span style="display: inline-block;width: 50%;padding-left: 20px;font-size: 16px;">SUB TOTAL </span>  : <span style="padding-left: 30px;"><?= $sub_total; ?></span>



                                    <span style="display: inline-block;width: 50%;padding-left: 20px;font-size: 16px;">VOUCHER </span>  : <span style="padding-left: 30px;"><?= $total_voc; ?> (-)</span>



                                    <hr>



                                    <span style="display: inline-block;width: 50%;padding-left: 20px;font-size: 16px;">TOTAL CP </span>  : <span style="padding-left: 30px;font-size: 40px;"><?= $final_total; ?></span>

                                     

                                </div>

                                

                            </div>

                        </div>

                    </div>

                    

                    

                </div>

            </div>

            <!-- end page content -->

             

        </div>

        <!-- end page container -->

        <!-- start footer -->

        <div class="page-footer">

            <div class="page-footer-inner"> 2019 &copy; All Rights Reserved.

            </div>

            <div class="scroll-to-top">

                <i class="icon-arrow-up"></i>

            </div>

        </div>

        <!-- end footer -->

    </div>

    <!-- start js include path -->

    <script src="assets/plugins/jquery/jquery.min.js" ></script>

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

    <script src="assets/plugins/jquery-blockui/jquery.blockui.min.js" ></script>

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

    <!-- bootstrap -->

    <script src="assets/plugins/bootstrap/js/bootstrap.min.js" ></script>

    <!-- data tables -->

    <script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>

  <script src="assets/plugins/datatables/plugins/bootstrap/dataTables.bootstrap4.min.js" ></script>

    <script src="assets/js/pages/table/table_data.js" ></script>

    <!-- Common js-->

  <script src="assets/js/app.js" ></script>

    <script src="assets/js/layout.js" ></script>

  <script src="assets/js/theme-color.js" ></script>

  <!-- Material -->

  <script src="assets/plugins/material/material.min.js"></script>

  <!-- animation -->

  <script src="assets/js/pages/ui/animations.js" ></script>

    <script src="assets/plugins/select2/js/select2.js" ></script>

    <script src="assets/js/pages/select2/select2-init.js" ></script>

    <script type="text/javascript">

      function fetch_select1(val)

            {

             $.ajax({

             type: 'post',

             url: 'fetch_data.php',

             data: {

              get_option:val

             },

             success: function (response) {

              document.getElementById("fetch_data").innerHTML=response; 

             }

             });

            }



             $(document).ready(function() {

               $("#search1").keyup(function() {

                var name1 = $('#search1').val();

               if (name1 == "") {

                 

               }

               else {

                 $.ajax({

                 type: "POST",

                 url: "searchname.php",

                 data: {

                     search: name1

                  },

                  success: function(html) {

                        $("#receiver1").html(html).show();

                         }

                        });

             

                   }

             

               });

             

            });

           

    </script>

    <!-- end js include path -->

</body>



</html>

 <?php 

      if (isset($_POST['check'])) {



        $random = rand(4000,5000);

        $random_no = "RC10".$random;



        $member_no_1 = $_POST['member_no'];



        $select_query_view = "select * from member where user_id='$member_no_1'";

        $run_view = mysqli_query($con,$select_query_view);



        $check_sposor_id = mysqli_num_rows($run_view);



         while ($row_view = mysqli_fetch_array($run_view)) {

          

          $user_id_view = $row_view['user_id'];

          $member_no = $row_view['member_no'];

        }



        $create_by = $_POST['create_by'];

        

        $delivery_type = $_POST['delivery_type'];

        $delivery_address = $_POST['delivery_address'];



        $select_query = "select * from roi_tree where member_no='$member_no'";

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

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

          $s_num = $serial++;

          $user_id = $row['user_id'];

          $member_no = $row['member_no'];

          $product_amount = $row['product_amount'];

        }



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

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

          }





                $select_query_count = "select * from product_tree";

                $run_count = mysqli_query($con,$select_query_count);

                $user_count = mysqli_num_rows($run_count);



                $nominee_name_id1 = $user_count + 1;

                $member_no_1 = sprintf('%03d',$nominee_name_id1);

                $product_no = $member_no_1;



          

          



      $product1 = $_POST['1'];

      $cp1 = $_POST['cp1'];

      $bv1 = $_POST['bv1'];

      $mrp1 = $_POST['mrp1'];



      $total_amount_1 = $mrp1*$product1;

      $total_cp_1 = $cp1*$product1;

      $total_bv_1 = $bv1*$product1;



      $product2 = $_POST['2'];

      $cp2 = $_POST['cp2'];

      $bv2 = $_POST['bv2'];

      $mrp2 = $_POST['mrp2'];

      $total_amount_2 = $mrp2*$product2;

      $total_cp_2 = $cp2*$product2;

      $total_bv_2 = $bv2*$product2;



      $product3 = $_POST['3'];

      $cp3 = $_POST['cp3'];

      $bv3 = $_POST['bv3'];

      $mrp3 = $_POST['mrp3'];



      $total_amount_3 = $mrp3*$product3;

      $total_cp_3 = $cp3*$product3;

      $total_bv_3 = $bv3*$product3;



      $product4 = $_POST['4'];

      $cp4 = $_POST['cp4'];

      $bv4 = $_POST['bv4'];

      $mrp4 = $_POST['mrp4'];

      $total_amount_4 = $mrp4*$product4;

      $total_cp_4 = $cp4*$product4;

      $total_bv_4 = $bv4*$product4;



      $product5 = $_POST['5'];

      $cp5 = $_POST['cp5'];

      $bv5 = $_POST['bv5'];

      $mrp5 = $_POST['mrp5'];

      $total_amount_5 = $mrp5*$product5;

      $total_cp_5 = $cp5*$product5;

      $total_bv_5 = $bv5*$product5;



      $product6 = $_POST['6'];

      $cp6 = $_POST['cp6'];

      $bv6 = $_POST['bv6'];

      $mrp6 = $_POST['mrp6'];

      $total_amount_6 = $mrp6*$product6;

      $total_cp_6 = $cp6*$product6;

      $total_bv_6 = $bv6*$product6;



      $product7 = $_POST['7'];

      $cp7 = $_POST['cp7'];

      $bv7 = $_POST['bv7'];

      $mrp7 = $_POST['mrp7'];

      $total_amount_7 = $mrp7*$product7;

      $total_cp_7 = $cp7*$product7;

      $total_bv_7 = $bv7*$product7;



      $product8 = $_POST['8'];

      $cp8 = $_POST['cp8'];

      $bv8 = $_POST['bv8'];

      $mrp8 = $_POST['mrp8'];

      $total_amount_8 = $mrp8*$product8;

      $total_cp_8 = $cp8*$product8;

      $total_bv_8 = $bv8*$product8;



      $product9 = $_POST['9'];

      $cp9 = $_POST['cp9'];

      $bv9 = $_POST['bv9'];

      $mrp9 = $_POST['mrp9'];



      $total_amount_9 = $mrp9*$product9;

      $total_cp_9 = $cp9*$product9;

      $total_bv_9 = $bv9*$product9;



      $product10 = $_POST['10'];

      $cp10 = $_POST['cp10'];

      $bv10 = $_POST['bv10'];

      $mrp10 = $_POST['mrp10'];



      $total_amount_10 = $mrp10*$product10;

      $total_cp_10 = $cp10*$product10;

      $total_bv_10 = $bv10*$product10;





      $product11 = $_POST['11'];

      $cp11 = $_POST['cp11'];

      $bv11 = $_POST['bv11'];

      $mrp11 = $_POST['mrp11'];



      $total_amount_11 = $mrp11*$product11;

      $total_cp_11 = $cp11*$product11;

      $total_bv_11 = $bv11*$product11;



      $product12 = $_POST['12'];

      $cp12 = $_POST['cp12'];

      $bv12 = $_POST['bv12'];

      $mrp12 = $_POST['mrp12'];



      $total_amount_12 = $mrp12*$product12;

      $total_cp_12 = $cp12*$product12;

      $total_bv_12 = $bv12*$product12;



      $product13 = $_POST['13'];

      $cp13 = $_POST['cp13'];

      $bv13 = $_POST['bv13'];

      $mrp13 = $_POST['mrp13'];



      $total_amount_13 = $mrp13*$product13;

      $total_cp_13 = $cp13*$product13;

      $total_bv_13 = $bv13*$product13;



      $product14 = $_POST['14'];

      $cp14 = $_POST['cp14'];

      $bv14 = $_POST['bv14'];

      $mrp14 = $_POST['mrp14'];



      $total_amount_14 = $mrp14*$product14;

      $total_cp_14 = $cp14*$product14;

      $total_bv_14 = $bv14*$product14;



      $product15 = $_POST['15'];

      $cp15 = $_POST['cp15'];

      $bv15 = $_POST['bv15'];

      $mrp15 = $_POST['mrp15'];



      $total_amount_15 = $mrp15*$product15;

      $total_cp_15 = $cp15*$product15;

      $total_bv_15 = $bv15*$product15;



      $product16 = $_POST['16'];

      $cp16 = $_POST['cp16'];

      $bv16 = $_POST['bv16'];

      $mrp16 = $_POST['mrp16'];



      $total_amount_16 = $mrp16*$product16;

      $total_cp_16 = $cp16*$product16;

      $total_bv_16 = $bv16*$product16;





      $product17 = $_POST['17'];

      $cp17 = $_POST['cp17'];

      $bv17 = $_POST['bv17'];

      $mrp17 = $_POST['mrp17'];



      $total_amount_17 = $mrp17*$product17;

      $total_cp_17 = $cp17*$product17;

      $total_bv_17 = $bv17*$product17;



      $product18 = $_POST['18'];

      $cp18 = $_POST['cp18'];

      $bv18 = $_POST['bv18'];

      $mrp18 = $_POST['mrp18'];



      $total_amount_18 = $mrp18*$product18;

      $total_cp_18 = $cp18*$product18;

      $total_bv_18 = $bv18*$product18;







      $product19 = $_POST['19'];

      $cp19 = $_POST['cp19'];

      $bv19 = $_POST['bv19'];

      $mrp19 = $_POST['mrp19'];



      $total_amount_19 = $mrp19*$product19;

      $total_cp_19 = $cp19*$product19;

      $total_bv_19 = $bv19*$product19;



      $product20 = $_POST['20'];

      $cp20 = $_POST['cp20'];

      $bv20 = $_POST['bv20'];

      $mrp20 = $_POST['mrp20'];



      $total_amount_20 = $mrp20*$product20;

      $total_cp_20 = $cp20*$product20;

      $total_bv_20 = $bv20*$product20;





      

      $total_amount = $total_amount_1+$total_amount_2+$total_amount_3+$total_amount_4+$total_amount_5+$total_amount_6+$total_amount_7+$total_amount_8+$total_amount_9+$total_amount_10+$total_amount_11+$total_amount_12+$total_amount_13+$total_amount_14+$total_amount_15+$total_amount_16+$total_amount_17+$total_amount_18+$total_amount_19+$total_amount_20;



      $total_cp = $total_cp_1+$total_cp_2+$total_cp_3+$total_cp_4+$total_cp_5+$total_cp_6+$total_cp_7+$total_cp_8+$total_cp_9+$total_cp_10+$total_cp_11+$total_cp_12+$total_cp_13+$total_cp_14+$total_cp_15+$total_cp_16+$total_cp_17+$total_cp_18+$total_cp_19+$total_cp_20;



      $total_bv = $total_bv_1+$total_bv_2+$total_bv_3+$total_bv_4+$total_bv_5+$total_bv_6+$total_bv_7+$total_bv_8+$total_bv_9+$total_bv_10+$total_bv_11+$total_bv_12+$total_bv_13+$total_bv_14+$total_bv_15+$total_bv_16+$total_bv_17+$total_bv_18+$total_bv_19+$total_bv_20;





      $select_query_voucher_bonus = "select SUM(total_amount) from wallet_payout where member_no = '$member_no' AND status='0'";

      $run_voucher_bonus = mysqli_query($con,$select_query_voucher_bonus);

      while($row_voucher_bonus = mysqli_fetch_array($run_voucher_bonus)){ 



            $total_voucher_bonus = $row_voucher_bonus['SUM(total_amount)']; 

            

      }



      $select_query_voucher_balance = "select SUM(amount) from cart_balance where member_no = '$member_no'";

      $run_voucher_balance = mysqli_query($con,$select_query_voucher_balance);

      while($row_voucher_balance = mysqli_fetch_array($run_voucher_balance)){ 



            $total_voucher_balance = $row_voucher_balance['SUM(amount)']; 

            

      } 



      $available_balance_amt = $total_voucher_bonus+$total_voucher_balance;



      // voucher 





          $voucher_bal = $_POST['voucher'];



          if ($voucher_bal == 1) {



           

            if ($total_cp > $available_balance_amt) {



               $total_voc = $available_balance_amt;



               $balance_voc_amt = 0;



               $payment_method = "CASH & VOUCHER";



                

             }

             else {



                $total_voc = $total_cp;



                $balance_voc_amt = $available_balance_amt-$total_cp;

                $payment_method = "VOUCHER";



             } 



            

            }

          else {



            



            $total_voc = 0;

            $balance_voc_amt = 0;

            $payment_method = $_POST['payment_method'];







          }



      //voucer





      $date_of_join = date("Y-m-d H:i:s");

      $date = date("Y-m-d");

     $year = date("Y");

     $month = date("m");



     $select_query_count = "select * from product_check";

    $run_count = mysqli_query($con,$select_query_count);

    $user_count = mysqli_num_rows($run_count);



    $nominee_name_id1 = $user_count + 1;

    $member_no_1 = sprintf('%03d',$nominee_name_id1);

    $order_code = $member_no_1;

    $final_bv = $total_bv+$product_amount;



      $insert_query = "insert into product_check(member_no, user_id, date, total_amount, bv, year, month, cp, order_code, relese, status, issue_date, create_by, payment_method, delivery_type, delivery_address, random_no, relation_ship_no, x_position, y_position, voucher) values('$member_no', '$user_id', '$date', '$total_amount', '$total_bv', '$year', '$month', '$total_cp', '$order_code', '1', '2', '$date', '$create_by', '$payment_method', '$delivery_type', '$delivery_address', '$random_no', '$relation_ship_no_main', '$x_position_main', '$y_position_main', '$total_voc')";



                if (mysqli_query($con,$insert_query)) {



                  if ($voucher_bal == 1) {



                    mysqli_query($con,"update wallet_payout set status='1' where member_no = '$member_no' AND status='0'");

                    mysqli_query($con,"delete from cart_balance where member_no = '$member_no'");



                  

                   

                }



                if ($balance_voc_amt > 0) {



                    mysqli_query($con,"insert into cart_balance(member_no, amount, date) values('$member_no', '$balance_voc_amt', '$date')");

                    



                  }



              

                   mysqli_query($con, "insert into product_tree(member_no, user_id, relation_ship_no, x_position, y_position, product_amount, product_no, date, month, year) values('$member_no_main', '$user_id_main', '$relation_ship_no_main', '$x_position_main', '$y_position_main', '$total_bv', '$product_no', '$date', '$month', '$year')");

                   

                  mysqli_query($con, "update roi_tree set product_amount='$final_bv', active_base='1' where member_no = '$member_no'");



                  if ($product1 > 0) {

                     $select_query_1 = "select * from products where product_id='1'";

                      $run_1 = mysqli_query($con,$select_query_1);

                      $num_right_1_1 = mysqli_num_rows($run_1);

                       $serial_payment = 1;

                       while ($row_1 = mysqli_fetch_array($run_1)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_1['product_id'];

                        $product_title = $row_1['product_title'];

                        $cp = $row_1['cp'];

                        $bv = $row_1['bv'];

                        $mrp = $row_1['mrp'];

                        $image = $row_1['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product1', '$total_amount_1', '$total_bv_1', '$total_cp_1', '$order_code')");

                      }

                  }



                  if ($product2 > 0) {

                     $select_query_2 = "select * from products where product_id='2'";

                      $run_2 = mysqli_query($con,$select_query_2);

                      $num_right_2_2 = mysqli_num_rows($run_2);

                       $serial_payment = 1;

                       while ($row_2 = mysqli_fetch_array($run_2)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_2['product_id'];

                        $product_title = $row_2['product_title'];

                        $cp = $row_2['cp'];

                        $bv = $row_2['bv'];

                        $mrp = $row_2['mrp'];

                        $image = $row_2['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product2', '$total_amount_2', '$total_bv_2', '$total_cp_2', '$order_code')");

                      }

                    }



                      if ($product3 > 0) {

                     $select_query_3 = "select * from products where product_id='3'";

                      $run_3 = mysqli_query($con,$select_query_3);

                      $num_right_3_3 = mysqli_num_rows($run_3);

                       $serial_payment = 1;

                       while ($row_3 = mysqli_fetch_array($run_3)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_3['product_id'];

                        $product_title = $row_3['product_title'];

                        $cp = $row_3['cp'];

                        $bv = $row_3['bv'];

                        $mrp = $row_3['mrp'];

                        $image = $row_3['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product3', '$total_amount_3', '$total_bv_3', '$total_cp_3', '$order_code')");

                      }

                  }



                  if ($product4 > 0) {

                     $select_query_4 = "select * from products where product_id='4'";

                      $run_4 = mysqli_query($con,$select_query_4);

                      $num_right_4_4 = mysqli_num_rows($run_4);

                       $serial_payment = 1;

                       while ($row_4 = mysqli_fetch_array($run_4)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_4['product_id'];

                        $product_title = $row_4['product_title'];

                        $cp = $row_4['cp'];

                        $bv = $row_4['bv'];

                        $mrp = $row_4['mrp'];

                        $image = $row_4['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product4', '$total_amount_4', '$total_bv_4', '$total_cp_4', '$order_code')");

                      }

                  }



                  if ($product5 > 0) {

                     $select_query_5 = "select * from products where product_id='5'";

                      $run_5 = mysqli_query($con,$select_query_5);

                      $num_right_5_5 = mysqli_num_rows($run_5);

                       $serial_payment = 1;

                       while ($row_5 = mysqli_fetch_array($run_5)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_5['product_id'];

                        $product_title = $row_5['product_title'];

                        $cp = $row_5['cp'];

                        $bv = $row_5['bv'];

                        $mrp = $row_5['mrp'];

                        $image = $row_5['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product5', '$total_amount_5', '$total_bv_5', '$total_cp_5', '$order_code')");

                      }

                  }



                  if ($product6 > 0) {

                     $select_query_6 = "select * from products where product_id='6'";

                      $run_6 = mysqli_query($con,$select_query_6);

                      $num_right_6_6 = mysqli_num_rows($run_6);

                       $serial_payment = 1;

                       while ($row_6 = mysqli_fetch_array($run_6)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_6['product_id'];

                        $product_title = $row_6['product_title'];

                        $cp = $row_6['cp'];

                        $bv = $row_6['bv'];

                        $mrp = $row_6['mrp'];

                        $image = $row_6['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product6', '$total_amount_6', '$total_bv_6', '$total_cp_6', '$order_code')");

                      }

                  }

                  if ($product7 > 0) {

                     $select_query_7 = "select * from products where product_id='7'";

                      $run_7 = mysqli_query($con,$select_query_7);

                      $num_right_7_7 = mysqli_num_rows($run_7);

                       $serial_payment = 1;

                       while ($row_7 = mysqli_fetch_array($run_7)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_7['product_id'];

                        $product_title = $row_7['product_title'];

                        $cp = $row_7['cp'];

                        $bv = $row_7['bv'];

                        $mrp = $row_7['mrp'];

                        $image = $row_7['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product7', '$total_amount_7', '$total_bv_7', '$total_cp_7', '$order_code')");

                      }

                  }



                  if ($product8 > 0) {

                     $select_query_8 = "select * from products where product_id='8'";

                      $run_8 = mysqli_query($con,$select_query_8);

                      $num_right_8_8 = mysqli_num_rows($run_8);

                       $serial_payment = 1;

                       while ($row_8 = mysqli_fetch_array($run_8)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_8['product_id'];

                        $product_title = $row_8['product_title'];

                        $cp = $row_8['cp'];

                        $bv = $row_8['bv'];

                        $mrp = $row_8['mrp'];

                        $image = $row_8['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product8', '$total_amount_8', '$total_bv_8', '$total_cp_8', '$order_code')");

                      }

                  }



                  if ($product9 > 0) {

                     $select_query_9 = "select * from products where product_id='9'";

                      $run_9 = mysqli_query($con,$select_query_9);

                      $num_right_9_9 = mysqli_num_rows($run_9);

                       $serial_payment = 1;

                       while ($row_9 = mysqli_fetch_array($run_9)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_9['product_id'];

                        $product_title = $row_9['product_title'];

                        $cp = $row_9['cp'];

                        $bv = $row_9['bv'];

                        $mrp = $row_9['mrp'];

                        $image = $row_9['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product9', '$total_amount_9', '$total_bv_9', '$total_cp_9', '$order_code')");

                      }

                  }



                  if ($product10 > 0) {

                     $select_query_10 = "select * from products where product_id='10'";

                      $run_10 = mysqli_query($con,$select_query_10);

                      $num_right_10_10 = mysqli_num_rows($run_10);

                       $serial_payment = 1;

                       while ($row_10 = mysqli_fetch_array($run_10)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_10['product_id'];

                        $product_title = $row_10['product_title'];

                        $cp = $row_10['cp'];

                        $bv = $row_10['bv'];

                        $mrp = $row_10['mrp'];

                        $image = $row_10['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product10', '$total_amount_10', '$total_bv_10', '$total_cp_10', '$order_code')");

                      }

                  }



                  if ($product11 > 0) {

                     $select_query_11 = "select * from products where product_id='11'";

                      $run_11 = mysqli_query($con,$select_query_11);

                      $num_right_11_11 = mysqli_num_rows($run_11);

                       $serial_payment = 1;

                       while ($row_11 = mysqli_fetch_array($run_11)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_11['product_id'];

                        $product_title = $row_11['product_title'];

                        $cp = $row_11['cp'];

                        $bv = $row_11['bv'];

                        $mrp = $row_11['mrp'];

                        $image = $row_11['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product11', '$total_amount_11', '$total_bv_11', '$total_cp_11', '$order_code')");

                      }

                  }



                  if ($product12 > 0) {

                     $select_query_12 = "select * from products where product_id='12'";

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

                      $num_right_12_12 = mysqli_num_rows($run_12);

                       $serial_payment = 1;

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

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_12['product_id'];

                        $product_title = $row_12['product_title'];

                        $cp = $row_12['cp'];

                        $bv = $row_12['bv'];

                        $mrp = $row_12['mrp'];

                        $image = $row_12['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product12', '$total_amount_12', '$total_bv_12', '$total_cp_12', '$order_code')");

                      }

                  }





                  if ($product13 > 0) {

                     $select_query_13 = "select * from products where product_id='13'";

                      $run_13 = mysqli_query($con,$select_query_13);

                      $num_right_13_13 = mysqli_num_rows($run_13);

                       $serial_payment = 1;

                       while ($row_13 = mysqli_fetch_array($run_13)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_13['product_id'];

                        $product_title = $row_13['product_title'];

                        $cp = $row_13['cp'];

                        $bv = $row_13['bv'];

                        $mrp = $row_13['mrp'];

                        $image = $row_13['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product13', '$total_amount_13', '$total_bv_13', '$total_cp_13', '$order_code')");

                      }

                  }





                  if ($product14 > 0) {

                     $select_query_14 = "select * from products where product_id='14'";

                      $run_14 = mysqli_query($con,$select_query_14);

                      $num_right_14_14 = mysqli_num_rows($run_14);

                       $serial_payment = 1;

                       while ($row_14 = mysqli_fetch_array($run_14)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_14['product_id'];

                        $product_title = $row_14['product_title'];

                        $cp = $row_14['cp'];

                        $bv = $row_14['bv'];

                        $mrp = $row_14['mrp'];

                        $image = $row_14['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product14', '$total_amount_14', '$total_bv_14', '$total_cp_14', '$order_code')");

                      }

                  }



                  if ($product15 > 0) {

                     $select_query_15 = "select * from products where product_id='15'";

                      $run_15 = mysqli_query($con,$select_query_15);

                      $num_right_15_15 = mysqli_num_rows($run_15);

                       $serial_payment = 1;

                       while ($row_15 = mysqli_fetch_array($run_15)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_15['product_id'];

                        $product_title = $row_15['product_title'];

                        $cp = $row_15['cp'];

                        $bv = $row_15['bv'];

                        $mrp = $row_15['mrp'];

                        $image = $row_15['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product15', '$total_amount_15', '$total_bv_15', '$total_cp_15', '$order_code')");

                      }

                  }





                  if ($product16 > 0) {

                     $select_query_16 = "select * from products where product_id='16'";

                      $run_16 = mysqli_query($con,$select_query_16);

                      $num_right_16_16 = mysqli_num_rows($run_16);

                       $serial_payment = 1;

                       while ($row_16 = mysqli_fetch_array($run_16)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_16['product_id'];

                        $product_title = $row_16['product_title'];

                        $cp = $row_16['cp'];

                        $bv = $row_16['bv'];

                        $mrp = $row_16['mrp'];

                        $image = $row_16['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product16', '$total_amount_16', '$total_bv_16', '$total_cp_16', '$order_code')");

                      }

                  }





                  if ($product17 > 0) {

                     $select_query_17 = "select * from products where product_id='17'";

                      $run_17 = mysqli_query($con,$select_query_17);

                      $num_right_17_17 = mysqli_num_rows($run_17);

                       $serial_payment = 1;

                       while ($row_17 = mysqli_fetch_array($run_17)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_17['product_id'];

                        $product_title = $row_17['product_title'];

                        $cp = $row_17['cp'];

                        $bv = $row_17['bv'];

                        $mrp = $row_17['mrp'];

                        $image = $row_17['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product17', '$total_amount_17', '$total_bv_17', '$total_cp_17', '$order_code')");

                      }

                  }



                  if ($product18 > 0) {

                     $select_query_18 = "select * from products where product_id='18'";

                      $run_18 = mysqli_query($con,$select_query_18);

                      $num_right_18_18 = mysqli_num_rows($run_18);

                       $serial_payment = 1;

                       while ($row_18 = mysqli_fetch_array($run_18)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_18['product_id'];

                        $product_title = $row_18['product_title'];

                        $cp = $row_18['cp'];

                        $bv = $row_18['bv'];

                        $mrp = $row_18['mrp'];

                        $image = $row_18['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product18', '$total_amount_18', '$total_bv_18', '$total_cp_18', '$order_code')");

                      }

                  }





                   if ($product19 > 0) {

                     $select_query_19 = "select * from products where product_id='19'";

                      $run_19 = mysqli_query($con,$select_query_19);

                      $num_right_19_19 = mysqli_num_rows($run_19);

                       $serial_payment = 1;

                       while ($row_19 = mysqli_fetch_array($run_19)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_19['product_id'];

                        $product_title = $row_19['product_title'];

                        $cp = $row_19['cp'];

                        $bv = $row_19['bv'];

                        $mrp = $row_19['mrp'];

                        $image = $row_19['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product19', '$total_amount_19', '$total_bv_19', '$total_cp_19', '$order_code')");

                      }

                  }





                  if ($product20 > 0) {

                     $select_query_20 = "select * from products where product_id='20'";

                      $run_20 = mysqli_query($con,$select_query_20);

                      $num_right_20_20 = mysqli_num_rows($run_20);

                       $serial_payment = 1;

                       while ($row_20 = mysqli_fetch_array($run_20)) {

                        $s_num_payment = $serial_payment++;

                        $product_id = $row_20['product_id'];

                        $product_title = $row_20['product_title'];

                        $cp = $row_20['cp'];

                        $bv = $row_20['bv'];

                        $mrp = $row_20['mrp'];

                        $image = $row_20['image'];





                        mysqli_query($con,"insert into final_order(member_no, user_id, product_code, qty, total_amount, bv, cp, order_code) values('$member_no', '$user_id', '$product_id', '$product20', '$total_amount_20', '$total_bv_20', '$total_cp_20', '$order_code')");

                      }

                  }





                    $_SESSION['order_code'] = $order_code;



                      echo "<script>window.open('invoice_bill.php','_self')</script>";

                }



         

      }





      

 ?>

<?php } ?>

Anon7 - 2022
SCDN GOK