+<?php
+// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
+// +--------------------------------------------------------------------+
+// | Ministerio de EconomÃa |
+// | Intranet |
+// +--------------------------------------------------------------------+
+// | This file is part of Intranet. |
+// | |
+// | Intranet is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published |
+// | by the Free Software Foundation; either version 2 of the License, |
+// | or (at your option) any later version. |
+// | |
+// | Intranet is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Hooks; if not, write to the Free Software Foundation, |
+// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +--------------------------------------------------------------------+
+// | Creado: Tue Jul 8 12:37:27 2003 |
+// | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
+// +--------------------------------------------------------------------+
+//
+// $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $
+//
+
+require_once '../../lib/noticia.php';
+require_once '../local_lib/HTML_Noticia.php';
+require_once '../../lib/mecondavdb.php';
+
+// +X2C includes
+require_once 'HTML/Table.php';
+// ~X2C
+
+// +X2C Class 187 :HTML_Titulares
+/**
+ * @access public
+ */
+class HTML_Titulares extends HTML_Table {
+ /**
+ * @var int $antiguedad
+ * @access public
+ */
+ var $antiguedad = null;
+
+ /**
+ * @var int $grupo_secciones
+ * @access public
+ */
+ var $grupo_secciones;
+
+ // ~X2C
+
+ // +X2C Operation 190
+ /**
+ * @param int $grupo_secciones
+ * @param int $antiguedad
+ *
+ * @return void
+ * @access public
+ */
+ function HTML_Titulares($grupo_secciones = null, $antiguedad = null) // ~X2C
+ {
+ parent::HTML_Table(array('width'=>'600', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0'));
+ $db = MEconDAVDB::Connect();
+ $hoy = new Date();
+ $fecha_nuevo = $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 ";
+ if(!is_null($antiguedad))
+ {
+ $hoy->subtractSeconds(60*60*24*$antiguedad);
+ $fecha_limite = $hoy->format('%Y-%m-%d');
+ $query .= "AND Articles.publication_date > '$fecha_limite' ";
+ }
+ $query .= "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));
+ }
+ }
+
+
+ $this->addRow(array($ht1,$ht2));
+ }
+ // -X2C
+
+} // -X2C Class :HTML_Titulares
+?>