<?php
    //Auto Load Classes
    require_once("../autoloader.php");
    require_once("../../core/helpers/vendor/autoload.php");

    //Allowed API Headers
    header('Access-Control-Allow-Origin: *');
    header('Content-Type: application/json');
    header("Access-Control-Allow-Methods: POST");
    header("Allow: POST, OPTIONS, PUT, DELETE");
    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 ApiAccess;
    $controller2 = new InternetData;
    date_default_timezone_set('Africa/Lagos');

 $requestMethod = $_SERVER["REQUEST_METHOD"]; 
  
  
  if (isset($_GET["plans"])) {
    $response["status"] = "success";
    $response["plans"] = $controller->getDataPlans();
    echo json_encode($response);
    exit();
}

if (isset($_GET["electricity"])) {
    $response["status"] = "success";
    $response["plans"] = $controller->getElectricityPlans();
    echo json_encode($response);
    exit();
}

if (isset($_GET["providers"])) {
    $response["status"] = "success";
    $response["plans"] = $controller->getElectricityPlans();
    echo json_encode($response);
    exit();
}

if (isset($_GET["exam"])) {
    $response["status"] = "success";
    $response["plans"] = $controller->getExamPlans();
    echo json_encode($response);
    exit();
}

if (isset($_GET["cable"])) {
    $response["status"] = "success";
    $response["plans"] = $controller->getCablePlans();
    echo json_encode($response);
    exit();
}

   
?>








 