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

    $StarterStatus = $_GET['StarterStatus'];
    if($StarterStatus == 'true'){
        $msg = 'Starter Info Updated';
        $link = 'packages.php';
        swal_success($msg,$link);
    }
    $VipStatus = $_GET['VipStatus'];
    if($VipStatus == 'true'){
        $msg = 'VIP Info Updated';
        $link = 'packages.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">Packages </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">Packages 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>
                                    <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-4 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>  <?php echo $s_plan?> </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>
                                                                            Min. Possible deposit:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $s_min_deposit?>' name = 'new_s_min_deposit'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Max. Possible deposit:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $s_max_deposit?>' name = 'new_s_max_deposit'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Minimum return:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $s_min_return?>' name = 'new_s_min_return'>
                                                                            </p>
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Maximum return:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $s_max_return?>' name = 'new_s_max_return'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Gift Bonus:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $s_gift_box?>' name = 'new_s_gift_box'>
                                                                            </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 $s_duration?>' name = 'new_s_duration'>
                                                                            </p>

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

                                                                <?php 
                                                                    if (isset($_POST['submit_starter'])) {
                                                                        $new_s_min_deposit = $db_conx->real_escape_string($_POST['new_s_min_deposit']);
                                                                        $new_s_max_deposit = $db_conx->real_escape_string($_POST['new_s_max_deposit']);
                                                                        $new_s_min_return = $db_conx->real_escape_string($_POST['new_s_min_return']);
                                                                        $new_s_max_return = $db_conx->real_escape_string($_POST['new_s_max_return']);
                                                                        $new_s_gift_box = $db_conx->real_escape_string($_POST['new_s_gift_box']);
                                                                        $new_s_duration = $db_conx->real_escape_string($_POST['new_s_duration']);

                                                                        $sql_edit_b = "UPDATE packages SET min_deposit = '$new_s_min_deposit',max_deposit = '$new_s_max_deposit',min_return= '$new_s_min_return',max_return= '$new_s_max_return',gift_box='$new_s_gift_box',duration = '$new_s_duration' WHERE id = '1'";
                                                                        $query_edit_b = $db_conx->query($sql_edit_b);

                                                                        if($query_edit_b ){
                                                                            header('location:packages.php?StarterStatus=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-4 col-sm-6">
                                                        <div class="card mb-xl-0">
                                                            <div class="card-body">
                                                                <div class="p-2">
                                                                    <h3><i class = 'fab fa-ethereum'> </i>  <?php echo $v_plan?>  </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 text-light font-size-18 me-2"></i>
                                                                            Min. Possible deposit:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $v_min_deposit?>' name = 'new_v_min_deposit'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Max. Possible deposit:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $v_max_deposit?>' name = 'new_v_max_deposit'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Minimum return:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $v_min_return?>' name = 'new_v_min_return'>
                                                                            </p>
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Maximum return:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $v_max_return?>' name = 'new_v_max_return'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Gift Bonus:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $v_gift_box?>' name = 'new_v_gift_box'>
                                                                            </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 $v_duration?>' name = 'new_v_duration'>
                                                                            </p>

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


                                                                    <?php 
                                                                    if (isset($_POST['submit_vip'])) {
                                                                        $new_v_min_deposit = $db_conx->real_escape_string($_POST['new_v_min_deposit']);
                                                                        $new_v_max_deposit = $db_conx->real_escape_string($_POST['new_v_max_deposit']);
                                                                        $new_v_min_return = $db_conx->real_escape_string($_POST['new_v_min_return']);
                                                                        $new_v_max_return = $db_conx->real_escape_string($_POST['new_v_max_return']);
                                                                        $new_v_gift_box = $db_conx->real_escape_string($_POST['new_v_gift_box']);
                                                                        $new_v_duration = $db_conx->real_escape_string($_POST['new_v_duration']);

                                                                        $sql_edit_v = "UPDATE packages SET min_deposit = '$new_v_min_deposit',max_deposit = '$new_v_max_deposit',min_return= '$new_v_min_return',max_return= '$new_v_max_return',gift_box='$new_v_gift_box',duration = '$new_v_duration' WHERE id = '2'";
                                                                        $query_edit_v = $db_conx->query($sql_edit_v);

                                                                        if($query_edit_v ){
                                                                            header('location:packages.php?VipStatus=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-4 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>  <?php echo $g_plan?> </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>
                                                                            Min. Possible deposit:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $g_min_deposit?>' name = 'new_g_min_deposit'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Max. Possible deposit:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $g_max_deposit?>' name = 'new_g_max_deposit'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Minimum return:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $g_min_return?>' name = 'new_g_min_return'>
                                                                            </p>
                                                                        
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Maximum return:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $g_max_return?>' name = 'new_g_max_return'>
                                                                            </p>
                                                                            <p class="mb-3 font-size-15"><i class="mdi mdi-check-circle text-light font-size-18 me-2"></i>
                                                                            Gift Bonus:
                                                                            <input type="text" class="form-control custom-input"  placeholder="100" value = '<?php echo $g_gift_box?>' name = 'new_g_gift_box'>
                                                                            </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 $g_duration?>' name = 'new_g_duration'>
                                                                            </p>
                                                                        
                                                                        </div>
                            
                                                                        <div class="mt-4 pt-2">
                                                                            <button type = 'submit' name = 'submit_gold' class="btn btn-light w-100">Update Info</a>
                                                                        </div>
                                                                        </form>

                                                                        <?php 
                                                                        if (isset($_POST['submit_gold'])) {
                                                                            $new_g_min_deposit = $db_conx->real_escape_string($_POST['new_g_min_deposit']);
                                                                            $new_g_max_deposit = $db_conx->real_escape_string($_POST['new_g_max_deposit']);
                                                                            $new_g_min_return = $db_conx->real_escape_string($_POST['new_g_min_return']);
                                                                            $new_g_max_return = $db_conx->real_escape_string($_POST['new_g_max_return']);
                                                                            $new_g_gift_box = $db_conx->real_escape_string($_POST['new_g_gift_box']);
                                                                            $new_g_duration = $db_conx->real_escape_string($_POST['new_g_duration']);

                                                                            $sql_edit_g = "UPDATE packages SET min_deposit = '$new_g_min_deposit',max_deposit = '$new_g_max_deposit',min_return= '$new_g_min_return',max_return= '$new_g_max_return',gift_box='$new_g_gift_box',duration = '$new_g_duration' WHERE id = '3'";
                                                                            $query_edit_g = $db_conx->query($sql_edit_g);

                                                                            if($query_edit_g){
                                                                                header('location:packages.php?GoldStatus=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>
                                           
                                        </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()?>