Código PHP:
function reporte($listado, $strTitulo )
{
$salida = "<div style=\"border: solid 0px black; height: 445px; overflow: auto; background-color: #BDCDDB;\">";
$salida .= "<br/><table id=\"ilumi\" width=\"70%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"table-layout: ;\">
<tr>
<td valign=\"top\">
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"Header\">
<tr>
<td class=\"HeaderLeft\"></td>
<th>$strTitulo</th>
<td class=\"HeaderRight\"></td>
</tr>
</table>";
$salida .= '<table class="Grid" >';
if ( $listado ){
$NumRegistro = pg_num_rows( $listado );
if ($NumRegistro > 0)
{
$salida .=' <table class="Grid" cellspacing="\" cellpadding="" style="empty-cells: show;">
<tr class="Caption">
<th width="100">Tienda</th>
<th width="100">fecha</th>
<th width="100">Monto</th>
</tr>
</table>';
$salida .= "<div style=\"border: solid 0px black; height: 387px; overflow: auto; background-color:#BDCDDB;\">";
$salida .= "<table width=\"70%\" class=\"Grid\" cellspacing=\"\" cellpadding=\"\" style=\"empty-cells: show;\"> ";
$salida .= '<tr class="Row">';
while($row = pg_fetch_assoc( $listado ) )
{
$salida .= '<tr class="Row">';
//$strVarEco = $aryRegistros["economico"];
//NOMBRE
if (!empty($row["nombre"]))
$salida .= '<td width="100" style="text-align:right;">'.$row["nombre"].'</td>';
else
$salida .= '<td width="100" style="text-align:right;"><font color="#f7f7f7">.</font></td>';
//FECHA
if (!empty($row["fechatr"]))
{
$salida .= '<td width="100" style="text-align:right; background-color: #f7f7f7;">'.$row["fechatr"].'</td>';
}
else
$salida .= '<td width="100" style="text-align:right;"><font color="#f7f7f7">.</font></td>';
//MONTO
if (!empty($row["total_monto"]))
$salida .= '<td width="100" style="text-align:right;">'.$row["total_monto"].'</td>';
else
$salida .= '<td width="100" style="text-align:right;"><font color="#f7f7f7">.</font></td>';
$salida .= '</tr>'."\n";
} //FIN WHILE
$salida .= '</tr>'."\n";
return $salida;
}
else
{
$salida = "<div>
<table width=\"70%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"Header\">
<tr>
<td >
<th>No se encontraron registros.</th>
<td>
</tr>
<td>
<input type=\"button\" class=\"Boton\" value=\"Nuevo Registro\" onclick='NuevoRegistro()'>
</td>
</table></div>";
return $Tabla;
}
}
}
$sajax_request_type = "GET";
sajax_init();
sajax_export("filtro_fecha");
sajax_handle_client_request();
lo que intento con esto es hacer uan consulta a mi base de datos y mostrar el resultado en la misma paguina para ello uso estas dos funciones en javascrip
Código:
function filtra_fechas()
{
var FechaIniSel = document.getElementById("fechaInicial").value;
var FechFinSel = document.getElementById("fechaFinal").value;
var DatosFecha = FechaIniSel + "," + FechFinSel;
x_filtro_fecha(DatosFecha,contenedor);
}
//Funcion que se encarga de llenar el grid con los resultados encontrados
function contenedor(Resultado)
{
document.getElementById("salida").innerHTML = Resultado;
}
y cuando ejecuto la paguina no me muestra nada como resultado espero sus aportes cuaquier aporte es bien benido gracias ando un poco desesperado por resolver esto