<?php

include './ControladorCr.php';
$controlador = new ControladorCr();
$data = new Data();
$String = new CString();
$CodAgrupamento = $_POST["POST_COD"];
$ArrayRegistros = $controlador->getListaTitulosAgrupamento($CodAgrupamento);

$TotalParcelasAgrupamento = trim($ArrayRegistros[0]->getTotalParcelasAgrupamento()) == 1 ? "Agrupamento não foi parcelado" : "Agrupamento parcelado em " . $ArrayRegistros[0]->getTotalParcelasAgrupamento() . " parcelas";

//$TotalParcelasAgrupamento = $ArrayRegistros[0]->getTotalParcelasAgrupamento();
if ($ArrayRegistros != null) {
    $Html = "
	<h5 align='center'><span class='label label-info'>$TotalParcelasAgrupamento</span></h5>

       <table border='1' class='tabela table-hover' id='tabelaCr'>
    	<thead>
    	    <tr> 
    		<th align='center'>Cód.</th>
    		<th align='center'>Parc.</th>
    		<th align='center'>Empresa</th>
    		<th align='center'>Descricao</th>
		<th align='center'>Receita</th>
    		<th align='center'>Valor</th>
    		<th align='center'>Vencimento</th>
    		<th align='center'>Status</th>
		<th align='center'>Fechamento</th>
    	    </tr>
    	</thead>