source: sipes/0.3-modules/sipp_pdf/templates/proyectos-ver-reformulacion-ae-pdf.tpl.php @ 2fa3319

stableversion-3.0
Last change on this file since 2fa3319 was 303fae2, checked in by José Gregorio Puentes <jpuentes@…>, 9 años ago

se agregaron los modulos

  • Propiedad mode establecida a 100755
File size: 4.5 KB
Línea 
1<?php
2?>
3<h2><?php print t('Resumen del Proyecto'); ?></h2>
4<p>
5  <b><?php print t('Código Único del Proyecto'); ?>:</b> <?php print $proyecto->field_proyecto_codigo[0]['value']; ?>
6</p>
7<p>
8  <b><?php print t('Nombre del Proyecto'); ?>:</b> <?php print $proyecto->title; ?></p>
9<p>
10  <b><?php print t('Organismo'); ?>:</b> <?php print $ente_planificador->title; ?></p>
11<h2><?php print t('Resumen Financiero de las Acciones'); ?></h2>
12<?php
13  $header = array();
14  $header[] = array('data' => t('Partidas'), 'colspan' => 2);
15  foreach($ftypes as $id_field => $texto) {
16    $header[] = array('data' => $texto);
17  }
18  $header[] = array('data' => t('TOTAL'));
19  $rows = array();
20  $rowsF = array();
21  $i = 0;
22  $totales = array();
23  $totalT = 0;
24  $plant = array();
25  $sumaplan = 0;
26  $sumaplanm = array();
27  foreach($partidas as $tid => $grupo) {
28    $i++;
29    $total = 0;
30    $total1 = 0;
31    $row = array();
32    $row1 = array();
33    $row[] = array('data' => $grupo, 'rowspan' => 2);
34    $row[] = array('data' => t('planificado'), );
35    $row1[] = array('data' => t('variación'), );
36    foreach($ftypes as $id_field => $texto) {
37      $varia = isset($variaciones['field_accion_esp_programacion_' . $ae->nid][$tid][$id_field]) ? $variaciones['field_accion_esp_programacion_' . $ae->nid][$tid][$id_field] : 0;
38      $min = $partidas_nodo[$tid][$id_field] + $varia;
39      $valor = isset($reformula['field_accion_esp_programacion_' . $ae->nid][$tid][$id_field])? $reformula['field_accion_esp_programacion_' . $ae->nid][$tid][$id_field] : 0;
40      $total1 += $valor;
41      $totalT += $min + $valor;
42      if (!isset($plant[$tid])) {
43        $plant[$tid] = 0;
44      }
45      $plant[$tid] += $min;
46      $sumaplan += $min;
47      if (!isset($totales[$id_field])) {
48        $totales[$id_field] = 0;
49      }
50      if (!isset($sumaplanm[$id_field])) {
51        $sumaplanm[$id_field] = 0;
52      }
53      $sumaplanm[$id_field] += $min;
54      $totales[$id_field] += $min + $valor;
55      $idformu = $ae->nid . '_field_accion_esp_programacion_' . $tid . '_' . $id_field;
56      $idformuj = str_replace('_', '-', $idformu);
57      $row[] = array('data' => number_format($min, 2, '.', ','), 'align' => 'center');
58      $row1[] = array('data' => number_format($valor, 2, '.', ','), 'align' => 'center');
59    }
60    $row[] = array('data' => number_format($plant[$tid], 2, '.', ','), 'align' => 'center');
61    $row1[] = array('data' => number_format($total1, 2, '.', ','), 'align' => 'center');
62    $rows[] = $row;
63    $rows[] = $row1;
64  }
65  $row = array();
66  $row[] = array('data' => '<b>' . t('TOTAL') . '</b>', 'colspan' => 2, 'align' => 'right');
67  foreach($ftypes as $id_field => $texto) {
68    $row[] = array('data' => number_format($totales[$id_field], 2, '.', ','), 'align' => 'center');
69  }
70  $row[] = array('data' => number_format($totalT, 2, '.', ','), 'align' => 'center');
71  $rows[] = $row;
72  print theme('table', $header, $rows, array('border' => '1'));
73?>
74<h2><?php print t('Distribución por fuentes de Financiamiento'); ?></h2>'
75<?php
76  $rows = array();
77  $row = array();
78  $row1 = array();
79  $sumalT = 0; 
80  foreach($arreglo as $id => $arreglo1) {
81    $sumal = 0; 
82    $output1 = '';
83    foreach($arreglo1 as $id1) {
84      $field = content_fields($id1, 'accion_especifica');
85      $varia = isset($variaciones[$id1 . '_' . $ae->nid][0]['value']) ? $variaciones[$id1 . '_' . $ae->nid][0]['value'] : 0;
86      $min = $ae->{$id1}[0]['value'] + $varia;
87      if (!isset($sumafinm[$id])) {
88        $sumafinm[$id] = 0;
89      }
90      $sumafinm[$id] += $min;
91      $sumatotalf += $min;
92      $field = content_fields($id1, 'accion_especifica');
93      $valor = isset($reformula[$id1 . '_' . $ae->nid][0]['value'])? $reformula[$id1 . '_' . $ae->nid][0]['value'] : 0;
94      $total1 += $valor;
95      $total += $valor;
96      $sumal += $min + $valor; 
97      $sumalT += $min + $valor; 
98      $idformuj = str_replace('_', '-', $id1);
99      $output1 .= '<p><b>' . $field['widget']['label'] . ':</b>' . '<br><b>' . t('Planificado') . ':</b> ' . number_format($min, 2, '.', ',') . '<br><b>' . t('Variación') . ':</b> ' . number_format($valor, 2, '.', ',') .  '</p>';
100    }
101    $row[] = array('data' => $output1, );
102    $row1[] = array('data' => number_format($sumal, 2, '.', ','), 'align' => 'center');
103  }
104  $rows[] = $row;
105  $rows[] = $row1;
106  $row = array();
107  $row[] = array('data' => '<b>' . t('TOTAL') . ':</b>', 'colspan' => 3, 'align' => 'right');
108  $row[] = array('data' => number_format($sumalT, 2, '.', ','), 'align' => 'center');
109  $rows[] = $row;
110  print theme('table', array(), $rows, array('border' => '1'));
111?>
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.