$Qry = new Consulta($sql); $rr = $Qry->ConsultaVerRegistro(); $programado = $rr[monto]; $tot_programado += $programado; //$programado=Programacion::ProgramacionProgramado($row[0],0,0); ?> <div align="right"><?php echo num_format($programado, '.0'); ?> </div></td> <?php } ?> <td><div align="center"><strong>Total</strong></div> <div align="right"><?php echo num_format($tot_programado, '.0'); ?> </div></td> </tr></table> </td> </tr> </table> <div align="center"> <?php $n = 0; foreach ($array_obj as $id) { $n++; echo '<a href="programacion_nivel_indicador.php?idanp=' . $idanp . '&id_obj=' . $id . '">[' . $n . ']</a> '; } ?> </div> <script language="javascript">
for ($p = 1; $p < 13; $p++) { $total += $col[$p]; $numero = num_format($col[$p] / $tc); if (empty($numero)) { $numero = " "; } ?> <td class="descripcion" align="right"><?php echo $numero; ?> </td> <?php } ?> <td align="right" class="descripcion"><?php echo num_format($total / $tc); ?> </td> </tr> </table> <?php if ($_GET[pdf] != 'ok') { ?> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center"> <?php if ($numpags > 1) { echo "Pagina: " . $pga . " de: " . $numpags . " <<"; for ($i = 0; $i < $numpags; $i++) { $cPga = $i + 1;
function sumar_partida_mes_programado($sql) { $query = new Consulta($sql); while ($row = $query->ConsultaVerRegistro()) { $id = $row[id_mes]; if ($row[total_monto] > 0) { $meses[0] = $meses[0] + $row[total_monto]; $meses[$id] = num_format($row[total_monto]); } } $meses[0] = num_format($meses[0]); $meses[13] = $meses[0]; return $meses; }
?> </tr> <?php $obj = new SqlSelect('', $_SESSION["inrena_4"][2], $_SESSION["inrena_4"][1]); $sql = $obj->set_sql(" nombre_tarea,t.id_tarea,medio_verificacion_tarea ", " AND pa.id_anp IN (" . $anps . ")", " t.id_tarea", " t.nombre_tarea"); $Qtarea = new Consulta($sql); while ($rowt = $Qtarea->ConsultaVerRegistro()) { $fila_tarea = "<tr><td width='200'>" . $rowt[0] . "</td><td width='200'>" . $rowt[2] . "</td>"; $monto_fila = 0; foreach ($ord_anp as $anp) { $sql_m = "SELECT sum(cantidad_metas_meses)\r\n\t\t\t\tFROM metas_meses mm \r\n\t\t\t\t\tInner Join asignacion_ff_anp_objetivos AS afao \r\n\t\t\t\t\t\tON afao.id_asignacion_ff_anp_objetivos=mm.id_ff_anp_subactividad\r\n\t\t\t\t\tInner Join asignacion_anp_objetivos aao \r\n\t\t\t\t\t\tON aao.id_asignacion_anp_objetivos = afao.id_asignacion_anp_objetivos\r\n\t\t\t\t\tInner Join presupuesto_anp as pa ON pa.id_presupuesto_anp = afao.id_presupuesto_anp \r\n\t\t\t\t\tInner Join presupuesto_ff as pf ON pf.id_presupuesto_ff = pa.id_presupuesto_ff\r\n\t\t\t\t\tInner Join fuente_financiamiento as ff ON ff.id_ff = pf.id_ff \r\n\t\t\t\tWHERE pf.id_axo_poa = '" . $_SESSION["inrena_4"][2] . "' AND id_tarea='" . $rowt[1] . "' AND pa.id_anp={$anp} \r\n\t\t\t\t\tAND pf.id_ff IN (" . $ff . ") " . permisos_fuente($_SESSION['inrena_4'][1]) . " GROUP BY pa.id_anp"; //die($sql_m); $Qm = new Consulta($sql_m); $monto = $Qm->ConsultaVerRegistro(); if ($monto[0] > 0) { $fila_tarea .= "<td align='right'>" . num_format($monto[0]) . "</td>"; $monto_fila += $monto[0]; } else { $fila_tarea .= "<td align='right'> </td>"; } } $fila_tarea .= "</tr>"; ///para q salga si hay algo if ($monto_fila > 0) { echo $fila_tarea; } } ?> </table> <script language="javascript">
function generar_td($cls, $issb = '') { $monto = sumar_ff_programado($this->sql); $td = ''; $ftefto = $this->ftefto; for ($i = 0; $i < count($ftefto); $i++) { $id = $ftefto[$i]; if ($monto[$id] == 0) { $monto[$id] = " "; } $td .= '<td class="' . $cls . '" valign="top" nowrap align="right">' . $monto[$id] . '</td>'; } if (!empty($issb)) { $meta = suma_meta_anp_subactividad($issb, $this->SqlFts, true); } /*if (!empty($this->sqlobj)){ $txtobj=ObjetivoEstrategico($this->sqlobj); }*/ $td = ' <td class="' . $cls . '" valign="top" > ' . $issb[resultado_esperado_asignacion] . '</td> <td class="' . $cls . '" valign="top" > ' . $issb[medio_verificacion_tarea] . '</td> <td class="' . $cls . '" valign="top" nowrap align="right">' . num_format($meta[cantidad][0]) . '</td> <td class="' . $cls . '" valign="top" nowrap align="right">' . $monto[0] . '</td>' . $td . ' </tr>'; return $td; }
echo $rper[2] . " " . $rper[3]; ?> </td> </tr> <?php } ?> <tr> <th>Total</th><td> </td><td> </td><td> </td> <?php foreach ($array_tot as $tot) { ?> <td><div align="right"> </div></td><td><div align="right"> <?php echo num_format($tot) . " "; ?> </div></td> <?php } ?> <td><div align="right"></div></td><td><div align="right"></div></td> </tr> </table> <script language="javascript"> FullScreen(); </script> </body> </html>
function info_anp() { $anp = $this->anp; //$part=$this->partidas; $tot = 0; for ($i = 0; $i < count($anp); $i++) { //echo $anp[$i]."****"; $C = $this->Consulta("siglas_anp, a.id_anp, p.id_partida", " and a.id_anp=" . $anp[$i] . " ", " group by nombre_anp"); $Q = new Consulta($C); while ($row = $Q->ConsultaVerRegistro()) { echo "<tr><th class='th2' align='left' bgcolor='#7B869C'>{$row['0']}</th>"; $totH = 0; foreach ($this->partidas as $part) { $Sql = $this->Consulta(" sum(monto_programacion_partidas_meses) ", " and a.id_anp=" . $anp[$i] . " and p.id_partida=" . $part, " "); $query = new Consulta($Sql); if ($col = $query->ConsultaVerRegistro()) { if ($this->md) { $val = $col[0] / $this->tc; } else { $val = $col[0]; } $totH += $val; $this->tot_col[$part] += $val; if ($part == 27) { $this->la_27 += $col[0]; } echo "<td align='right'>" . num_format($val) . "</td>"; } else { echo "<td> </td>"; } } echo "<td align='right'>" . num_format($totH) . "</td></tr>"; $tot += $totH; } } echo "<tr bgcolor='#7B869C'><th class='th2' width='5%' align='center' >TOTALES " . $this->simbolomd . "</th>"; foreach ($this->partidas as $part) { echo "<th class='th2' align='right'>" . num_format($this->tot_col[$part]) . "</th>"; } echo "<th class='th2' width='5%' align='right'>" . num_format($tot) . "</th></tr>"; /*echo "<tr><th class='th2' width='5%' align='center'>TOTAL ".$this->simbolomd." sin la 27</th> <td colspan='".$this->nro_col."'> </td> <th class='th2' width='5%' align='right'>".num_format($tot-$this->la_27)."</th></tr>";*/ }
function reporte_ff_sa($rowsa) { $sql = "SELECT fas.monto_ff_anp_subactividad as monto, asa.siglas_ff, fas.id_ff_anp_subactividad\r\n\t\t\tFROM ff_anp_subactividad AS fas Inner Join anp_subactividad AS asb ON asb.id_anp_subactividad = fas.id_anp_subactividad\r\n\t\t\tInner Join presupuesto_anp AS pa ON pa.id_presupuesto_anp = fas.id_presupuesto_anp Inner Join presupuesto_ff AS pf ON pf.id_presupuesto_ff = pa.id_presupuesto_ff\r\n\t\t\tInner Join fuente_financiamiento AS asa ON asa.id_ff = pf.id_ff Inner Join subactividad AS sa ON sa.id_subactividad = asb.id_subactividad\r\n\t\t\tWHERE asb.id_axo_poa = '" . $this->axo_poa . "' AND asb.id_anp = '" . $this->anpid . "' AND asb.id_subactividad = '" . $rowsa[id_subactividad] . "'\r\n\t\t\tGROUP BY pf.id_ff\r\n\t\t\tORDER BY sa.id_subactividad ASC"; //echo ($sql."<br>"); $queryff = new Consulta($sql); while ($rowff = $queryff->ConsultaVerRegistro()) { $monto = $this->sumar_programacion_meses($rowff); if (!empty($monto[monto])) { ?> <tr> <td width="9%" nowrap><?php echo $rowff[siglas_ff]; ?> </td> <td width="91%"><?php echo ' S/ ' . num_format($monto[monto]); ?> </td> </tr> <?php } } }
</a> <td width="80" bgcolor="#2EA495"><a href="<?php echo $url; ?> not_viewed_bandwidth" class="h"><?php echo $message[75]; ?> </a> <?php } foreach ($rows as $row) { echo '<tr><td class="l"><a href="' . $AWStatsURL . "?month={$month}&year={$year}&config=" . $row['config'] . '">' . $row['config'] . '</a><td>' . num_format($row['unique']) . '<td>' . num_format($row['visits']) . '<td>' . num_format($row['pages']) . '<td>' . num_format($row['hits']) . '<td>' . byte_format($row['bandwidth']); if ($NotViewed == 'columns') { echo '<td>' . num_format($row['not_viewed_pages']) . '<td>' . num_format($row['not_viewed_hits']) . '<td>' . byte_format($row['not_viewed_bandwidth']); } echo "\n"; } echo '<tr><td class="l" bgcolor="#ECECEC"> Total<td bgcolor="#ECECEC">' . num_format($unique_total) . '<td bgcolor="#ECECEC">' . num_format($visits_total) . '<td bgcolor="#ECECEC">' . num_format($pages_total) . '<td bgcolor="#ECECEC">' . num_format($hits_total) . '<td bgcolor="#ECECEC">' . byte_format($bandwidth_total); if ($NotViewed == 'columns') { echo '<td bgcolor="#ECECEC">' . num_format($not_viewed_pages_total) . '<td bgcolor="#ECECEC">' . num_format($not_viewed_hits_total) . '<td bgcolor="#ECECEC">' . byte_format($not_viewed_bandwidth_total); } echo "\n"; ?> </table> <br><br><center><b>AWStats Totals 1.18</b> - <a href="http://www.telartis.nl/xcms/awstats">© 2004-2010 Telartis BV</a></center><br><br> </body> </html>
function reporte_fuente($query, $reg1) { $filas = $query->numcampos(); $registros = $query->numregistros(); if ($_GET[pdf] == 'ok') { $fondo = ""; } else { $fondo = "bgcolor='#EEEEEE'"; } $this->sql = "<table border=0 width='85%' {$fondo} align=center cellspacing=1 cellpadding=2>"; $this->sql .= "<tr>"; for ($i = 0; $i < $filas; $i++) { $align = ""; //if($i==1){$align="left";} $this->sql .= "<th align={$align} bgcolor='#cccccc' nowrap='nowrap'>" . $query->nombrecampo($i) . "</th>"; } $this->sql .= "</tr>"; $w = 1; $rows = 0; $j = 0; while ($rows = $query->ConsultaVerRegistro()) { $this->sql .= "<tr >"; if ($id == 5 || $id == 6) { for ($i = 0; $i < $filas; $i++) { $align = ""; if ($i == 0 || $i == 4) { $align = "center"; } $this->sql .= "<td align={$align}>" . $rows[$i] . "</td>"; } } else { $T = $reg1 + $w; $band = 0; for ($i = 1; $i < $filas + 1; $i++) { $align = "right"; if ($i == 0 || $i == 4) { $align = "center"; } $miVar = $rows[$i - 1]; if ($i == 1 || $i == 2) { $align = "left"; } /////// if ($i == 1 && !strstr($miVar, '-')) { $band = 1; } if ($i == 2 && $band == 1) { $ej = explode('-', $miVar); $miVar = $ej[0]; } ///// if (is_numeric($miVar)) { $miVar = num_format($miVar); } $this->sql .= "<td align={$align}>" . $miVar . "</td>"; } } $w++; $this->sql .= "</tr>"; } $cdata = $this->sql . "</table>"; $this->sql = ""; return $cdata; }
function generar_td_fuente($ftefto, $cls, $cwhere = '', $campogroup = '', $campoorder = '') { //$this->estado=false; for ($i = 0; $i < count($ftefto); $i++) { $cSuma = $this->sumar_programado_fuente($ftefto[$i], $cwhere, $campogroup, $campoorder); if ($cSuma[monto_total]) { if ($this->md) { $numero = $cSuma[monto_total] / $this->tipo_de_cambio; } else { $numero = $cSuma[monto_total]; } $numero = num_format($numero); //$this->estado=true; } else { $numero = ""; } if (empty($numero)) { $numero = " "; } $td_fuente .= '<td align="right" class="' . $cls . '" >' . $numero . '</td>'; } return $td_fuente; }
function reporte_ff_sa($rowsa) { $sql = "SELECT Sum(programacion_partidas_meses.monto_programacion_partidas_meses) as monto ,\r\n\t\t\t\t\t\t\tfuente_financiamiento.siglas_ff\r\n\t\t\t\t\tFROM programacion_partidas\r\n\t\t\t\t\t\tInner Join programacion_partidas_meses \r\n\t\t\t\t\tON programacion_partidas.id_programacion_partidas = programacion_partidas_meses.id_programacion_partidas\r\n\t\t\t\t\t\tInner Join asignacion_ff_anp_objetivos \r\n\t\t\t\tON asignacion_ff_anp_objetivos.id_asignacion_ff_anp_objetivos = programacion_partidas.id_ff_anp_subactividad\r\n\t\t\t\t\tInner Join presupuesto_anp \r\n\t\t\t\t\t\tON presupuesto_anp.id_presupuesto_anp = asignacion_ff_anp_objetivos.id_presupuesto_anp\r\n\t\t\t\t\tInner Join presupuesto_ff ON presupuesto_ff.id_presupuesto_ff = presupuesto_anp.id_presupuesto_ff\r\n\t\t\t\t\tInner Join fuente_financiamiento ON fuente_financiamiento.id_ff = presupuesto_ff.id_ff\r\n\t\t\t\t\tWHERE id_asignacion_anp_objetivos = '" . $rowsa[id_asignacion_anp_objetivos] . "' " . permisos_fuente($_SESSION['inrena_4'][1], 'presupuesto_ff') . " GROUP BY fuente_financiamiento.id_ff ORDER BY fuente_financiamiento.siglas_ff"; //echo ($sql."<br>"); $queryff = new Consulta($sql); while ($rowff = $queryff->ConsultaVerRegistro()) { if (!empty($rowff[monto])) { ?> <tr> <td width="9%" nowrap><?php echo $rowff[siglas_ff]; ?> </td> <td width="91%"><?php echo ' S/ ' . num_format($rowff[monto]); ?> </td> </tr> <?php } } }
function Info_Ejecutor() { //echo "****".$this->ejecutor."---".$this->axo."----".axo($this->axo); $sql = "select nombre_ff, nombre_fuentefinanciamiento, coordinador_ff, email_ff, tipo_cambio_ff,\tmonto_presupuesto_ff \r\n\t\t\tfrom fuente_financiamiento e,fuentefinanciamiento f, presupuesto_ff pf, presupuesto_anp pa \r\n\t\t\twhere e.id_ff=" . $this->ejecutor . " and id_axo_poa=" . $this->axo . " \r\n\t\t\tand e.id_ff=pf.id_ff and f.id_fuentefinanciamiento=e.id_fuentefinanciamiento and pf.id_presupuesto_ff=pa.id_presupuesto_ff\r\n\t\t\tgroup by e.id_ff"; $query = new Consulta($sql); while ($r = $query->ConsultaVerRegistro()) { ?> <tr> <td width="250"><b> Nombre Fuente Financiamiento: </b> </td> <td ><?php echo $r[1]; ?> </td> </tr> <tr> <td ><b> Nombre Ejecutor: </b> </td> <td ><?php echo $r[0]; ?> </td> </tr> <tr> <td ><b> Coordinador: </b></td> <td ><?php echo $r[2]; ?> </td> </tr> <tr> <td ><b> Email: </b></td> <td ><?php echo $r[3]; ?> </td> </tr> <tr> <td ><b> Tipo Cambio: </b></td> <td width="50%">S/. <?php echo $r[4]; ?> </td> </tr> <tr> <td ><b> Cantidad Soles: </b></td> <td width="50%">S/. <?php echo num_format($r[5]); ?> </td> </tr> <tr> <td ><b> Cantidad Dolares: </b></td> <td width="50%" >$ <?php echo num_format($r[5] / $r[4]); ?> </td> </tr> <?php } }