<?php

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: *');

require '../../modelo/conexion.php';
require '../../modelo/proveedor.php';

$response = array();

$proveedores = Proveedor::mdlGetAllProveedores();

if (!$proveedores) {
    $response['response'] = 'error';
    $response['message'] = 'No se encontraron proveedores';
    echo json_encode($response);
    return;
}

$response['response'] = 'success';
$response['data'] = $proveedores;

echo json_encode($response);