<% Option explizit '********************************************* Beschreibung: 37080308 Adressbuch ' Autor: gwd 05.11.2002 '********************************************* %> <!--#include file="pub/funcxml.asp"--> <!--#include file="pub/constpub.asp"--> <!--#include file="pub/funcpub.asp"--> <!--#include file="pub/class/clsPerson.asp"--> <% Dim objXml, objPerson Dim strErr Set objXml = Server.CreateObject("MSXML2.DOMDocument") Set objPerson = New Cls_Person ' Cls_Person-Objekt generieren If Request.Form("btnOk") <> "" Then Wenn LoadXmlDoc(objXml, C_XMLFILE, False, strErr) Dann 'XML-Datei laden' Weisen Sie dem entsprechenden Attribut einen Wert zu objPerson.Name = CheckStrInput(Request.Form("txtName")) objPerson.Nick = CheckStrInput(Request.Form("txtNick")) objPerson.Mobile = CheckStrInput(Request.Form("txtMobile")) objPerson.Tel = CheckStrInput(Request.Form("txtTel")) objPerson.Email = CheckStrInput(Request.Form("txtEmail")) objPerson.QQ = CheckStrInput(Request.Form("txtQQ")) objPerson.Company = CheckStrInput(Request.Form("txtCompany")) If Not objPerson.AddToXml(objXml) Then ' Rufen Sie die AddToXml-Methode der Cls_Person-Klasse auf, um Daten hinzuzufügen: AddErr strErr, objPerson.GetLastError Anders AddErr strErr, „Hinzufügen erfolgreich“ Response.Write "<script language=""javascript"">opener.location.reload();</script>" Ende wenn Ende wenn Ende wenn Setze objXml = Nothing %> <HTML> <KOPF> <TITLE><% = C_TITLE %></TITLE> <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=GB2312"/> <link rel="stylesheet" href="contact.css" type="text/css"> <script language="javascript"> <!-- Funktion CheckForm() { return true; } //--> </script> </KOPF> <KÖRPER> <% = strErr %> <div class="title">Kontaktinformationen hinzufügen</div> <form name="form1" method="post" action="add.asp" onsubmit="return CheckForm()"> <table align="center" width="100%" cellspacing="1" cellpadding="2" border="0" bgcolor="#666600"> <tr bgcolor="#ffffff"> <td width="25%" bgcolor="#e5e5e5" align="right"><b>Name: </b></td> <td width="75%"><input type="text" name="txtName" size="25" class="input" value="<%=CheckStrOutput(objPerson.Name)%>"></td > </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>Englischer Name: </b></td> <td><input type="text" name="txtNick" size="25" class="input" value="<%=CheckStrOutput(objPerson.Nick)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>Mobiltelefon: </b></td> <td><input type="text" name="txtMobile" size="25" class="input" value="<%=CheckStrOutput(objPerson.Mobile)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>Tel: </b></td> <td><input type="text" name="txtTel" size="25" class="input" value="<%=CheckStrOutput(objPerson.Tel)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>E-Mail:</b></td> <td><input type="text" name="txtEmail" size="25" class="input" value="<%=CheckStrOutput(objPerson.Email)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>QQ:</b></td> <td><input type="text" name="txtQQ" size="25" class="input" value="<%=CheckStrOutput(objPerson.QQ)%>"></td> </tr> <tr bgcolor="#ffffff"> <td bgcolor="#e5e5e5" align="right"><b>Firma: </b></td> <td><input type="text" name="txtCompany" size="25" class="input" value="<%=CheckStrOutput(objPerson.Company)%>"></td> </tr> </Tabelle> <br> <div align="center"> <input type="submit" name="btnOk" value="Submit"> <input type="button" name="btnClose" value="Close" onclick="javascript:return window.close();"> </div> </form> </KÖRPER> </HTML> <% Setze objPerson = Nothing %> |