I created an if / elseif condition inside the foreache, to change the color of the payment status button. I have three status and three colors for home status. Only he's not picking up the colors. I think the problem is at the moment of clarifying the values for the variable. I'll send a print of my screen.
<?php$query=$this->sindico->get_listfinanceiro()->result();foreach($queryas$linha):echo'<tr>';printf('<td>%s/%s</td>',($linha->numero_apart)?:'/',($linha->nome_usu));printf('<td>%s</td>',$linha->data_pagamento);printf('<td>%s</td>',"Bs:".$linha->valor_pagamento);
$class = "" ;
if (!isset($linha->valor_pagamento["PAGO"])){
$class = 'btn-sucesso' ;}
elseif (!isset($linha->valor_pagamento["PENDENTE"])){
$class = 'btn-warning' ;}
elseif (!isset($linha->valor_pagamento['NO PAGO'])){
$class = 'btn-danger' ;}
printf('<td><button type="button" class="btn '.$class.' btn-xs">%s</button></td>', $linha->status_pagamento);
printf('<td class="text-center">%s</td>', '<div class="btn-group btn-xs"><button data-toggle="dropdown" class="btn btn-xs dropdown-toggle" data-original-title="" title="">Action<span class="caret"></span></button><ul class="dropdown-menu pull-right"><li><a href="editar/'.$linha->id_finan.'">Edit</a></li><li><a href="excluir/'.$linha->id_finan.'">Delete</a></li>' );
echo '</tr>';
endforeach;
?>