<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers: Content-Type');
require_once('../lib/dbclass.php');




$message = 'false';
$dataqty = findQuery('SELECT sum(Received) Received  FROM  tbl_transaction where donation=1 and tbl_transaction.Received>0');
$units   = 0;

if ($dataqty[0]['Received'] > 0) {
    $units   = $dataqty[0]['Received'];
    $message = 'true';
}

$data2[] = [



'Count' => $units,

];

updateQuery('update `tbl_customer` set `Ward`=0 where id in (select tbl_transaction.customerid from tbl_transaction where tbl_transaction.clubid>0)');



echo json_encode(['Status' => $message, 'data' => $data2]);

return;

?>

