<?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:14px !important; color:#757575 !important; font-weight:400; text-align:right;}
.tdtext2{ font-size:14px !important; color:#757575 !important; font-weight:400; text-align:right;}
.tdtext3{ font-size:14px !important; color:#757575 !important; font-weight:400; text-align:right;}

.text small{ font-size:14px; color:#757575; font-weight:400;}
.listView .listItem {
   padding: 0px 55px 0px 0px;
   color: #757575;
   font-size: 14px;
   font-weight:400;
}
.listView .listItem .text {
    font-size: 14px;
}
 .null_data{
    height: 33px;
    line-height: 33px;
    font-size: 12px;
    text-align: center;
    margin:0 auto;
}
.appContent1{background:white;}
</style>
</head>

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

<!-- App Header -->
<div class="appHeader1">
  <div class="left"> <a href="/mine.php" onClick="goBack();" class="icon goBack"> <i class="icon ion-md-arrow-back"></i> </a>
    <div class="pageTitle">Reward</div>
  </div>
</div>
<!-- * App Header --> 
<!-- App Capsule -->
<div id="appCapsule">
  <div class="appContent1 listView">
   <table id="example1"  class="table table-borderless">
      <thead>
      <tr style="display:none;"><th></th><th></th></tr>
      </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('h:i A d-m-Y',$post_date2);
 $actiontypearray=explode("~",$summeryResult['actiontype']);
 @$actiontype=$actiontypearray[0];
 @$actiontypeval=$actiontypearray[1];
if($actiontype=='refer_commission'){?>
         <tr>
          <td>
          <div class="listItem">
         
            <div class="text"><div><strong>Refer Commission</strong><small><?php echo $convert;?></small></div></div>
            </div>
            </td>
          <td class="tdtext">₹ <?php echo number_format($summeryResult['amount'],2);?></td>
        </tr>
      
        <?php }}}else{?>
        <tr>
          <td colspan="2">
          <div class="">
            <div class="null_data"><strong>No data available</strong></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.dataTables.min.js"></script>
<script>

  $(function () {
    $('#example1').DataTable({
      "paging": true,
      "lengthChange": false,
      "searching": false,
      "ordering": false,
      "info": true,
      "autoWidth": false
    });
  });
</script>
</body>
</html>