<?php
session_start();
ob_start();
include('includes/config.php');
if($_SESSION['name'] == '')
 {
     header("location:index.php");
 }
    else{
        
        if(isset($_POST['submit'])=='Submit'){
	$mra=($_POST['mra']);
	$mwa=($_POST['mwa']);
	$level1=($_POST['level1']);
	$level2=($_POST['level2']);
    $with_charge=$_POST['with_charge'];
    $first_bonus=$_POST['first_bonus'];
    $open_bonus=$_POST['open_bonus'];
	
$sql= "UPDATE `paymentsetting` SET `rechargeamount` = '$mra',`withdrawalamount` = '$mwa',`level1` = '$level1',`level2` = '$level2',`with_charge`='$with_charge',`first_bonus`='$first_bonus',`open_bonus`='$open_bonus' WHERE `id`= '1'";
//print_r($sql);exit;
$query=mysqli_query($com,$sql);
if($query){
	
	$msg="Update successfully";
	}else 
{
$error="Something went wrong. Please try again";
}

	}
        ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Forcecrypto Admin< </title>
        <link rel="stylesheet" href="css/bootstrap.min.css" media="screen" >
        <link rel="stylesheet" href="css/font-awesome.min.css" media="screen" >
        <link rel="stylesheet" href="css/animate-css/animate.min.css" media="screen" >
        <link rel="stylesheet" href="css/lobipanel/lobipanel.min.css" media="screen" >
        <link rel="stylesheet" href="css/prism/prism.css" media="screen" >
        <link rel="stylesheet" href="css/select2/select2.min.css" >
        <link rel="stylesheet" href="css/main.css" media="screen" >
        <script src="js/modernizr/modernizr.min.js"></script>
    </head>
    <body class="top-navbar-fixed">
        <div class="main-wrapper">

            <!-- ========== TOP NAVBAR ========== -->
  <?php include('includes/topbar.php');?> 
            <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -->
            <div class="content-wrapper">
                <div class="content-container">

                    <!-- ========== LEFT SIDEBAR ========== -->
                   <?php include('includes/leftbar.php');?>  
                    <!-- /.left-sidebar -->

                    <div class="main-page">

                     <div class="container-fluid">
                            <div class="row page-title-div">
                                <div class="col-md-6">
                                    <h2 class="title">Amount Setup</h2>
                                
                                </div>
                                
                                <!-- /.col-md-6 text-right -->
                            </div>
                            <!-- /.row -->
                            <div class="row breadcrumb-div">
                                <div class="col-md-6">
                                    
                                </div>
                             
                            </div>
                            <!-- /.row -->
                        </div>
                        <div class="container-fluid">
                           
                        <div class="row">
                                    <div class="col-md-12">
                                        <div class="panel">
                                            <div class="panel-heading">
                                                <div class="panel-title">
                                                    <h5></h5>
                                                </div>
                                            </div>
                                            <div class="panel-body">
<?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
 <strong>Well done!</strong><?php echo htmlentities($msg); ?>
 </div><?php } 
else if($error){?>
    <div class="alert alert-danger left-icon-alert" role="alert">
                                            <strong>Oh snap!</strong> <?php echo htmlentities($error); ?>
                                        </div>
                                        <?php } ?>
                                                 <form  method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" enctype="multipart/form-data">
<?php
      
      $sql="select* FROM `paymentsetting` WHERE id='1'";
      $query=mysqli_query($com,$sql);
       $role=mysqli_fetch_array($query);
   ?>
<div class="form-group">
<label for="default" class="col-sm-6 control-label">Minium Recharge Amount</label>
<div class="col-sm-6">
<input type="text" class="form-control" onkeypress="return isNumber(event)" name="mra" id="mra"  value="<?php echo $role['rechargeamount'];?>">
</div>
</div>

<div class="form-group">
<label for="default" class="col-sm-6 control-label">Minimum Withdrawal Amount</label>
<div class="col-sm-6">
<input type="text" class="form-control" onkeypress="return isNumber(event)" name="mwa" id="mwa"  value="<?php echo $role['withdrawalamount'];?>">
</div>
</div>

<!--<div class="form-group">
<label for="default" class="col-sm-6 control-label">Level1 Commission <i class="red_txt">[in %]</i></label>
<div class="col-sm-6">
<input type="text" class="form-control" name="level1" id="level1"  value="<?php echo $role['level1'];?>">
</div>
</div>

<div class="form-group">
<label for="default" class="col-sm-6 control-label">Level2 Commission <i class="red_txt">[in %]</i></label>
<div class="col-sm-6">
<input type="text" class="form-control"  name="level2" id="level2"  value="<?php echo $role['level2'];?>">
</div>
</div> 

<div class="form-group">
<label for="default" class="col-sm-6 control-label">Withdrawal Charges<i class="red_txt">[in %]</i></label>
<div class="col-sm-6">
<input type="text" class="form-control" name="with_charge" id="with_charge"  value="<?php echo $role['with_charge'];?>">
</div>
</div>

<div class="form-group">
<label for="default" class="col-sm-6 control-label">First Recharge Bonus</label>
<div class="col-sm-6">
<input type="text" class="form-control"  name="first_bonus" id="first_bonus"  value="<?php echo $role['first_bonus'];?>">
</div>
</div>

<div class="form-group">
<label for="default" class="col-sm-6 control-label">Opening Bonus </label>
<div class="col-sm-6">
<input type="text" class="form-control"  name="open_bonus" id="open_bonus"  value="<?php echo $role['open_bonus'];?>">
</div>
</div>-->



                                                    
                                                    <div class="form-group">
                                                        <div class="col-sm-offset-6 col-sm-6">
                                                            <button type="submit" name="submit" class="btn btn-primary">Update</button>
                                                        </div>
                                                    </div>
                                                </form>

                                            </div>
                                        </div>
                                    </div>
                                    <!-- /.col-md-12 -->
                                </div>
                    </div>
                </div>
                <!-- /.content-container -->
            </div>
            <!-- /.content-wrapper -->
        </div>
        <!-- /.main-wrapper -->
        <script src="js/jquery/jquery-2.2.4.min.js"></script>
        <script src="js/bootstrap/bootstrap.min.js"></script>
        <script src="js/pace/pace.min.js"></script>
        <script src="js/lobipanel/lobipanel.min.js"></script>
        <script src="js/iscroll/iscroll.js"></script>
        <script src="js/prism/prism.js"></script>
        <script src="js/select2/select2.min.js"></script>
        <script src="js/main.js"></script>
        <script>
            $(function($) {
                $(".js-states").select2();
                $(".js-states-limit").select2({
                    maximumSelectionLength: 2
                });
                $(".js-states-hide").select2({
                    minimumResultsForSearch: Infinity
                });
            });
        </script>
    </body>
</html>
<?PHP } ?>
