Listing 1816
Followup to listing-1815.txt, submitted by anonymous user.
Submitted by anonymous user, 2 December 2008
// Voy leyendo campos //
$camposAcumulados="";
$iTexto=0;
for($i2=0;$i2<count($camposMostrar);$i2++) {
$iTexto=1 + $i2 + 1;
$datoTemporal=$camposMostrar[$i2];
$valorTemp=explode(":",$datoTemporal);
// creo array de los valores separados por : //
for($i3=0;$i3<count($valorTemp);$i3++) {
$datoWhile[$i3]=$valorTemp[$i3];
}
/*
$campoTemp=$valorTemp[0];
$tipoCampo=$valorTemp[1];
$posibleFuncion=$valorTemp[2];
$dato3=$valorTemp[3];
*/
$maxCaracteresCampoTemp=$camposCaracteres[$i2];
$campoRealTemp=$camposRealesBase[$i2];
$textoDefectoTemp=$arrayDatosBase[0][$campoRealTemp];
// Si el campo existe muestro el texto
if ( strlen($datoWhile[0]) > 0 ) {
$texto=$campoGenerico."_texto_".$iTexto;
$datoTemplate[]="<div class='textosNormal'>". $lenguaje[$texto]."</div>";
if ( $datoWhile[1] == "texto" ) {
// Campo a enviar al proceos php/
$camposAcumulados=$camposAcumulados.":".$datoWhile[0];
$datoTemplate[]="<div>".armarCampoInput($strFields,$datoWhile[0],$datoWhile[2],$maxCaracteresCampoTemp,$textoDefectoTemp)."</div>";
}
if ( $datoWhile[1] == "checkbox" ) {
// Campo a enviar al proceos php/
$camposAcumulados=$camposAcumulados.":".$datoWhile[0]."=checked";;
$datoTemplate[]="<div>".armarCheckbox($campoTemp,20,$textoDefectoTemp)."</div>";
}
if ( $datoWhile[1] == "combo" ) {
// Campos //
$camposAcumulados=$camposAcumulados.":".$datoWhile[0];
$sqlCombo=$maxCaracteresCampoTemp;
$datoTemplate[]="<div>".armarCombo($datoWhile[0],$sqlCombo,$textoDefectoTemp,$datoWhile[2])."</div>";
}
if ( $datoWhile[1] == "radio" ) {
// Campos //
$camposAcumulados=$camposAcumulados.":".$datoWhile[2]."=valorRadio";
$datoTemplate[]="<div>".armarRadioButton($datoWhile[0],$datoWhile[2],'1',$datoWhile[3],$textoDefectoTemp,$datoWhile[4])."</div>";
}
}
$iTexto=$iTexto + 1;
}
// Template o muestro //
print_r($datoTemplate);
if ( strlen($template) > 0 ) {
$templateFull=$datosPagina['pag'].$dirTemplates.$template;
$templatePath=$dirRaizEntero.$dirTemplates.$template;
$templateReal=leerPHP($templateFull,$templatePath);
for($i2=0;$i2<count($datoTemplate);$i2++) {
$iReal=$i2 + 1;
$dat="#dato".$iReal."#";
$templateReal=str_replace($dat,$datoTemplate[$i2],$templateReal);
}
echo $templateReal;
}
else {
for($i2=0;$i2<count($datoTemplate);$i2++) {
echo $datoTemplate[$i];
}
}
