require('connect.inc'); $sql = "Select SUM(b.boleValor) as total_mes, b.boleMes from sacado s, boleto b where s.sacaId = b.sacaId and b.retoId = 0 and b.boleQuitadoExternamente = 0 and s.sacaValDesconto <> 100.00 and s.sacaStatus <> 1 and s.sacaId <> 267 and b.boleMes <= month(now()) and b.boleAno = year(now()) group by boleMes order by boleMes"; $res = mysql_query("$sql", $bd) or die ('ERRO ---> '.$sql.' '.mysql_error($bd)); $Jan=$Fev=$Mar=$Abr=$Mai=$Jun=$Jul=$Ago=$Set=$Out=$Nov=$Dez = "R$ 0,0"; $ano = date(Y); while($row = mysql_fetch_array($res)){ switch ($row['boleMes']) { case 1: $Jan = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 2: $Fev = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 3: $Mar = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 4: $Abr = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 5: $Mai = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 6: $Jun = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 7: $Jul = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 8: $Ago= "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 9: $Set = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 10: $Out = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 11: $Nov = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; case 12: $Dez = "R$ ".str_replace('.',',',sprintf('%01.1f',$row['total_mes'])).""; break; } } ?>
![]() |
FURJ
- Fundação de Apoio a UNIRIO COBRANÇA |
![]() |
|