<?php 
ob_start();
session_start();
if($_SESSION['userid']=="")
{header("location:login.php");exit();}?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<?php include 'head.php';?>
<link rel="stylesheet" href="assets/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="description" content="Bitter Mobile Template">
<meta name="keywords" content="bootstrap, mobile template, bootstrap 4, mobile, html, responsive" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="assets/css/dataTables.bootstrap.min.css" rel="stylesheet"/>
<style>

h3 {
	font-weight:normal;
}
.tdtext{ font-size:16px !important; color:#000000 !important; font-weight:normal; text-align:right;}
.tdtext2{ font-size:16px !important; color:#000000 !important; font-weight:normal; text-align:right;}
.tdtext3{ font-size:16px !important; color:#000000 !important; font-weight:normal; text-align:right;}

.text small{ font-size:14px; color:#000000;}
.listView .listItem {
     color: #757575;
    font-size:14px;
    font-weight:400;
   padding: 0px 55px 0px 0px;
}
.listView .listItem .text {
    font-size: 16px;
}
</style>
</head>

<body>
<?php
include("include/connection.php");
$userid=$_SESSION['userid'];?>
<!-- Page loading -->

<!-- * Page loading --> 

<!-- App Header -->
<div class="appHeader1">
  <div class="left"> <a href="/withdrawal.php" onClick="goBack();" class="icon goBack"> <i class="icon ion-md-arrow-back"></i> </a>
    <div class="pageTitle">Withdrawal Record</div>
  </div>
</div>
<!-- * App Header --> 
<!-- App Capsule -->
<div id="appCapsule" class="" style="background:white;    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 5px 0 rgb(0 0 0 / 14%), 0 1px 10px 0 rgb(0 0 0 / 12%);
    will-change: padding-left,padding-right;">
  <div class="appContent1 listView">
    <table class="table table-borderless">
      <thead>
      </thead>
      <tbody>
      <?php
	  @$userid=$_SESSION['userid'];
      $summery=mysqli_query($con,"select * from `tbl_walletsummery` where `userid`='".$userid."' order by id desc");
	  $summeryRows=mysqli_num_rows($summery);
	  if($summeryRows!=''){
		  while($summeryResult=mysqli_fetch_array($summery)){
$post_date = $summeryResult['createdate'];
 $post_date2 = strtotime($post_date);
 $convert=date('Y-m-d H:m',$post_date2);
  $convert1=date('YmdHm',$post_date2);
 $actiontypearray=explode("~",$summeryResult['actiontype']);
 @$actiontype=$actiontypearray[0];
 @$actiontypeval=$actiontypearray[1];
if($actiontype=='recharge'){
	  ?>
       <?php }if($actiontype=='withdraw'){
$chkwithdrawalQuery=mysqli_query($con,"select * from `tbl_withdrawal` where `id`='".$actiontypeval."'");
$chkwithdrawalResult=mysqli_fetch_array($chkwithdrawalQuery);
if($chkwithdrawalResult['status']==0){?>
       
        <tr>
          <td class="td-text">
          <div class="listItem">
         
        <div  style="font-size:14px;" class="">  
        <p class="" style="font-size:14px;">
      ₹ <?php  $amount = $summeryResult['amount'];
               $total2 = $amount*5/100;
               $last = $summeryResult['amount']-$total2;
               echo round($last,2);?></p>
            
       <p class="" style="font-size:14px;">
      <?php $new = $summeryResult['id'];
      $char = 'JJWS';
           
            echo $char; echo $convert1; echo $new;
            ?></p>
       <small><?php echo $convert;?></small></div>
            </div>
            </td> <td class="tdtext text-danger">
               
     <span style="color:#9c27b0; font-size: 14px;">Withdrawing</span> <br>
          &emsp;
<small style="color: #757575">BankCard</small></td>
        </tr>

        
        <?php }else if($chkwithdrawalResult['status']==1){?>
       
        <tr>
          <td class="td-text">
          <div class="listItem">
        
            <div> <p class="" style="font-size:14px;">₹ <?php  $amount = $summeryResult['amount'];
                           $total2 = $amount*5/100;
                           
                           $last = $summeryResult['amount']-$total2;
                          
                         echo round($last,2);?>
            </p>
         <p class="" style="font-size:14px;">
      <?php $new = $summeryResult['id'];
      $char = 'JJWS';
           
            echo $char; echo $convert1; echo $new;
            ?></p>
       
            <small><?php echo $convert;?></small></div>
            </div>
            </td>
       <td class="tdtext3 text-suc"> <span style="font-size:14px;color:#009688" class="">Agree</span>  <br>
          &emsp;
<small style="color: #757575">BankCard</small></td>
        </tr>
        <?php }else if($chkwithdrawalResult['status']==2){?>
        <tr>
          <td>
          <div class="listItem">
         
     <div style="font-size:14px;" class="">
          <p class="" style="font-size:14px;">+ ₹ <?php  $amount = $summeryResult['amount'];
                           $total2 = $amount*5/100;
                           
                        
                          
                         echo round($amount,2);?>
         </p>
            <p class="" style="font-size:14px;">
      <?php $new = $summeryResult['id'];
      $char = 'JJWS';
           
            echo $char; echo $convert1; echo $new;
            ?></p><small><?php echo $convert;?></small></div>
            </div>
            </td>
          <td class="tdtext2 ">
              <!--<span style="color:red; font-size: 14px;">Failed </span> <br>-->
          &emsp;
<small style="color: #757575">BankCard</small></td>
        </tr>
        <?php }?>
         
 
        <tr>
          
            </tr>
        <?php }}}else{?>
        <tr>
          <td colspan="2">
          <div class="listItem">
            <div class="text"><div class="text-center"><strong>Transation not found...</strong></div></div>
            </div>
            </td>
          
        </tr>
        <?php }?>
      </tbody>
    </table>
  </div>
</div>
<!-- appCapsule -->

<?php include("include/footer.php");?>

<script src="assets/js/lib/jquery-3.4.1.min.js"></script> 
<!-- Bootstrap--> 
<script src="assets/js/lib/popper.min.js"></script> 
<script src="assets/js/lib/bootstrap.min.js"></script> 
<!-- Owl Carousel --> 
<script src="assets/js/plugins/owl.carousel.min.js"></script> 
<!-- Main Js File --> 
<script src="assets/js/app.js"></script> 
<script src="assets/js/jquery.validate.min.js"></script> 
<script>
	window.oncontextmenu = function () {
				return false;
			}
			$(document).keydown(function (event) {
				if (event.keyCode == 123) {
					return false;
				}
				else if ((event.ctrlKey && event.shiftKey && event.keyCode == 73) || (event.ctrlKey && event.shiftKey && event.keyCode == 74)) {
					return false;
				}
			});
</script>
<script>
/*function check(e)
{
alert(e.keyCode);
}*/
 document.onkeydown = function(e) {
    if (e.ctrlKey && (e.keyCode === 67 || e.keyCode === 86 || e.keyCode === 85 ||     e.keyCode === 117 || e.keycode === 17 || e.keycode === 85)) {//ctrl+u Alt+c, Alt+v will also be disabled sadly.
        alert('Chutiya Ho Tum');
    }
    return false;
};
</script>
</body>
</html>