- //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();
+ //Base de Datos
+ $dbh = IntranetDB::connect();
+
+ //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 MEconDAV.Articles, MEconDAV.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 MEconDAV.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 MEconDAV.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();