<?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 * FROM tbl_challenge WHERE status=0 AND CURDATE() between challenge_startdate and challenge_enddate');











if ($data) {
    for ($i = 0;$i < count($data);$i++) {
        $message = 'true';

        $data2[] = [



            'challenge_image' => 'https://iumltuvvur.com//Challenge/upload/' . $data[$i]['challenge_image'],



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

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

return;

?>

