<?php
ob_start();
include('../include/db_conx.php');
isset($_SESSION['admin_login']);
if (!isset($_SESSION['admin_login'])) {
    header("location: auth-login.php");
    exit();
} else {
    include('../include/admin_head.php');

    $BitcoinStatus = $_GET['BitcoinStatus'];
    if($BitcoinStatus == 'true'){
        $msg = 'Bitcoin Info Updated';
        $link = 'withdraw_info.php';
        swal_success($msg,$link);
    }
    $EthereumStatus = $_GET['EthereumStatus'];
    if($EthereumStatus == 'true'){
        $msg = 'Ethereum Info Updated';
        $link = 'withdraw_info.php';
        swal_success($msg,$link);
    }
    $BankStatus = $_GET['BankStatus'];
    if($BankStatus == 'true'){
        $msg = 'Bank Info Updated';
        $link = 'withdraw_info.php';
        swal_success($msg,$link);
    }
    $LitecoinStatus = $_GET['LitecoinStatus'];
    if($LitecoinStatus == 'true'){
        $msg = 'Litecoin Info Updated';
        $link = 'withdraw_info.php';
        swal_success($msg,$link);
    }
    $CreditCardStatus = $_GET['CreditCardStatus'];
    if($CreditCardStatus == 'true'){
        $msg = 'Credit Card Info Updated';
        $link = 'withdraw_info.php';
        swal_success($msg,$link);
    }

?>



    <body>

        <!-- <body data-layout="horizontal"> -->

        <!-- Begin page -->
        <div id="layout-wrapper">

            <?php include('../include/admin_header.php'); ?>

            <!-- ========== Left Sidebar Start ========== -->

            <!-- Left Sidebar End -->
            <?php include('../include/admin_sidebar.php'); ?>



            <!-- ============================================================== -->
            <!-- Start right Content here -->
            <!-- ============================================================== -->
            <div class="main-content">

                <div class="page-content">
                    <div class="container-fluid">

                        <!-- start page title -->
                        <div class="row">
                            <div class="col-12">
                                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                                    <h4 class="mb-sm-0 font-size-18">Withdrawal </h4>

                                    <div class="page-title-right">
                                        <ol class="breadcrumb m-0">
                                            <li class="breadcrumb-item"><a href="javascript: void(0);">Admin</a></li>
                                            <li class="breadcrumb-item active">Withdrawal List</li>
                                        </ol>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- end page title -->





                        <div class="row">
                            <div class="col-lg-12">
                                <div class="card">
                                    <div class="card-header d-flex">
                                        <h4 class="card-title mb-0 flex-grow-1">Start your creative project right plans</h4>
                                        <div class="flex-shrink-0 align-self-end">
                                            <ul class="nav justify-content-end nav-tabs-custom rounded card-header-tabs" id="pills-tab" role="tablist">
                                                <li class="nav-item">
                                                    <a class="nav-link px-3 rounded monthly active" id="monthly" data-bs-toggle="pill" href="#month" role="tab" aria-controls="month" aria-selected="true">Page 1</a>
                                                </li>
                                                <li class="nav-item">
                                                    <a class="nav-link px-3 rounded yearly" id="yearly" data-bs-toggle="pill" href="#year" role="tab" aria-controls="year" aria-selected="false">Page 2</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="card-body">
                                        <div class="tab-content" id="pills-tabContent">
                                            <div class="tab-pane fade active show" id="month" role="tabpanel" aria-labelledby="monthly">
                                                <div class="row">
                                                    <div class="col-xl-3 col-sm-6">
                                                        <div class="card bg-primary mb-xl-0">
                                                            <div class="card-body">
                                                                <div class="p-2">
                                                                    <h3 class=" text-white"><i class = 'fab fa-bitcoin'> </i>  Bitcoin </h3>
                                                                    <form  method = 'POST'>
                                                                    <div class="mt-4 pt-2 text-white">
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Minimum amount:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $b_min_amount?>' name = 'new_b_min_amount'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Maximum amount:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $b_max_amount?>' name = 'new_b_max_amount'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Charges (Fixed):
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $b_charges_fix?>' name = 'new_b_charges_fix'>
                                                                            </p>
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Charges (%):
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $b_charges?>' name = 'new_b_charges'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Duration:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $b_duration?>' name = 'new_b_duration'>
                                                                            </p>

                                                                       
                                                                      
                                                                        </div>
                        
                                                                        <div class="mt-4 pt-2">
                                                                            <button type = 'submit' name = 'bitcoin_submit' class="btn btn-light w-100">Update Info</a>
                                                                        </div>
                                                                </form>

                                                                <?php 
                                                                    if (isset($_POST['bitcoin_submit'])) {
                                                                        $new_b_min_amount = $db_conx->real_escape_string($_POST['new_b_min_amount']);
                                                                        $new_b_max_amount = $db_conx->real_escape_string($_POST['new_b_max_amount']);
                                                                        $new_b_charges_fix = $db_conx->real_escape_string($_POST['new_b_charges_fix']);
                                                                        $new_b_charges = $db_conx->real_escape_string($_POST['new_b_charges']);
                                                                        $new_b_duration = $db_conx->real_escape_string($_POST['new_b_duration']);

                                                                        $sql_edit_b = "UPDATE bitcoin SET min_amount = '$new_b_min_amount',max_amount = '$new_b_max_amount',charges_fix= '$new_b_charges_fix',charges= '$new_b_charges',duration='$new_b_duration'";
                                                                        $query_edit_b = $db_conx->query($sql_edit_b);

                                                                        if($query_edit_b ){
                                                                            header('location:withdraw_info.php?BitcoinStatus=true');
                        
                                                                        }else{
                                                                            echo 'An error has occurred please contact admin';
                                                                        }


                                                                        
                                                                    }

                                                                ?>
                                                                </div>
                                                            </div>
                                                            <!-- end card body -->
                                                        </div>
                                                        <!-- end card -->
                                                    </div>
                                                    <!-- end col -->
        
                                                    <div class="col-xl-3 col-sm-6">
                                                        <div class="card mb-xl-0">
                                                            <div class="card-body">
                                                                <div class="p-2">
                                                                    <h3><i class = 'fab fa-ethereum'> </i>  Ethereum </h3>
                                                                    <form method = 'POST'>
                                                                        <div class="mt-4 pt-2 text-muted">
                                                                        <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle font-size-18 me-2"></i>
                                                                            Minimum amount:
                                                                        <input type="text" class="form-control"  placeholder="100" value = '<?php echo $e_min_amount?>' name = 'new_e_min_amount'>
                                                                        </p>

                                                                        <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle  font-size-18 me-2"></i>
                                                                                Maximum amount:
                                                                            <input type="text" class="form-control "  placeholder="100" value = '<?php echo $e_max_amount?>' name = 'new_e_max_amount'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle font-size-18 me-2"></i>
                                                                                Charges (Fixed):
                                                                            <input type="text" class="form-control"  placeholder="100" value = '<?php echo $e_charges_fix?>' name = 'new_e_charges_fix'>
                                                                            </p>
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle  font-size-18 me-2"></i>
                                                                                Charges (%):
                                                                            <input type="text" class="form-control"  placeholder="100" value = '<?php echo $e_charges?>' name = 'new_e_charges'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle font-size-18 me-2"></i>
                                                                                Duration:
                                                                            <input type="text" class="form-control"  placeholder="100" value = '<?php echo $e_duration?>' name = 'new_e_duration'>
                                                                            </p>
                                                                        </div>
                            
                                                                        <div class="mt-4 pt-2">
                                                                            <button type = 'submit' name = 'eth_submit' class="btn btn-light w-100 ">Update Info</a>
                                                                        </div>
                                                                    </form>


                                                                    <?php 
                                                                        if (isset($_POST['eth_submit'])) {
                                                                            $new_e_min_amount = $db_conx->real_escape_string($_POST['new_e_min_amount']);
                                                                            $new_e_max_amount = $db_conx->real_escape_string($_POST['new_e_max_amount']);
                                                                            $new_e_charges_fix = $db_conx->real_escape_string($_POST['new_e_charges_fix']);
                                                                            $new_e_charges = $db_conx->real_escape_string($_POST['new_e_charges']);
                                                                            $new_e_duration = $db_conx->real_escape_string($_POST['new_e_duration']);

                                                                            $sql_edit_e = "UPDATE ethereum SET min_amount = '$new_e_min_amount',max_amount = '$new_e_max_amount',charges_fix= '$new_e_charges_fix',charges= '$new_e_charges',duration='$new_e_duration'";
                                                                            $query_edit_e = $db_conx->query($sql_edit_e);

                                                                            if($query_edit_e ){
                                                                                header('location:withdraw_info.php?EthereumStatus=true');
                            
                                                                            }else{
                                                                                echo 'An error has occurred please contact admin';
                                                                            }


                                                                            
                                                                        }

                                                                    ?>
                                                                </div>
                                                            </div>
                                                            <!-- end card body -->
                                                        </div>
                                                        <!-- end card -->
                                                    </div>
                                                    <!-- end col -->
        
                                                    <div class="col-xl-3 col-sm-6">
                                                        <div class="card bg-primary mb-xl-0">
                                                            <div class="card-body">
                                                                <div class="p-2">
                                                                    <h3 class=" text-white"><i class = ' fas fa-building  '> </i>  Bank Details </h3>
                                                                    <form method = 'POST'>
                                                                        <div class="mt-4 pt-2 text-white">
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Minimum amount:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $ba_min_amount?>' name = 'new_ba_min_amount'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Maximum amount:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $ba_max_amount?>' name = 'new_ba_max_amount'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Charges (Fixed):
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $ba_charges_fix?>' name = 'new_ba_charges_fix'>
                                                                            </p>
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Charges (%):
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $ba_charges?>' name = 'new_ba_charges'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Duration:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $ba_duration?>' name = 'new_ba_duration'>
                                                                            </p>
                                                                        
                                                                        </div>
                            
                                                                        <div class="mt-4 pt-2">
                                                                            <button type = 'submit' name = 'bank_submit' class="btn btn-light w-100">Update Info</a>
                                                                        </div>
                                                                        </form>

                                                                        <?php 
                                                                        if (isset($_POST['bank_submit'])) {
                                                                            $new_ba_min_amount = $db_conx->real_escape_string($_POST['new_ba_min_amount']);
                                                                            $new_ba_max_amount = $db_conx->real_escape_string($_POST['new_ba_max_amount']);
                                                                            $new_ba_charges_fix = $db_conx->real_escape_string($_POST['new_ba_charges_fix']);
                                                                            $new_ba_charges = $db_conx->real_escape_string($_POST['new_ba_charges']);
                                                                            $new_ba_duration = $db_conx->real_escape_string($_POST['new_ba_duration']);

                                                                            $sql_edit_ba = "UPDATE bank_transfer SET min_amount = '$new_ba_min_amount',max_amount = '$new_ba_max_amount',charges_fix= '$new_ba_charges_fix',charges= '$new_ba_charges',duration='$new_ba_duration'";
                                                                            $query_edit_ba = $db_conx->query($sql_edit_ba);

                                                                            if($query_edit_ba ){
                                                                                header('location:withdraw_info.php?BankStatus=true');
                            
                                                                            }else{
                                                                                echo 'An error has occurred please contact admin';
                                                                            }


                                                                            
                                                                        }

                                                                    ?>
                                                                </div>
                                                            </div>
                                                            <!-- end card body -->
                                                        </div>
                                                        <!-- end card -->
                                                    </div>
                                                    <!-- end col -->
        
                                                    <div class="col-xl-3 col-sm-6">
                                                        <div class="card mb-0">
                                                            <div class="card-body">
                                                                <div class="p-2">
                                                                    <h3><i class = 'fab fa-pushed'> </i>  Litecoin </h3>
                                                                    <form Method = 'POST'>
                                                                        <div class="mt-4 pt-2 text-muted">
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle font-size-18 me-2"></i>
                                                                                Minimum amount:
                                                                            <input type="text" class="form-control"  placeholder="100" value = '<?php echo $l_min_amount?>' name = 'new_l_min_amount'>
                                                                            </p>

                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle  font-size-18 me-2"></i>
                                                                                    Maximum amount:
                                                                            <input type="text" class="form-control "  placeholder="100" value = '<?php echo $l_max_amount?>' name = 'new_l_max_amount'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle font-size-18 me-2"></i>
                                                                                Charges (Fixed):
                                                                            <input type="text" class="form-control"  placeholder="100" value = '<?php echo $l_charges_fix?>' name = 'new_l_charges_fix'>
                                                                            </p>
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle  font-size-18 me-2"></i>
                                                                                Charges (%):
                                                                            <input type="text" class="form-control"  placeholder="100" value = '<?php echo $l_charges?>' name = 'new_l_charges'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle font-size-18 me-2"></i>
                                                                                Duration:
                                                                            <input type="text" class="form-control"  placeholder="100" value = '<?php echo $l_duration?>' name = 'new_l_duration'>
                                                                            </p>
                                                                        </div>
                            
                                                                        <div class="mt-4 pt-2">
                                                                            <button type = 'submit' name = 'ltc_submit' class="btn btn-light w-100 ">Update Info</a>
                                                                        </div>
                                                                    </form>

                                                                    <?php 
                                                                        if (isset($_POST['ltc_submit'])) {
                                                                            $new_l_min_amount = $db_conx->real_escape_string($_POST['new_l_min_amount']);
                                                                            $new_l_max_amount = $db_conx->real_escape_string($_POST['new_l_max_amount']);
                                                                            $new_l_charges_fix = $db_conx->real_escape_string($_POST['new_l_charges_fix']);
                                                                            $new_l_charges = $db_conx->real_escape_string($_POST['new_l_charges']);
                                                                            $new_l_duration = $db_conx->real_escape_string($_POST['new_l_duration']);

                                                                            $sql_edit_l = "UPDATE litecoin SET min_amount = '$new_l_min_amount',max_amount = '$new_l_max_amount',charges_fix= '$new_l_charges_fix',charges= '$new_l_charges',duration='$new_l_duration'";
                                                                            $query_edit_l = $db_conx->query($sql_edit_l);

                                                                            if($sql_edit_l ){
                                                                                header('location:withdraw_info.php?LitecoinStatus=true');
                            
                                                                            }else{
                                                                                echo 'An error has occurred please contact admin';
                                                                            }


                                                                            
                                                                        }

                                                                    ?>
                                                                </div>
                                                            </div>
                                                            <!-- end card body -->
                                                        </div>
                                                        <!-- end card -->
                                                    </div>
                                                    <!-- end col -->
                                                </div>
                                                <!-- end row -->
                                            </div>
                                            <!-- end tab pane -->
                                            <div class="tab-pane fade" id="year" role="tabpanel" aria-labelledby="yearly">
                                                <div class="row">
                                                   
                                   
        
                                                    <div class="col-lg-3">
                                                        <div class="card bg-primary mb-0">
                                                            <div class="card-body">
                                                                <div class="p-2">
                                                                   
                                                                <h3 class=" text-white"><i class = ' fas fa-credit-card '> </i>  Credit Card </h3>
                                                                    <form method = 'POST'>
                                                                        <div class="mt-4 pt-2 text-white">
                                                                        <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Minimum amount:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $l_min_amount?>' name = 'new_l_min_amount'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Maximum amount:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $l_max_amount?>' name = 'new_l_max_amount'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Charges (Fixed):
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $l_charges_fix?>' name = 'new_l_charges_fix'>
                                                                            </p>
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Charges (%):
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $l_charges?>' name = 'new_l_charges'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                                Duration:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $l_duration?>' name = 'new_l_duration'>
                                                                            </p>
                                                                        
                                                                        </div>

                                                                   
                                                                   
                        
                                                                        <div class="mt-4 pt-2">
                                                                            <button type = 'submit' name = 'ltc_submit' class="btn btn-light w-100">Update Info</a>
                                                                        </div>
                                                                        </form>

                                                                        <?php 
                                                                        if (isset($_POST['ltc_submit'])) {
                                                                            $new_l_min_amount = $db_conx->real_escape_string($_POST['new_l_min_amount']);
                                                                            $new_l_max_amount = $db_conx->real_escape_string($_POST['new_l_max_amount']);
                                                                            $new_l_charges_fix = $db_conx->real_escape_string($_POST['new_l_charges_fix']);
                                                                            $new_l_charges = $db_conx->real_escape_string($_POST['new_l_charges']);
                                                                            $new_l_duration = $db_conx->real_escape_string($_POST['new_l_duration']);

                                                                            $sql_edit_l = "UPDATE litecoin SET min_amount = '$new_l_min_amount',max_amount = '$new_l_max_amount',charges_fix= '$new_l_charges_fix',charges= '$new_l_charges',duration='$new_l_duration'";
                                                                            $query_edit_l = $db_conx->query($sql_edit_l);

                                                                            if($query_edit_l){
                                                                                header('location:withdraw_info.php?CreditCardStatus=true');
                            
                                                                            }else{
                                                                                echo 'An error has occurred please contact admin';
                                                                            }


                                                                            
                                                                        }

                                                                    ?>


                                                                </div>
                                                            </div>
                                                            <!-- end card body -->
                                                        </div>
                                                        <!-- end card -->
                                                    </div>
                                                    <!-- end col -->
        
                                                    
                                                </div>
                                            </div>
                                            <!-- end tab pane -->
                                        </div>
                                        <!-- end tab content -->
                                    </div>
                                    <!-- end card body -->
                                </div>
                                <!-- end card -->
                            </div>
                            <!-- end col -->
                        </div>



                        <!-- end table responsive -->
                    </div>
                    <!-- end card body -->
                </div>
                <!-- end card -->
            </div>
            <!-- end col -->
        </div>
        <!-- end row -->
        </div> <!-- container-fluid -->
        </div>
        <!-- End Page-content -->


        <?php include('../include/admin_footer.php'); ?>
        </div>
        <!-- end main content-->

        </div>
        <!-- END layout-wrapper -->




        <!-- Right bar overlay-->
        <div class="rightbar-overlay"></div>

        <script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
        <script src="assets/libs/metismenu/metisMenu.min.js"></script>
        <script src="assets/libs/simplebar/simplebar.min.js"></script>
        <script src="assets/libs/node-waves/waves.min.js"></script>
        <script src="assets/libs/feather-icons/feather.min.js"></script>
        <!-- pace js -->
        <script src="assets/libs/pace-js/pace.min.js"></script>

        <!-- flatpickr js -->
        <script src="assets/libs/flatpickr/flatpickr.min.js"></script>

        <!-- Required datatable js -->
        <script src="assets/libs/datatables.net/js/jquery.dataTables.min.js"></script>
        <script src="assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>

        <!-- Responsive examples -->
        <script src="assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
        <script src="assets/libs/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>

        <!-- init js -->
        <script src="assets/js/pages/invoices-list.init.js"></script>

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

    </html>

<?php  } 

ob_end_flush()?>