1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
<%
Set objDom = Server.createObject("MSXML2.DOmDocument.4.0")
fichier = Server.MapPath("Frais.xml")
if (objDom.load(fichier)) then
set objNode = objDom.selectSingleNode("//SALARIE[@RUBRIQUE='"&request.form("SALARIE")&"']/MOIS[@NUM='"&request.form("Mois")&"']")
set NewNode = objDom.createElement("EVENEMENT")
NewNode.setAttribute "NUM", request.form("numEv")
'***TAB RECUPERATION VALEUR DU FORMULAIRE'*********
'1 Dimension nom de la balise XML
'2 Dimension valeur du request
Dim TabXML(6,1)
TabXML(0,0) ="JOUR"
TabXML(0,1) =request.form("Jour")
'----------------------------------------
TabXML(1,0) ="OBJET"
TabXML(1,1) =request.form("oBJET")
'----------------------------------------
TabXML(2,0) ="LIEU"
TabXML(2,1) =request.form("lieuDep")
'----------------------------------------
TabXML(3,0) ="KMS"
TabXML(3,1) =request.form("KMS")
'----------------------------------------
TabXML(4,0) ="MontantKMS"
TabXML(4,1) =request.form("MONTANTKMS")
'----------------------------------------
TabXML(5,0) ="AUTRES"
TabXML(5,1) =request.form("AUTRES")
'----------------------------------------
TabXML(6,0) ="MONTANTDEP"
TabXML(6,1) =request.form("MONTANTDEP")
'****************************************
FOR i=0 TO UBOUND(TabXML)
set newElement = objDom.createElement(TabXML(i,0))
newnode.appendChild newElement
Set newtext = objDom.createTextNode(TabXML(i,1))
newElement.appendChild newtext
objNode.InsertBefore NewNode, objNode.lastChild
objDom.save(Server.MapPath("Frais.xml"))
END IF
%> |
Partager