+<?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 Nov 4 18:17:24 2003
+// | Autor: Myrna Degano <mdegan@mecon.gov.ar>
+// +--------------------------------------------------------------------+
+//
+// $Id: xmi2code.tpl.php 50 2003-08-12 19:00:38Z mmarre $
+//
+
+require_once 'DB.php';
+require_once 'MECON/HTML/Image.php';
+require_once 'MECON/HTML/Link.php';
+
+
+// +X2C includes
+require_once 'HTML/Table.php';
+// ~X2C
+
+// +X2C Class 189 :Servicios_Informes
+/**
+ * Clase para la visualizaciOn de Informes Parlamentarios por Intranet.
+Esto es provisorio, hasta tanto se defina cOmo han de actualizarse y mostrarse estos informes en la nueva Intranet.
+ *
+ * @access public
+ */
+class Servicios_Informes extends HTML_Table {
+ // ~X2C
+
+ // +X2C Operation 191
+ /**
+ * @return string
+ * @access public
+ */
+ function getCSS() // ~X2C
+ {
+ $css = '/sistemas/intranet/css/servicios_informes.css';
+ return $css;
+ }
+ // -X2C
+
+ // +X2C Operation 192
+ /**
+ * @return string
+ * @access public
+ */
+ function toHtml() // ~X2C
+ {
+ //Base de Datos
+ $dbh = DB::connect("mysql://mark:mark@intranet-db/MEconDAV");
+
+ //Imágenes
+ $IMG_l296 =& new MECON_HTML_Image('../../images/servicios_informes_l296.gif', '', array('height'=>'1', 'width'=>'296'));
+ $IMG_l24 =& new MECON_HTML_Image('../../images/servicios_informes_l296.gif', '', array('height'=>'1', 'width'=>'24'));
+ $IMG_l320 =& new MECON_HTML_Image('../../images/servicios_informes_l320.gif', '', array('height'=>'24', 'width'=>'320'));
+ $IMG_parl =& new MECON_HTML_Image('../../images/servicios_informes_parl.gif', '-', array('height'=>'24', 'width'=>'24'));
+
+ //Informes
+ $SECCION = 53;
+ $sql= " SELECT headline, Articles.article_id, publication_date
+ FROM Articles, ArticlePublicationStates
+ WHERE section_id = $SECCION AND
+ Articles.article_publication_state_id=ArticlePublicationStates.article_publication_state_id AND
+ ArticlePublicationStates.publication_state_id=5
+ ORDER BY publication_date desc, Articles.article_id desc";
+ $informes = $dbh->getAll($sql);
+
+ $cant_col2 = intval(count($informes)/2);
+ $cant_col1 = count($informes) - $cant_col2;
+
+ $tabla_out =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="660" align="center"');
+
+ $tabla_col1 =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="320"');
+ for ($i=0; $i<$cant_col1; $i++){
+ $tabla_col1->addRow(array($informes[$i][0]), array('class'=>'servicios_informes_informe', 'colspan'=>'2'));
+ $tabla_col1->addRow(array($IMG_l24->toHtml(), $IMG_l296->toHtml()));
+
+ //Obtener Adjuntos
+ $sql = "SELECT file_for_article_id, mimetype, filename, caption
+ FROM FilesForArticle
+ WHERE article_id = ". $informes[$i][1]. " AND
+ (oculto <> 1 OR oculto IS NULL)
+ ORDER BY file_for_article_id ASC";
+ $adjuntos = $dbh->getAll($sql);
+
+ foreach ($adjuntos as $item){
+ $url = '/sistemas/intranet/servicios/informes/get_file.php';
+ $link_adjunto = new MECON_HTML_Link($url,
+ $item[3],
+ array('id'=>$item[0]),
+ array('target'=>'_blank'));
+ $tabla_col1->addRow(array($IMG_parl->toHtml(), $link_adjunto->toHtml()), array('class'=>'servicios_informes_adjunto'));
+ }
+
+ $tabla_col1->addRow(array($IMG_l320->toHtml()), array('colspan'=>'2'));
+ }
+
+ $tabla_col2 =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="320"');
+ for ($i=$cant_col1; $i<count($informes); $i++){
+ $tabla_col2->addRow(array($informes[$i][0]), array('class'=>'servicios_informes_informe', 'colspan'=>'2'));
+ $tabla_col2->addRow(array($IMG_l24->toHtml(), $IMG_l296->toHtml()));
+
+ //Obtener Adjuntos
+ $sql = "SELECT file_for_article_id, mimetype, filename, caption
+ FROM FilesForArticle
+ WHERE article_id = ". $informes[$i][1]. " AND
+ (oculto <> 1 OR oculto IS NULL)
+ ORDER BY file_for_article_id ASC";
+ $adjuntos = $dbh->getAll($sql);
+
+ foreach ($adjuntos as $item){
+ $url = '/sistemas/intranet/servicios/informes/get_file.php';
+ $link_adjunto = new MECON_HTML_Link($url,
+ $item[3],
+ array('id'=>$item[0]),
+ array('target'=>'_blank'));
+ $tabla_col2->addRow(array($IMG_parl->toHtml(), $link_adjunto->toHtml()), array('class'=>'servicios_informes_adjunto'));
+ }
+
+ $tabla_col2->addRow(array($IMG_l320->toHtml()), array('colspan'=>'2'));
+ }
+
+ $tabla_out->addRow(array($tabla_col1->toHtml(), $tabla_col2->toHtml()), array('align'=>'center', 'valign'=>'top'));
+
+ return $tabla_out->toHtml();
+ }
+ // -X2C
+
+} // -X2C Class :Servicios_Informes
+?>
\ No newline at end of file