<% @Language="VBScript" @LCID = "1034"%> <% Option Explicit Response.Buffer = True Response.Expires = -1000 %><% dim mysql, conntemp, rstemp, showblank, shownull dim pk_formularios,frm_nombre,frm_activo,frm_leyenda dim frm_campos,frm_enlaces,frm_fechaA,frm_fechaB dim vcampos,venlaces,vtxt dim vcnum() ,vcnombre(), vctipo(),vcsubtipo(),vcinfo0(),vcrequerido(),vcest() dim color,tcolor dim i,j dim fondot,texto fondot="#ccccff" pk_formularios=request.querystring("pk_formularios") mySQL="SELECT * FROM TF_FORMULARIOS where pk_formularios= "&cstr(pk_formularios)&";" set conntemp=server.createobject("adodb.connection") conntemp.open cadena_conexion set rstemp=conntemp.execute(mySQL) showblank=" " shownull="-null-" if rstemp.eof then response.write "Sin datos...
" set rstemp=nothing conntemp.close set conntemp=nothing else pk_formularios=rstemp("pk_formularios") frm_nombre=rstemp("frm_nombre") frm_leyenda=rstemp("frm_leyenda") frm_activo=rstemp("frm_activo") frm_fechaA=rstemp("frm_fechaA") frm_fechaB=rstemp("frm_fechaB") frm_enlaces=rstemp("frm_enlaces") set rstemp=nothing end if dim max mySQL= "SELECT COUNT(*) FROM TF_CAMPOS WHERE fk_formularios="&pk_formularios set rstemp=conntemp.execute(mySQL) if not rstemp.eof then max=rstemp(0) if max="" or isnull(max) then max=0 max=cint(max+1) else max=0 end if set rstemp=nothing redim vcnum(max) ,vcnombre(max), vctipo(max),vcsubtipo(max),vcinfo0(max),vtxt(max),vcrequerido(max),vcest(max),vcinfotabla(max) dim vcinfotablax dim y,z mySQL= "SELECT * FROM TF_CAMPOS WHERE fk_formularios="&pk_formularios&" ORDER BY cam_orden" set rstemp=conntemp.execute(mySQL) if not rstemp.eof then dim vinfo,vinfo0 dim resp,tam dim x,nombres,nums,tipos,subtipos j=0 i=0 nombres="" nums="" tipos="" subtipos="" do while not rstemp.eof 'response.write "//"&j&"
" vcnum(j)=rstemp("pk_campos") nums=nums&","&vcnum(j) vcnombre(j)=rstemp("cam_nombre") vctipo(j)=rstemp("cam_tipo") vcsubtipo(j)=rstemp("cam_subtipo") vcinfo0(j)=vcsubtipo(j) vcinfotabla(j)=rstemp("cam_info") select case vctipo(j) case "descripcion": vtxt(j)="" case "texto": tam=10 select case vcsubtipo(j) case "corto": tam=5 case "mediano": tam=20 case "largo": tam=50 end select vtxt(j)="" case "si/no": vcinfo0(j)=replace(vcsubtipo(j),"|","/") resp=split(vcsubtipo(j),"|") vtxt(j)=""&resp(0) vtxt(j)=vtxt(j)&"
"&resp(1) case "respuestas multiples": vinfo=split(vcinfo0(j),"|") vcinfo0(j)="" vtxt(j)="" for x=0 to ubound(vinfo) if vinfo(x)<>"" and not isnull(vinfo(x)) then vcinfo0(j)=vcinfo0(j)&"-"&vinfo(x)&"
" vtxt(j)=vtxt(j)&"" end if next vtxt(j)=vtxt(j)&"
"&vinfo(x)&"
" case "decimal": vtxt(j)="" case "entero": vtxt(j)="" case "respuesta unica": vinfo=split(vcinfo0(j),"|") vcinfo0(j)="" vtxt(j)="" for x=0 to ubound(vinfo) if vinfo(x)<>"" and not isnull(vinfo(x)) then vcinfo0(j)=vcinfo0(j)&"-"&vinfo(x)&"
" vtxt(j)=vtxt(j)&"" end if next vtxt(j)=vtxt(j)&"
"&vinfo(x)&"
" case "tabla": 'Response.Write(vcinfo0(j)) vinfo=split(vcinfo0(j),"|") vcinfotablax=split(vcinfotabla(j),"|") vtxt(j)="" z=1 for x=0 to vinfo(1) vtxt(j)=vtxt(j)&"" for y=0 to vinfo(2) 'response.write i&"--"&j if x=0 and y=0 then vtxt(j)=vtxt(j)&"" else if (x=0 or y=0) and not(x=0 and y=0) then vtxt(j)=vtxt(j)&"" z=cint(z+1) else vtxt(j)=vtxt(j)&"" end if end if next vtxt(j)=vtxt(j)&"" next vtxt(j)=vtxt(j)&"" vtxt(j)=vtxt(j)&"" vtxt(j)=vtxt(j)&"
"& vinfo(0) &""&vcinfotablax(z)&"" select case vinfo(3) case "texto": vtxt(j)=vtxt(j)&"" case "numero": vtxt(j)=vtxt(j)&"" case "radioF": vtxt(j)=vtxt(j)&"" case "radioC": vtxt(j)=vtxt(j)&"" case "multiF","multiC","multi": vtxt(j)=vtxt(j)&"" end select vtxt(j)=vtxt(j)&"
" end select vcrequerido(j)=rstemp("cam_requerido") vcest(j)=rstemp("cam_cest") j=cint(j+1) rstemp.movenext loop end if %> Formularios ADEIT <% nums=mid(nums,2,len(nums)-1) %>

name=pk_formularios id=pk_formularios>
<%= ucase(frm_nombre) %>
<%=frm_leyenda%>
<%for i=0 to max-2 %><% if vctipo(i)="descripcion" then color="#949aad" tcolor="#ffffff" else color="#cccccc" tcolor="#000000" end if %> <% next %>
<% if vctipo(i)<>"entero" and vctipo(i)<>"decimal" and vcsubtipo(i)<>"corto" then if vcrequerido(i)="1" then %>*<% end if %> <%= vcnombre(i) %>
<%= vtxt(i) %> <%else%>
<% if vcrequerido(i)="1" then %>*<% end if%> <%= vcnombre(i) %> <%=vtxt(i)%>
<% end if %>
Los campos marcados con * son obligatorios.