report2.asp 84 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958
  1. <!--#include file="Inc/common.asp"-->
  2. <!--#include file="Inc/MD5.asp"-->
  3. <!--#include file="Inc/Function.asp"-->
  4. <!--#include file="Admin_Common.asp"-->
  5. <!--#include file="CheckComeUrl.asp"-->
  6. <!--#include file="arrClass.asp"-->
  7. <!--#include file="xmlClass.asp"-->
  8. <%
  9. Dim uid, rsRole, isAdmin, rsgan
  10. uid = trim(request("uid"))
  11. if trim(Lcase(AdminName)) = "admin" then
  12. isAdmin = true
  13. else
  14. isAdmin = false
  15. end if
  16. dim i, j, k, kk, kkk, totalseconds, maxdot, intervaltime, dot, itime, chart_temp, chart_temp2, chart, chart1, chart2, chart3, chart4, chart5, chart6, chart7, chart8, chart9, chart10
  17. maxdot = 800
  18. intervaltime = 1800
  19. maxperpage = 30
  20. %>
  21. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  22. <html xmlns="http://www.w3.org/1999/xhtml">
  23. <head>
  24. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  25. <title>斯特钮机房监控系统</title>
  26. <link href="bs2010.css" rel="stylesheet" type="text/css" />
  27. <script type="text/javascript" src="js/share.js"></script>
  28. <script type="text/javascript" src="js/prototype.js"></script>
  29. <script language="javascript" type="text/javascript" src="datepicker/WdatePicker.js"></script>
  30. <script language="javascript" type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
  31. <script language="javascript" type="text/javascript" src="js/jquery.sparkline.js"></script>
  32. <script language="javascript">
  33. function GetData()
  34. {
  35. url="alarm.asp";//调用页面
  36. var xmlhttp=null;
  37. if(window.XMLHttpRequest)
  38. {
  39. xmlhttp=new XMLHttpRequest();
  40. }
  41. if(!xmlhttp&&window.ActiveXObject)
  42. {
  43. try
  44. {
  45. xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.5.0")
  46. }
  47. catch(e)
  48. {
  49. try
  50. {
  51. xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.4.0")
  52. }
  53. catch(e){
  54. try
  55. {
  56. new ActiveXObject("Msxml2.XMLHTTP")
  57. }
  58. catch(e)
  59. {
  60. try{
  61. new ActiveXObject("Microsoft.XMLHTTP")
  62. }catch(e)
  63. {
  64. }
  65. }
  66. }
  67. }
  68. }
  69. if(!xmlhttp){alert("XMLHTTP不可用,请升级安装。");location="support/msxml.msi"}
  70. xmlhttp.open("GET",url,false);
  71. xmlhttp.send();
  72. var str = xmlhttp.responseText;
  73. document.getElementById("loadcontent").innerHTML=str;
  74. setTimeout("GetData()",<%=refreshRate%>);
  75. }
  76. </script>
  77. <script language=javascript>
  78. <!--
  79. function SetFocus() {
  80. if(document.searchForm.bl.value == '')
  81. document.searchForm.bl.focus();
  82. else
  83. document.searchForm.bl.select();
  84. }
  85. function CheckForm() {
  86. // if(document.searchForm.stype.value == 2 && document.searchForm.bl.value == '') {
  87. // alert('请选择要查询的变量!');
  88. // document.searchForm.bl.focus();
  89. // return false;
  90. // }
  91. if(document.searchForm.d1.value == '') {
  92. alert('请选择开始日期!');
  93. document.searchForm.d1.focus();
  94. return false;
  95. }
  96. if(document.searchForm.d2.value == '') {
  97. alert('请选择结束日期!');
  98. document.searchForm.d2.focus();
  99. return false;
  100. }
  101. }
  102. //-->
  103. </script>
  104. </head>
  105. <body onLoad="javascript:GetData();">
  106. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  107. <tr>
  108. <td class="mainbg"><table width="760" border="0" cellspacing="0" cellpadding="0">
  109. <tr>
  110. <td valign="top">
  111. <div id="loadcontent">
  112. <p></p>
  113. 数据载入中……</div>
  114. <br />
  115. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  116. <tr>
  117. <td width="20" height="40"><img src="images/arr1.gif" width="14" height="18" /></td>
  118. <td class="deviceName">报警通知查询</td>
  119. </tr>
  120. </table>
  121. <br />
  122. <%
  123. Action = trim(request("Action"))
  124. select case Action
  125. case "search"
  126. call search
  127. case "showpage"
  128. call showpage
  129. case "showchart"
  130. call showchart
  131. case "showpage2"
  132. call showpage2
  133. case "showchart2"
  134. call showchart2
  135. case "createExcel"
  136. call createExcel
  137. case "showpageSms"
  138. call showpageSms
  139. case "showpageTel"
  140. call showpageTel
  141. case "showpageEmail"
  142. call showpageEmail
  143. case else
  144. call main
  145. end select
  146. sub main()
  147. %>
  148. <form name='searchForm' method='Post' action='report.asp' onSubmit='return CheckForm();'>
  149. <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  150. <tr>
  151. <td class="deviceTdTitle">变量列表</td>
  152. <td width="50%" class="deviceTdTitle">筛选器</td>
  153. </tr>
  154. <tr class="deviceTd">
  155. <td rowspan=2 align="center">
  156. <select name="bl" size="2" <%if multiple = true then response.write "multiple='multiple'"%> id="bl" style="width:300px; height:300px; border:1px solid #CCC;">
  157. <%=getbl()%>
  158. </select> </td>
  159. <td align="center">
  160. <table width="200" border="0" cellspacing="0" cellpadding="0">
  161. <tr>
  162. <td align="left"><strong>日期设置</strong></td>
  163. </tr>
  164. <tr>
  165. <td align="left">从
  166. <input type="hidden" id="d1_y" name="d1_y" size="5"/>
  167. <input type="hidden" id="d1_M" name="d1_M" size="3"/>
  168. <input type="hidden" id="d1_d" name="d1_d" size="3"/>
  169. <input type="hidden" id="d1_HH" name="d1_HH" size="3"/>
  170. <input type="hidden" id="d1_mm" name="d1_mm" size="3"/>
  171. <input type="hidden" id="d1_ss" name="d1_ss" size="3"/>
  172. <input type="text" id="d1" name="d1" style="border:1px solid #CCC;background:url(DatePicker/skin/datePicker.gif) center right no-repeat" onfocus="WdatePicker({el:'d1',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'<%=startdate%>',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',onpicked:pickedFunc1})"/>
  173. <script>
  174. function pickedFunc1(){
  175. $dp.$('d1_y').value=$dp.cal.getP('y');
  176. $dp.$('d1_M').value=$dp.cal.getP('M');
  177. $dp.$('d1_d').value=$dp.cal.getP('d');
  178. $dp.$('d1_HH').value=$dp.cal.getP('H');
  179. $dp.$('d1_mm').value=$dp.cal.getP('m');
  180. $dp.$('d1_ss').value=$dp.cal.getP('s');
  181. }
  182. </script></td>
  183. </tr>
  184. <tr>
  185. <td align="left">到
  186. <input type="hidden" id="d2_y" name="d2_y" size="5"/>
  187. <input type="hidden" id="d2_M" name="d2_M" size="3"/>
  188. <input type="hidden" id="d2_d" name="d2_d" size="3"/>
  189. <input type="hidden" id="d2_HH" name="d2_HH" size="3"/>
  190. <input type="hidden" id="d2_mm" name="d2_mm" size="3"/>
  191. <input type="hidden" id="d2_ss" name="d2_ss" size="3"/>
  192. <%if dateLimit = 0 or allowHistoryDataSearch = false then%>
  193. <input type="text" id="d2" name="d2" style="border:1px solid #CCC;background:url(DatePicker/skin/datePicker.gif) center right no-repeat" onfocus="WdatePicker({el:'d2',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d1\')||\'<%=startdate%>\'}',maxDate:'%y-%M-%d %H:%m:%s',onpicked:pickedFunc2})"/>
  194. <%else%>
  195. <input type="text" id="d2" name="d2" style="border:1px solid #CCC;background:url(DatePicker/skin/datePicker.gif) center right no-repeat" onfocus="WdatePicker({el:'d2',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d1\')||\'<%=startdate%>\'}',maxDate:'#F{$dp.$D(\'d1\',{d:<%=dateLimit%>})||\'%y-%M-%d %H:%m:%s\'}',onpicked:pickedFunc2})"/>
  196. <%end if%>
  197. <script>
  198. function pickedFunc2(){
  199. $dp.$('d2_y').value=$dp.cal.getP('y');
  200. $dp.$('d2_M').value=$dp.cal.getP('M');
  201. $dp.$('d2_d').value=$dp.cal.getP('d');
  202. $dp.$('d2_HH').value=$dp.cal.getP('H');
  203. $dp.$('d2_mm').value=$dp.cal.getP('m');
  204. $dp.$('d2_ss').value=$dp.cal.getP('s');
  205. }
  206. </script></td>
  207. </tr>
  208. </table>
  209. <br /></td>
  210. </tr>
  211. <tr class="deviceTd">
  212. <td align="center"><label>
  213. </label>
  214. <table width="200" border="0" cellspacing="0" cellpadding="0">
  215. <tr>
  216. <td align="left"><strong>查询类型</strong></td>
  217. </tr>
  218. <tr>
  219. <td align="left">
  220. <%if allowHistoryDataSearch = true then%><label><input type="radio" name="stype" id="stype" value="1" onclick="javascript:document.getElementById('bl').disabled='';" />历史记录</label><br /><%end if%>
  221. <label><input name="stype" type="radio" id="stype" value="2" checked="checked" onclick="javascript:document.getElementById('bl').disabled='';" />报警记录</label>
  222. <%if allowSmsSearch = true then%><br /><label><input name="stype" type="radio" id="stype" value="3" onclick="javascript:document.getElementById('bl').disabled='disabled';" />短信记录</label><%end if%>
  223. <%if allowTelSearch = true then%><br /><label><input name="stype" type="radio" id="stype" value="4" onclick="javascript:document.getElementById('bl').disabled='disabled';" />电话记录</label><%end if%>
  224. <%if allowEmailSearch = true then%><br /><label><input name="stype" type="radio" id="stype" value="5" onclick="javascript:document.getElementById('bl').disabled='disabled';" />Email记录</label><%end if%>
  225. </td>
  226. </tr>
  227. </table>
  228. </td>
  229. </tr>
  230. <tr class="deviceTd">
  231. <td colspan="2" align="center">
  232. <input type="hidden" id="Action" name="Action" value="search" />
  233. <input type="submit" name="submit" id="submit" value="查询" />
  234. </td>
  235. </tr>
  236. </table>
  237. </form>
  238. <script>
  239. SetFocus();
  240. </script>
  241. <%
  242. end sub
  243. sub search()
  244. dim bl,d1_y,d1_M,d1_d,d1_HH,d1_mm,d1_ss,d1,d2_y,d2_M,d2_d,d2_HH,d2_mm,d2_ss,d2,stype,sql,isMulti,rswr,bl_str,bl_arr,ao,fr
  245. stype = trim(request("stype"))
  246. bl = trim(request("bl"))
  247. d1_y = trim(request("d1_y"))
  248. d1_M = trim(request("d1_M"))
  249. d1_d = trim(request("d1_d"))
  250. d1_HH = trim(request("d1_HH"))
  251. d1_mm = trim(request("d1_mm"))
  252. d1_ss = trim(request("d1_ss"))
  253. d1 = trim(request("d1"))
  254. d2_y = trim(request("d2_y"))
  255. d2_M = trim(request("d2_M"))
  256. d2_d = trim(request("d2_d"))
  257. d2_HH = trim(request("d2_HH"))
  258. d2_mm = trim(request("d2_mm"))
  259. d2_ss = trim(request("d2_ss"))
  260. d2 = trim(request("d2"))
  261. if (stype = 1 or stype = 2) and bl = "" then
  262. response.write "<script>alert('请选择变量!');</script>"
  263. response.write "<script>window.history.go(-1);</script>"
  264. response.end
  265. end if
  266. if ubound(split(bl,",")) > reportNum-1 then
  267. response.write "<script>alert('所选变量最多不能超过"&reportNum&"个!');</script>"
  268. response.write "<script>window.history.go(-1);</script>"
  269. response.end
  270. end if
  271. totalseconds = datediff("s",d1,d2)
  272. session("bl") = bl
  273. session("d1") = d1
  274. session("d2") = d2
  275. session("totalseconds") = totalseconds
  276. session("bl") = bl
  277. '获取变量并重新格式化
  278. if instr(bl,",") > 0 then
  279. isMulti = true
  280. else
  281. isMulti = false
  282. end if
  283. if stype = 1 then
  284. '检查xml文件是否存在,不存在则创建,否则直接调用
  285. dim prename, xmlSetting_header, xmlSetting_footer, xmlSetting_body, xmlData_header, xmlData_footer, xmlData_body, xmlFileSetting, xmlFileData, xmlAllData_header, xmlAllData_body, xmlAllData_footer
  286. prename = d1_y&d1_M&d1_d&d1_HH&d1_mm&"to"&d2_y&d2_M&d2_d&d2_HH&d2_mm&"_log"
  287. ' else
  288. ' prename = d1_y&d1_M&d1_d&d1_HH&d1_mm&"to"&d2_y&d2_M&d2_d&d2_HH&d2_mm&"_alarm"
  289. session("prename") = prename
  290. if fso.fileexists(server.mappath("temp/"&prename&"_data.xml")) and fso.fileexists(server.mappath("temp/"&prename&"_settings.xml")) then
  291. if stype = 1 then
  292. call showchart
  293. ' elseif stype = 2 then
  294. ' call showchart2
  295. end if
  296. end if
  297. '检查temp文件夹
  298. if not fso.Folderexists(server.mappath("temp")) then
  299. Fso.CreateFolder(Server.MapPath("temp"))
  300. end if
  301. xmlSetting_header = "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
  302. xmlSetting_header = xmlSetting_header & "<settings>" & vbCrLf
  303. xmlSetting_header = xmlSetting_header & " <data_type></data_type>" & vbCrLf
  304. xmlSetting_header = xmlSetting_header & " <csv_separator></csv_separator>" & vbCrLf
  305. xmlSetting_header = xmlSetting_header & " <skip_rows></skip_rows>" & vbCrLf
  306. xmlSetting_header = xmlSetting_header & " <font></font>" & vbCrLf
  307. xmlSetting_header = xmlSetting_header & " <text_size>12</text_size>" & vbCrLf
  308. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  309. xmlSetting_header = xmlSetting_header & " <decimals_separator></decimals_separator>" & vbCrLf
  310. xmlSetting_header = xmlSetting_header & " <thousands_separator></thousands_separator>" & vbCrLf
  311. xmlSetting_header = xmlSetting_header & " <digits_after_decimal>2</digits_after_decimal>" & vbCrLf
  312. xmlSetting_header = xmlSetting_header & " <scientific_min></scientific_min>" & vbCrLf
  313. xmlSetting_header = xmlSetting_header & " <scientific_max></scientific_max>" & vbCrLf
  314. xmlSetting_header = xmlSetting_header & " <redraw>true</redraw>" & vbCrLf
  315. xmlSetting_header = xmlSetting_header & vbCrLf
  316. xmlSetting_header = xmlSetting_header & " <reload_data_interval></reload_data_interval>" & vbCrLf
  317. xmlSetting_header = xmlSetting_header & " <preloader_on_reload></preloader_on_reload>" & vbCrLf
  318. xmlSetting_header = xmlSetting_header & " <add_time_stamp></add_time_stamp>" & vbCrLf
  319. xmlSetting_header = xmlSetting_header & vbCrLf
  320. xmlSetting_header = xmlSetting_header & " <connect></connect>" & vbCrLf
  321. xmlSetting_header = xmlSetting_header & " <hide_bullets_count>20</hide_bullets_count>" & vbCrLf
  322. xmlSetting_header = xmlSetting_header & " <link_target></link_target>" & vbCrLf
  323. xmlSetting_header = xmlSetting_header & " <start_on_axis></start_on_axis>" & vbCrLf
  324. xmlSetting_header = xmlSetting_header & " <colors></colors>" & vbCrLf
  325. xmlSetting_header = xmlSetting_header & " <rescale_on_hide></rescale_on_hide>" & vbCrLf
  326. xmlSetting_header = xmlSetting_header & " <js_enabled></js_enabled>" & vbCrLf
  327. xmlSetting_header = xmlSetting_header & vbCrLf
  328. xmlSetting_header = xmlSetting_header & " <background>" & vbCrLf
  329. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  330. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  331. xmlSetting_header = xmlSetting_header & " <border_color></border_color>" & vbCrLf
  332. xmlSetting_header = xmlSetting_header & " <border_alpha></border_alpha>" & vbCrLf
  333. xmlSetting_header = xmlSetting_header & " <file></file>" & vbCrLf
  334. xmlSetting_header = xmlSetting_header & " </background>" & vbCrLf
  335. xmlSetting_header = xmlSetting_header & vbCrLf
  336. xmlSetting_header = xmlSetting_header & " <plot_area>" & vbCrLf
  337. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  338. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  339. xmlSetting_header = xmlSetting_header & " <border_color></border_color>" & vbCrLf
  340. xmlSetting_header = xmlSetting_header & " <border_alpha></border_alpha>" & vbCrLf
  341. xmlSetting_header = xmlSetting_header & " <margins>" & vbCrLf
  342. xmlSetting_header = xmlSetting_header & " <left></left>" & vbCrLf
  343. xmlSetting_header = xmlSetting_header & " <top></top>" & vbCrLf
  344. xmlSetting_header = xmlSetting_header & " <right></right>" & vbCrLf
  345. xmlSetting_header = xmlSetting_header & " <bottom></bottom>" & vbCrLf
  346. xmlSetting_header = xmlSetting_header & " </margins>" & vbCrLf
  347. xmlSetting_header = xmlSetting_header & " </plot_area>" & vbCrLf
  348. xmlSetting_header = xmlSetting_header & vbCrLf
  349. xmlSetting_header = xmlSetting_header & " <scroller>" & vbCrLf
  350. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  351. xmlSetting_header = xmlSetting_header & " <y></y>" & vbCrLf
  352. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  353. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  354. xmlSetting_header = xmlSetting_header & " <bg_color></bg_color>" & vbCrLf
  355. xmlSetting_header = xmlSetting_header & " <bg_alpha></bg_alpha>" & vbCrLf
  356. xmlSetting_header = xmlSetting_header & " <height></height>" & vbCrLf
  357. xmlSetting_header = xmlSetting_header & " </scroller>" & vbCrLf
  358. xmlSetting_header = xmlSetting_header & vbCrLf
  359. xmlSetting_header = xmlSetting_header & " <grid>" & vbCrLf
  360. xmlSetting_header = xmlSetting_header & " <x>" & vbCrLf
  361. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  362. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  363. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  364. xmlSetting_header = xmlSetting_header & " <dashed></dashed>" & vbCrLf
  365. xmlSetting_header = xmlSetting_header & " <dash_length></dash_length>" & vbCrLf
  366. xmlSetting_header = xmlSetting_header & " <approx_count></approx_count>" & vbCrLf
  367. xmlSetting_header = xmlSetting_header & " </x>" & vbCrLf
  368. xmlSetting_header = xmlSetting_header & " <y_left>" & vbCrLf
  369. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  370. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  371. xmlSetting_header = xmlSetting_header & " <alpha>0</alpha>" & vbCrLf
  372. xmlSetting_header = xmlSetting_header & " <dashed></dashed>" & vbCrLf
  373. xmlSetting_header = xmlSetting_header & " <dash_length></dash_length>" & vbCrLf
  374. xmlSetting_header = xmlSetting_header & " <approx_count></approx_count>" & vbCrLf
  375. xmlSetting_header = xmlSetting_header & " <fill_color>000000</fill_color>" & vbCrLf
  376. xmlSetting_header = xmlSetting_header & " <fill_alpha>5</fill_alpha>" & vbCrLf
  377. xmlSetting_header = xmlSetting_header & " </y_left>" & vbCrLf
  378. xmlSetting_header = xmlSetting_header & " <y_right>" & vbCrLf
  379. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  380. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  381. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  382. xmlSetting_header = xmlSetting_header & " <dashed></dashed>" & vbCrLf
  383. xmlSetting_header = xmlSetting_header & " <dash_length></dash_length>" & vbCrLf
  384. xmlSetting_header = xmlSetting_header & " <approx_count></approx_count>" & vbCrLf
  385. xmlSetting_header = xmlSetting_header & " <fill_color></fill_color>" & vbCrLf
  386. xmlSetting_header = xmlSetting_header & " <fill_alpha></fill_alpha>" & vbCrLf
  387. xmlSetting_header = xmlSetting_header & " </y_right>" & vbCrLf
  388. xmlSetting_header = xmlSetting_header & " </grid>" & vbCrLf
  389. xmlSetting_header = xmlSetting_header & vbCrLf
  390. xmlSetting_header = xmlSetting_header & " <values>" & vbCrLf
  391. xmlSetting_header = xmlSetting_header & " <x>" & vbCrLf
  392. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  393. xmlSetting_header = xmlSetting_header & " <rotate>45</rotate>" & vbCrLf
  394. xmlSetting_header = xmlSetting_header & " <frequency></frequency>" & vbCrLf
  395. xmlSetting_header = xmlSetting_header & " <skip_first></skip_first>" & vbCrLf
  396. xmlSetting_header = xmlSetting_header & " <skip_last></skip_last>" & vbCrLf
  397. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  398. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  399. xmlSetting_header = xmlSetting_header & " <inside></inside>" & vbCrLf
  400. xmlSetting_header = xmlSetting_header & " </x>" & vbCrLf
  401. xmlSetting_header = xmlSetting_header & " <y_left>" & vbCrLf
  402. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  403. xmlSetting_header = xmlSetting_header & " <reverse></reverse>" & vbCrLf
  404. xmlSetting_header = xmlSetting_header & " <rotate></rotate>" & vbCrLf
  405. xmlSetting_header = xmlSetting_header & " <min></min>" & vbCrLf
  406. xmlSetting_header = xmlSetting_header & " <max></max>" & vbCrLf
  407. xmlSetting_header = xmlSetting_header & " <strict_min_max></strict_min_max>" & vbCrLf
  408. xmlSetting_header = xmlSetting_header & " <frequency></frequency>" & vbCrLf
  409. xmlSetting_header = xmlSetting_header & " <skip_first></skip_first>" & vbCrLf
  410. xmlSetting_header = xmlSetting_header & " <skip_last></skip_last>" & vbCrLf
  411. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  412. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  413. xmlSetting_header = xmlSetting_header & " <unit></unit>" & vbCrLf
  414. xmlSetting_header = xmlSetting_header & " <unit_position></unit_position>" & vbCrLf
  415. xmlSetting_header = xmlSetting_header & " <integers_only></integers_only>" & vbCrLf
  416. xmlSetting_header = xmlSetting_header & " <inside></inside>" & vbCrLf
  417. xmlSetting_header = xmlSetting_header & " <duration></duration>" & vbCrLf
  418. xmlSetting_header = xmlSetting_header & " </y_left>" & vbCrLf
  419. xmlSetting_header = xmlSetting_header & " <y_right>" & vbCrLf
  420. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  421. xmlSetting_header = xmlSetting_header & " <reverse></reverse>" & vbCrLf
  422. xmlSetting_header = xmlSetting_header & " <rotate></rotate>" & vbCrLf
  423. xmlSetting_header = xmlSetting_header & " <min></min>" & vbCrLf
  424. xmlSetting_header = xmlSetting_header & " <max></max>" & vbCrLf
  425. xmlSetting_header = xmlSetting_header & " <strict_min_max></strict_min_max>" & vbCrLf
  426. xmlSetting_header = xmlSetting_header & " <frequency></frequency>" & vbCrLf
  427. xmlSetting_header = xmlSetting_header & " <skip_first></skip_first>" & vbCrLf
  428. xmlSetting_header = xmlSetting_header & " <skip_last></skip_last>" & vbCrLf
  429. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  430. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  431. xmlSetting_header = xmlSetting_header & " <unit></unit>" & vbCrLf
  432. xmlSetting_header = xmlSetting_header & " <unit_position></unit_position>" & vbCrLf
  433. xmlSetting_header = xmlSetting_header & " <integers_only></integers_only>" & vbCrLf
  434. xmlSetting_header = xmlSetting_header & " <inside></inside>" & vbCrLf
  435. xmlSetting_header = xmlSetting_header & " <duration></duration>" & vbCrLf
  436. xmlSetting_header = xmlSetting_header & " </y_right>" & vbCrLf
  437. xmlSetting_header = xmlSetting_header & " </values>" & vbCrLf
  438. xmlSetting_header = xmlSetting_header & vbCrLf
  439. xmlSetting_header = xmlSetting_header & " <axes>" & vbCrLf
  440. xmlSetting_header = xmlSetting_header & " <x>" & vbCrLf
  441. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  442. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  443. xmlSetting_header = xmlSetting_header & " <width></width>" & vbCrLf
  444. xmlSetting_header = xmlSetting_header & " <tick_length></tick_length>" & vbCrLf
  445. xmlSetting_header = xmlSetting_header & " </x>" & vbCrLf
  446. xmlSetting_header = xmlSetting_header & " <y_left>" & vbCrLf
  447. xmlSetting_header = xmlSetting_header & " <type></type>" & vbCrLf
  448. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  449. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  450. xmlSetting_header = xmlSetting_header & " <width></width>" & vbCrLf
  451. xmlSetting_header = xmlSetting_header & " <tick_length></tick_length>" & vbCrLf
  452. xmlSetting_header = xmlSetting_header & " <logarithmic></logarithmic>" & vbCrLf
  453. xmlSetting_header = xmlSetting_header & " </y_left>" & vbCrLf
  454. xmlSetting_header = xmlSetting_header & " <y_right>" & vbCrLf
  455. xmlSetting_header = xmlSetting_header & " <type></type>" & vbCrLf
  456. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  457. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  458. xmlSetting_header = xmlSetting_header & " <width></width>" & vbCrLf
  459. xmlSetting_header = xmlSetting_header & " <tick_length></tick_length>" & vbCrLf
  460. xmlSetting_header = xmlSetting_header & " <logarithmic></logarithmic>" & vbCrLf
  461. xmlSetting_header = xmlSetting_header & " </y_right>" & vbCrLf
  462. xmlSetting_header = xmlSetting_header & " </axes>" & vbCrLf
  463. xmlSetting_header = xmlSetting_header & vbCrLf
  464. xmlSetting_header = xmlSetting_header & " <indicator>" & vbCrLf
  465. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  466. xmlSetting_header = xmlSetting_header & " <zoomable></zoomable>" & vbCrLf
  467. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  468. xmlSetting_header = xmlSetting_header & " <line_alpha></line_alpha>" & vbCrLf
  469. xmlSetting_header = xmlSetting_header & " <selection_color></selection_color>" & vbCrLf
  470. xmlSetting_header = xmlSetting_header & " <selection_alpha></selection_alpha>" & vbCrLf
  471. xmlSetting_header = xmlSetting_header & " <x_balloon_enabled></x_balloon_enabled>" & vbCrLf
  472. xmlSetting_header = xmlSetting_header & " <x_balloon_text_color></x_balloon_text_color>" & vbCrLf
  473. xmlSetting_header = xmlSetting_header & " </indicator>" & vbCrLf
  474. xmlSetting_header = xmlSetting_header & vbCrLf
  475. xmlSetting_header = xmlSetting_header & " <balloon>" & vbCrLf
  476. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  477. xmlSetting_header = xmlSetting_header & " <only_one></only_one>" & vbCrLf
  478. xmlSetting_header = xmlSetting_header & " <on_off></on_off>" & vbCrLf
  479. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  480. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  481. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  482. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  483. xmlSetting_header = xmlSetting_header & " <max_width></max_width>" & vbCrLf
  484. xmlSetting_header = xmlSetting_header & " <corner_radius></corner_radius>" & vbCrLf
  485. xmlSetting_header = xmlSetting_header & " <border_width></border_width>" & vbCrLf
  486. xmlSetting_header = xmlSetting_header & " <border_alpha></border_alpha>" & vbCrLf
  487. xmlSetting_header = xmlSetting_header & " <border_color></border_color>" & vbCrLf
  488. xmlSetting_header = xmlSetting_header & " </balloon> " & vbCrLf
  489. xmlSetting_header = xmlSetting_header & vbCrLf
  490. xmlSetting_header = xmlSetting_header & " <legend>" & vbCrLf
  491. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  492. xmlSetting_header = xmlSetting_header & " <x></x>" & vbCrLf
  493. xmlSetting_header = xmlSetting_header & " <y></y>" & vbCrLf
  494. xmlSetting_header = xmlSetting_header & " <width></width>" & vbCrLf
  495. xmlSetting_header = xmlSetting_header & " <max_columns></max_columns>" & vbCrLf
  496. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  497. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  498. xmlSetting_header = xmlSetting_header & " <border_color></border_color>" & vbCrLf
  499. xmlSetting_header = xmlSetting_header & " <border_alpha></border_alpha>" & vbCrLf
  500. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  501. xmlSetting_header = xmlSetting_header & " <text_color_hover></text_color_hover>" & vbCrLf
  502. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  503. xmlSetting_header = xmlSetting_header & " <spacing></spacing>" & vbCrLf
  504. xmlSetting_header = xmlSetting_header & " <margins></margins>" & vbCrLf
  505. xmlSetting_header = xmlSetting_header & " <graph_on_off></graph_on_off>" & vbCrLf
  506. xmlSetting_header = xmlSetting_header & " <reverse_order></reverse_order>" & vbCrLf
  507. xmlSetting_header = xmlSetting_header & " <align></align>" & vbCrLf
  508. xmlSetting_header = xmlSetting_header & " <key>" & vbCrLf
  509. xmlSetting_header = xmlSetting_header & " <size></size>" & vbCrLf
  510. xmlSetting_header = xmlSetting_header & " <border_color></border_color>" & vbCrLf
  511. xmlSetting_header = xmlSetting_header & " <key_mark_color></key_mark_color>" & vbCrLf
  512. xmlSetting_header = xmlSetting_header & " </key>" & vbCrLf
  513. xmlSetting_header = xmlSetting_header & " <values>" & vbCrLf
  514. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  515. xmlSetting_header = xmlSetting_header & " <width></width>" & vbCrLf
  516. xmlSetting_header = xmlSetting_header & " <align></align>" & vbCrLf
  517. xmlSetting_header = xmlSetting_header & " <text><![CDATA[]]></text>" & vbCrLf
  518. xmlSetting_header = xmlSetting_header & " </values>" & vbCrLf
  519. xmlSetting_header = xmlSetting_header & " </legend> " & vbCrLf
  520. xmlSetting_header = xmlSetting_header & vbCrLf
  521. xmlSetting_header = xmlSetting_header & " <zoom_out_button>" & vbCrLf
  522. xmlSetting_header = xmlSetting_header & " <x></x>" & vbCrLf
  523. xmlSetting_header = xmlSetting_header & " <y></y>" & vbCrLf
  524. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  525. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  526. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  527. xmlSetting_header = xmlSetting_header & " <text_color_hover></text_color_hover>" & vbCrLf
  528. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  529. xmlSetting_header = xmlSetting_header & " <text></text>" & vbCrLf
  530. xmlSetting_header = xmlSetting_header & " </zoom_out_button> " & vbCrLf
  531. xmlSetting_header = xmlSetting_header & vbCrLf
  532. xmlSetting_header = xmlSetting_header & " <help>" & vbCrLf
  533. xmlSetting_header = xmlSetting_header & " <button>" & vbCrLf
  534. xmlSetting_header = xmlSetting_header & " <x></x>" & vbCrLf
  535. xmlSetting_header = xmlSetting_header & " <y></y>" & vbCrLf
  536. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  537. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  538. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  539. xmlSetting_header = xmlSetting_header & " <text_color_hover></text_color_hover>" & vbCrLf
  540. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  541. xmlSetting_header = xmlSetting_header & " <text></text>" & vbCrLf
  542. xmlSetting_header = xmlSetting_header & " </button>" & vbCrLf
  543. xmlSetting_header = xmlSetting_header & " <balloon>" & vbCrLf
  544. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  545. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  546. xmlSetting_header = xmlSetting_header & " <width></width>" & vbCrLf
  547. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  548. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  549. xmlSetting_header = xmlSetting_header & " <text><![CDATA[]]></text>" & vbCrLf
  550. xmlSetting_header = xmlSetting_header & " </balloon>" & vbCrLf
  551. xmlSetting_header = xmlSetting_header & " </help> " & vbCrLf
  552. xmlSetting_header = xmlSetting_header & vbCrLf
  553. xmlSetting_header = xmlSetting_header & " <export_as_image>" & vbCrLf
  554. xmlSetting_header = xmlSetting_header & " <file></file>" & vbCrLf
  555. xmlSetting_header = xmlSetting_header & " <target></target>" & vbCrLf
  556. xmlSetting_header = xmlSetting_header & " <x></x>" & vbCrLf
  557. xmlSetting_header = xmlSetting_header & " <y></y>" & vbCrLf
  558. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  559. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  560. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  561. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  562. xmlSetting_header = xmlSetting_header & " </export_as_image>" & vbCrLf
  563. xmlSetting_header = xmlSetting_header & vbCrLf
  564. xmlSetting_header = xmlSetting_header & " <error_messages>" & vbCrLf
  565. xmlSetting_header = xmlSetting_header & " <enabled></enabled>" & vbCrLf
  566. xmlSetting_header = xmlSetting_header & " <x></x>" & vbCrLf
  567. xmlSetting_header = xmlSetting_header & " <y></y>" & vbCrLf
  568. xmlSetting_header = xmlSetting_header & " <color></color>" & vbCrLf
  569. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  570. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  571. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  572. xmlSetting_header = xmlSetting_header & " </error_messages> " & vbCrLf
  573. xmlSetting_header = xmlSetting_header & vbCrLf
  574. xmlSetting_header = xmlSetting_header & " <strings>" & vbCrLf
  575. xmlSetting_header = xmlSetting_header & " <no_data></no_data>" & vbCrLf
  576. xmlSetting_header = xmlSetting_header & " <export_as_image></export_as_image>" & vbCrLf
  577. xmlSetting_header = xmlSetting_header & " <error_in_data_file></error_in_data_file>" & vbCrLf
  578. xmlSetting_header = xmlSetting_header & " <collecting_data></collecting_data>" & vbCrLf
  579. xmlSetting_header = xmlSetting_header & " <wrong_zoom_value></wrong_zoom_value>" & vbCrLf
  580. xmlSetting_header = xmlSetting_header & " <ss></ss>" & vbCrLf
  581. xmlSetting_header = xmlSetting_header & " <mm></mm>" & vbCrLf
  582. xmlSetting_header = xmlSetting_header & " <hh></hh>" & vbCrLf
  583. xmlSetting_header = xmlSetting_header & " <DD></DD>" & vbCrLf
  584. xmlSetting_header = xmlSetting_header & " </strings>" & vbCrLf
  585. xmlSetting_header = xmlSetting_header & vbCrLf
  586. xmlSetting_header = xmlSetting_header & " <context_menu>" & vbCrLf
  587. xmlSetting_header = xmlSetting_header & " <default_items>" & vbCrLf
  588. xmlSetting_header = xmlSetting_header & " <zoom></zoom>" & vbCrLf
  589. xmlSetting_header = xmlSetting_header & " <print></print>" & vbCrLf
  590. xmlSetting_header = xmlSetting_header & " </default_items>" & vbCrLf
  591. xmlSetting_header = xmlSetting_header & " </context_menu>" & vbCrLf
  592. xmlSetting_header = xmlSetting_header & vbCrLf
  593. xmlSetting_header = xmlSetting_header & " <vertical_lines>" & vbCrLf
  594. xmlSetting_header = xmlSetting_header & " <width>80</width>" & vbCrLf
  595. xmlSetting_header = xmlSetting_header & " <alpha></alpha>" & vbCrLf
  596. xmlSetting_header = xmlSetting_header & " <clustered></clustered>" & vbCrLf
  597. xmlSetting_header = xmlSetting_header & " <mask></mask>" & vbCrLf
  598. xmlSetting_header = xmlSetting_header & " </vertical_lines>" & vbCrLf
  599. xmlSetting_header = xmlSetting_header & vbCrLf
  600. xmlSetting_header = xmlSetting_header & " <labels>" & vbCrLf
  601. xmlSetting_header = xmlSetting_header & " <label lid=""0"">" & vbCrLf
  602. xmlSetting_header = xmlSetting_header & " <x></x>" & vbCrLf
  603. xmlSetting_header = xmlSetting_header & " <y>20</y>" & vbCrLf
  604. xmlSetting_header = xmlSetting_header & " <rotate></rotate>" & vbCrLf
  605. xmlSetting_header = xmlSetting_header & " <width></width>" & vbCrLf
  606. xmlSetting_header = xmlSetting_header & " <align>center</align>" & vbCrLf
  607. xmlSetting_header = xmlSetting_header & " <text_color></text_color>" & vbCrLf
  608. xmlSetting_header = xmlSetting_header & " <text_size></text_size>" & vbCrLf
  609. xmlSetting_header = xmlSetting_header & " <text>" & vbCrLf
  610. xmlSetting_header = xmlSetting_header & " <![CDATA[<b></b>]]>" & vbCrLf
  611. xmlSetting_header = xmlSetting_header & " </text>" & vbCrLf
  612. xmlSetting_header = xmlSetting_header & " </label>" & vbCrLf
  613. xmlSetting_header = xmlSetting_header & " </labels>" & vbCrLf
  614. xmlSetting_header = xmlSetting_header & vbCrLf
  615. 'xmlSetting_footer
  616. xmlSetting_footer = xmlSetting_footer & " <guides>" & vbCrLf
  617. xmlSetting_footer = xmlSetting_footer & " <max_min></max_min>" & vbCrLf
  618. xmlSetting_footer = xmlSetting_footer & " <guide>" & vbCrLf
  619. xmlSetting_footer = xmlSetting_footer & " <axis></axis>" & vbCrLf
  620. xmlSetting_footer = xmlSetting_footer & " <start_value></start_value>" & vbCrLf
  621. xmlSetting_footer = xmlSetting_footer & " <end_value></end_value>" & vbCrLf
  622. xmlSetting_footer = xmlSetting_footer & " <title></title>" & vbCrLf
  623. xmlSetting_footer = xmlSetting_footer & " <width></width>" & vbCrLf
  624. xmlSetting_footer = xmlSetting_footer & " <color></color>" & vbCrLf
  625. xmlSetting_footer = xmlSetting_footer & " <alpha></alpha>" & vbCrLf
  626. xmlSetting_footer = xmlSetting_footer & " <fill_color></fill_color>" & vbCrLf
  627. xmlSetting_footer = xmlSetting_footer & " <fill_alpha></fill_alpha>" & vbCrLf
  628. xmlSetting_footer = xmlSetting_footer & " <inside></inside>" & vbCrLf
  629. xmlSetting_footer = xmlSetting_footer & " <centered></centered>" & vbCrLf
  630. xmlSetting_footer = xmlSetting_footer & " <rotate></rotate>" & vbCrLf
  631. xmlSetting_footer = xmlSetting_footer & " <text_size></text_size>" & vbCrLf
  632. xmlSetting_footer = xmlSetting_footer & " <text_color></text_color>" & vbCrLf
  633. xmlSetting_footer = xmlSetting_footer & " <dashed></dashed>" & vbCrLf
  634. xmlSetting_footer = xmlSetting_footer & " <dash_length></dash_length>" & vbCrLf
  635. xmlSetting_footer = xmlSetting_footer & " </guide>" & vbCrLf
  636. xmlSetting_footer = xmlSetting_footer & " </guides>" & vbCrLf
  637. xmlSetting_footer = xmlSetting_footer & "</settings>" & vbCrLf
  638. if isMulti = false then
  639. xmlSetting_body = xmlSetting_body & " <graphs>" & vbCrLf
  640. xmlSetting_body = xmlSetting_body & " <graph gid=""1"">" & vbCrLf
  641. xmlSetting_body = xmlSetting_body & " <axis>left</axis> " & vbCrLf
  642. xmlSetting_body = xmlSetting_body & " <title>" & xml_getVarDesc(trim(bl)) & "</title>" & vbCrLf
  643. xmlSetting_body = xmlSetting_body & " <line_width>2</line_width>" & vbCrLf
  644. xmlSetting_body = xmlSetting_body & " <color></color>" & vbCrLf
  645. xmlSetting_body = xmlSetting_body & " <bullet>square</bullet>" & vbCrLf
  646. xmlSetting_body = xmlSetting_body & " <bullet_size>8</bullet_size>" & vbCrLf
  647. xmlSetting_body = xmlSetting_body & " <selected>true</selected>" & vbCrLf
  648. xmlSetting_body = xmlSetting_body & " <balloon_text>" & vbCrLf
  649. xmlSetting_body = xmlSetting_body & " <![CDATA[{value}"& xml_getUnit(trim(bl)) & "]]>" & vbCrLf
  650. xmlSetting_body = xmlSetting_body & " </balloon_text>" & vbCrLf
  651. xmlSetting_body = xmlSetting_body & " </graph>" & vbCrLf
  652. xmlSetting_body = xmlSetting_body & " </graphs>" & vbCrLf
  653. xmlSetting_body = xmlSetting_body & vbCrLf
  654. else
  655. xmlSetting_body = xmlSetting_body & " <graphs>" & vbCrLf
  656. bl_arr = split(bl,",")
  657. for i = 0 to ubound(bl_arr)
  658. xmlSetting_body = xmlSetting_body & " <graph gid=""" & i+1 & """>" & vbCrLf
  659. xmlSetting_body = xmlSetting_body & " <axis>left</axis> " & vbCrLf
  660. xmlSetting_body = xmlSetting_body & " <title>" & xml_getVarDesc(trim(bl_arr(i))) & "</title>" & vbCrLf
  661. xmlSetting_body = xmlSetting_body & " <line_width>2</line_width>" & vbCrLf
  662. xmlSetting_body = xmlSetting_body & " <color></color>" & vbCrLf
  663. xmlSetting_body = xmlSetting_body & " <bullet>square</bullet>" & vbCrLf
  664. xmlSetting_body = xmlSetting_body & " <bullet_size>8</bullet_size>" & vbCrLf
  665. xmlSetting_body = xmlSetting_body & " <selected>true</selected>" & vbCrLf
  666. xmlSetting_body = xmlSetting_body & " <balloon_text>" & vbCrLf
  667. xmlSetting_body = xmlSetting_body & " <![CDATA[{value}"& xml_getUnit(trim(bl_arr(i))) & "]]>" & vbCrLf
  668. xmlSetting_body = xmlSetting_body & " </balloon_text>" & vbCrLf
  669. xmlSetting_body = xmlSetting_body & " </graph>" & vbCrLf
  670. xmlSetting_body = xmlSetting_body & vbCrLf
  671. next
  672. xmlSetting_body = xmlSetting_body & " </graphs>" & vbCrLf
  673. end if
  674. Set xmlFileSetting = Fso.Createtextfile(server.mappath( "temp/" & prename & "_settings.xml "),,true)
  675. xmlFileSetting.write xmlSetting_header & xmlSetting_body & xmlSetting_footer
  676. xmlFileSetting.close
  677. set xmlFileSetting = nothing
  678. 'xmlData
  679. xmlData_header = xmlData_header & "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
  680. xmlData_header = xmlData_header & "<chart>" & vbCrLf
  681. xmlData_footer = xmlData_footer & "</chart>" & vbCrLf
  682. itime = totalseconds / intervaltime
  683. if itime > maxdot then
  684. itime = maxdot
  685. intervaltime = totalseconds / itime
  686. else
  687. itime = totalseconds / intervaltime
  688. end if
  689. if isMulti = false then
  690. xmlData_body = xmlData_body & " <series>" & vbCrLf
  691. for i = 0 to int(itime)-2
  692. xmlData_body = xmlData_body & " <value xid=""" & i & """>" & formattime(dateadd("s",i*int(intervaltime),d1)) & "</value>" & vbCrLf
  693. next
  694. xmlData_body = xmlData_body & " </series>" & vbCrLf
  695. xmlData_body = xmlData_body & " <graphs>" & vbCrLf
  696. xmlData_body = xmlData_body & " <graph gid=""1"">" & vbCrLf
  697. for i = 0 to int(itime)-2
  698. xmlData_body = xmlData_body & " <value xid=""" & i & """></value>" & vbCrLf
  699. next
  700. xmlData_body = xmlData_body & " </graph>" & vbCrLf
  701. xmlData_body = xmlData_body & " </graphs>" & vbCrLf
  702. else
  703. xmlData_body = xmlData_body & " <series>" & vbCrLf
  704. for i = 0 to int(itime)-2
  705. xmlData_body = xmlData_body & " <value xid=""" & i & """>" & formattime(dateadd("s",i*int(intervaltime),d1)) & "</value>" & vbCrLf
  706. next
  707. xmlData_body = xmlData_body & " </series>" & vbCrLf
  708. xmlData_body = xmlData_body & " <graphs>" & vbCrLf
  709. bl_arr = split(bl,",")
  710. for i = 0 to ubound(bl_arr)
  711. xmlData_body = xmlData_body & " <graph gid=""" & i+1 & """>" & vbCrLf
  712. for j = 0 to int(itime)-2
  713. xmlData_body = xmlData_body & " <value xid=""" & j & """></value>" & vbCrLf
  714. next
  715. xmlData_body = xmlData_body & " </graph>" & vbCrLf
  716. next
  717. xmlData_body = xmlData_body & " </graphs>" & vbCrLf
  718. end if
  719. Set xmlFileData = Fso.Createtextfile(server.mappath("temp/" & prename & "_data.xml"),true)
  720. xmlFileData.write xmlData_header & xmlData_body & xmlData_footer
  721. xmlFileData.close
  722. set xmlFileData = nothing
  723. 'xmlAllData
  724. xmlAllData_header = xmlAllData_header & "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
  725. if stype = 1 then
  726. xmlAllData_header = xmlAllData_header & "<?xml-stylesheet type='text/xsl' href='../page.xsl' ?>" & vbCrLf
  727. else
  728. xmlAllData_header = xmlAllData_header & "<?xml-stylesheet type='text/xsl' href='../page2.xsl' ?>" & vbCrLf
  729. end if
  730. xmlAllData_header = xmlAllData_header & "<data>" & vbCrLf
  731. xmlAllData_footer = xmlAllData_footer & "</data>" & vbCrLf
  732. ' xmlAllData_body = xmlAllData_body & " <subdata>" & vbCrLf
  733. ' xmlAllData_body = xmlAllData_body & " <varname></varname>" & vbCrLf
  734. ' xmlAllData_body = xmlAllData_body & " <happentime></happentime>" & vbCrLf
  735. ' xmlAllData_body = xmlAllData_body & " <value></value>" & vbCrLf
  736. ' xmlAllData_body = xmlAllData_body & " <alarmmsg></alarmmsg>" & vbCrLf
  737. ' xmlAllData_body = xmlAllData_body & " </subdata>" & vbCrLf
  738. xmlAllData_body = ""
  739. Set xmlFileData = Fso.Createtextfile(server.mappath("temp/" & prename & "_alldata.xml"),true)
  740. xmlFileData.write xmlAllData_header & xmlAllData_body & xmlAllData_footer
  741. xmlFileData.close
  742. set xmlFileData = nothing
  743. end if
  744. '创建xml文件完毕
  745. if stype = 2 then
  746. '===========显示报警日志,读取t_waring_record表===================================================================================================
  747. ' if isMulti = false then
  748. '
  749. ' if bl = "" then
  750. ' response.write "no records!"
  751. ' response.end
  752. ' end if
  753. '
  754. ' else
  755. '
  756. ' bl_arr = split(bl,",")
  757. '
  758. ' for i = 0 to ubound(bl_arr)
  759. ' sql = "select * from t_waring_record where type_desc = '" & xml_getVarDesc(trim(bl_arr(i))) & "'"
  760. ' set kk = server.CreateObject("adodb.recordset")
  761. ' kk.open sql, conn, 1, 1
  762. ' if not kk.eof then
  763. ' if bl_str = "" then
  764. ' bl_str = "'" & xml_getVarDesc(trim(bl_arr(i))) & "'"
  765. ' else
  766. ' bl_str = bl_str & "," & "'" & xml_getVarDesc(trim(bl_arr(i))) & "'"
  767. ' end if
  768. ' end if
  769. ' next
  770. '
  771. ' if bl_str = "" then
  772. ' response.write "no records2!"
  773. ' response.end
  774. ' end if
  775. '
  776. ' end if
  777. '
  778. ' sql = "select type_desc,happen_time,curr_value,warncontent from t_waring_record where type_desc "
  779. ' if isMulti = true then
  780. ' sql = sql & "in (" & bl_str & ")"
  781. ' else
  782. ' sql = sql & "= '" & bl & "'"
  783. ' end if
  784. ' '时间范围
  785. ' sql = sql & " and happen_time between '" & d1 & "' and '" & d2 & "'"
  786. ' '排序
  787. ' sql = sql & " order by equip_desc, type_desc, happen_time desc"
  788. '
  789. ' 'set rswr = server.CreateObject("adodb.recordset")
  790. ' 'rswr.open sql, conn, 1, 1
  791. '
  792. ' set rswr = conn.execute(sql)
  793. ' dim xml_alert, xmlFile_alert, i, node_subdata, node_varname, node_value, node_happentime, varname, node_warncontent
  794. ' xmlFile_alert = server.MapPath("temp/" & prename & "_alldata.xml")
  795. ' set xml_alert = server.CreateObject("MicroSoft.XMLDom")
  796. ' xml_alert.Load(xmlFile_alert)
  797. ' varname = xml_getVarDesc(replace(bl,"""",""))
  798. '
  799. ' if xml_alert.parseError.errorCode <> 0 then
  800. ' Response.Write "xml.parseError.errorCode = " & xml_alert.parseError.errorCode
  801. ' Response.Write "xml.parseError.reason = " & xml_alert.parseError.reason
  802. ' Response.Write "xml.parseError.line = " & xml_alert.parseError.line
  803. ' Response.End
  804. ' end if
  805. '
  806. ' if rswr.bof and rswr.eof then
  807. ' else
  808. ' do while not rswr.eof
  809. ' set node_subdata = xml_alert.createElement("subdata")
  810. ' set node_varname = xml_alert.createElement("varname")
  811. ' node_varname.text = rswr("type_desc")
  812. ' set node_value = xml_alert.createElement("value")
  813. ' node_value.text = dotwithonebit(rswr("curr_value"),2)
  814. ' set node_happentime = xml_alert.createElement("happentime")
  815. ' node_happentime.text = replace(rswr("happen_time"),"""","")
  816. ' set node_warncontent = xml_alert.createElement("warncontent")
  817. ' node_warncontent.text = replace(rswr("warncontent"),"""","")
  818. ' node_subdata.appendChild(node_varname)
  819. ' node_subdata.appendChild(node_value)
  820. ' node_subdata.appendChild(node_happentime)
  821. ' node_subdata.appendChild(node_warncontent)
  822. ' xml_alert.getElementsByTagName("data")(0).appendChild(node_subdata)
  823. ' rswr.movenext
  824. ' loop
  825. '
  826. ' end if
  827. ' rswr.close
  828. ' set rswr = nothing
  829. '
  830. ' xml_alert.save xmlFile_alert
  831. ' set xml_alert = nothing
  832. session("isMulti") = isMulti
  833. session("bl") = bl
  834. session("d1") = d1
  835. session("d2") = d2
  836. call showpage2
  837. elseif stype = 3 then '短信
  838. session("d1") = d1
  839. session("d2") = d2
  840. call showpageSms
  841. elseif stype = 4 then '电话
  842. session("d1") = d1
  843. session("d2") = d2
  844. call showpageTel
  845. elseif stype = 5 then 'Email
  846. session("d1") = d1
  847. session("d2") = d2
  848. call showpageEmail
  849. else
  850. '===========显示历史日志,开始读取文件操作数组===================================================================================================
  851. '判断日期范围加载对应的文本文件
  852. dim txt, oyy, omm, odd
  853. txt = ""
  854. 'formattime(dateadd("d",intervaltime*(i-1),d1))
  855. if d1_y = d2_y then 'Only one Year
  856. if d1_M = d2_M then 'Only one Month
  857. if d1_d = d2_d then 'Only one day
  858. txt = FSOFileRead("\log\summary" & d1_y & d1_M & d1_d & ".log")
  859. call logToxml(txt, isMulti, bl, d1, d2, prename)
  860. else 'Multi days
  861. for odd = d1_d to d2_d
  862. if len(odd) = 1 then odd = "0" & odd
  863. txt = FSOFileRead("\log\summary" & d1_y & d1_M & odd & ".log")
  864. call logToxml(txt, isMulti, bl, d1, d2, prename)
  865. next
  866. end if
  867. else 'Multi months
  868. for omm = d1_M to d2_M
  869. if len(omm) = 1 then omm = "0" & omm
  870. if omm = d1_M then 'First month
  871. for odd = d1_d to 31
  872. if len(odd) = 1 then odd = "0" & odd
  873. txt = FSOFileRead("\log\summary" & d1_y & omm & odd & ".log")
  874. call logToxml(txt, isMulti, bl, d1, d2, prename)
  875. next
  876. elseif omm = d2_M then 'last month
  877. for odd = 1 to d2_d
  878. if len(odd) = 1 then odd = "0" & odd
  879. txt = FSOFileRead("\log\summary" & d1_y & omm & odd & ".log")
  880. call logToxml(txt, isMulti, bl, d1, d2, prename)
  881. next
  882. else 'other month
  883. for odd = 1 to 31
  884. if len(odd) = 1 then odd = "0" & odd
  885. txt = FSOFileRead("\log\summary" & d1_y & omm & odd & ".log")
  886. call logToxml(txt, isMulti, bl, d1, d2, prename)
  887. next
  888. end if
  889. next
  890. end if
  891. else 'multi years
  892. for oyy = d1_Y to d2_Y
  893. if oyy = d1_Y then 'first year
  894. for omm = d1_M to 12
  895. if len(omm) = 1 then omm = "0" & omm
  896. if omm = d1_M then 'first month
  897. for odd = d1_d to 31
  898. if len(odd) = 1 then odd = "0" & odd
  899. txt = FSOFileRead("\log\summary" & d1_y & omm & odd & ".log")
  900. call logToxml(txt, isMulti, bl, d1, d2, prename)
  901. next
  902. else 'other month
  903. for odd = 1 to 31
  904. if len(odd) = 1 then odd = "0" & odd
  905. txt = FSOFileRead("\log\summary" & d1_y & omm & odd & ".log")
  906. call logToxml(txt, isMulti, bl, d1, d2, prename)
  907. next
  908. end if
  909. next
  910. elseif oyy = d2_Y then 'last year
  911. for omm = 1 to d2_M
  912. if len(omm) = 1 then omm = "0" & omm
  913. if omm = d2_M then 'last month
  914. for odd = 1 to d2_d
  915. if len(odd) = 1 then odd = "0" & odd
  916. txt = FSOFileRead("\log\summary" & d2_y & omm & odd & ".log")
  917. call logToxml(txt, isMulti, bl, d1, d2, prename)
  918. next
  919. else 'other months
  920. for odd = 1 to 31
  921. if len(odd) = 1 then odd = "0" & odd
  922. txt = FSOFileRead("\log\summary" & d2_y & omm & odd & ".log")
  923. call logToxml(txt, isMulti, bl, d1, d2, prename)
  924. next
  925. end if
  926. next
  927. else 'other years
  928. for omm = 1 to 12
  929. if len(omm) = 1 then omm = "0" & omm
  930. for odd = 1 to 31
  931. if len(odd) = 1 then odd = "0" & odd
  932. txt = FSOFileRead("\log\summary" & oyy & omm & odd & ".log")
  933. call logToxml(txt, isMulti, bl, d1, d2, prename)
  934. next
  935. next
  936. end if
  937. next
  938. end if
  939. ' 按月查询
  940. ' if d1_y & d1_M = d2_y & d2_M then '只查询一个月
  941. ' txt = FSOFileRead("\log\summary" & d1_y & d1_M & d1_d & ".log")
  942. ' call logToxml(txt, isMulti, bl, d1, d2, prename)
  943. ' else
  944. ' if d1_y = d2_y then '同年查询
  945. ' for i = d1_M to d2_M
  946. ' if len(i)=1 then i = "0" & i
  947. ' txt = FSOFileRead("\log\summary" & d1_y & i & ".log")
  948. ' call logToxml(txt, isMulti, bl, d1, d2, prename)
  949. ' next
  950. ' else '跨年查询
  951. ' for i = d1_y to d2_y
  952. ' if i = d1_y then
  953. ' for j = d1_M to 12
  954. ' if len(j)=1 then j = "0" & j
  955. ' txt = FSOFileRead("\log\summary" & i & j & ".log")
  956. ' call logToxml(txt, isMulti, bl, d1, d2, prename)
  957. ' next
  958. ' elseif i = d2_y then
  959. ' for j = 1 to d2_M
  960. ' if len(j)=1 then j = "0" & j
  961. ' txt = FSOFileRead("\log\summary" & i & j & ".log")
  962. ' call logToxml(txt, isMulti, bl, d1, d2, prename)
  963. ' next
  964. ' else
  965. ' for j = 1 to 12
  966. ' if len(j)=1 then j = "0" & j
  967. ' txt = FSOFileRead("\log\summary" & i & j & ".log")
  968. ' call logToxml(txt, isMulti, bl, d1, d2, prename)
  969. ' next
  970. ' end if
  971. ' next
  972. ' end if
  973. ' end if
  974. session("bl_arr") = bl_arr
  975. session("isMulti") = isMulti
  976. set fr = nothing
  977. call showchart
  978. end if
  979. end sub
  980. '===========显示结果=========================================================================================================
  981. sub showpage
  982. %>
  983. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  984. <tr>
  985. <td align="center"><img src="images/title_data.jpg" width="740" height="40" border="0" usemap="#showdata" /></td>
  986. </tr>
  987. <tr>
  988. <td align="center">&nbsp;</td>
  989. </tr>
  990. <tr>
  991. <td align="center"><iframe src="temp/<%=session("prename")%>_alldata.xml" frameborder="0" width="760" height="980" scrolling="no"></iframe>&nbsp;</td>
  992. </tr>
  993. </table>
  994. <map name="showdata" id="showdata">
  995. <area shape="rect" coords="667,8,740,31" href="report.asp?action=showchart" />
  996. </map>
  997. <p></p>
  998. <%
  999. end sub
  1000. '===========绘制图表=========================================================================================================
  1001. sub showchart()
  1002. %>
  1003. <!-- amline script-->
  1004. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1005. <tr>
  1006. <td align="center"><img src="images/title_chart.jpg" width="740" height="40" border="0" usemap="#showsss" /></td>
  1007. </tr>
  1008. </table>
  1009. <script type="text/javascript" src="js/swfobject.js"></script>
  1010. <div id="flashcontent">
  1011. </div>
  1012. <script type="text/javascript">
  1013. // <![CDATA[
  1014. var so = new SWFObject("images/amline.swf", "amline", "760", "500", "8", "#FFFFFF");
  1015. so.addVariable("path", "/");
  1016. so.addVariable("settings_file", encodeURIComponent("temp/<%=session("prename")%>_settings.xml"));
  1017. so.addVariable("data_file", encodeURIComponent("temp/<%=session("prename")%>_data.xml"));
  1018. so.write("flashcontent");
  1019. // ]]>
  1020. </script>
  1021. <!-- end of amline script -->
  1022. <%
  1023. end sub
  1024. '===========显示结果2=========================================================================================================
  1025. '显示报警记录
  1026. sub showpage2
  1027. dim isMulti, bl, d1, d2
  1028. isMulti = session("isMulti")
  1029. bl = session("bl")
  1030. d1 = session("d1")
  1031. d2 = session("d2")
  1032. dim rsa, sql, totalPages, totalRecords, strFileName, bl_arr, bl_str
  1033. strFileName = "report.asp?action=showpage2"
  1034. if isMulti = false then
  1035. if bl = "" then
  1036. response.write "没有记录!"
  1037. response.end
  1038. end if
  1039. else
  1040. bl_arr = split(bl,",")
  1041. for i = 0 to ubound(bl_arr)
  1042. sql = "select * from t_waring_record where type_desc = '" & xml_getVarDesc(trim(bl_arr(i))) & "'"
  1043. set kk = server.CreateObject("adodb.recordset")
  1044. kk.open sql, conn, 1, 1
  1045. if not kk.eof then
  1046. if bl_str = "" then
  1047. bl_str = "'" & xml_getVarDesc(trim(bl_arr(i))) & "'"
  1048. else
  1049. bl_str = bl_str & "," & "'" & xml_getVarDesc(trim(bl_arr(i))) & "'"
  1050. end if
  1051. end if
  1052. next
  1053. if bl_str = "" then
  1054. response.write "没有记录!"
  1055. response.end
  1056. end if
  1057. end if
  1058. sql = "select type_desc,happen_time,curr_value,warncontent from t_waring_record where type_desc "
  1059. if isMulti = true then
  1060. sql = sql & "in (" & bl_str & ")"
  1061. else
  1062. sql = sql & "= '" & xml_getVarDesc(trim(bl)) & "'"
  1063. end if
  1064. '时间范围
  1065. sql = sql & " and happen_time between '" & d1 & "' and '" & d2 & "'"
  1066. '排序
  1067. sql = sql & " order by equip_desc, type_desc, happen_time desc"
  1068. set rsa = server.CreateObject("adodb.recordset")
  1069. rsa.open sql, conn, 1, 1
  1070. rsa.pagesize = maxperpage
  1071. totalPages = rsa.pagecount
  1072. totalRecords = rsa.recordcount
  1073. if rsa.bof and rsa.eof then
  1074. else
  1075. dim pageAction
  1076. pageAction = request("pageAction")
  1077. select case pageAction
  1078. case "goPage" session("page") = CLng(request("pageNum"))
  1079. case "first" session("page") = 1
  1080. case "prev" session("page") = session("page") - 1
  1081. case "next" session("page") = session("page") + 1
  1082. case "last" session("page") = totalPages
  1083. case else session("page") = 1
  1084. end select
  1085. if session("page") < 1 then session("page") = 1
  1086. if session("page") > totalPages then session("page") = totalPages
  1087. rsa.absolutepage = session("page")
  1088. end if
  1089. %>
  1090. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1091. <tr>
  1092. <td align="center"><img src="images/title_alarm.jpg" width="740" height="40" border="0" /></td>
  1093. </tr>
  1094. <tr>
  1095. <td align="center"><table width="740" border="0" cellspacing="0" cellpadding="0">
  1096. <tr>
  1097. <td height="40" align="left">
  1098. <%
  1099. if totalPages > 1 then
  1100. if session("page")=1 then
  1101. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 第一页-上一页 -<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1102. elseif session("page")=TotalPages Then
  1103. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-下一页-最后一页"
  1104. else
  1105. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1106. end if
  1107. else
  1108. response.write "共有报警" & totalRecords & "条 " & session("page") & "/" & totalPages & "页"
  1109. end if
  1110. %>
  1111. </td>
  1112. </tr>
  1113. </table>
  1114. <table width="740" border="0" cellspacing="1" cellpadding="0">
  1115. <tr>
  1116. <td height="20" align="center" bgcolor="#FFCC99"><strong>变量名</strong></td>
  1117. <td align="center" bgcolor="#FFCC99"><strong>发生时间</strong></td>
  1118. <td align="center" bgcolor="#FFCC99"><strong>报警信息</strong></td>
  1119. <td width="80" align="center" bgcolor="#FFCC99"><strong>值</strong></td>
  1120. </tr>
  1121. <%if rsa.bof and rsa.eof then%>
  1122. <tr>
  1123. <td height="20" colspan="4" align="center">没有记录!</td>
  1124. </tr>
  1125. <%
  1126. else
  1127. i = 0
  1128. do while not rsa.eof and i < maxperpage
  1129. i = i + 1
  1130. %>
  1131. <tr>
  1132. <td height="20" align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("type_desc")%></td>
  1133. <td align="center" bgcolor="#F6F6F6"><%=rsa("happen_time")%></td>
  1134. <td align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("warncontent")%></td>
  1135. <td align="center" bgcolor="#F6F6F6"><%=dotwithonebit(rsa("curr_value"),2)%></td>
  1136. </tr>
  1137. <%
  1138. rsa.movenext
  1139. loop
  1140. rsa.close
  1141. set rsa = nothing
  1142. end if
  1143. %>
  1144. </table></td>
  1145. </tr>
  1146. <tr>
  1147. <td align="center">&nbsp;</td>
  1148. </tr>
  1149. </table>
  1150. <p></p>
  1151. <%
  1152. end sub
  1153. '===========显示短信查询结果=========================================================================================================
  1154. sub showpageSms
  1155. dim d1, d2
  1156. d1 = session("d1")
  1157. d2 = session("d2")
  1158. dim rsa, sql, totalPages, totalRecords, strFileName
  1159. strFileName = "report.asp?action=showpageSms"
  1160. sql = "select telnum, contactname, sendtime, contents from t_sms_rec where "
  1161. '时间范围
  1162. sql = sql & "sendtime between '" & d1 & "' and '" & d2 & "'"
  1163. '排序
  1164. sql = sql & " order by id desc"
  1165. set rsa = server.CreateObject("adodb.recordset")
  1166. rsa.open sql, conn, 1, 1
  1167. rsa.pagesize = maxperpage
  1168. totalPages = rsa.pagecount
  1169. totalRecords = rsa.recordcount
  1170. if rsa.bof and rsa.eof then
  1171. else
  1172. dim pageAction
  1173. pageAction = request("pageAction")
  1174. select case pageAction
  1175. case "goPage" session("page") = CLng(request("pageNum"))
  1176. case "first" session("page") = 1
  1177. case "prev" session("page") = session("page") - 1
  1178. case "next" session("page") = session("page") + 1
  1179. case "last" session("page") = totalPages
  1180. case else session("page") = 1
  1181. end select
  1182. if session("page") < 1 then session("page") = 1
  1183. if session("page") > totalPages then session("page") = totalPages
  1184. rsa.absolutepage = session("page")
  1185. end if
  1186. %>
  1187. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1188. <tr>
  1189. <td align="center"><img src="images/title_chart_sms.jpg" width="740" height="40" border="0" /></td>
  1190. </tr>
  1191. <tr>
  1192. <td align="center"><table width="740" border="0" cellspacing="0" cellpadding="0">
  1193. <tr>
  1194. <td height="40" align="left">
  1195. <%
  1196. if totalPages > 1 then
  1197. if session("page")=1 then
  1198. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 第一页-上一页 -<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1199. elseif session("page")=TotalPages Then
  1200. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-下一页-最后一页"
  1201. else
  1202. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1203. end if
  1204. else
  1205. response.write "共有报警" & totalRecords & "条 " & session("page") & "/" & totalPages & "页"
  1206. end if
  1207. %>
  1208. </td>
  1209. </tr>
  1210. </table>
  1211. <table width="740" border="0" cellspacing="1" cellpadding="0">
  1212. <tr>
  1213. <td height="20" align="center" bgcolor="#FFCC99"><strong>联系人</strong></td>
  1214. <td align="center" bgcolor="#FFCC99"><strong>手机号码</strong></td>
  1215. <td align="center" bgcolor="#FFCC99"><strong>报警信息</strong></td>
  1216. <td align="center" bgcolor="#FFCC99"><strong>发送时间</strong></td>
  1217. </tr>
  1218. <%if rsa.bof and rsa.eof then%>
  1219. <tr>
  1220. <td height="20" colspan="4" align="center">没有记录!</td>
  1221. </tr>
  1222. <%
  1223. else
  1224. i = 0
  1225. do while not rsa.eof and i < maxperpage
  1226. i = i + 1
  1227. %>
  1228. <tr>
  1229. <td height="20" align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contactname")%></td>
  1230. <td align="center" bgcolor="#F6F6F6"><%=rsa("telnum")%></td>
  1231. <td align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contents")%></td>
  1232. <td align="center" bgcolor="#F6F6F6"><%=rsa("sendtime")%></td>
  1233. </tr>
  1234. <%
  1235. rsa.movenext
  1236. loop
  1237. rsa.close
  1238. set rsa = nothing
  1239. end if
  1240. %>
  1241. </table></td>
  1242. </tr>
  1243. <tr>
  1244. <td align="center">&nbsp;</td>
  1245. </tr>
  1246. </table>
  1247. <p></p>
  1248. <%
  1249. end sub
  1250. '===========显示电话查询结果=========================================================================================================
  1251. sub showpageTel
  1252. dim d1, d2
  1253. d1 = session("d1")
  1254. d2 = session("d2")
  1255. dim rsa, sql, totalPages, totalRecords, strFileName
  1256. strFileName = "report.asp?action=showpageTel"
  1257. sql = "select telnum, contactname, sendtime, contents from t_notice_rec where "
  1258. '时间范围
  1259. sql = sql & "sendtime between '" & d1 & "' and '" & d2 & "'"
  1260. '排序
  1261. sql = sql & " order by id desc"
  1262. set rsa = server.CreateObject("adodb.recordset")
  1263. rsa.open sql, conn, 1, 1
  1264. rsa.pagesize = maxperpage
  1265. totalPages = rsa.pagecount
  1266. totalRecords = rsa.recordcount
  1267. if rsa.bof and rsa.eof then
  1268. else
  1269. dim pageAction
  1270. pageAction = request("pageAction")
  1271. select case pageAction
  1272. case "goPage" session("page") = CLng(request("pageNum"))
  1273. case "first" session("page") = 1
  1274. case "prev" session("page") = session("page") - 1
  1275. case "next" session("page") = session("page") + 1
  1276. case "last" session("page") = totalPages
  1277. case else session("page") = 1
  1278. end select
  1279. if session("page") < 1 then session("page") = 1
  1280. if session("page") > totalPages then session("page") = totalPages
  1281. rsa.absolutepage = session("page")
  1282. end if
  1283. %>
  1284. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1285. <tr>
  1286. <td align="center"><img src="images/title_chart_tel.jpg" width="740" height="40" border="0" /></td>
  1287. </tr>
  1288. <tr>
  1289. <td align="center"><table width="740" border="0" cellspacing="0" cellpadding="0">
  1290. <tr>
  1291. <td height="40" align="left">
  1292. <%
  1293. if totalPages > 1 then
  1294. if session("page")=1 then
  1295. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 第一页-上一页 -<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1296. elseif session("page")=TotalPages Then
  1297. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-下一页-最后一页"
  1298. else
  1299. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1300. end if
  1301. else
  1302. response.write "共有报警" & totalRecords & "条 " & session("page") & "/" & totalPages & "页"
  1303. end if
  1304. %>
  1305. </td>
  1306. </tr>
  1307. </table>
  1308. <table width="740" border="0" cellspacing="1" cellpadding="0">
  1309. <tr>
  1310. <td height="20" align="center" bgcolor="#FFCC99"><strong>联系人</strong></td>
  1311. <td align="center" bgcolor="#FFCC99"><strong>手机号码</strong></td>
  1312. <td align="center" bgcolor="#FFCC99"><strong>报警信息</strong></td>
  1313. <td align="center" bgcolor="#FFCC99"><strong>发送时间</strong></td>
  1314. </tr>
  1315. <%if rsa.bof and rsa.eof then%>
  1316. <tr>
  1317. <td height="20" colspan="4" align="center">没有记录!</td>
  1318. </tr>
  1319. <%
  1320. else
  1321. i = 0
  1322. do while not rsa.eof and i < maxperpage
  1323. i = i + 1
  1324. %>
  1325. <tr>
  1326. <td height="20" align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contactname")%></td>
  1327. <td align="center" bgcolor="#F6F6F6"><%=rsa("telnum")%></td>
  1328. <td align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contents")%></td>
  1329. <td align="center" bgcolor="#F6F6F6"><%=rsa("sendtime")%></td>
  1330. </tr>
  1331. <%
  1332. rsa.movenext
  1333. loop
  1334. rsa.close
  1335. set rsa = nothing
  1336. end if
  1337. %>
  1338. </table></td>
  1339. </tr>
  1340. <tr>
  1341. <td align="center">&nbsp;</td>
  1342. </tr>
  1343. </table>
  1344. <p></p>
  1345. <%
  1346. end sub
  1347. '===========显示Email查询结果=========================================================================================================
  1348. sub showpageEmail
  1349. dim d1, d2
  1350. d1 = session("d1")
  1351. d2 = session("d2")
  1352. dim rsa, sql, totalPages, totalRecords, strFileName
  1353. strFileName = "report.asp?action=showpageEmail"
  1354. sql = "select emailaddr, contactname, sendtime, contents from t_email_rec where "
  1355. '时间范围
  1356. sql = sql & "sendtime between '" & d1 & "' and '" & d2 & "'"
  1357. '排序
  1358. sql = sql & " order by id desc"
  1359. set rsa = server.CreateObject("adodb.recordset")
  1360. rsa.open sql, conn, 1, 1
  1361. rsa.pagesize = maxperpage
  1362. totalPages = rsa.pagecount
  1363. totalRecords = rsa.recordcount
  1364. if rsa.bof and rsa.eof then
  1365. else
  1366. dim pageAction
  1367. pageAction = request("pageAction")
  1368. select case pageAction
  1369. case "goPage" session("page") = CLng(request("pageNum"))
  1370. case "first" session("page") = 1
  1371. case "prev" session("page") = session("page") - 1
  1372. case "next" session("page") = session("page") + 1
  1373. case "last" session("page") = totalPages
  1374. case else session("page") = 1
  1375. end select
  1376. if session("page") < 1 then session("page") = 1
  1377. if session("page") > totalPages then session("page") = totalPages
  1378. rsa.absolutepage = session("page")
  1379. end if
  1380. %>
  1381. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1382. <tr>
  1383. <td align="center"><img src="images/title_chart_email.jpg" width="740" height="40" border="0" /></td>
  1384. </tr>
  1385. <tr>
  1386. <td align="center"><table width="740" border="0" cellspacing="0" cellpadding="0">
  1387. <tr>
  1388. <td height="40" align="left">
  1389. <%
  1390. if totalPages > 1 then
  1391. if session("page")=1 then
  1392. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 第一页-上一页 -<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1393. elseif session("page")=TotalPages Then
  1394. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-下一页-最后一页"
  1395. else
  1396. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1397. end if
  1398. else
  1399. response.write "共有报警" & totalRecords & "条 " & session("page") & "/" & totalPages & "页"
  1400. end if
  1401. %>
  1402. </td>
  1403. </tr>
  1404. </table>
  1405. <table width="740" border="0" cellspacing="1" cellpadding="0">
  1406. <tr>
  1407. <td height="20" align="center" bgcolor="#FFCC99"><strong>联系人</strong></td>
  1408. <td align="center" bgcolor="#FFCC99"><strong>Email地址</strong></td>
  1409. <td align="center" bgcolor="#FFCC99"><strong>报警信息</strong></td>
  1410. <td align="center" bgcolor="#FFCC99"><strong>发送时间</strong></td>
  1411. </tr>
  1412. <%if rsa.bof and rsa.eof then%>
  1413. <tr>
  1414. <td height="20" colspan="4" align="center">没有记录!</td>
  1415. </tr>
  1416. <%
  1417. else
  1418. i = 0
  1419. do while not rsa.eof and i < maxperpage
  1420. i = i + 1
  1421. %>
  1422. <tr>
  1423. <td height="20" align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contactname")%></td>
  1424. <td align="center" bgcolor="#F6F6F6"><%=rsa("emailaddr")%></td>
  1425. <td align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contents")%></td>
  1426. <td align="center" bgcolor="#F6F6F6"><%=rsa("sendtime")%></td>
  1427. </tr>
  1428. <%
  1429. rsa.movenext
  1430. loop
  1431. rsa.close
  1432. set rsa = nothing
  1433. end if
  1434. %>
  1435. </table></td>
  1436. </tr>
  1437. <tr>
  1438. <td align="center">&nbsp;</td>
  1439. </tr>
  1440. </table>
  1441. <p></p>
  1442. <%
  1443. end sub
  1444. '===========绘制图表=========================================================================================================
  1445. sub showchart2()
  1446. %>
  1447. <!-- amline script-->
  1448. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1449. <tr>
  1450. <td align="center"><img src="images/title_alarm.jpg" width="740" height="40" border="0" /></td>
  1451. </tr>
  1452. </table>
  1453. <map name="showchart" id="showchart"><area shape="rect" coords="569,6,638,30" href="report.asp?action=showpage" />
  1454. </map>
  1455. <script type="text/javascript" src="js/swfobject.js"></script>
  1456. <div id="flashcontent">
  1457. </div>
  1458. <script type="text/javascript">
  1459. // <![CDATA[
  1460. var so = new SWFObject("images/amline.swf", "amline", "760", "500", "8", "#FFFFFF");
  1461. so.addVariable("path", "/");
  1462. so.addVariable("settings_file", encodeURIComponent("temp/<%=session("prename")%>_settings.xml"));
  1463. so.addVariable("data_file", encodeURIComponent("temp/<%=session("prename")%>_data.xml"));
  1464. so.write("flashcontent");
  1465. // ]]>
  1466. </script>
  1467. <!-- end of amline script -->
  1468. <%
  1469. end sub
  1470. '===========导出Excel=========================================================================================================
  1471. sub createExcel()
  1472. dim prename, xmlFile, xml, iRow
  1473. prename = session("prename")
  1474. if not fso.fileexists(server.mappath("temp/"&prename&".xls")) then
  1475. xmlFile = server.MapPath("temp/" & prename & "_alldata.xml")
  1476. set xml = server.CreateObject("MicroSoft.XMLDom")
  1477. xml.Load(xmlFile)
  1478. Response.ContentType = "application/msexcel"
  1479. Dim xlWorkSheet
  1480. Dim xlApplication
  1481. Set xlApplication = Server.CreateObject("Excel.Application")
  1482. xlApplication.Visible = False
  1483. xlApplication.Workbooks.Add
  1484. Set xlWorksheet = xlApplication.Worksheets(1)
  1485. xlWorksheet.Cells(1,1).Value = "变量名"
  1486. xlWorksheet.Cells(1,2).Value = "值"
  1487. xlWorksheet.Cells(1,3).Value = "发生时间"
  1488. iRow = 2
  1489. if xml.getElementsByTagName("subdata").length = 0 then
  1490. xlWorksheet.Cells(iRow,1).Value = ""
  1491. xlWorksheet.Cells(iRow,2).Value = ""
  1492. xlWorksheet.Cells(iRow,3).Value = ""
  1493. else
  1494. for i = 0 to xml.getElementsByTagName("subdata").length - 1
  1495. xlWorksheet.Cells(iRow,1).Value = xml.getElementsByTagName("subdata")(i).childNodes.item(0).text
  1496. xlWorksheet.Cells(iRow,2).Value = xml.getElementsByTagName("subdata")(i).childNodes.item(1).text
  1497. xlWorksheet.Cells(iRow,3).Value = xml.getElementsByTagName("subdata")(i).childNodes.item(2).text
  1498. iRow = iRow + 1
  1499. next
  1500. end if
  1501. xlWorksheet.SaveAs Server.MapPath("temp/" & prename & ".xls")
  1502. xlApplication.Quit
  1503. 'Close the Workbook
  1504. Set xlWorksheet = Nothing
  1505. Set xlApplication = Nothing
  1506. set xml = nothing
  1507. response.Redirect "report.asp?action=createExcel"
  1508. else
  1509. %>
  1510. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1511. <tr>
  1512. <td align="center"><img src="images/title_excel.jpg" border="0" usemap="#makeexcel" /></td>
  1513. </tr>
  1514. <tr>
  1515. <td height="100" align="center">&nbsp;</td>
  1516. </tr>
  1517. <tr>
  1518. <td align="center"><a href="temp/<%=prename%>.xls"><img src="images/excel_created.jpg" width="300" height="300" border="0" /></a></td>
  1519. </tr>
  1520. </table>
  1521. <map name="makeexcel" id="makeexcel">
  1522. <area shape="rect" coords="598,6,667,30" href="report.asp?action=showpage" />
  1523. <area shape="rect" coords="667,6,739,30" href="report.asp?action=showchart" />
  1524. </map>
  1525. <%
  1526. end if
  1527. end sub
  1528. %>
  1529. </td>
  1530. </tr>
  1531. </table></td>
  1532. </tr>
  1533. <tr>
  1534. <td>&nbsp;</td>
  1535. </tr>
  1536. </table>
  1537. <map name="showsss" id="showsss">
  1538. <area shape="rect" coords="569,4,642,33" href="report.asp?action=showpage" />
  1539. </map></body>
  1540. </html>
  1541. <%
  1542. '获取设备列表
  1543. function getsb()
  1544. dim sql, rssb, str
  1545. sql = "select t_classid, classname from t_area where child = 0 and parentid <> 0 order by orderid, t_classid"
  1546. set rssb = conn.execute(sql)
  1547. if rssb.bof and rssb.eof then
  1548. str = "<option>无设备</option>"
  1549. else
  1550. do while not rssb.eof
  1551. str = str & "<option value='" & rssb(0) & "'>" & rssb(1) & "</option>"
  1552. rssb.movenext
  1553. loop
  1554. end if
  1555. rssb.close
  1556. set rssb = nothing
  1557. getsb = str
  1558. end function
  1559. '获取变量列表
  1560. function getbl()
  1561. dim sql, rsbl, str, areaid
  1562. if isAdmin = true then
  1563. sql = "select description, varname from t_dev_variant where issave = '1' order by description"
  1564. else
  1565. sql = "select description, varname from t_dev_variant where uid in (select uid from t_role_equip where userid = '" & trim(AdminName) & "') and issave = '1' order by description"
  1566. end if
  1567. set rsbl = conn.execute(sql)
  1568. if rsbl.bof and rsbl.eof then
  1569. str = str & "<option>无变量</option>"
  1570. else
  1571. do while not rsbl.eof
  1572. str = str & "<option value='" & rsbl(1) & "'>" & rsbl(0) & "</option>" & vbCrLf
  1573. rsbl.movenext
  1574. loop
  1575. end if
  1576. rsbl.close
  1577. set rsbl = nothing
  1578. getbl = str
  1579. end function
  1580. '打开文件文本并读取内容
  1581. function FSOFileRead(filename)
  1582. Dim objFSO,objCountFile,FiletempData
  1583. Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
  1584. if not objFSO.fileExists(server.mappath(filename)) then exit function
  1585. Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
  1586. FSOFileRead = objCountFile.ReadAll
  1587. objCountFile.Close
  1588. Set objCountFile=Nothing
  1589. Set objFSO = Nothing
  1590. End Function
  1591. '删除不符合条件的数组元素
  1592. function arrayremove(m, n, byval arrpar, byval key, byval key2, byval key3)
  1593. dim i,j,k
  1594. k=0
  1595. for i = 1 to ubound(arrpar,2)
  1596. if left(arrpar(m,i),len(key)) = key and arrpar(n,i) > key2 and arrpar(n,i) < key3 then
  1597. k = k+1
  1598. for j = 0 to ubound(arrpar,1)
  1599. arrpar(j,k-1) = arrpar(j,i)
  1600. next
  1601. end if
  1602. next
  1603. ReDim Preserve arrpar(ubound(arrpar,1), k-1)
  1604. arrayremove = arrpar
  1605. end function
  1606. function arrayremove_multi(m, n, byval arrpar, byval key, byval key2, byval key3)
  1607. dim i,j,k,key_arr,kk
  1608. k=0
  1609. key_arr = split(key,",")
  1610. for i = 1 to ubound(arrpar,2)
  1611. for kk = 0 to ubound(key_arr)
  1612. if left(arrpar(m,i),len(key_arr(kk))) = key_arr(kk) and arrpar(n,i) > key2 and arrpar(n,i) < key3 then
  1613. k = k+1
  1614. for j = 0 to ubound(arrpar,1)
  1615. arrpar(j,k-1) = arrpar(j,i)
  1616. next
  1617. end if
  1618. next
  1619. next
  1620. ReDim Preserve arrpar(ubound(arrpar,1), k-1)
  1621. arrayremove = arrpar
  1622. end function
  1623. function arrayremove2(m, n, byval arrpar, byval key, byval key2)
  1624. dim i,j,k
  1625. k=0
  1626. for i = 0 to ubound(arrpar,2)
  1627. if arrpar(m,i) = key and mid(cstr(formattime(arrpar(n,i))),1,10) = mid(cstr(key2),1,10) then
  1628. k = k+1
  1629. for j = 0 to ubound(arrpar,1)
  1630. arrpar(j,k-1) = arrpar(j,i)
  1631. next
  1632. end if
  1633. next
  1634. ReDim Preserve arrpar(ubound(arrpar,1), k-1)
  1635. arrayremove2 = arrpar
  1636. end function
  1637. '合并数组
  1638. function array_merge(byVal firstArray, byVal secondArray)
  1639. dim totalSize
  1640. dim i,j
  1641. dim combinedArray
  1642. 'Ensure that we're dealing with arrays.
  1643. if not isArray(firstArray) then
  1644. firstArray = Array(firstArray)
  1645. end if
  1646. if not isArray(secondArray) then
  1647. secondArray = Array(secondArray)
  1648. end if
  1649. 'Set up the new array.
  1650. totalSize = uBound(firstArray,2) + uBound(secondArray,2) + 1
  1651. combinedArray = firstArray
  1652. redim preserve combinedArray(uBound(firstArray,1),totalSize)
  1653. for i = 0 to uBound(secondArray,2)
  1654. for j = 0 to uBound(firstArray,1)
  1655. combinedArray(j,uBound(firstArray,2) + 1 + i) = secondArray(j,i)
  1656. next
  1657. next
  1658. array_merge = combinedArray
  1659. end function
  1660. function formattime(t)
  1661. dim omm,odd,ohh,ostr
  1662. omm = month(t)
  1663. odd = day(t)
  1664. ohh = hour(t)
  1665. ostr = cstr(t)
  1666. if len(omm) = 1 then ostr = replace(ostr,"-"&omm,"-0"&omm,1,1)
  1667. if len(odd) = 1 then ostr = replace(ostr,"-"&odd,"-0"&odd,1,1)
  1668. if len(ohh) = 1 then ostr = replace(ostr," "&ohh," 0"&ohh,1,1)
  1669. formattime = ostr
  1670. end function
  1671. function getMax(arr)
  1672. dim i, max
  1673. if not isArray(arr) then
  1674. arr = Array(arr)
  1675. end if
  1676. max = cint(arr(0))
  1677. for i = 0 to ubound(arr)
  1678. if cint(arr(i)) > cint(max) then max = cint(arr(i))
  1679. next
  1680. getMax = max
  1681. end function
  1682. '日志文件筛选后存入xml
  1683. function logToxml(oLog, isMulti, bl, d1, d2, prename)
  1684. dim ao, arr, bl_arr, i, j, arr1, arr2
  1685. set ao = new arrayoperate
  1686. arr = ao.stringtoarray(oLog) '日志存入数组
  1687. if isMulti = false then
  1688. arr1 = arrayremove(0,2,arr,""""&trim(bl)&"""",""""&d1&"""",""""&d2&"""")
  1689. call arrToxml(0, arr1, d1, intervaltime, itime, trim(bl), prename)
  1690. call arrToxml_all(arr1, d1, trim(bl), prename)
  1691. else
  1692. bl_arr = split(trim(bl),",")
  1693. for i = 0 to ubound(bl_arr)
  1694. arr2 = arrayremove(0,2,arr,""""&trim(bl_arr(i))&"""",""""&d1&"""",""""&d2&"""")
  1695. call arrToxml(i, arr2, d1, intervaltime, itime, trim(bl_arr(i)), prename)
  1696. call arrToxml_all(arr2, d1, trim(bl_arr(i)), prename)
  1697. next
  1698. end if
  1699. set ao = nothing
  1700. end function
  1701. '数组到xml.data.xml
  1702. function arrToxml(num, arr, d1, intervaltime, itime, bl, prename)
  1703. dim xml, xmlFile, tags, nodeValue, preValue
  1704. xmlFile = server.MapPath("temp/" & prename & "_data.xml")
  1705. set xml = server.CreateObject("MicroSoft.XMLDom")
  1706. xml.Load(xmlFile)
  1707. if xml.parseError.errorCode <> 0 then
  1708. Response.Write "xml.parseError.errorCode = " & xml.parseError.errorCode
  1709. Response.Write "xml.parseError.reason = " & xml.parseError.reason
  1710. Response.Write "xml.parseError.line = " & xml.parseError.line
  1711. Response.End
  1712. end if
  1713. for i = 1 to itime - 1
  1714. chart_temp = arrayremove(0, 2, arr, """" & trim(bl) & """", """" & formattime(dateadd("s",intervaltime*(i-1),d1)) & """", """" & formattime(dateadd("s",intervaltime*i,d1)) & """")
  1715. if ubound(chart_temp,2) <> -1 then
  1716. xml.getElementsByTagName("graph")(num).childNodes.item(i-1).text = dotwithonebit(chart_temp(1,ubound(chart_temp,2)),2)
  1717. end if
  1718. chart_temp = ""
  1719. next
  1720. xml.save xmlFile
  1721. set xml = nothing
  1722. end function
  1723. '数组到xml.alldata.xml
  1724. function arrToxml_all(arr, d1, bl, prename)
  1725. dim xml_all, xmlFile_all, i, node_subdata, node_varname, node_value, node_happentime, varname
  1726. xmlFile_all = server.MapPath("temp/" & prename & "_alldata.xml")
  1727. set xml_all = server.CreateObject("MicroSoft.XMLDom")
  1728. xml_all.Load(xmlFile_all)
  1729. varname = xml_getVarDesc(replace(bl,"""",""))
  1730. if xml_all.parseError.errorCode <> 0 then
  1731. Response.Write "xml.parseError.errorCode = " & xml_all.parseError.errorCode
  1732. Response.Write "xml.parseError.reason = " & xml_all.parseError.reason
  1733. Response.Write "xml.parseError.line = " & xml_all.parseError.line
  1734. Response.End
  1735. end if
  1736. for i = 0 to ubound(arr,2)
  1737. set node_subdata = xml_all.createElement("subdata")
  1738. set node_varname = xml_all.createElement("varname")
  1739. node_varname.text = varname
  1740. set node_value = xml_all.createElement("value")
  1741. node_value.text = dotwithonebit(arr(1,i),2)
  1742. set node_happentime = xml_all.createElement("happentime")
  1743. node_happentime.text = replace(arr(2,i),"""","")
  1744. node_subdata.appendChild(node_varname)
  1745. node_subdata.appendChild(node_value)
  1746. node_subdata.appendChild(node_happentime)
  1747. xml_all.getElementsByTagName("data")(0).appendChild(node_subdata)
  1748. next
  1749. xml_all.save xmlFile_all
  1750. set xml_all = nothing
  1751. end function
  1752. function xml_getVarDesc(varName)
  1753. dim rsxml, desc, sql
  1754. sql = "select description from t_dev_variant where varname = '" & varName & "'"
  1755. set rsxml = server.CreateObject("adodb.recordset")
  1756. rsxml.open sql, conn, 1, 1
  1757. if rsxml.bof and rsxml.eof then
  1758. desc = ""
  1759. else
  1760. desc = rsxml("description")
  1761. end if
  1762. xml_getVarDesc = desc
  1763. rsxml.close
  1764. set rsxml = nothing
  1765. end function
  1766. function xml_getUnit(varName)
  1767. dim rsxml, str, sql
  1768. sql = "select unit from t_dev_variant where varname = '" & varName & "'"
  1769. set rsxml = server.CreateObject("adodb.recordset")
  1770. rsxml.open sql, conn, 1, 1
  1771. if rsxml.bof and rsxml.eof then
  1772. str = ""
  1773. else
  1774. str = rsxml(0)
  1775. end if
  1776. xml_getUnit = rsxml(0)
  1777. set rsxml = nothing
  1778. end function
  1779. function dotwithonebit(d,n)
  1780. dim od, odstr
  1781. if isNumeric(d) and instr(d,".") > 0 then
  1782. odstr = split(d,".")
  1783. od = odstr(0) & "." & left(odstr(1),n)
  1784. else
  1785. od = d
  1786. end if
  1787. dotwithonebit = od
  1788. end function
  1789. %>