<?php
include("../connect.php");
$response = array();
if(isset($_POST['admin_id']))
{
	$admin_id = $_POST['admin_id'];
	$select_payment = mysqli_query($con,"select * from tbl_bt_transaction where admin_id='$admin_id'");
	
	$payments=array();
	if(mysqli_num_rows($select_payment)>0)
	{     
		while($fetch_payment=mysqli_fetch_assoc($select_payment))
		{
			$payments['bt_txn_id'] = $fetch_payment['bt_txn_id'];
			$payments['transaction_date'] = $fetch_payment['transaction_date'];
			$payments['transaction_time'] = $fetch_payment['transaction_time'];
			$payments['transaction_id'] = $fetch_payment['transaction_id'];
			$payments['plan_type'] = $fetch_payment['plan_type'];
			$payments['month'] = $fetch_payment['month'];
			$payments['transaction_amount'] = $fetch_payment['transaction_amount'];
			$payments['txn_status'] = $fetch_payment['txn_status'];
			$payments['payment_mode'] = $fetch_payment['payment_mode'];
			$payments['txn_type'] = $fetch_payment['txn_type'];
		
			$response['payments'][]=$payments;
		}
	}
	else
	{
		$response['payments'][]=$payments;
	}

	$response['success']=1;	
	$response['details']="Data Success";
}
else
{
	$response['success']=0;
	$response['details']="Required fields missing";
}
echo json_encode($response);
?> 