<?php
require_once("../../autoloader.php");
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
header("Allow: POST, OPTIONS, PUT, DELETE, GET");
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Origin");

$headers = apache_request_headers();
$response = array();
$controller = new SubscriberModel;

date_default_timezone_set('Africa/Lagos');

// Get the input data for user ID
$input = json_decode(file_get_contents('php://input'), true);

    $mtnStatus = $controller->mtnStatus();
        $airtelStatus = $controller->airtelStatus();
        $gloStatus = $controller->gloStatus();
        $ninemobileStatus = $controller->ninemobileStatus();

        // Prepare the response data
        $data = [
            'MTN' => $mtnStatus,
            'Airtel' => $airtelStatus,
            'Glo' => $gloStatus,
            '9mobile' => $ninemobileStatus,
        ];

        // Return the response as JSON
        header('Content-Type: application/json');
        echo json_encode($data);

?>
