From: Myrna Degano Date: Wed, 5 Nov 2003 17:19:25 +0000 (+0000) Subject: Se agregan en Servicios los Informes Parlamentarios. X-Git-Tag: svn_import~101 X-Git-Url: https://git.llucax.com/mecon/intranet.git/commitdiff_plain/4f8bc31d20f46ddb617fc55800841d680337155b?ds=sidebyside Se agregan en Servicios los Informes Parlamentarios. --- diff --git a/doc/servicios/informes/informes.xmi b/doc/servicios/informes/informes.xmi new file mode 100644 index 0000000..a9774b4 --- /dev/null +++ b/doc/servicios/informes/informes.xmi @@ -0,0 +1,63 @@ + + + + + umbrello uml modeller http://uml.sf.net + 1.1.5 + UnicodeUTF8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/servicios/informes/xmi2code.config b/doc/servicios/informes/xmi2code.config new file mode 100644 index 0000000..79972cf --- /dev/null +++ b/doc/servicios/informes/xmi2code.config @@ -0,0 +1,49 @@ + + + + + diff --git a/doc/servicios/informes/xmi2code.tpl.php b/doc/servicios/informes/xmi2code.tpl.php new file mode 100644 index 0000000..922e1ee --- /dev/null +++ b/doc/servicios/informes/xmi2code.tpl.php @@ -0,0 +1,28 @@ + +// +--------------------------------------------------------------------+ +// +// $Id: xmi2code.tpl.php 50 2003-08-12 19:00:38Z mmarre $ +// diff --git a/sistema/local_lib/Servicios/Informes.php b/sistema/local_lib/Servicios/Informes.php new file mode 100644 index 0000000..c0e519b --- /dev/null +++ b/sistema/local_lib/Servicios/Informes.php @@ -0,0 +1,149 @@ + +// +--------------------------------------------------------------------+ +// +// $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 +?> \ No newline at end of file diff --git a/sistema/www/css/servicios_informes.css b/sistema/www/css/servicios_informes.css new file mode 100644 index 0000000..4c64198 --- /dev/null +++ b/sistema/www/css/servicios_informes.css @@ -0,0 +1,40 @@ +.servicios_informes_informe { + color: #003366; + font-family: arial, helvetica, sans-serif; + font-size: 10pt; + font-style: bold; + line-height: normal; + text-align: left; + vertical-align: middle ; + font-weight: bold; +} +.servicios_informes_titulo { + color: #000000; + font-family: arial, helvetica, sans-serif; + font-size: 12pt; + font-style: bold; + line-height: normal; + text-align: center; + vertical-align: middle ; + font-weight: bold; +} +.servicios_informes_subtitulo { + color: #000000; + font-family: arial, helvetica, sans-serif; + font-size: 10pt; + font-style: bold; + line-height: normal; + text-align: center; + vertical-align: middle ; + font-weight: bold; +} +.servicios_informes_adjunto { + color: #000000; + font-family: arial, helvetica, sans-serif; + font-size: 10pt; + font-style: normal; + line-height: normal; + text-align: left; + vertical-align: middle ; + font-weight: normal; +} diff --git a/sistema/www/images/servicios_informes_blanco1.gif b/sistema/www/images/servicios_informes_blanco1.gif new file mode 100644 index 0000000..fc25609 Binary files /dev/null and b/sistema/www/images/servicios_informes_blanco1.gif differ diff --git a/sistema/www/images/servicios_informes_deco1.gif b/sistema/www/images/servicios_informes_deco1.gif new file mode 100644 index 0000000..0212be1 Binary files /dev/null and b/sistema/www/images/servicios_informes_deco1.gif differ diff --git a/sistema/www/images/servicios_informes_deco2.gif b/sistema/www/images/servicios_informes_deco2.gif new file mode 100644 index 0000000..be247f5 Binary files /dev/null and b/sistema/www/images/servicios_informes_deco2.gif differ diff --git a/sistema/www/images/servicios_informes_l1.gif b/sistema/www/images/servicios_informes_l1.gif new file mode 100644 index 0000000..b99eba5 Binary files /dev/null and b/sistema/www/images/servicios_informes_l1.gif differ diff --git a/sistema/www/images/servicios_informes_l2.gif b/sistema/www/images/servicios_informes_l2.gif new file mode 100644 index 0000000..b99eba5 Binary files /dev/null and b/sistema/www/images/servicios_informes_l2.gif differ diff --git a/sistema/www/images/servicios_informes_l296.gif b/sistema/www/images/servicios_informes_l296.gif new file mode 100644 index 0000000..94a0153 Binary files /dev/null and b/sistema/www/images/servicios_informes_l296.gif differ diff --git a/sistema/www/images/servicios_informes_l320.gif b/sistema/www/images/servicios_informes_l320.gif new file mode 100644 index 0000000..98f8319 Binary files /dev/null and b/sistema/www/images/servicios_informes_l320.gif differ diff --git a/sistema/www/images/servicios_informes_parl.gif b/sistema/www/images/servicios_informes_parl.gif new file mode 100644 index 0000000..fb905dc Binary files /dev/null and b/sistema/www/images/servicios_informes_parl.gif differ diff --git a/sistema/www/images/servicios_informes_t1.gif b/sistema/www/images/servicios_informes_t1.gif new file mode 100644 index 0000000..5c2317b Binary files /dev/null and b/sistema/www/images/servicios_informes_t1.gif differ diff --git a/sistema/www/images/servicios_informes_t2.gif b/sistema/www/images/servicios_informes_t2.gif new file mode 100644 index 0000000..41da0c8 Binary files /dev/null and b/sistema/www/images/servicios_informes_t2.gif differ diff --git a/sistema/www/servicios/informes/get_file.php b/sistema/www/servicios/informes/get_file.php new file mode 100755 index 0000000..27e7921 --- /dev/null +++ b/sistema/www/servicios/informes/get_file.php @@ -0,0 +1,41 @@ + +------------------------------------------------------------------------------*/ + +require_once 'DB.php'; + +//Conexión a la BD +$dbh = DB::connect("mysql://mark:mark@intranet-db/MEconDAV"); +if (DB::isError($dbh)) { + die ($dbh->getMessage()); +} + +//Obtener Datos del Adjunto +$sql = "SELECT mimetype, filename, size + FROM FilesForArticle + WHERE file_for_article_id = ". $_GET['id']; +$datos = $dbh->getAll($sql); + +$mime = $datos[0][0]; +$filename = $datos[0][1]; +$filesize = $datos[0][2]; + +//Esta es la dirección en donde se alojan los adjuntos +$dir = '/var/www/mecondav/archivos/'; +$dir = $dir.$_GET['id']; + +header("Content-Type: ".$mime); +header("Content-Disposition: attachment; filename=".$filename); +header("Pragma: no-cache"); +header("Expires: 0"); +header("Content-Length: ".$filesize); + +readfile ($dir); +?> \ No newline at end of file diff --git a/sistema/www/servicios/informes/informes.php b/sistema/www/servicios/informes/informes.php new file mode 100644 index 0000000..7aff29c --- /dev/null +++ b/sistema/www/servicios/informes/informes.php @@ -0,0 +1,76 @@ + +------------------------------------------------------------------------------*/ + +require_once '../../../local_lib/HTML_DietMarco.php'; +require_once 'MECON/HTML/Image.php'; +require_once 'HTML/Table.php'; +require_once '../../../local_lib/Servicios/Informes.php'; + +//Marco de servicios en intranet +$MARCO = new HTML_DietMarco('servicios', 'Informes Parlamentarios'); +$MARCO->addTitle('Informes Parlamentarios'); + +//Imágenes +$IMG_Blanco1_30 =& new MECON_HTML_Image('../../images/servicios_informes_blanco1.gif', '', array('height'=>'1', 'width'=>'30')); +$IMG_Blanco1_170 =& new MECON_HTML_Image('../../images/servicios_informes_blanco1.gif', '', array('height'=>'1', 'width'=>'170')); +$IMG_Blanco1_20 =& new MECON_HTML_Image('../../images/servicios_informes_blanco1.gif', '', array('height'=>'1', 'width'=>'20')); +$IMG_Blanco1_1 =& new MECON_HTML_Image('../../images/servicios_informes_blanco1.gif', '', array('height'=>'6', 'width'=>'1')); +$IMG_Blanco1_10 =& new MECON_HTML_Image('../../images/servicios_informes_blanco1.gif', '', array('height'=>'10', 'width'=>'10')); +$IMG_l1 =& new MECON_HTML_Image('../../images/servicios_informes_l1.gif', '', array('height'=>'2', 'width'=>'760')); +$IMG_l2 =& new MECON_HTML_Image('../../images/servicios_informes_l2.gif', '', array('height'=>'2', 'width'=>'760')); +$IMG_t1 =& new MECON_HTML_Image('../../images/servicios_informes_t1.gif', '', array('height'=>'24', 'width'=>'30')); +$IMG_t2 =& new MECON_HTML_Image('../../images/servicios_informes_t2.gif', '', array('height'=>'24', 'width'=>'30')); +$IMG_deco1 =& new MECON_HTML_Image('../../images/servicios_informes_deco1.gif', '', array('height'=>'20', 'width'=>'200')); +$IMG_deco2 =& new MECON_HTML_Image('../../images/servicios_informes_deco2.gif', '', array('height'=>'20', 'width'=>'200')); + +//Informes Parlamentarios +$INFORMES =& new Servicios_Informes(); + +//Tabla Contenedora +$TABLA =& new HTML_Table ('border="0" cellPadding="0" cellSpacing="0" width="760"'); +$TABLA->addRow(array($IMG_Blanco1_30->toHtml(), + $IMG_Blanco1_170->toHtml(), + $IMG_Blanco1_170->toHtml(), + $IMG_Blanco1_20->toHtml(), + $IMG_Blanco1_170->toHtml(), + $IMG_Blanco1_170->toHtml(), + $IMG_Blanco1_30->toHtml())); +$TABLA->addRow(array($IMG_l1->toHtml()), array('height'=>'2')); +$TABLA->updateCellAttributes(1,0, 'colspan="7"'); +$TABLA->addRow(array($IMG_t1->toHtml(), + ' ', + 'Servicios', '', '', + ' ', + $IMG_t2->toHtml())); +$TABLA->updateCellAttributes(2,2, array('colspan'=>'3', 'class'=>'servicios_informes_titulo')); +$TABLA->addRow(array($IMG_l2->toHtml()), array('height'=>'2')); +$TABLA->updateCellAttributes(3,0, 'colspan="7"'); +$TABLA->addRow(array($IMG_deco1->toHtml(), '', + 'Informes Parlamentarios', '', '', + $IMG_deco2->toHtml(), '')); +$TABLA->updateCellAttributes(4,0, 'colspan="2"'); +$TABLA->updateCellAttributes(4,2, 'colspan="3" class="servicios_informes_subtitulo"'); +$TABLA->updateCellAttributes(4,5, 'colspan="2"'); +$TABLA->addRow(array($IMG_Blanco1_1->toHtml())); +$TABLA->updateCellAttributes(5,0, 'colspan="7"'); + +$TABLA->addRow(array('
'.$INFORMES->toHtml().'
')); +$TABLA->updateCellAttributes(6,0, 'colspan="7"'); + +$TABLA->addRow(array($IMG_Blanco1_10->toHtml())); +$TABLA->updateCellAttributes(7,0, 'colspan="7"'); + + +$MARCO->addStyleSheet($INFORMES->getCSS()); +$MARCO->addBodyContent($TABLA); +$MARCO->display(); + +?>