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










$checking = findQuery('SELECT * FROM `settings`');



if ($checking) {
    $Appversionnumber = $checking[0]['version'];

    $expiry  = date('Y-m-d', strtotime($checking[0]['enddate']));
    $today   = date('Y-m-d');
    $expired = 0;



    if ($expiry < $today) {
        $expired = 1;
    }



    $data2[] = [
                              'Appversionnumber' => $Appversionnumber,
                              'hide'             => $checking[0]['hide'],
                              'expired'          => $expired,
      'hideforappstore'                          => $checking[0]['hideforappstore'],
       'playstore_url'                           => $checking[0]['playstore_url'],
                              'appstore_url'     => $checking[0]['appstore_url'],
                              ];

    $message = 'True';





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

    return;
}













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

return;
?>	   
