***********************************************************************************/
include "manutencao.php";
include "../inc/topo.php";
include "../inc/paginacaoIni.php";
$filtro = "";
if (!empty($nome)) {
    $filtro .= " and sis_grupo.nome like '%{$nome}%' ";
}
if (!empty($descricao)) {
    $filtro .= " and sis_grupo.descricao like '%{$descricao}%' ";
}
if (!empty($ativo)) {
    $filtro .= " and sis_grupo.ativo = " . ($ativo == "2" ? "0" : "1") . " ";
}
$sql = "select *\n        from sis_grupo\n\twhere 1=1 {$filtro} order by nome";
$rs = execQueryPag($sql);
?>
<h1>Perfis</h1>
<br><br>

<!-- FORMULARIO -->
<?php 
include "formulario.php";
?>
<br>
<!-- LISTAGEM -->
<table class="tabLista">
  <tr>
	<th></th>
        <th>Codigo</th>
	<th>Nome</th>
if ($_REQUEST['acao']) {
    $nome = $_REQUEST["nome"];
    $sigla = $_REQUEST["sigla"];
    $ativado = $_REQUEST["ativado"];
    if (!empty($nome)) {
        $filtro .= " and s.nome like '%{$nome}%'";
    }
    if (!empty($sigla)) {
        $filtro .= " and s.sigla like '%{$sigla}%'";
    }
    if (!empty($ativado)) {
        $filtro .= " and s.ativado = {$ativado}";
    }
}
$sql = "select * from sis_secretaria s\n        where 1=1\n        {$filtro}\n        order by s.nome";
$resultado = execQueryPag($sql);
$num = mysql_num_rows($resultado);
?>
<h1>Cadastro de SIC's</h1>
<br><br>
<form action="index.php" method="post" id="formulario" target="_self">
<fieldset style="width: 50%;">
<legend>Buscar:</legend>
    <table>
    <tr>
        <td>Nome:</td>
        <td>
            <input type="text" name="nome" id="nome" value="<?php 
echo $nome;
?>
" size="30" maxlength="100" />