<?php
require_once 'conexao.php';

require_once 'conexao.php';
require_once 'config.php';

$pdo  = Conexao::getInstance();
$sql = "SELECT DISTINCT c.cat_001, c.cat_002 ";
$sql .= "FROM categoria c INNER JOIN materiais m ON c.cat_001 = m.cat_001 ";
$sql .= "WHERE c.sit_001 = 4 AND m.sit_001 = 4 AND c.exibe_comanda = 1 ORDER BY cat_002";
$stm = $pdo->prepare($sql);
$stm->execute();
$categorias = $stm->fetchAll(PDO::FETCH_OBJ);

echo json_encode($categorias);
?>
