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 'DB.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 $css = '/sistemas/intranet/css/servicios_informes.css';
66 function toHtml() // ~X2C
69 $dbh = DB::connect("mysql://mark:mark@intranet-db/MEconDAV");
72 $IMG_l296 =& new MECON_HTML_Image('../../images/servicios_informes_l296.gif', '', array('height'=>'1', 'width'=>'296'));
73 $IMG_l24 =& new MECON_HTML_Image('../../images/servicios_informes_l296.gif', '', array('height'=>'1', 'width'=>'24'));
74 $IMG_l320 =& new MECON_HTML_Image('../../images/servicios_informes_l320.gif', '', array('height'=>'24', 'width'=>'320'));
75 $IMG_parl =& new MECON_HTML_Image('../../images/servicios_informes_parl.gif', '-', array('height'=>'24', 'width'=>'24'));
79 $sql= " SELECT headline, Articles.article_id, publication_date
80 FROM Articles, ArticlePublicationStates
81 WHERE section_id = $SECCION AND
82 Articles.article_publication_state_id=ArticlePublicationStates.article_publication_state_id AND
83 ArticlePublicationStates.publication_state_id=5
84 ORDER BY publication_date desc, Articles.article_id desc";
85 $informes = $dbh->getAll($sql);
87 $cant_col2 = intval(count($informes)/2);
88 $cant_col1 = count($informes) - $cant_col2;
90 $tabla_out =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="660" align="center"');
92 $tabla_col1 =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="320"');
93 for ($i=0; $i<$cant_col1; $i++){
94 $tabla_col1->addRow(array($informes[$i][0]), array('class'=>'servicios_informes_informe', 'colspan'=>'2'));
95 $tabla_col1->addRow(array($IMG_l24->toHtml(), $IMG_l296->toHtml()));
98 $sql = "SELECT file_for_article_id, mimetype, filename, caption
100 WHERE article_id = ". $informes[$i][1]. " AND
101 (oculto <> 1 OR oculto IS NULL)
102 ORDER BY file_for_article_id ASC";
103 $adjuntos = $dbh->getAll($sql);
105 foreach ($adjuntos as $item){
106 $url = '/sistemas/intranet/servicios/informes/get_file.php';
107 $link_adjunto = new MECON_HTML_Link($url,
109 array('id'=>$item[0]),
110 array('target'=>'_blank'));
111 $tabla_col1->addRow(array($IMG_parl->toHtml(), $link_adjunto->toHtml()), array('class'=>'servicios_informes_adjunto'));
114 $tabla_col1->addRow(array($IMG_l320->toHtml()), array('colspan'=>'2'));
117 $tabla_col2 =& new HTML_Table('border="0" cellPadding="0" cellSpacing="0" width="320"');
118 for ($i=$cant_col1; $i<count($informes); $i++){
119 $tabla_col2->addRow(array($informes[$i][0]), array('class'=>'servicios_informes_informe', 'colspan'=>'2'));
120 $tabla_col2->addRow(array($IMG_l24->toHtml(), $IMG_l296->toHtml()));
123 $sql = "SELECT file_for_article_id, mimetype, filename, caption
125 WHERE article_id = ". $informes[$i][1]. " AND
126 (oculto <> 1 OR oculto IS NULL)
127 ORDER BY file_for_article_id ASC";
128 $adjuntos = $dbh->getAll($sql);
130 foreach ($adjuntos as $item){
131 $url = '/sistemas/intranet/servicios/informes/get_file.php';
132 $link_adjunto = new MECON_HTML_Link($url,
134 array('id'=>$item[0]),
135 array('target'=>'_blank'));
136 $tabla_col2->addRow(array($IMG_parl->toHtml(), $link_adjunto->toHtml()), array('class'=>'servicios_informes_adjunto'));
139 $tabla_col2->addRow(array($IMG_l320->toHtml()), array('colspan'=>'2'));
142 $tabla_out->addRow(array($tabla_col1->toHtml(), $tabla_col2->toHtml()), array('align'=>'center', 'valign'=>'top'));
144 return $tabla_out->toHtml();
148 } // -X2C Class :Servicios_Informes