<html>
<head>
<title> FOLHA DE PAGAMENTO </title>
<link href="inclusos/css_precopratico.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
error_reporting(0);
ini_set("display_errors", 0 );
header('Content-Type: text/html; charset=utf-8');
include("configuracao.php");//confirma no banco de dados
include("inclusos/funcoes.php");
include("seguranca.php"); // Inclui o arquivo com o sistema de seguran?a
protegePagina(); // Protege a página
?>

<?php
$SelecionaObrasServico = Seleciona("usuarios", "WHERE idcentrodecusto IS NOT NULL", "ORDER BY nome ASC");
$contar = mysql_num_rows($SelecionaObrasServico);

for($i=0;$i<1;$i++){   
$html[$i] = "";
    $html[$i] .= "<table id='tblExport'>";
    $html[$i] .= "<tr>";
    $html[$i] .= "<td bgcolor='red'><b>Cód.(NÃO EXCLUIR)</b></td>";
    $html[$i] .= "<td bgcolor='red'><b>Colaborador</b></td>";
    $html[$i] .= "<td><b>Adto. de Salário</b></td>";
	$html[$i] .= "<td><b>Salário</b></td>";	
    $html[$i] .= "<td><b>Valor VR</b></td>";
	$html[$i] .= "<td><b>Valor Transporte</b></td>";	
	$html[$i] .= "<td><b>1º Parc. 13º</b></td>";
    $html[$i] .= "<td><b>2º Parc. 13º</b></td>";    
    $html[$i] .= "<td><b>Data de Pagamento (00/00/0000)</b></td>";
	$html[$i] .= "<td bgcolor='red'><b>Nome Centro de Custo</b></td>";	
    $html[$i] .= "<td bgcolor='red'><b>Centro De Custo (id)</b></td>";						
    $html[$i] .= "</tr>";
}

$i = 1;
while($ret = mysql_fetch_array($SelecionaObrasServico)){
    $html[$i] .= "<tr>";
    $html[$i] .= "<td bgcolor='red'><b>".$ret['idusuario']."</b></td>";
    $html[$i] .= "<td bgcolor='red'><b>".$ret['nome']."</b></td>";
    $html[$i] .= "<td></td>";	
    $html[$i] .= "<td></td>";
    $html[$i] .= "<td></td>";
    $html[$i] .= "<td></td>";
    $html[$i] .= "<td></td>";
	$html[$i] .= "<td></td>";
	$html[$i] .= "<td></td>";	
    $html[$i] .= "<td bgcolor='red'><b>".NomeCentroCusto($ret['idcentrodecusto'])."</b></td>";
	$html[$i] .= "<td bgcolor='red'><b>".$ret['idcentrodecusto']."</b></td>";	
    $html[$i] .= "</tr>";
    $i++;
}
    $html[$i] .= "</table>";
for($i=0;$i<=$contar;$i++){  
    echo $html[$i];
}	

?>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="js/excel/jquery.btechco.excelexport.js" charset="utf8"></script>
<script src="js/excel/jquery.base64.js" charset="utf8"></script>
<script>
    $(document).ready(function () {
            $("#tblExport").btechco_excelexport({
                containerid: "tblExport"
               , datatype: $datatype.Table
               , filename: 'FOLHA DE PAGAMENTO - <?php echo date('d/m/Y');?>'
            });
			window.close();
    });
</script>
</body>
</html>