X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/f5f3a1c3c7197cc0baa49fc15f96a27054c49f64..83cf0a600579a4b59b7458f42eacf92eb75ba5b5:/sistema/www/noticias.php diff --git a/sistema/www/noticias.php b/sistema/www/noticias.php index 90f5331..8a6c0b2 100644 --- a/sistema/www/noticias.php +++ b/sistema/www/noticias.php @@ -2,72 +2,25 @@ require_once '../local_lib/copete.php'; $c = new Copete('noticias'); - echo $c->toHTML(); -?> -
- - require_once '../local_lib/intranetdb.php'; - require_once 'MECON/HTML/Arbol/ArbolDB.php'; - $db = IntranetDB::connect(); - $dbdata = array( + $c->display(); + $noticias = new HTML_Table(array('width' => '760', 'border' => '0')); + require_once '../local_lib/intranetdb.php'; + require_once 'MECON/HTML/Arbol/ArbolDB.php'; + $db = IntranetDB::connect(); + $dbdata = array( 'db' => $db, 'tabla' => 'grupo_secciones', 'id' => 'grupo', 'nombre' => 'nombre', 'id_padre' => 'grupo_padre', 'prepend_link' => 'noticias.php?grupo='); - $arbol = new HTML_ArbolDB($dbdata, '/MECON/images/arbol_noticias.gif'); - echo $arbol->toHTML(); - ?> - | -- - require_once '../../lib/noticia.php'; - require_once '../local_lib/HTML_Noticia.php'; - require_once '../../lib/mecondavdb.php'; - $db = MEconDAVDB::Connect(); - $hoy = new Date(); - $fecha_nuevo = $hoy->format('%Y-%m-%d'); - $hoy->subtractSeconds(60*60*24*7);//7 dias - $fecha_limite = $hoy->format('%Y-%m-%d'); - $query = "SELECT Articles.article_id, - IF(Articles.publication_date > '$fecha_nuevo', 'NUEVA', null) - FROM Articles, ArticlePublicationStates - WHERE Articles.article_publication_state_id = - ArticlePublicationStates.article_publication_state_id - AND ArticlePublicationStates.publication_state_id=5 - AND Articles.publication_date > '$fecha_limite' - ORDER BY Articles.publication_date desc"; - $result = $db->query($query); - if(DB::isError($result)) - die($result->getMessage("query mal hecho")); - $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($impar) - { - $impar = false; - $ht1->addRow(array($not)); - } - else - { - $impar = true; - $ht2->addRow(array($not)); - } - } - $ht = new HTML_Table(array('width'=>'300', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0')); - $ht->addRow(array($ht1,$ht2)); - $ht->display(); - ?> - | -