// +--------------------------------------------------------------------+ // // $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; $iaddRow(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 ?>