<% dim pos Sub creerTab(attrib) response.write "" End Sub Sub creerligne(attrib) response.write "" End Sub Sub creercol(attrib,txt,fincol,finligne) response.write "" end if if finligne then response.write "" end if end sub sub fermercol response.write "" End sub sub fermerligne(fincol) if fincol then response.write "" end if response.write "" End sub Sub fermertab response.write "
" response.write txt if fincol then response.write "
" End Sub Sub concat(txt,tab) tab(pos)=txt pos=pos+1 End sub function quote(txt) quote=join(array("'",replace(txt,"'","''"),"'"),"") End Function function menu(data,nom,message,numselect,attrib) dim i,tab(1000) pos=0 concat "",tab menu=join(tab,"") End function Function Zonetexte(nom,valeur,attrib) dim str str=array("") Zonetexte=join(str,"") end function function champ(typech,nom,valeur,attrib) dim str str=array("input type=",typech," name=",nom," value=",quote(valeur)," ",attrib,">") champ=join(str,"") end function sub creerform(action,method,attrib) dim str str=array("
") response.write join(str,"") end sub sub fermerform response.write "
" end sub function hyperlien(href,txt,tabvar,tabval,attrib) dim tab(200),i pos=0 concat "",tab concat txt,tab concat "",tab hyperlien=join(tab,"") end function function image(src,attrib) dim str str=array("") image=join(str,"") End function function zero(nb,max) dim taille taille=len(nb) if taille < max then zero=string(max-taille,"0")&nb end if end function function decoupe(strsource,balisedeb,balisefin) dim tabtemp1,tabtemp2,tabstr(2) tabtemp1=split(strsource,balisedeb) tabtemp2=split(tabtemp1(1),balisefin) tabstr(0)=tabtemp1(0) tabstr(1)=tabtemp2(0) tabstr(2)=tabtemp2(1) decoupe=tabstr end function function lirefic(chemin) dim fso,fic set fso=createobject("scripting.filesystemobject") set fic=fso.opentextfile(chemin) lirefic=fic.readall fic.close set fic=nothing set fso=nothing end function Sub validform(onlyone) dim item,strvars,tempvar,valide strvars="" for each item in request.form if instr(item,"R_") <> 0 then tempvar=request.form(item) if tempvar="" then strtemp=mid(item,3,len(item)-2) strvars=join(array(strvars,strtemp,";"),"") else valide=true end if end if next if onlyone=true then if not valide then strtemp= "Au moins un des champs doit être renseigné" strhtml=genmodele("mod_message",server.mappath(".")) strhtml=replace(strhtml,"{message}",strtemp) strhtml=replace(strhtml,"{hist}","-1") response.write strhtml response.end end if else if strvars<>"" then strtemp= "Les champs suivants doivent être renseignés :
" strtemp=strtemp&replace(strvars,";","
") strhtml=genmodele("mod_message",server.mappath(".")) strhtml=replace(strhtml,"{message}",strtemp) strhtml=replace(strhtml,"{hist}","-1") response.write strhtml response.end end if end if end sub function genmodele(modele,cheminmodele) dim chemin if isempty(application(modele)) then chemin=cheminmodele&"\"&modele&".html" application("modele")=lirefic(chemin) end if genmodele=application("modele") end function %>