<?php
session_start();
ob_start();
include('includes/config.php');
if($_SESSION['name'] == '')
 {
     header("location:index.php");
 }
    else{
        
        ?>
<!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">Withdrawal Accept And Reject</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">
                                                    
                                                </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 } ?>
                                               
 <?php


$id=$_GET['ID'];
$with = mysqli_fetch_assoc(mysqli_query($com,"select * from withdrawal where id='$id'"));
$userid  = $with['userid'];
$loginuser = mysqli_fetch_assoc(mysqli_query($com,"select * from loginuser where id='$userid'"));
$bankname = mysqli_fetch_assoc(mysqli_query($com,"select * from bankdetail where userid='$userid'"));


?>                                           <table class="table">
  <tbody>
    <tr>
      <td style="color: blue; font-size:25px;" scope="col">Mobile:</td>
      <td style="color: blue; font-size:25px;" scope="col" ><?php echo $loginuser['mobile'];?></td>
      
    </tr>
   <!--<tr>
      <td style="color: blue; font-size:25px;" scope="col">Name:</td>
      <td style="color: blue; font-size:25px;" scope="col" ><?php echo $loginuser['name'];?></td>
      
    </tr> -->
  
    <tr>
      <input type="hidden" id="id" name="id" value="<?php echo $id; ?>">
      <td style="color: blue; font-size:25px;">Date:</td>
      <td style="color: blue; font-size:25px;"><?php echo $convert=date('d-m-Y',strtotime($with['createdate']));?></td>
      
    </tr>
    
    <tr>  
      <td style="color: blue; font-size:25px;" scope="col"> Amount:</td>
      <td style="color: blue; font-size:25px;" scope="col"><i class="red_txt" style="font-size:25px;"><?php echo number_format($with['amount'],2);?></i></td>
      
    </tr>
    
    
    </tbody>
    </table>
               <h4 style="color: blue; font-size:25px;" ><strong>Account Holder Name:</strong> <?php echo $bankname['name'];?></h4>
                 <h4 style="color: blue; font-size:25px;" ><strong>Bank Name:</strong> <?php echo $bankname['bankname'];?></h4>         
                 <h4 style="color: blue; font-size:25px;" ><strong>Account Number:</strong> <?php echo $bankname['account'];?></h4>
                  <h4 style="color: blue; font-size:25px;" ><strong>Ifsc Code:</strong> <?php echo $bankname['ifsc'];?></h4>
                         
                          
                       <br>   
                      <div class="col-md-12">
                      <div class="row">
                        <div class="col-md-6 text-center"> 
						<a onclick="acceptreject(1)" class="btn btn-success"><strong><i class="fa fa-check"></i> Accepted</strong></a></div>
                        
                        <div class="col-md-6 text-center"> 
						<a onclick="acceptreject(2)" class="btn btn-danger"><strong><i class="fa fa-times"></i> Rejected</strong></a></div>
						
                      </div>                                 

                                            </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>
        <script>
			    function acceptreject(val) {
                 var id = document.getElementById('id').value; 
                 var type = val;
                   $.ajax({
                   type: "Post",
                    data: { id: id,type : type},
                   url: "manage_withdrawaAction.php",
                   success: function (html) {
                       
                       window.location = 'withrequest.php';
                       
                   },
                   
                   
               });

       }
</script>
    </body>
</html>
<?PHP } ?>
