<?php
include("auth.php");
?>
<?php include("header.php");?>

            <!-- HEADER DESKTOP-->

            <!-- MAIN CONTENT-->
         


            

<div class="main-content">
                <div class="section__content section__content--p30">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="overview-wrap">
                                    <h2 class="title-1">Dashboard</h2>
                                </div>
                            </div>
                        </div>


                        <?php 
include("dbcon.php");
error_reporting(~E_NOTICE);

if(isset($_POST["update"])) {
	$wallet = $_POST["wallet"];

	
	$id = $_GET["id"];
	
	$query = mysqli_query($db,"update waddress set wallet='$wallet' where id='$id'");
	
	if(!$query) {
		echo "Not updated succesfully".mysqli_error($db);
	}else {
		$msg ="Updated Successfully";
	}
}
if(isset($_GET['id'])) {
$id = (int)$_GET['id'];
$result  = mysqli_query($db,"SELECT * FROM waddress WHERE id = $id");
while ($row = mysqli_fetch_array($result)) {



?>



       
   
        <!-- BASIC FORM ELELEMNTS -->
        <div class="row mt">
          <div class="col-lg-12">
            <div class="form-panel">
              
			  <h4 class="mb" style ="color:green;"><i class="fa fa-angle-right"></i> <?php echo $msg;?></h4>
              <form class="form-horizontal style-form" method="POST" action="">
                  
              
                   <div class="form-group">
                  <label class="col-sm-2 col-sm-2 control-label">Email</label>
                  <div class="col-sm-10">
                    <input type="text" name="wallet" class="form-control" value="<?php echo $row["wallet"];?>" required>
                  </div>
                </div>
              
               
               

              
             
                
               
				
		
			
				
                <div class="form-group">
                <button type="submit" name="update" class="btn btn-success" style ="margin-left:200px;">Update</button>
              </form>
			  
			  <?php
}
}
?>
            </div>
          </div>
          <!-- col-lg-12-->
        </div>
        <!-- /row -->
        <!-- INLINE FORM ELELEMNTS -->
        
        <!-- /row -->
      </section>



            <!-- END MAIN CONTENT-->
            <!-- END PAGE CONTAINER-->
        </div>
    </div>
  

 

    <!-- Jquery JS-->
    <script src="vendor/jquery-3.2.1.min.js"></script>
    <!-- Bootstrap JS-->
    <script src="vendor/bootstrap-4.1/popper.min.js"></script>
    <script src="vendor/bootstrap-4.1/bootstrap.min.js"></script>
    <!-- Vendor JS       -->
    <script src="vendor/slick/slick.min.js">
    </script>
    <script src="vendor/wow/wow.min.js"></script>
    <script src="vendor/animsition/animsition.min.js"></script>
    <script src="vendor/bootstrap-progressbar/bootstrap-progressbar.min.js">
    </script>
    <script src="vendor/counter-up/jquery.waypoints.min.js"></script>
    <script src="vendor/counter-up/jquery.counterup.min.js">
    </script>
    <script src="vendor/circle-progress/circle-progress.min.js"></script>
    <script src="vendor/perfect-scrollbar/perfect-scrollbar.js"></script>
    <script src="vendor/chartjs/Chart.bundle.min.js"></script>
    <script src="vendor/select2/select2.min.js">
    </script>

    <script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>

    <!-- Main JS-->
    <script src="js/main.js"></script>
    <script src="../js/user.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@8"></script>
    
    <script type="text/javascript">
        new Morris.Line({
            // ID of the element in which to draw the chart.
            element: 'myfirstchart',
            // Chart data records -- each entry in this array corresponds to a point on
            // the chart.
            data: [
                
            ],
            // The name of the data record attribute that contains x-values.
            xkey: 'year',
            // A list of names of data record attributes that contain y-values.
            ykeys: ['value'],
            // Labels for the ykeys -- will be displayed when you hover over the
            // chart.
            labels: ['Value'],

            resize: true
        });

        convert();

        $("#withdrawButton").click(function(e){
            e.preventDefault()

            var loading_html = '<div style="height:150px;width:150px;margin: 0 auto;"><img style="width: 100%;" src="https://i.ya-webdesign.com/images/minimalist-transparent-loading-gif-6.gif" /></div>'

            swal.fire({
                title: "<h5></h5>", 
                html: loading_html,  
                showConfirmButton: false,
                showCancelButton: false,
                allowOutsideClick: false
            })

            setTimeout(()=>{
                swal.fire('Unable to complete request', 'Please upgrade your account', 'warning')
            }, 2000)
        })

    </script>

                        
                          
                        <?php include("footer.php");?>
                    </div>
                </div>
            </div>
            <!-- END MAIN CONTENT-->
            <!-- END PAGE CONTAINER-->
        </div>

    </div>

    <!-- Jquery JS-->
    

</body>

</html>
<!-- end document-->
