1. The first is the XML document (experimental data, will automatically generate XML files through the agent)
Statics.xml? OpenPage
====================================
Xml version = "1.0" encoding = "gb2312"?> xyn username> XXXXXXXXXXXXXXXXXXXXX fileid> how to make statics tasktitle> USING XML Content> 2004-08-01 starttime> 2004-08-08 endtime> going well ... statu> 20 hours > Jzokay, ZZQ Leaders> DDDDDDD PJ> task> chenjun username> 444444444444444 fileID> SBB, OA Tasktitle> SBB, OA content> 2004-08-01 2004-08-08 DONE statu> 2 Hours> WW Leaders> Well Done !!! pj> task>
Administrator username> 4444444444455555555 test pertask4sbb.nsf on r6.5 tasktitle> it dons't support chinese very well, be careful! < / Content> 2004-08-01 starttime> 2004-08-08 endtime> doing statu> 10 hours> jzokay leaders > Be Careful pj> task> wangqiang username> 4444444444555555555 test pertask4sbb.nsf on r6.5 tasktitle> IT Dons't Support Chinese Very Well, Be Careful! Content> 2004-08-01 2004-08-08 endtime> doing statu> < Hours> 10 hours> JZOKAY Leaders> Be Careful pj> task> xyn usrname> 111111111111 The Web of Our Company tasktitle> as so as possibal content> 2004-08-01 starttime> 2004-08-25 endtime> on the Way statu> 10 hours> XIGONG Leaders> sooner, better pj> task>
Xyn username> 3333333333 fileID> do search in r6.5, get ready for other program tasktitle> do search in r6.5 content > 2004-08-01 starttime> 2004-08-08 endtime> doing statu> 30 hours> jzokay leaders> < PJ> sooner, better pj> task> wangqiang username> 1111111111 xxxxxxx tasktitle> ccccccccccc content> 2004-08-01 2004-08-08 endtime> DONE statu> 12 hours> jzokay leaders> Okokokokokokokok pj> task>
========================================= 3, form: My task | MyTask
Domain: Thisuser, AUSER (specified one user), Time1 (start time of the query), Time2 (the end time of the query)
Jsheader:
VAR XML = New ActiveXObject ("Microsoft.xmLDom"); XML.Assync = false; XML.Load ("statics.xml? openpage);
// Spectacle Function WriteHeader () {var htm = "
"htm = HTM "
Current User TH> "HTM = HTM "
Task Title TH> "HTM = HTM "
Document Number TH>" HTM = HTM "
Task content th>" HTM = HTM "
Start time th>" htm = htm "
End Time th> "HTM = HTM "
Current Status TH> "HTM = HTM "
Workload TH> "HTM = HTM "
Person in charge TH > "Htm = htm "
evaluation tH> tr> "Return HTM}
// No matter what, all task record function loadall () {
VAR XSL = New ActiveXObject ("Microsoft.xmLDom"); xsl.async = false; xsl.load ("style2.xsl"); var Soruce = Xml.TransformNode (XSL) Var obj = document.getlementByid ("D1") Obj.innerhtml = Soruce}
/ / Over the current user's task record function loadbyuser () {var obj = document.getlementByid ("thisuser") VAR items = Xml.selectnodes ("// tasks / task [username = ' obj.value " "" ); Var i var total = 0 var htmlbody = "" f (iTems.Length! = 0) {for (i = 0; i "htmlbody = HTMLBody "
HTMLBODY TR> "Total = Total PARSEINT (Items.Item (i) .childNodes.Item (7) .NodeTypedValue)} {document.getyle! =") {document.getElementByid ("D1"). InnerHTML = WriteHeader () HTMLBODY Table> ";} else {document.write (" Did not find a record that meets the specified condition! ")} //document.write (HTMLBODY); //Document.write (" < / Table> ") // Alert (Total)} else {document.write (" Did not find a record of the specified condition! ")}} // According to the username, the start time, check the task record within a time And statistical workload
Function LoadByuser_1 (username, time1, time2) {// Time1 = Time1.Replace ("-", ""). Replace ("-", ") // Time2 = Time2.Replace (" - "," ") .replace ("-", ") var obj = document.getlementByid (" auser ") // alert (Time2) var items = Xml.selectNodes (" // Tasks / Task [username = '" Obj.Value " '] "); // var items = Xml.selectnodes (" // Tasks / Task [username =' " Obj.value " 'and endtime> " Time1 " and endtime <" TIME2 "] "); Var I var total = 0 var htmlbody = "" = {for (i = 0; i Time1 && items.Item (i) .childnodes.Item (5) .NodeTypedValue = Time1 && items.Item i) .childNodes.Item (5) .NodeTypedValue <= TIME2) {// alert ("ok") //} htmlbody = htmlbody