<?php

	header('Content-Type: application/json');
	ini_set('display_startup_errors',1);
	ini_set('display_errors',1);
	error_reporting(1);
	ini_set("log_errors", 1);
	ini_set("error_log", "php-error.log");

	date_default_timezone_set('Asia/Kolkata');

	require_once("database.php");


	class PayoutList
	{
		private $conn;

		function __Construct()
		{
			$dbconnect = new Database();
			$this->conn = $dbconnect->getConnection();

		}


		function getPayoutList()
		{

		   try{

				$stmt  = $this->conn->prepare("select * from my_payout_run order by id desc");
				$stmt->execute();
				$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
			 	return $result;
			
		  }catch(Exception $err){

			return 0;

		  } 


		
		}
    }

	$result = array();
	$payout = new PayoutList();
    $payoutList = $payout->getPayoutList();

	$result['success'] = true;
	$result['message'] = "Payout List!";
	$result['payoutList'] = $payoutList; 
	echo json_encode($result);



?>

