Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/11/2011, 07:56
Avatar de kimmy
kimmy
 
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 16 años, 6 meses
Puntos: 15
Pregunta Poner en rojo los que no pagaron

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
  1. <html>
  2. <?php
  3. $ruta = '..';
  4. include ('../func/func.php');
  5.  
  6.   $conn = db_connect();
  7.   if (!$conn)
  8.    return 0;
  9.    
  10. $mes_actual = 'Noviembre';
  11. $ciclo_actual ='2011-2012';
  12. ?>
  13. <body>
  14. <table id="mytable">
  15.  
  16. <?php
  17.  
  18. $result = mysql_query("SELECT * FROM deuda where ciclo='$ciclo_actual'");
  19.  
  20. $paging = new PHPPaging($conn);
  21.  
  22. $hasta = 25;
  23.  
  24. if($pag==""){
  25.  $desde = 0;
  26.  $pag = 1;    
  27. }
  28. else{
  29.  $pag = $_GET["pag"];
  30.  $pagS = $pag - 1;
  31.  $desde = $hasta * $pagS;    
  32. }
  33.     echo
  34. "
  35.          <tr>
  36.         <th><div align=\"center\"><strong>Cedula</strong></div></th>
  37.         <th><div align=\"center\"><strong>Agosto</strong></div></th>
  38.            <th><div align=\"center\"><strong>Septiembre</strong></div></th>
  39.            <th><div align=\"center\"><strong>Octubre</strong></div></th>
  40.         <th><div align=\"center\"><strong>Noviembre</strong></div></th>
  41.         <th><div align=\"center\"><strong>Diciembre</strong></div></th>
  42.            <th><div align=\"center\"><strong>Enero</strong></div></th>
  43.            <th><div align=\"center\"><strong>Febrero</strong></div></th>
  44.            <th><div align=\"center\"><strong>Marzo</strong></div></th>
  45.            <th><div align=\"center\"><strong>Abril</strong></div></th>
  46.            <th><div align=\"center\"><strong>Mayo</strong></div></th>
  47.            <th><div align=\"center\"><strong>Junio</strong></div></th>
  48.            <th><div align=\"center\"><strong>Julio</strong></div></th>
  49.            </tr>
  50.          <tr>";
  51.  
  52.  
  53. $result = "SELECT * FROM deuda ORDER BY id_deuda ASC";           
  54.  
  55. $paging->agregarConsulta($result);
  56.  
  57. // Ejecutamos la paginación
  58. $paging->ejecutar();
  59.  
  60. while ($result  = $paging->fetchResultado()) {
  61. $rci = $result['rci'];
  62. $agosto = $result['agosto'];
  63. $septiembre = $result['septiembre'];
  64. $octubre = $result['octubre'];
  65. $noviembre = $result['noviembre'];
  66. $diciembre = $result['diciembre'];
  67. $enero = $result['enero'];
  68. $febrero = $result['febrero'];
  69. $marzo = $result['marzo'];
  70. $abril = $result['abril'];
  71. $mayo = $result['mayo'];
  72. $junio = $result['junio'];
  73. $julio = $result['julio'];
  74.  
  75. if ($agosto == 0) {
  76.     $agosto2 = 'NP';
  77. } else {
  78.     $agosto2 = 'P';
  79. }
  80.  
  81. if ($septiembre == 0) {
  82.     $septiembre2 = 'NP';
  83. } else {
  84.     $septiembre2 = 'P';
  85. }
  86.  
  87. if ($octubre == 0) {
  88.     $octubre2 = 'NP';
  89. } else {
  90.     $octubre2 = 'P';
  91. }
  92.  
  93. if ($noviembre == 0) {
  94.     $noviembre2 = 'NP';
  95. } else {
  96.     $noviembre2 = 'P';
  97. }
  98.  
  99. if ($diciembre == 0) {
  100.     $diciembre2 = 'NP';
  101. } else {
  102.     $diciembre2 = 'P';
  103. }
  104.  
  105. if ($enero == 0) {
  106.     $enero2 = 'NP';
  107. } else {
  108.     $enero2 = 'P';
  109. }
  110.  
  111. if ($febrero == 0) {
  112.     $febrero2 = 'NP';
  113. } else {
  114.     $febrero2 = 'P';
  115. }
  116.  
  117. if ($marzo == 0) {
  118.     $marzo2 = 'NP';
  119. } else {
  120.     $marzo2 = 'P';
  121. }
  122.  
  123. if ($abril == 0) {
  124.     $abril2 = 'NP';
  125. } else {
  126.     $abril2 = 'P';
  127. }
  128.  
  129. if ($mayo == 0) {
  130.     $mayo2 = 'NP';
  131. } else {
  132.     $mayo2 = 'P';
  133. }
  134.  
  135. if ($junio == 0) {
  136.     $junio2 = 'NP';
  137. } else {
  138.     $junio2 = 'P';
  139. }
  140.  
  141. if ($julio == 0) {
  142.     $julio2 = 'NP';
  143. } else {
  144.     $julio2 = 'P';
  145. }
  146.  
  147. echo "
  148.         <td><div align=\"center\">$rci</div></td>
  149.         <td><div align=\"center\">$agosto2</div></td>
  150.         <td><div align=\"center\">$septiembre2</div></td>  
  151.         <td><div align=\"center\">$octubre2</div></td>
  152.         <td><div align=\"center\">$noviembre2</div></td>
  153.         <td><div align=\"center\">$diciembre2</div></td>
  154.            <td><div align=\"center\">$enero2</div></td>
  155.            <td><div align=\"center\">$febrero2</div></td>
  156.            <td><div align=\"center\">$marzo2</div></td>
  157.            <td><div align=\"center\">$abril2</div></td>
  158.            <td><div align=\"center\">$mayo2</div></td>
  159.            <td><div align=\"center\">$junio2</div></td>
  160.            <td><div align=\"center\">$julio2</div></td>
  161.          
  162.              </tr>
  163.             ";
  164. }  
  165. ?>
  166. </table>
  167. <?php
  168.     echo "<b>Navegacion</b>: ".$paging->fetchNavegacion();
  169.     mysql_close($conn);
  170. ?>
  171. </body>
  172. </html>

Traté de ponerlo asi:

Código PHP:
Ver original
  1. if ($agosto == 0) {
  2.     $agosto2 = 'NP';
  3.     "<font color='red'>" .$agosto2 ."</font>";
  4. } else {
  5.     $agosto2 = 'P';
  6. }

pero no funciona. Les agradezco su ayuda para aprender a hacerlo.
__________________
Caminando con el corazón partío