<?php

require_once '../../core/api_bootstrap.php';
require_once '../../core/provider_auth.php';

ProviderAuth::id();

try {

$db = new Database();
$conn = $db->connect();

$query="

SELECT
id,
name

FROM states

WHERE status=1

ORDER BY name ASC

";

$stmt=$conn->prepare($query);
$stmt->execute();

$rows=$stmt->fetchAll();

Response::success($rows);

}
catch(Exception $e){

Logger::log("system.log",$e->getMessage());
Response::error("Server error",500);

}