function depositos($sql)
{
    global $TOTALES, $direccion, $orderby;
    $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
    mysql_select_db(DB_NAME);
    $result = mysql_db_query(DB_NAME, $sql);
    if (mysql_error() != "") {
        echo "<br>" . $sql . "<br><font class='TEditorError'><br>";
        echo mysql_error() . "</font>";
        exit;
    }
    ?>
	 <table border="0" align="center" cellspacing="5"><?php 
    $conta = 0;
    while ($dato = mysql_fetch_array($result, MYSQL_BOTH)) {
        if ($conta == 0) {
            echo "<tr>";
            $i = count($dato) / 2;
            for ($aux = 0; $aux < $i; $aux++) {
                $campo = mysql_field_name($result, $aux);
                $img_ordenamiento = "";
                if ($orderby == $campo) {
                    if ($direccion == "ASC" or $direccion == "") {
                        $img_ordenamiento = "<img src=" . TEImagesPath . "arror_up.png>";
                    } else {
                        $img_ordenamiento = "<img src=" . TEImagesPath . "arror_down.png>";
                    }
                }
                echo "<th align=center><a href='javascript:reordena(\"{$campo}\")'><font style='font-size:11px'>" . despiega_nombre_columna_reportes($campo) . "</font></a> {$img_ordenamiento}</th>";
            }
            echo "</tr>";
            $conta++;
        }
        if ($conta == 2) {
            $conta = 1;
            $aux_f = " bgcolor=#f5f5f4";
        } else {
            $aux_f = "";
            $conta = 2;
        }
        echo "<tr {$aux_f}>";
        $i = count($dato) / 2;
        for ($aux = 0; $aux < $i; $aux++) {
            $valor = $dato[$aux];
            $TOTALES[mysql_field_name($result, $aux)] = $TOTALES[mysql_field_name($result, $aux)] * 1 + $valor;
            $campo = mysql_field_name($result, $aux);
            include "reporteador_muestra campo.php";
        }
        echo "</tr>";
        echo "<tr><td  colspan=10>";
        $sql_pagos = "SELECT EGRESO_ID, PAGO from ban_p_bancos_egresos where MOVIMIENTO_ID=" . $dato["MOVIMIENTO_ID"];
        despliega_sql_completo($sql_pagos);
        echo "</tr><td>";
    }
    $TOTALES["REGISTROS"] = mysql_num_rows($result);
    global $campos_totales;
    //print_r($campos_totales)."+";print_r($TOTALES);
    echo '<tr>';
    foreach ($TOTALES as $campo => $valor) {
        echo "<td class='gran_total'>";
        if (in_array($campo, $campos_totales)) {
            echo despiega_nombre_columna_reportes($campo);
        }
        //echo $campo;
        echo "</td>";
    }
    echo "</tr>";
    echo '<tr>';
    foreach ($TOTALES as $campo => $valor) {
        echo "<td class='gran_total'>";
        if (in_array($campo, $campos_totales)) {
            echo formato_moneda($valor, 2);
        }
        //echo $campo;
        echo "</td>";
    }
    echo "</tr>";
    echo "</table>";
}
$titulo = " title='" . $valor . "'";
echo "<td nowrap align='{$alineacion}' {$titulo}>";
if ($REPORTE_COLUMNA[$campo]["SIZE"]) {
    $size = $REPORTE_COLUMNA[$campo]["SIZE"];
} else {
    $size = 3000;
}
if (strlen($valor) > $size) {
    echo substr($valor, 0, $size) . "...";
} else {
    if ($REPORTE_COLUMNA[$campo]["FORMATO"] == "Moneda") {
        echo formato_moneda($valor, 2);
    } else {
        echo $valor;
    }
}
switch ($campo) {
    case "PROMESA_PAGO":
        if ($_POST['mode'] != "excel") {
            echo "<a href='../admin/?table=cob_p_gestion&add=1&no_menu=1&folio_fiscal=" . $dato["FACTURA"] . "' target=gestion_cobranza><img src=" . TEImagesPath . "LeftSubmenuCatalog.png border=0></a>";
        }
        break;
    case "PAGOS":
        if ($rep == "com1") {
            $sql_pagos = "select c.PAGO, b.MONEDA  from egr_p_egresos b, egr_p_egresos_facturas c where b.PROVEEDOR_ID=" . $dato["PROVEEDOR_ID"] . " and c.FACTURA='" . $dato["FACTURA"] . "' and\nb.EGRESO_ID=c.EGRESO_ID  ";
            despliega_sql_completo($sql_pagos);
            //echo $sql_pagos;
        }
        break;
}
echo "</td>";
<?php

include "../config/config.php";
require_once "reporte_inicio.php";
include $rep . "_reporteador_sql.php";
require "reporteador_encabezado.php";
despliega_sql_completo($sql_canceladas);
require_once "reporte_fin.php";
<?php

if (1 == 0) {
    if ($table == "cip") {
        if ($FieldName == "PI_COMENTARIOS") {
            if ($edit > 0) {
                ?>
        <table  border="0" align="center" cellpadding="10" cellspacing="10">
		  <tr>
			<td>
              <?php 
                $sql = "select a.NOMBRE, PORCENTAJE from te_usuarios a, cip_pedido_interno_vendedores b where a.USUARIO_ID=b.VENDEDOR_ID and PI_ID=" . $valor_llave;
                //echo $sql;
                //			  $aux=consulta($sql);
                //			  ($aux);
                //			  echo $aux;
                despliega_sql_completo($sql);
                ?>
            </td>
		  </tr>           
          </table>
        <?php 
            }
        }
    }
}
Exemple #5
0
<?php

include "../config/funciones_generales.php";
include "../config/funciones_particulares.php";
include "../config/variables.php";
?>
<link rel="stylesheet" href="../TableEditor/TEditorSkins/Default/style.css" type="text/css">
<?php 
switch ($sql) {
    case "pagos_facturas_1":
        $sql_mostrar = "select * from \nban_p_bancos_facturas a\nwhere \n((select count(*) from ban_p_bancos where MOVIMIENTO_ID=a.MOVIMIENTO_ID)=0)\norder by MOVIMIENTO_ID";
        echo "<center>Pagos en Bancos SIN movimimento bancario (-1 son pagos del año pasado)</center>";
        despliega_sql_completo($sql_mostrar);
        break;
}