]> git.llucax.com Git - mecon/intranet.git/commitdiff
Ahora tiene 2 tablas para las noticias desacomodadas
authorGonzalo Merayo <merayo@gmail.com>
Mon, 7 Jul 2003 19:23:53 +0000 (19:23 +0000)
committerGonzalo Merayo <merayo@gmail.com>
Mon, 7 Jul 2003 19:23:53 +0000 (19:23 +0000)
sistema/www/noticias.php

index a53f34fd0550e581a89f2cb967344066f126ace4..90f53319c8d719ac07bc338a081fc5fa7ca5df38 100644 (file)
        $result = $db->query($query);
        if(DB::isError($result))
          die($result->getMessage("query mal hecho"));
-       $ht = new HTML_Table(array('width'=>'600', 'border'=>'0', 'cellspacing'=>'0'));
-       $not1 = $not2 = null;
+       $ht1 = new HTML_Table(array('width'=>'300', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0'));
+       $ht2 = new HTML_Table(array('width'=>'300', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0'));
+       $impar = true;
        while($row = $result->fetchRow())
        {
-         
          $n = new noticia($row[0]);
          $not = new HTML_Noticia($n);
         if($row[1] == 'NUEVA')
              $not->setNuevo(true);
-        if(is_null($not1)) $not1 = $not;
-        elseif(is_null($not2))
+        if($impar)
         {
-          $not2 = $not;
-           $ht->addRow(array($not1, $not2));
+          $impar = false;
+           $ht1->addRow(array($not));
         }
         else
         {
-          $not1 = $not;
-          $not2 = null;
+          $impar = true;
+           $ht2->addRow(array($not));
         }
        }
-       if(is_null($not2)) $ht->addRow(array($not1));
+       $ht = new HTML_Table(array('width'=>'300', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0'));
+       $ht->addRow(array($ht1,$ht2));
        $ht->display();
     ?>
     </td>