<?php
@session_start();
include "control/activity.php";

 $dd = new activity();
 $loginStatus = $_SESSION['loginDetails'];


  if($loginStatus == null){
    echo "<script>window.open('login.php','_self')</script>";
  }

  $payIId = $_REQUEST['payIId'];

  $table = "balance_withdraw INNER JOIN userdetails ON balance_withdraw.user_key = userdetails.userKey";
  $condition = " where balance_withdraw.withdraw_key='$payIId'";
  $getDetails = $dd->single($table,$condition);
  $userKey = $getDetails['userKey'];
  
  


  $table = "admin_calculation";
  $condition = null;
  $getAdminDetails = $dd->single($table,$condition);
  
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title><?= $getAdminDetails['title']; ?></title>
</head>
<body>

    <div class="main" id="main">
		  <?php include "menu.php"; ?>
    <div class="right"> 
  <div class="tab-content">


   <?php include "headermenu.php"; ?>


        <!-- Overview -->
         <div id="overview" class="tab-pane active"  >
                <div class="content" >
                  
               <div class="content-wrapper">
                 <div class="container-fluid">

                      <!--======================================================  Content  ====================================================-->                                            
                          <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                              <a href="dashboard.php">ALL-REQUEST</a>
                            </li>
                          </ol>

                          <div class="row">
                              <div class="col-xl-4 col-sm-4mb-4">
                                 <table class="table table-bordered data-table">
                                     <tr>
                                        <td colspan="2">Full Name : <input disabled name="" class="form-control" value="<?= $getDetails['bankholder']; ?>"/></td>
                                     </tr>
                                     <tr>
                                        <td colspan="2">Request Date : <input disabled name="" class="form-control" value="<?= $getDetails['action_date']; ?>"/></td>
                                     </tr>
                                     <tr>
                                        <td colspan="2">Amount : <input disabled name="" class="form-control" value="<?= $getDetails['amounnt']; ?>"/></td>
                                     </tr>
                                     <tr>
                                        <td colspan="2">Account Number : <input disabled name="" class="form-control" value="<?= $getDetails['bankaccount']; ?>"/></td>
                                     </tr>
                                     <tr>
                                        <td colspan="2">Bankifsc : <input disabled name="" class="form-control" value="<?= $getDetails['bankifsc']; ?>"/></td>
                                     </tr>
                                     <tr>
                                        <td colspan="2">Refrence Number : <input disabled name="" class="form-control" value="<?= $getDetails['refrence_number']; ?>"/></td>
                                     </tr>
                                     <tr>
                                        <td colspan="2">Payment Status : <input disabled name="" class="form-control" value="<?= $getDetails['payment_status']; ?>"/></td>
                                     </tr>
                                     <tr>
                                        <td><button onclick="getApproved(<?= $payIId; ?>)" class="btn btn-block bg-success"> APPROVED</button></td>
                                        <td><button onclick="getRejcted(<?= $payIId; ?>)" class="btn btn-block bg-danger"> CANCEL</button></td>
                                     </tr>
                                 </table>
                              </div>
                          </div>
  
                           
      <!--============  FIN DE L'AJOUT  ===============-->
      
<script>
 function kycRequest()
 {
    window.open('kyc_request_page.php','_self');
 }


 function getgoDetails(a)
 {
    window.open('getKeyActivityPage.php?iid='+a,'_self');
 }



 function getApproved()
 {
    var ttt = confirm('Are you sure to ACTION this ?');
    if(ttt == true)
    {
        window.open("withdrawAction.php?payId=<?= $payIId; ?>&type=approved&userKey=<?= $userKey; ?>&am=<?= $getDetails['amounnt']; ?>","_self");
    }
 }


 function getRejcted()
 {
    var ttt = confirm('Are you sure to REJECT this ?');
    if(ttt == true)
    {
        window.open("withdrawAction.php?payId=<?= $payIId; ?>&type=rejected&userKey=<?= $userKey; ?>","_self");
    }
 }

</script>
      
     
      </div>
      <!-- /.container-fluid-->
       </div>  <!-- /content-wrapper-->


                </div>
                </div>
             </div><!--Right panel-->
</div><!--Main-->


</body>
</html>



<?php include "style.php" ?>