Hola amigos. Tengo este codigo que me trae todos los datos de los pagos realizados, pero quisiera que me pusiera en rojo los que no han pagado y no se como hacerlo. Este es el código:
Código PHP:
Ver original<html>
<?php
$ruta = '..';
include ('../func/func.php');
$conn = db_connect();
if (!$conn)
return 0;
$mes_actual = 'Noviembre';
$ciclo_actual ='2011-2012';
?>
<body>
<table id="mytable">
<?php
$result = mysql_query("SELECT * FROM deuda where ciclo='$ciclo_actual'");
$paging = new PHPPaging($conn);
$hasta = 25;
if($pag==""){
$desde = 0;
$pag = 1;
}
else{
$pag = $_GET["pag"];
$pagS = $pag - 1;
$desde = $hasta * $pagS;
}
echo
"
<tr>
<th><div align=\"center\"><strong>Cedula</strong></div></th>
<th><div align=\"center\"><strong>Agosto</strong></div></th>
<th><div align=\"center\"><strong>Septiembre</strong></div></th>
<th><div align=\"center\"><strong>Octubre</strong></div></th>
<th><div align=\"center\"><strong>Noviembre</strong></div></th>
<th><div align=\"center\"><strong>Diciembre</strong></div></th>
<th><div align=\"center\"><strong>Enero</strong></div></th>
<th><div align=\"center\"><strong>Febrero</strong></div></th>
<th><div align=\"center\"><strong>Marzo</strong></div></th>
<th><div align=\"center\"><strong>Abril</strong></div></th>
<th><div align=\"center\"><strong>Mayo</strong></div></th>
<th><div align=\"center\"><strong>Junio</strong></div></th>
<th><div align=\"center\"><strong>Julio</strong></div></th>
</tr>
<tr>";
$result = "SELECT * FROM deuda ORDER BY id_deuda ASC";
$paging->agregarConsulta($result);
// Ejecutamos la paginación
$paging->ejecutar();
while ($result = $paging->fetchResultado()) {
$rci = $result['rci'];
$agosto = $result['agosto'];
$septiembre = $result['septiembre'];
$octubre = $result['octubre'];
$noviembre = $result['noviembre'];
$diciembre = $result['diciembre'];
$enero = $result['enero'];
$febrero = $result['febrero'];
$marzo = $result['marzo'];
$abril = $result['abril'];
$mayo = $result['mayo'];
$junio = $result['junio'];
$julio = $result['julio'];
if ($agosto == 0) {
$agosto2 = 'NP';
} else {
$agosto2 = 'P';
}
if ($septiembre == 0) {
$septiembre2 = 'NP';
} else {
$septiembre2 = 'P';
}
if ($octubre == 0) {
$octubre2 = 'NP';
} else {
$octubre2 = 'P';
}
if ($noviembre == 0) {
$noviembre2 = 'NP';
} else {
$noviembre2 = 'P';
}
if ($diciembre == 0) {
$diciembre2 = 'NP';
} else {
$diciembre2 = 'P';
}
if ($enero == 0) {
$enero2 = 'NP';
} else {
$enero2 = 'P';
}
if ($febrero == 0) {
$febrero2 = 'NP';
} else {
$febrero2 = 'P';
}
if ($marzo == 0) {
$marzo2 = 'NP';
} else {
$marzo2 = 'P';
}
if ($abril == 0) {
$abril2 = 'NP';
} else {
$abril2 = 'P';
}
if ($mayo == 0) {
$mayo2 = 'NP';
} else {
$mayo2 = 'P';
}
if ($junio == 0) {
$junio2 = 'NP';
} else {
$junio2 = 'P';
}
if ($julio == 0) {
$julio2 = 'NP';
} else {
$julio2 = 'P';
}
echo "
<td><div align=\"center\">$rci</div></td>
<td><div align=\"center\">$agosto2</div></td>
<td><div align=\"center\">$septiembre2</div></td>
<td><div align=\"center\">$octubre2</div></td>
<td><div align=\"center\">$noviembre2</div></td>
<td><div align=\"center\">$diciembre2</div></td>
<td><div align=\"center\">$enero2</div></td>
<td><div align=\"center\">$febrero2</div></td>
<td><div align=\"center\">$marzo2</div></td>
<td><div align=\"center\">$abril2</div></td>
<td><div align=\"center\">$mayo2</div></td>
<td><div align=\"center\">$junio2</div></td>
<td><div align=\"center\">$julio2</div></td>
</tr>
";
}
?>
</table>
<?php
echo "<b>Navegacion</b>: ".$paging->fetchNavegacion();
?>
</body>
</html>
Traté de ponerlo asi:
Código PHP:
Ver originalif ($agosto == 0) {
$agosto2 = 'NP';
"<font color='red'>" .$agosto2 ."</font>";
} else {
$agosto2 = 'P';
}
pero no funciona. Les agradezco su ayuda para aprender a hacerlo.