<?php

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

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require '../../modelo/marca.php';

$response = array();

$marcas = Marca::mdlGetMarcas(1);

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

$response['response'] = 'success';
$response['data'] = $marcas;
echo json_encode($response);