<?php include "inc/app-top-member.php";

	$result = $eagro3->pointlist($_SESSION["member_id"]);
	$array = json_decode($result,true);

	$result_detail = $eagro3->pointdetail($_SESSION["member_id"]);
	$array_detail = json_decode($result_detail,true);



?>
<!DOCTYPE html>
<html>
<head>
	<title>E-Agro - E-credit Management</title>
	<?php include "inc/head.php";?>

	<style>
table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 83%;
}

td, th {
  border: 1px solid #dddddd;
  text-align: center;
  padding: 4px;
 /* min-width: 65px;*/
}

tr:nth-child(even) {
  background-color: #ffff;
}
</style>
<style type="text/css">
	.dataTables_paginate a{
		margin-left: 5px;
		margin-right: 5px;

	}

	.dataTables_filter{
		float: right !important;
	}
</style>
<style>
  .option1 {
    float: left; /* show on the same line */

  }
@media screen and (min-width 768px){
.balance-text{
float: right;
}}
</style>
<!-- <script type="text/javascript">
function getSoftloanListOnLoad(){

	$.ajax({
		type:'post',
		url:'action_v2.php',
		data:{"action":"getSoftloanListOnLoad"},
		success:function(result){
			var result_obj = JSON.parse(result);
			// console.log(result);

			if(result_obj.valid){
				document.getElementById("tableData").innerHTML = result_obj.html;
			}else{

			}
		}
	})
};
</script> -->
</head>
<body>
	<header>
		<?php include "inc/header.php"; ?>
	</header>

    <div class="breadcrumb-area mb-50">
    </div>

	<div class="my-account-section section position-relative mb-50 fix">
		<div class="container">
			<div class="row">
				<div class="col-12">
					<div class="row">
						<?php include "inc/member_sidebar.php"; ?>

						<div class="col-lg-9 col-12">
							<div class="tab-content" id="myaccountContent">
								<!-- Single Tab Content Start -->
								<div class="tab-pane fade show active" id="dashboad" role="tabpanel">
									<div class="myaccount-content">
									<!-- <div class="myaccount-content"> -->
										<div>
											<h3 class="option1">E-point Management</h3>
											<h3 class="balance-text"> <?php echo change("balance"); ?>:<?php echo $array_detail["member_loyalty_point"]; ?> </h3>

										</div>

											<table class="table table-bordered tableecredit">
												<thead class="thead-light">
												 <tr>
												 	<th>No</th>
													<th>Order ID</th>
												  <th>Datetime</th>
													<th>Point Receive</th>
												  <th>Point Balance</th>
												 </tr>
												</thead>
												 <tbody>
											<?php
											if($array["valid"]){
												$count =1;
											 	for($a=0;$a<count($array["data"]);$a++){
											 		?>
											 		<tr>
											 			<td><?php echo $count; ?></td>
											 			<td><?php echo $array["data"][$a]["order_id"]; ?></td>
											 			<td><?php echo $array["data"][$a]["point_in_timestamp"]; ?></td>
											 			<td><?php echo $array["data"][$a]["point_in_amount"]; ?></td>
														<td><?php echo $array["data"][$a]["point_balance"]; ?></td>

											 		</tr>
											 		<?php
											 		$count++;
											 	}
											}else{

											}

											?>
		               	</tbody>
											</table>
										</div>

								</div>
							</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<?php include "inc/inc-js.php"; ?>
	<script type="text/javascript">
$(document).ready( function () {
    $('.tableecredit').DataTable({
    	"pagingType": "full_numbers",
    	"lengthChange": false,
    	"dom": '<lf<t>ip>'
    });

    $(".dataTables_paginate ").click(function(){
	    $('html, body').animate({
	        scrollTop: $(".myaccount-content").offset().top
	    }, 1000);
    })
} );
</script>
</body>
<footer>
	<?php include "inc/footer.php"; ?>
</footer>


</html>
