<?php require_once('topo.php');?>
<?php require_once('lateral.php');?>
<?php
//VERIFICAÇÃO DO PROGRAMA E NÍVEL PERMISÃO
$idprograma_pagina1 = 18;
$idprograma_pagina2 = 19;
//VERIFICA A AÇÃO DO USUÁRIO

$SelecionaProgramaUsuario = Seleciona("usuarios_programas", "WHERE idusuario='".$_SESSION['usuarioID']."' AND idprograma IN ('$idprograma_pagina1', '$idprograma_pagina2')", "LIMIT 0,1");
while($progama_usuario = mysql_fetch_array($SelecionaProgramaUsuario)){
$AcaoUsuario = $progama_usuario['acao'];
}

//AÇÕES
// Visualizar
// Inserir
// Completa

//MASTER ACESSO
if($_SESSION['master'] == 1){
   $AcaoUsuario = "Completa"; 
}

//FIM VERIFICAÇÃO PROGRAMA

$datainicio = $_GET['datainicio'];

if($datainicio == ""){
	$datainicio = date('Y-m') . "-01";
	//$datainicio = date('Y-m-d');
}

$datafim = $_GET['datafim'];

if($datafim == ""){
	$datafim = date('Y-m') . "-30";
}

if($_GET['atualiza_linha'] == "conta"){

$titulo_conta = $_POST['titulo_conta'];
$valor_conta = $_POST['valor_conta'];
$data_conta = $_POST['data_conta'];

$campos_alterar = "titulo_conta='$titulo_conta', valor_conta='$valor_conta', data_conta='$data_conta'";

$atualizar = Alterar("contas", $campos_alterar, "idconta", $_GET['idconta']);

//ALTERAR LOG FINANCEIRO
$alterar_logfinanceiro = mysql_query("UPDATE logs_financeiro SET data='$data_conta', valor='$valor_conta' WHERE idconta='".$_GET['idconta']."' AND idpagamento IS NULL") or die (mysql_error());      
   
$redireciona = VerificaSql($atualizar, "listar_contas_agenciae.php?idcentrodecusto=".$_GET['idcentrodecusto']."&tipo=".$_GET['tipo']."&Filtro=".$_GET['Filtro']."&Exibe=".$_GET['Exibe']."", "listar_contas_agenciae.php?idcentrodecusto=".$_GET['idcentrodecusto']."&tipo=".$_GET['tipo']."&Filtro=".$_GET['Filtro']."&Exibe=".$_GET['Exibe']."");

}

?>     
      <!-- Right side column. Contains the navbar and content of the page -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            Contas à <?php echo $_GET['tipo'];?>
            <small>listagem de contas à <?php echo $_GET['tipo'];?>cadastradas</small>
          </h1>
			<?php
            //VERIFICAR USUARIO PROGRAMA
            if($AcaoUsuario == "Inserir" or $AcaoUsuario == "Editar" or $AcaoUsuario == "Completa"){ 						
            ?>                  

          <button type='button' class='btn btn-twitter' style=" float: right;" onclick="window.print();"><i class="fa fa-print" aria-hidden="true"></i></button>


          <button type="button" class="btn btn-primary" style=" float:right;" onclick="location.href='manutencao_contas_agenciae.php';"><i class="fa fa-plus-circle" aria-hidden="true"></i> Nova Conta</button>
          <?php if($_GET['tipo'] == "Pagar"){;?>
          <a href="exportar_folhadepagamento.php" target="_blank">
          <button type="button" class="btn btn-success" style=" float:right;">Exportar Folha de Pagamento</button>
          </a>

          <a href="importar_folhadepagamento.php" class="fancybox fancybox.iframe">
          <button type="button" class="btn btn-vk" style=" float:right;">Importar Folha de Pagamento</button>
          </a>
          
          <?php } }?>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-xs-12"><!-- /.box -->

              <div class="box">
                <div class="box-header">
                <div class='col-xs-3'>
                <label>Categoria</label>
                <select class="form-control" name="categoria" id="categoria" onchange="MM_jumpMenu('parent',this,0)" style="text-transform:uppercase">
                <option value="listar_contas_agenciae.php?idcentrodecusto=<?php echo $_GET['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=CentroDeCustoTodos&Exibe=<?php echo $_GET['Exibe'];?>&datainicio=<?php echo $_GET['datainicio'];?>&datafim=<?php echo $_GET['datafim'];?>">Todas Categorias</option>      
                <?php $SelecionaCategoria = Seleciona("categorias_contas", "", ""); while($categorias = mysql_fetch_array($SelecionaCategoria)){ ?>
                <option value="listar_contas_agenciae.php?idcentrodecusto=<?php echo $_GET['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=CentroDeCustoTodos&Exibe=<?php echo $_GET['Exibe'];?>&datainicio=<?php echo $_GET['datainicio'];?>&datafim=<?php echo $_GET['datafim'];?>&Categoria=<?php echo $categorias['idcategoria_conta'];?>" <?php if($_GET['Categoria'] == $categorias['idcategoria_conta']){ echo "selected";}?>><?php echo $categorias['titulo'];?></option>
                <?php }?>
                </select>       
                </div>                               
                  
                  <div class="col-xs-3" style="float:right">
					<label>Centro de Custo</label>                  
                    <select id="jumpMenu2" onchange="MM_jumpMenu('parent',this,0)"  class="form-control">
                    <option value="listar_contas_agenciae.php?idcentrodecusto=<?php echo $_GET['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=CentroDeCustoTodos&Exibe=<?php echo $_GET['Exibe'];?>&datainicio=<?php echo $_GET['datainicio'];?>&datafim=<?php echo $_GET['datafim'];?>&Categoria=<?php echo $_GET['Categoria'];?>"> Selecione um Centro de Custo </option>      
                    <?php 	  
                    $SelecionaCentroCusto = Seleciona("centrodecusto", "", "ORDER BY titulo ASC");
                    while($centro = mysql_fetch_array($SelecionaCentroCusto)){
                    ?>
                    <option value="listar_contas_agenciae.php?idcentrodecusto=<?php echo $centro['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=CentroDeCustoTodos&Exibe=<?php echo $_GET['Exibe'];?>&datainicio=<?php echo $_GET['datainicio'];?>&datafim=<?php echo $_GET['datafim'];?>&Categoria=<?php echo $_GET['Categoria'];?>" <?php if($_GET['idcentrodecusto'] == $centro['idcentrodecusto']){ echo "selected";}?>> <?php echo $centro['titulo'];?> </option>
                    <?php }?>
                    <option value="listar_contas_agenciae.php?idcentrodecusto=<?php echo $_GET['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=&Exibe=<?php echo $_GET['Exibe'];?>&datainicio=<?php echo $_GET['datainicio'];?>&datafim=<?php echo $_GET['datafim'];?>&Categoria=<?php echo $_GET['Categoria'];?>" <?php if($_GET['Filtro'] == ""){ echo "selected";}?>> TODOS </option>        
                    </select>
                    </div> 
                    
                  <div class="col-xs-2" style="float:right">
                  <label>Status Conta</label> 
                    <select id="jumpMenu2" onchange="MM_jumpMenu('parent',this,0)"  class="form-control">
                    <option value="listar_contas_agenciae.php?idcentrodecusto=<?php echo $_GET['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=CentroDeCustoTodos&datainicio=<?php echo $_GET['datainicio'];?>&datafim=<?php echo $_GET['datafim'];?>&Categoria=<?php echo $_GET['Categoria'];?>" <?php if($_GET['Exibe'] == ""){ echo "selected";}?>> TODOS </option>
                    <option value="listar_contas_agenciae.php?idcentrodecusto=<?php echo $_GET['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=CentroDeCustoTodos&Exibe=Aberto&datainicio=<?php echo $_GET['datainicio'];?>&datafim=<?php echo $_GET['datafim'];?>&Categoria=<?php echo $_GET['Categoria'];?>" <?php if($_GET['Exibe'] == "Aberto"){ echo "selected";}?>> ABERTO </option>
                    <option value="listar_contas_agenciae.php?idcentrodecusto=<?php echo $_GET['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=CentroDeCustoTodos&Exibe=Pago&datainicio=<?php echo $_GET['datainicio'];?>&datafim=<?php echo $_GET['datafim'];?>&Categoria=<?php echo $_GET['Categoria'];?>" <?php if($_GET['Exibe'] == "Pago"){ echo "selected";}?>> PAGO </option>
                    </select>
                    </div> 
                    
                  <div class="col-xs-2" style="float:right">
                  <label>Data Fim</label> 
                    <form name="form" id="form" method="get" action="listar_contas_agenciae.php">       
                    <input type="hidden" name="idcentrodecusto"  value="<?php echo $_GET['idcentrodecusto'];?>" />
                    <input type="hidden" name="tipo"  value="<?php echo $_GET['tipo'];?>" />
                    <input type="hidden" name="Filtro"  value="CentroDeCustoTodos" /> 
                    <input type="hidden" name="Exibe"  value="<?php echo $_GET['Exibe'];?>" />       
                    <input type="hidden" name="datainicio"  value="<?php echo $datainicio;?>" />
                    <input type="hidden" name="Categoria"  value="<?php echo $_GET['Categoria'];?>" />                                
                    <input name="datafim" type="date" id="datafim" class="form-control" value="<?php echo $datafim;?>" onchange="this.form.submit()" />
                    </form>
                    </div> 
                    
                  <div class="col-xs-2" style="float:right">
                  <label>Data Inicio</label> 
                    <form name="form" id="form" method="get" action="listar_contas_agenciae.php">       
                    <input type="hidden" name="idcentrodecusto"  value="<?php echo $_GET['idcentrodecusto'];?>" />
                    <input type="hidden" name="tipo"  value="<?php echo $_GET['tipo'];?>" />
                    <input type="hidden" name="Filtro"  value="CentroDeCustoTodos" /> 
                    <input type="hidden" name="Exibe"  value="<?php echo $_GET['Exibe'];?>" />       
                    <input type="hidden" name="datafim"  value="<?php echo $datafim;?>" /> 
                    <input type="hidden" name="Categoria"  value="<?php echo $_GET['Categoria'];?>" />           
                    <input name="datainicio" type="date" id="datainicio" class="form-control" value="<?php echo $datainicio;?>" onchange="this.form.submit()" />
                    </form>
                    </div>                                                                              
                  
                  
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table id="example1" class="table table-bordered table-striped">
                    <thead>
                      <tr>
                        <th style="cursor:pointer">Código</th>
                        <th style="cursor:pointer">Evento</th>
                        <th style="cursor:pointer">Tipo</th>
                        <?php if($_GET['tipo'] == "Pagar"){?>
                        <th style="cursor:pointer">Categoria</th>
                        <?php }?>                        
                        <th style="cursor:pointer">Titulo</th>
                        <th style="cursor:pointer">V. Bruto</th>
                        <th style="cursor:pointer">V. Liquido</th>                        
                        <th style="cursor:pointer">Data</th>
                        <th style="cursor:pointer">Status</th>
                        <!--<th style="cursor:pointer">Cadastrado por</th>-->
                        <th style="cursor:pointer">C. de Custo</th>
                        <th style="cursor:pointer" class="noprint"></th>
                        <th style="cursor:pointer" class="noprint"></th>
                        <th style="cursor:pointer" class="noprint"></th>
                        <th style="cursor:pointer" class="noprint"></th>
                      </tr>
                    </thead>
                    <tbody>
                    <?php
					
	$tipo = $_GET['tipo'];
	//$sql = "WHERE data_conta BETWEEN ('$datainicio') AND ('$datafim') AND tipo_conta='$tipo'";
	
	$sql = "
	SELECT 
	C.idconta, C.idcliente, C.idusuario, C.idfornecedor, C.nf, C.idobra, C.status_conta, C.data_conta, C.valor_conta, C.tipo_conta, C.titulo_conta, C.categoria_antiga, C.categoria, C.categoria2, C.categoria3, C.observacao, C.idcentrodecusto, CL.nome, F.nome AS nome_fornecedor, U.nome AS nome_usuario, CC.titulo AS nome_centrocusto, C1.titulo AS categoria1, C2.titulo AS categoria2, C3.titulo AS categoria3
	FROM contas AS C
	LEFT JOIN clientes AS CL ON C.idcliente = CL.idcliente
	LEFT JOIN fornecedores AS F ON C.idfornecedor = F.idfornecedor
	LEFT JOIN usuarios AS U ON C.idusuario = U.idusuario
	LEFT JOIN centrodecusto AS CC ON C.idcentrodecusto = CC.idcentrodecusto
	LEFT JOIN categorias_contas AS C1 ON C.categoria = C1.idcategoria_conta
	LEFT JOIN categorias_contas_nivel2 AS C2 ON C.categoria2 = C2.idcategoria_conta_nivel2
	LEFT JOIN categorias_contas_nivel3 AS C3 ON C.categoria3 = C3.idcategoria_conta_nivel3	
	WHERE C.data_conta BETWEEN ('$datainicio') AND ('$datafim') AND C.tipo_conta='$tipo'
	";
	
	if($_GET['Filtro'] == "CentroDeCustoTodos"){
	
	if($_GET['Exibe'] == ""){
	if($_GET['Categoria'] == ""){	
	echo "1";
		$sql_complementar = " AND C.idcentrodecusto='".$_GET['idcentrodecusto']."' ";
	}else{
		echo "2";
		$sql_complementar = " AND C.idcentrodecusto='".$_GET['idcentrodecusto']."' AND C.categoria='".$_GET['Categoria']."' ";
	}
	}else{
	if($_GET['Categoria'] == ""){	
		echo "3";	
		$sql_complementar = " AND C.status_conta='".$_GET['Exibe']."' AND C.idcentrodecusto='".$_GET['idcentrodecusto']."' ";
	}else{
		echo "4";
		$sql_complementar = " AND C.status_conta='".$_GET['Exibe']."' AND C.idcentrodecusto='".$_GET['idcentrodecusto']."' AND C.categoria='".$_GET['Categoria']."' ";
	}
	}
	}else{

	if($_GET['Exibe'] == ""){
	if($_GET['Categoria'] == ""){	
		echo "5";
		$sql_complementar = " ";
	}else{
		echo "6";
		$sql_complementar = " AND C.categoria='".$_GET['Categoria']."' ";
	}
	}else{
	if($_GET['Categoria'] == ""){
		echo "7";		
		$sql_complementar = " AND C.status_conta='".$_GET['Exibe']."' ";
	}else{
		echo "8";
		$sql_complementar = " AND C.status_conta='".$_GET['Exibe']."' AND C.categoria='".$_GET['Categoria']."' ";
	}
	}

	}
	
//echo $sql . $sql_complementar;
//exit();					
					$Seleciona = mysql_query($sql . $sql_complementar . " ORDER BY data_conta ASC", $conexao) or die(mysql_error());
										
					//$Seleciona = Seleciona("contas", "".$sql . $sql_complementar." AND excluido IS NULL", "ORDER BY data_conta ASC");

					while($linha = mysql_fetch_array($Seleciona)){
						$idconta_atual = $linha['idconta'];
						$idcliente = $linha['idcliente'];
						$idusuario = $linha['idusuario'];
						$idfornecedor = $linha['idfornecedor'];
					//SOMA PAGAMENTOS
					
					$SelecionaPagamentos = Seleciona("pagamentos", "WHERE idconta='$idconta_atual'", "");
					$TotalPagamentoAdd = mysql_num_rows($SelecionaPagamentos);
					
					$selec_produtos = "select sum(valor) AS soma FROM pagamentos WHERE idconta='$idconta_atual' AND status='Pago' AND excluido <> 'sim'";					
					$exec_produtos = mysql_query($selec_produtos, $conexao) or die(mysql_error());   
					    
					while($areceberpago_produto=mysql_fetch_array($exec_produtos)) {
					$TotalPagamento = $areceberpago_produto['soma'];	
					}
						
					
					if($idcliente != "" or $idcliente != 0){
                    $OrigemConta = "Cliente:" .$linha['nome'];
                    }
					
                    if($idusuario != "" or $idusuario != 0){    
					$OrigemConta = "Colaborador:" .$linha['nome_usuario'];
                    }
				
                    if($idfornecedor != "" or $idfornecedor != 0){  
					$OrigemConta = "Fornecedor:" .$linha['nome_fornecedor'];  
                    }
                                            
					if($linha['status_conta'] == "Pago"){
						$cor_celula = "#BFFFBF";
					}else{
						$cor_celula = "";
					}
					
					if($TotalPagamentoAdd == 0){
						$cor_celula = "#DFBFFF";
					}
					
					//VERIFICA SE CONTA FOI PAGA E JÁ ESTA PAGA
					
					if($linha['status_conta'] != "Pago" and $linha['valor_conta'] == $TotalPagamento){
							$AlterarConta = Alterar("contas", "status_conta='Pago'", "idconta", $linha['idconta']);
							$AlterarConta = Alterar("logs_financeiro", "status='Pago'", "idconta", $linha['idconta']);
							echo "<script> window.location.reload() </script>";	
						
							
					}
					?>
                      <tr style="cursor:pointer">
                        <form id="form_conta<?php echo $linha['idconta'];?>" method="post" enctype="multipart/form-data" action="listar_contas_agenciae.php?idcentrodecusto=<?php echo $_GET['idcentrodecusto'];?>&tipo=<?php echo $_GET['tipo'];?>&Filtro=<?php echo $_GET['Filtro'];?>&Exibe=<?php echo $_GET['Exibe'];?>&atualiza_linha=conta&idconta=<?php echo $linha['idconta'];?>">                                            
                        <td bgcolor="<?php echo $cor_celula;?>"><?php echo $linha['idconta'];?></td>
                        <td bgcolor="<?php echo $cor_celula;?>"><?php echo RetornaCampoGeral("obras", $linha['idobra'], "idobra", "codmax");?></td>
                        <td bgcolor="<?php echo $cor_celula;?>"><?php echo $linha['tipo_conta'];?></td>
                        <?php if($_GET['tipo'] == "Pagar"){?>
                        <td bgcolor="<?php echo $cor_celula;?>">  
                        <span style="font-size: 9px">                      
                        <?php 
						echo $linha['categoria1'] . " / " . $linha['categoria2']. " / " . $linha['categoria3'];
                        echo "<br>";
                        ?>                        
                        
                        <?php echo $linha['categoria_antiga'];?>
                        </span>
                        <?php }?>
                        </td>                        
                        <td bgcolor="<?php echo $cor_celula;?>">
						<input type="text" name="titulo_conta" class="form-control" value="<?php echo $linha['titulo_conta'];?>" style="font-size:11px; width:200px;">
                        <?php echo "<font style='font-size:2px; color: white' class='noprint'>" .$linha['titulo_conta'] . "</font>";?>
						<?php echo "<br>" . $OrigemConta;?>
						
                        
                        </td>
                        <td bgcolor="<?php echo $cor_celula;?>" data-search='<?php echo number_format($linha['valor_conta'], 2, ',', '.');?>' data-order='<?php echo $linha['valor_conta'];?>'>
						<input type="text" name="valor_conta" class="form-control" value="<?php echo $linha['valor_conta'];?>" style="font-size:11px; width:100px;">
						<?php echo "<font style='font-size:2px; color: white' class='noprint'>" .$linha['valor_conta'] . "</font>";?>
						</td>
                        <td bgcolor="<?php echo $cor_celula;?>">
						<input type="text" name="totalpagamento" class="form-control" value="<?php echo "R$ " . number_format($TotalPagamento, 2, ',', '.');?>" style="font-size:11px;  width:100px;" readonly>
						<?php echo "<font style='font-size:2px; color: white' class='noprint'>" .$TotalPagamento . "</font>";?>
                        
						
                        </td>                        
                        <td bgcolor="<?php echo $cor_celula;?>" data-search='<?php echo InverteDataNovoSeparador($linha['data_conta'], "-", "/");?>' data-order='<?php echo $linha['data_conta'];?>'>
						
                        <input type="date" name="data_conta" class="form-control" value="<?php echo $linha['data_conta'];?>" style="font-size:11px;">
                        <?php echo "<font style='font-size:2px; color: white' class='noprint'>" .InverteDataNovoSeparador($linha['data_conta'], "-", "/") . "</font>";?>
						</td>
                        <td bgcolor="<?php echo $cor_celula;?>"><?php echo $linha['status_conta'];?></td>
                        
                        <td bgcolor="<?php echo $cor_celula;?>" style="font-size:9px"><?php echo $linha['nome_centrocusto'];?></td>
                        <td bgcolor="<?php echo $cor_celula;?>"  class="noprint">
                        <a href='javascript:form_conta<?php echo $linha['idconta'];?>.submit()'>
                        <button type='button' class='btn btn-success' style=" float: right;" ><i class="fa fa-save" aria-hidden="true"></i></button>
                        </a>
                        </td>
                        <td bgcolor="<?php echo $cor_celula;?>"  class="noprint">
                        <a href="manutencao_contas_agenciae.php?idconta=<?php echo $linha['idconta'];?>&VerConta=Sim" target="_blank">
                        <button type='button' class='btn btn-twitter' style=" float: right;"><i class="fa fa-search" aria-hidden="true"></i></button>
                        </a>                          
                        </td>
                        <td bgcolor="<?php echo $cor_celula;?>"  class="noprint">
                        <a class="fancybox fancybox.iframe" style="color: #000000;" href="arquivos/index.php?origem=Contas&idconta=<?php echo $linha['idconta'];?>">
                        <button type="button" class="btn btn-github" style=" float: right;">
                        <i class="fa fa-file" aria-hidden="true"></i>
                        </button>   
                        </a>                          
                        </td>
                        <td bgcolor="<?php echo $cor_celula;?>"  class="noprint">
                        <a class="fancybox fancybox.iframe" style="color: #000000;" href="modificar_conta.php?idconta=<?php echo $linha['idconta'];?>&idcentrodecusto=<?php echo $linha['idcentrodecusto'];?>&data_vencimento=<?php echo $linha['data_conta'];?>&tipo=<?php echo $linha['tipo_conta'];?>">
                        <button type="button" class="btn btn-twitter" style=" float: right;">
                        <i class="fa fa-files-o" aria-hidden="true"></i>
                        </button>   
                        </a>                        
                        </td> 
                      </form>
                      </tr>
                      
                      <?php 
					  $TotalContaGeral[] = $linha['valor_conta'];
					  $TotalPagamentoGeral[] = $TotalPagamento;
                        $OrigemConta = "";
					  $TotalPagamento = "";
					  $NomeCliente = "";
					  $NomeFornecedor = "";
					  $NomeColaborador = "";
						$idconta_atual = "";
						$idcliente = "";
						$idusuario = "";
						$idfornecedor = "";
						$cor_celula = "";					  
					  }?>                      
                    </tbody>
                    <tfoot>
                      <tr>
                        <th style="cursor:pointer"></th>
                        <th style="cursor:pointer"></th>
                        <th style="cursor:pointer"></th>
                        <?php if($_GET['tipo'] == "Pagar"){?>
                        <th style="cursor:pointer"></th>
                        <?php }?>                        
                        <th style="cursor:pointer"></th>
                        <th style="cursor:pointer"><?php echo "R$ " . number_format(array_sum($TotalContaGeral), 2, ',', '.');?></th>
                        <th style="cursor:pointer"><?php echo "R$ " . number_format(array_sum($TotalPagamentoGeral), 2, ',', '.');?></th>                        
                        <th style="cursor:pointer"></th>
                        <th style="cursor:pointer"></th>
                        <!--<th style="cursor:pointer">Cadastrado por</th>-->
                        <th style="cursor:pointer"></th>
                        <th style="cursor:pointer" class="noprint"></th>
                        <th style="cursor:pointer" class="noprint"></th>
                        <th style="cursor:pointer" class="noprint"></th>
                        <th style="cursor:pointer" class="noprint"></th>
                      </tr>
                    </tfoot>                    
                  </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>      
<?php require_once('rodape.php');?>