<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

require( "../sql.class.php" );
$sql = new sqlclass( );
$sql->connect( );
$pCategoria = $_POST['categoria'];
$sql->query( "SELECT Numero, Sub FROM SITE_SHOPSUBCATEGORIAS WHERE Categoria='".$pCategoria."' AND Condicao='1'" );
$rows = $sql->rowcount( );
if ( $rows )
{
    $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
    $xml .= "<subcategorias>\n";
    while ( $info = $sql->row( ) )
    {
        $xml .= "<subcategoria>\n";
        $xml .= "<codigo>".$info[0]."</codigo>\n";
        $xml .= "<descricao>".$info[1]."</descricao>\n";
        $xml .= "</subcategoria>\n";
    }
    $xml .= "</subcategorias>\n";
    header( "Content-type: application/xml; charset=iso-8859-1" );
}
echo $xml;
?>
