1 | <?php |
---|
2 | $rows = array(); |
---|
3 | $row = array(); |
---|
4 | $row[] = array('data' => t('Acciones Especificas'), 'rowspan' => 2); |
---|
5 | $row[] = array('data' => t('Mes'), 'colspan' => 12, 'align' => 'center'); |
---|
6 | $row[] = array('data' => t('Total'), 'rowspan' => 2, 'align' => 'center'); |
---|
7 | $rows[] = $row; |
---|
8 | $row = array(); |
---|
9 | foreach($ftypes as $valor) { |
---|
10 | $row[] = array('data' => $valor, 'align' => 'center'); |
---|
11 | } |
---|
12 | $rows[] = $row; |
---|
13 | $i = 1; |
---|
14 | $suma_mes = array(); |
---|
15 | if (count($arreglo_anual)) { |
---|
16 | $suma = 0; |
---|
17 | foreach($arreglo_anual as $nid => $valore) { |
---|
18 | $row = array(); |
---|
19 | $row[] = array('data' => $titles[$nid], 'align' => 'center'); |
---|
20 | foreach($ftypes as $id => $valor) { |
---|
21 | $suma += $valore[$id]; |
---|
22 | if (!isset($suma_mes[$id])) { |
---|
23 | $suma_mes[$id] = 0; |
---|
24 | } |
---|
25 | $suma_mes[$valor] += $valore[$id]; |
---|
26 | $row[] = array('data' => number_format($valore[$id], 2, '.', ','), 'align' => 'center'); |
---|
27 | } |
---|
28 | $row[] = array('data' => number_format($suma, 2, '.', ','), 'align' => 'center'); |
---|
29 | $rows[] = $row; |
---|
30 | } |
---|
31 | $row = array(); |
---|
32 | $row[] = array('data' => t('TOTAL'), 'align' => 'center'); |
---|
33 | $suma = 0; |
---|
34 | foreach($ftypes as $valor) { |
---|
35 | $row[] = array('data' => number_format($suma_mes[$valor], 2, '.', ','), 'align' => 'center'); |
---|
36 | $suma += $suma_mes[$valor]; |
---|
37 | } |
---|
38 | $style = ''; |
---|
39 | if ($suma != $proyecto->field_proyecto_monto_anual[0]['value']) { |
---|
40 | $style = 'color: red'; |
---|
41 | } |
---|
42 | $row[] = array('data' => number_format($suma, 2, '.', ','), 'align' => 'center', 'style' => $style); |
---|
43 | $rows[] = $row; |
---|
44 | } |
---|
45 | else { |
---|
46 | $row = array(); |
---|
47 | $row[] = array('data' => t('No existen acciones especificas'), 'colspan' => 12, 'align' => 'center'); |
---|
48 | } |
---|
49 | print '<h2>' . t('Resumen financiero de las acciones') . '</h2>' . '<p><b>' . t('Monto total para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], 2, '.', ',') . '</p>' . theme('table', array(), $rows, array('border' => '1')); |
---|
50 | $rows = array(); |
---|
51 | $row = array(); |
---|
52 | $row[] = array('data' => t('Acciones Especificas'), 'rowspan' => 2); |
---|
53 | $row[] = array('data' => t('Partidas'), 'colspan' => count($partidas), 'align' => 'center'); |
---|
54 | $row[] = array('data' => t('Total'), 'rowspan' => 2, 'align' => 'center'); |
---|
55 | $rows[] = $row; |
---|
56 | $row = array(); |
---|
57 | foreach($partidas as $valor) { |
---|
58 | $row[] = array('data' => $partidas_nombres[$valor], 'align' => 'center'); |
---|
59 | } |
---|
60 | $rows[] = $row; |
---|
61 | $suma_mes = array(); |
---|
62 | if (count($arreglo_partida)) { |
---|
63 | $suma = 0; |
---|
64 | foreach($arreglo_partida as $nid => $valore) { |
---|
65 | $row = array(); |
---|
66 | $row[] = array('data' => $titles[$nid], 'align' => 'center'); |
---|
67 | foreach($partidas as $valor) { |
---|
68 | if (!$valore[$valor]) { |
---|
69 | $valore[$valor] = 0; |
---|
70 | } |
---|
71 | $suma += $valore[$valor]; |
---|
72 | if (!isset($suma_mes[$valor])) { |
---|
73 | $suma_mes[$valor] = 0; |
---|
74 | } |
---|
75 | $suma_mes[$valor] += $valore[$valor]; |
---|
76 | $row[] = array('data' => number_format($valore[$valor], 2, '.', ','), 'align' => 'center'); |
---|
77 | } |
---|
78 | $row[] = array('data' => number_format($suma, 2, '.', ','), 'align' => 'center'); |
---|
79 | $rows[] = $row; |
---|
80 | } |
---|
81 | $row = array(); |
---|
82 | $row[] = array('data' => t('TOTAL'), 'align' => 'center'); |
---|
83 | $suma = 0; |
---|
84 | foreach($partidas as $valor) { |
---|
85 | $row[] = array('data' => number_format($suma_mes[$valor], 2, '.', ','), 'align' => 'center'); |
---|
86 | $suma += $suma_mes[$valor]; |
---|
87 | } |
---|
88 | $style = ''; |
---|
89 | if ($suma != $proyecto->field_proyecto_monto_anual[0]['value']) { |
---|
90 | $style = 'color: red'; |
---|
91 | } |
---|
92 | $row[] = array('data' => number_format($suma, 2, '.', ','), 'align' => 'center', 'style' => $style); |
---|
93 | $rows[] = $row; |
---|
94 | } |
---|
95 | else { |
---|
96 | $row = array(); |
---|
97 | $row[] = array('data' => t('No existen acciones especificas'), 'colspan' => 12, 'align' => 'center'); |
---|
98 | } |
---|
99 | print '<h2>' . t('Distribución por partida presupuestaria') . '</h2>' . '<p><b>' . t('Monto total para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], 2, '.', ',') . '</p>' . theme('table', array(), $rows, array('border' => '1')); |
---|
100 | $rows = array(); |
---|
101 | $row = array(); |
---|
102 | foreach($fields_financiamiento as $id => $arreglo) { |
---|
103 | $output1 = '<h3>' . $title[$id] . '</h3>'; |
---|
104 | foreach($arreglo as $field) { |
---|
105 | $output1 .= '<p><b>' . $titulos_campos[$field] . ':</b> ' . number_format($valores[$field], 2, '.', ',') . '</p>'; |
---|
106 | } |
---|
107 | $row[] = array('data' => $output1, 'align' => 'center'); |
---|
108 | } |
---|
109 | $rows[] = $row; |
---|
110 | print '<h2>' . t('Fuentes de financiamiento') . '</h2>' . '<p><b>' . t('Monto total para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], 2, '.', ',') . '</p>' . theme('table', array(), $rows, array('border' => '1')); |
---|
111 | ?> |
---|