I have a Grid Application with a php Script in the onScriptInit Event.
I have an echo that prints some html on the page, but the html is printed twice.
My sql query use variables that are setted it that script to.
$DESDE = '\'20150101\'';
$HASTA = '\'20150131\'';
$SUCURSALES = '';
$FILTRO = '';
if (isset($_GET['BEGIN_DATE'])) {
$DESDE = $_GET['BEGIN_DATE'];
if (isset($_GET['END_DATE'])) {
$HASTA = $_GET['END_DATE'];
$FILTRO = "FECHA ENTRE $DESDE Y $HASTA";
}
} else {
$WHERE = "FECHA BETWEEN $DESDE AND $HASTA";
}
if (isset($_GET['sucursales'])) {
$SUCURSALES = $_GET['sucursales'];
}
if (empty($SUCURSALES)) {
$WHERE = " FECHA BETWEEN $DESDE AND $HASTA";
$FILTRO = "Fecha entre $DESDE y $HASTA";
} else {
$WHERE = " FECHA BETWEEN $DESDE AND $HASTA AND SUCURSAL IN ($SUCURSALES)";
$FILTRO = "Fecha entre $DESDE y $HASTA y Sucursal est? incluida en ($SUCURSALES)";
}
echo '<table cellspacing="0" cellpadding="0" align="center" valign="top">';
echo '<tbody><tr><td>';
echo '<div class="scGridBorder">';
//echo ' <table width="80%" cellspacing="0" cellpadding="0"><tbody>';
echo $FILTRO;
//echo '</td></tr></tbody></table>';
echo '</div></td></tr></tbody></table>';
echo '<div style="heigth=10px;"> </div></tr></td></table>';
[sqlWHERE] = $WHERE;
Is this normal, a bug or perhaps i am doing something wrong?
Thank you very much in advance.
Regards,
Maxi