<?php

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

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

$response = array();

$material_extras = MaterialExtra::mdlGetAllMaterialExtras();

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

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

echo json_encode($response);