2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // +--------------------------------------------------------------------+
4 // | Ministerio de Economía |
6 // +--------------------------------------------------------------------+
7 // | This file is part of Intranet. |
9 // | Intranet is free software; you can redistribute it and/or modify |
10 // | it under the terms of the GNU General Public License as published |
11 // | by the Free Software Foundation; either version 2 of the License, |
12 // | or (at your option) any later version. |
14 // | Intranet is distributed in the hope that it will be useful, but |
15 // | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 // | General Public License for more details. |
19 // | You should have received a copy of the GNU General Public License |
20 // | along with Hooks; if not, write to the Free Software Foundation, |
21 // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 // +--------------------------------------------------------------------+
23 // | Creado: Tue Nov 4 18:17:24 2003
24 // | Autor: Myrna Degano <mdegan@mecon.gov.ar>
25 // +--------------------------------------------------------------------+
27 // $Id: xmi2code.tpl.php 50 2003-08-12 19:00:38Z mmarre $
30 require_once 'intranetdb.php';
31 require_once 'MECON/HTML/Image.php';
32 require_once 'MECON/HTML/Link.php';
36 require_once 'HTML/Table.php';
39 // +X2C Class 189 :Servicios_Informes
41 * Clase para la visualizaciOn de Informes Parlamentarios por Intranet.
42 Esto es provisorio, hasta tanto se defina cOmo han de actualizarse y mostrarse estos informes en la nueva Intranet.
46 class Servicios_Informes extends HTML_Table {
54 function getCSS() // ~X2C
56 return '/sistemas/intranet/css/servicios_informes.css';
65 function toHtml() // ~X2C
68 $dbh = IntranetDB::connect();
71 $IMG_l296 =& new MECON_HTML_Image('../../images/servicios_informes_l296.gif', '', array('height'=>'1', 'width'=>'296'));
72 $IMG_l24 =& new MECON_HTML_Image('../../images/servicios_informes_l296.gif', '', array('height'=>'1', 'width'=>'24'));
73 $IMG_l320 =& new MECON_HTML_Image('../../images/servicios_informes_l320.gif', '', array('height'=>'24', 'width'=>'320'));
74 $IMG_parl =& new MECON_HTML_Image('../../images/servicios_informes_parl.gif', '-', array('height'=>'24', 'width'=>'24'));
78 $sql= " SELECT headline, Articles.article_id, publication_date
79 FROM MEconDAV.Articles, MEconDAV.ArticlePublicationStates
80 WHERE section_id = $SECCION AND
81 Articles.article_publication_state_id=ArticlePublicationStates.article_publication_state_id AND
82 ArticlePublicationStates.publication_state_id=5
83 ORDER BY publication_date desc, Articles.article_id desc";
84 $informes = $dbh->getAll($sql);
86 $cant_col2 = intval(count($informes)/2);
87 $cant_col1 = count($informes) - $cant_col2;
89 $tabla_out =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="660" align="center"');
91 $tabla_col1 =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="320"');
92 for ($i=0; $i<$cant_col1; $i++){
93 $tabla_col1->addRow(array($informes[$i][0]), array('class'=>'servicios_informes_informe', 'colspan'=>'2'));
94 $tabla_col1->addRow(array($IMG_l24->toHtml(), $IMG_l296->toHtml()));
97 $sql = "SELECT file_for_article_id, mimetype, filename, caption
98 FROM MEconDAV.FilesForArticle
99 WHERE article_id = ". $informes[$i][1]. " AND
100 (oculto <> 1 OR oculto IS NULL)
101 ORDER BY file_for_article_id ASC";
102 $adjuntos = $dbh->getAll($sql);
104 foreach ($adjuntos as $item){
105 $url = '/sistemas/intranet/servicios/informes/get_file.php';
106 $link_adjunto = new MECON_HTML_Link($url,
108 array('id'=>$item[0]),
109 array('target'=>'_blank'));
110 $tabla_col1->addRow(array($IMG_parl->toHtml(), $link_adjunto->toHtml()), array('class'=>'servicios_informes_adjunto'));
113 $tabla_col1->addRow(array($IMG_l320->toHtml()), array('colspan'=>'2'));
116 $tabla_col2 =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="320"');
117 for ($i=$cant_col1; $i<count($informes); $i++){
118 $tabla_col2->addRow(array($informes[$i][0]), array('class'=>'servicios_informes_informe', 'colspan'=>'2'));
119 $tabla_col2->addRow(array($IMG_l24->toHtml(), $IMG_l296->toHtml()));
122 $sql = "SELECT file_for_article_id, mimetype, filename, caption
123 FROM MEconDAV.FilesForArticle
124 WHERE article_id = ". $informes[$i][1]. " AND
125 (oculto <> 1 OR oculto IS NULL)
126 ORDER BY file_for_article_id ASC";
127 $adjuntos = $dbh->getAll($sql);
129 foreach ($adjuntos as $item){
130 $url = '/sistemas/intranet/servicios/informes/get_file.php';
131 $link_adjunto = new MECON_HTML_Link($url,
133 array('id'=>$item[0]),
134 array('target'=>'_blank'));
135 $tabla_col2->addRow(array($IMG_parl->toHtml(), $link_adjunto->toHtml()), array('class'=>'servicios_informes_adjunto'));
138 $tabla_col2->addRow(array($IMG_l320->toHtml()), array('colspan'=>'2'));
141 $tabla_out->addRow(array($tabla_col1->toHtml(), $tabla_col2->toHtml()), array('align'=>'center', 'valign'=>'top'));
143 return $tabla_out->toHtml();
147 } // -X2C Class :Servicios_Informes