<?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');

$id = $_REQUEST['id'];




$data = findQuery('select ifnull(sum(`product_amount1`),0) Received from `tbl_challenge`');










if ($data) {
    $message = 'true';

    $data2[] = [



            'Amount' => $data[0]['Received'],




        ];
} else {
    $message = 'false';
    $data2[] = ['error' => 'Not Found'];
}

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

return;

?>

