report.asp 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948
  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="25" 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. </tr>
  1217. <%if rsa.bof and rsa.eof then%>
  1218. <tr>
  1219. <td height="20" colspan="3" align="center">没有记录!</td>
  1220. </tr>
  1221. <%
  1222. else
  1223. i = 0
  1224. do while not rsa.eof and i < maxperpage
  1225. i = i + 1
  1226. %>
  1227. <tr>
  1228. <td height="25" align="center" bgcolor="#F6F6F6"><%=rsa("telnum")%></td>
  1229. <td align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contents")%></td>
  1230. <td align="center" bgcolor="#F6F6F6"><%=rsa("sendtime")%></td>
  1231. </tr>
  1232. <%
  1233. rsa.movenext
  1234. loop
  1235. rsa.close
  1236. set rsa = nothing
  1237. end if
  1238. %>
  1239. </table></td>
  1240. </tr>
  1241. <tr>
  1242. <td align="center">&nbsp;</td>
  1243. </tr>
  1244. </table>
  1245. <p></p>
  1246. <%
  1247. end sub
  1248. '===========显示电话查询结果=========================================================================================================
  1249. sub showpageTel
  1250. dim d1, d2
  1251. d1 = session("d1")
  1252. d2 = session("d2")
  1253. dim rsa, sql, totalPages, totalRecords, strFileName
  1254. strFileName = "report.asp?action=showpageTel"
  1255. sql = "select telnum, contactname, sendtime, contents from t_notice_rec where "
  1256. '时间范围
  1257. sql = sql & "sendtime between '" & d1 & "' and '" & d2 & "'"
  1258. '排序
  1259. sql = sql & " order by id desc"
  1260. set rsa = server.CreateObject("adodb.recordset")
  1261. rsa.open sql, conn, 1, 1
  1262. rsa.pagesize = maxperpage
  1263. totalPages = rsa.pagecount
  1264. totalRecords = rsa.recordcount
  1265. if rsa.bof and rsa.eof then
  1266. else
  1267. dim pageAction
  1268. pageAction = request("pageAction")
  1269. select case pageAction
  1270. case "goPage" session("page") = CLng(request("pageNum"))
  1271. case "first" session("page") = 1
  1272. case "prev" session("page") = session("page") - 1
  1273. case "next" session("page") = session("page") + 1
  1274. case "last" session("page") = totalPages
  1275. case else session("page") = 1
  1276. end select
  1277. if session("page") < 1 then session("page") = 1
  1278. if session("page") > totalPages then session("page") = totalPages
  1279. rsa.absolutepage = session("page")
  1280. end if
  1281. %>
  1282. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1283. <tr>
  1284. <td align="center"><img src="images/title_chart_tel.jpg" width="740" height="40" border="0" /></td>
  1285. </tr>
  1286. <tr>
  1287. <td align="center"><table width="740" border="0" cellspacing="0" cellpadding="0">
  1288. <tr>
  1289. <td height="40" align="left">
  1290. <%
  1291. if totalPages > 1 then
  1292. if session("page")=1 then
  1293. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 第一页-上一页 -<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1294. elseif session("page")=TotalPages Then
  1295. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-下一页-最后一页"
  1296. else
  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>-<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1298. end if
  1299. else
  1300. response.write "共有报警" & totalRecords & "条 " & session("page") & "/" & totalPages & "页"
  1301. end if
  1302. %>
  1303. </td>
  1304. </tr>
  1305. </table>
  1306. <table width="740" border="0" cellspacing="1" cellpadding="0">
  1307. <tr>
  1308. <td height="25" align="center" bgcolor="#FFCC99"><strong>手机号码</strong></td>
  1309. <td align="center" bgcolor="#FFCC99"><strong>报警信息</strong></td>
  1310. <td align="center" bgcolor="#FFCC99"><strong>发送时间</strong></td>
  1311. </tr>
  1312. <%if rsa.bof and rsa.eof then%>
  1313. <tr>
  1314. <td height="20" colspan="3" align="center">没有记录!</td>
  1315. </tr>
  1316. <%
  1317. else
  1318. i = 0
  1319. do while not rsa.eof and i < maxperpage
  1320. i = i + 1
  1321. %>
  1322. <tr>
  1323. <td height="25" align="center" bgcolor="#F6F6F6"><%=rsa("telnum")%></td>
  1324. <td align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contents")%></td>
  1325. <td align="center" bgcolor="#F6F6F6"><%=rsa("sendtime")%></td>
  1326. </tr>
  1327. <%
  1328. rsa.movenext
  1329. loop
  1330. rsa.close
  1331. set rsa = nothing
  1332. end if
  1333. %>
  1334. </table></td>
  1335. </tr>
  1336. <tr>
  1337. <td align="center">&nbsp;</td>
  1338. </tr>
  1339. </table>
  1340. <p></p>
  1341. <%
  1342. end sub
  1343. '===========显示Email查询结果=========================================================================================================
  1344. sub showpageEmail
  1345. dim d1, d2
  1346. d1 = session("d1")
  1347. d2 = session("d2")
  1348. dim rsa, sql, totalPages, totalRecords, strFileName
  1349. strFileName = "report.asp?action=showpageEmail"
  1350. sql = "select emailaddr, contactname, sendtime, contents from t_email_rec where "
  1351. '时间范围
  1352. sql = sql & "sendtime between '" & d1 & "' and '" & d2 & "'"
  1353. '排序
  1354. sql = sql & " order by id desc"
  1355. set rsa = server.CreateObject("adodb.recordset")
  1356. rsa.open sql, conn, 1, 1
  1357. rsa.pagesize = maxperpage
  1358. totalPages = rsa.pagecount
  1359. totalRecords = rsa.recordcount
  1360. if rsa.bof and rsa.eof then
  1361. else
  1362. dim pageAction
  1363. pageAction = request("pageAction")
  1364. select case pageAction
  1365. case "goPage" session("page") = CLng(request("pageNum"))
  1366. case "first" session("page") = 1
  1367. case "prev" session("page") = session("page") - 1
  1368. case "next" session("page") = session("page") + 1
  1369. case "last" session("page") = totalPages
  1370. case else session("page") = 1
  1371. end select
  1372. if session("page") < 1 then session("page") = 1
  1373. if session("page") > totalPages then session("page") = totalPages
  1374. rsa.absolutepage = session("page")
  1375. end if
  1376. %>
  1377. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1378. <tr>
  1379. <td align="center"><img src="images/title_chart_email.jpg" width="740" height="40" border="0" /></td>
  1380. </tr>
  1381. <tr>
  1382. <td align="center"><table width="740" border="0" cellspacing="0" cellpadding="0">
  1383. <tr>
  1384. <td height="40" align="left">
  1385. <%
  1386. if totalPages > 1 then
  1387. if session("page")=1 then
  1388. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 第一页-上一页 -<a href="&strFileName&"&PageAction=next><strong>下一页</strong></a>-<a href="&strFileName&"&PageAction=last><strong>最后一页</strong></a>"
  1389. elseif session("page")=TotalPages Then
  1390. response.write "共有报警<strong>"&TotalRecords&"</strong>条 "&session("page")&"/"&TotalPages&"页 <a href="&strFileName&"&PageAction=first><strong>第一页</strong></a>-<a href="&strFileName&"&PageAction=prev><strong>上一页</strong></a>-下一页-最后一页"
  1391. else
  1392. 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>"
  1393. end if
  1394. else
  1395. response.write "共有报警" & totalRecords & "条 " & session("page") & "/" & totalPages & "页"
  1396. end if
  1397. %>
  1398. </td>
  1399. </tr>
  1400. </table>
  1401. <table width="740" border="0" cellspacing="1" cellpadding="0">
  1402. <tr>
  1403. <td height="25" align="center" bgcolor="#FFCC99"><strong>Email地址</strong></td>
  1404. <td align="center" bgcolor="#FFCC99"><strong>报警信息</strong></td>
  1405. <td align="center" bgcolor="#FFCC99"><strong>发送时间</strong></td>
  1406. </tr>
  1407. <%if rsa.bof and rsa.eof then%>
  1408. <tr>
  1409. <td height="20" colspan="3" align="center">没有记录!</td>
  1410. </tr>
  1411. <%
  1412. else
  1413. i = 0
  1414. do while not rsa.eof and i < maxperpage
  1415. i = i + 1
  1416. %>
  1417. <tr>
  1418. <td height="25" align="center" bgcolor="#F6F6F6"><%=rsa("emailaddr")%></td>
  1419. <td align="left" bgcolor="#eeeeee" style="padding-left:20px"><%=rsa("contents")%></td>
  1420. <td align="center" bgcolor="#F6F6F6"><%=rsa("sendtime")%></td>
  1421. </tr>
  1422. <%
  1423. rsa.movenext
  1424. loop
  1425. rsa.close
  1426. set rsa = nothing
  1427. end if
  1428. %>
  1429. </table></td>
  1430. </tr>
  1431. <tr>
  1432. <td align="center">&nbsp;</td>
  1433. </tr>
  1434. </table>
  1435. <p></p>
  1436. <%
  1437. end sub
  1438. '===========绘制图表=========================================================================================================
  1439. sub showchart2()
  1440. %>
  1441. <!-- amline script-->
  1442. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1443. <tr>
  1444. <td align="center"><img src="images/title_alarm.jpg" width="740" height="40" border="0" /></td>
  1445. </tr>
  1446. </table>
  1447. <map name="showchart" id="showchart"><area shape="rect" coords="569,6,638,30" href="report.asp?action=showpage" />
  1448. </map>
  1449. <script type="text/javascript" src="js/swfobject.js"></script>
  1450. <div id="flashcontent">
  1451. </div>
  1452. <script type="text/javascript">
  1453. // <![CDATA[
  1454. var so = new SWFObject("images/amline.swf", "amline", "760", "500", "8", "#FFFFFF");
  1455. so.addVariable("path", "/");
  1456. so.addVariable("settings_file", encodeURIComponent("temp/<%=session("prename")%>_settings.xml"));
  1457. so.addVariable("data_file", encodeURIComponent("temp/<%=session("prename")%>_data.xml"));
  1458. so.write("flashcontent");
  1459. // ]]>
  1460. </script>
  1461. <!-- end of amline script -->
  1462. <%
  1463. end sub
  1464. '===========导出Excel=========================================================================================================
  1465. sub createExcel()
  1466. dim prename, xmlFile, xml, iRow
  1467. prename = session("prename")
  1468. if not fso.fileexists(server.mappath("temp/"&prename&".xls")) then
  1469. xmlFile = server.MapPath("temp/" & prename & "_alldata.xml")
  1470. set xml = server.CreateObject("MicroSoft.XMLDom")
  1471. xml.Load(xmlFile)
  1472. Response.ContentType = "application/msexcel"
  1473. Dim xlWorkSheet
  1474. Dim xlApplication
  1475. Set xlApplication = Server.CreateObject("Excel.Application")
  1476. xlApplication.Visible = False
  1477. xlApplication.Workbooks.Add
  1478. Set xlWorksheet = xlApplication.Worksheets(1)
  1479. xlWorksheet.Cells(1,1).Value = "变量名"
  1480. xlWorksheet.Cells(1,2).Value = "值"
  1481. xlWorksheet.Cells(1,3).Value = "发生时间"
  1482. iRow = 2
  1483. if xml.getElementsByTagName("subdata").length = 0 then
  1484. xlWorksheet.Cells(iRow,1).Value = ""
  1485. xlWorksheet.Cells(iRow,2).Value = ""
  1486. xlWorksheet.Cells(iRow,3).Value = ""
  1487. else
  1488. for i = 0 to xml.getElementsByTagName("subdata").length - 1
  1489. xlWorksheet.Cells(iRow,1).Value = xml.getElementsByTagName("subdata")(i).childNodes.item(0).text
  1490. xlWorksheet.Cells(iRow,2).Value = xml.getElementsByTagName("subdata")(i).childNodes.item(1).text
  1491. xlWorksheet.Cells(iRow,3).Value = xml.getElementsByTagName("subdata")(i).childNodes.item(2).text
  1492. iRow = iRow + 1
  1493. next
  1494. end if
  1495. xlWorksheet.SaveAs Server.MapPath("temp/" & prename & ".xls")
  1496. xlApplication.Quit
  1497. 'Close the Workbook
  1498. Set xlWorksheet = Nothing
  1499. Set xlApplication = Nothing
  1500. set xml = nothing
  1501. response.Redirect "report.asp?action=createExcel"
  1502. else
  1503. %>
  1504. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  1505. <tr>
  1506. <td align="center"><img src="images/title_excel.jpg" border="0" usemap="#makeexcel" /></td>
  1507. </tr>
  1508. <tr>
  1509. <td height="100" align="center">&nbsp;</td>
  1510. </tr>
  1511. <tr>
  1512. <td align="center"><a href="temp/<%=prename%>.xls"><img src="images/excel_created.jpg" width="300" height="300" border="0" /></a></td>
  1513. </tr>
  1514. </table>
  1515. <map name="makeexcel" id="makeexcel">
  1516. <area shape="rect" coords="598,6,667,30" href="report.asp?action=showpage" />
  1517. <area shape="rect" coords="667,6,739,30" href="report.asp?action=showchart" />
  1518. </map>
  1519. <%
  1520. end if
  1521. end sub
  1522. %>
  1523. </td>
  1524. </tr>
  1525. </table></td>
  1526. </tr>
  1527. <tr>
  1528. <td>&nbsp;</td>
  1529. </tr>
  1530. </table>
  1531. <map name="showsss" id="showsss">
  1532. <area shape="rect" coords="569,4,642,33" href="report.asp?action=showpage" />
  1533. </map></body>
  1534. </html>
  1535. <%
  1536. '获取设备列表
  1537. function getsb()
  1538. dim sql, rssb, str
  1539. sql = "select t_classid, classname from t_area where child = 0 and parentid <> 0 order by orderid, t_classid"
  1540. set rssb = conn.execute(sql)
  1541. if rssb.bof and rssb.eof then
  1542. str = "<option>无设备</option>"
  1543. else
  1544. do while not rssb.eof
  1545. str = str & "<option value='" & rssb(0) & "'>" & rssb(1) & "</option>"
  1546. rssb.movenext
  1547. loop
  1548. end if
  1549. rssb.close
  1550. set rssb = nothing
  1551. getsb = str
  1552. end function
  1553. '获取变量列表
  1554. function getbl()
  1555. dim sql, rsbl, str, areaid
  1556. sql = "select description, varname from t_dev_variant where issave = '1' order by description"
  1557. set rsbl = conn.execute(sql)
  1558. if rsbl.bof and rsbl.eof then
  1559. str = str & "<option>无变量</option>"
  1560. else
  1561. do while not rsbl.eof
  1562. str = str & "<option value='" & rsbl(1) & "'>" & rsbl(0) & "</option>" & vbCrLf
  1563. rsbl.movenext
  1564. loop
  1565. end if
  1566. rsbl.close
  1567. set rsbl = nothing
  1568. getbl = str
  1569. end function
  1570. '打开文件文本并读取内容
  1571. function FSOFileRead(filename)
  1572. Dim objFSO,objCountFile,FiletempData
  1573. Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
  1574. if not objFSO.fileExists(server.mappath(filename)) then exit function
  1575. Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
  1576. FSOFileRead = objCountFile.ReadAll
  1577. objCountFile.Close
  1578. Set objCountFile=Nothing
  1579. Set objFSO = Nothing
  1580. End Function
  1581. '删除不符合条件的数组元素
  1582. function arrayremove(m, n, byval arrpar, byval key, byval key2, byval key3)
  1583. dim i,j,k
  1584. k=0
  1585. for i = 1 to ubound(arrpar,2)
  1586. if left(arrpar(m,i),len(key)) = key and arrpar(n,i) > key2 and arrpar(n,i) < key3 then
  1587. k = k+1
  1588. for j = 0 to ubound(arrpar,1)
  1589. arrpar(j,k-1) = arrpar(j,i)
  1590. next
  1591. end if
  1592. next
  1593. ReDim Preserve arrpar(ubound(arrpar,1), k-1)
  1594. arrayremove = arrpar
  1595. end function
  1596. function arrayremove_multi(m, n, byval arrpar, byval key, byval key2, byval key3)
  1597. dim i,j,k,key_arr,kk
  1598. k=0
  1599. key_arr = split(key,",")
  1600. for i = 1 to ubound(arrpar,2)
  1601. for kk = 0 to ubound(key_arr)
  1602. if left(arrpar(m,i),len(key_arr(kk))) = key_arr(kk) and arrpar(n,i) > key2 and arrpar(n,i) < key3 then
  1603. k = k+1
  1604. for j = 0 to ubound(arrpar,1)
  1605. arrpar(j,k-1) = arrpar(j,i)
  1606. next
  1607. end if
  1608. next
  1609. next
  1610. ReDim Preserve arrpar(ubound(arrpar,1), k-1)
  1611. arrayremove = arrpar
  1612. end function
  1613. function arrayremove2(m, n, byval arrpar, byval key, byval key2)
  1614. dim i,j,k
  1615. k=0
  1616. for i = 0 to ubound(arrpar,2)
  1617. if arrpar(m,i) = key and mid(cstr(formattime(arrpar(n,i))),1,10) = mid(cstr(key2),1,10) then
  1618. k = k+1
  1619. for j = 0 to ubound(arrpar,1)
  1620. arrpar(j,k-1) = arrpar(j,i)
  1621. next
  1622. end if
  1623. next
  1624. ReDim Preserve arrpar(ubound(arrpar,1), k-1)
  1625. arrayremove2 = arrpar
  1626. end function
  1627. '合并数组
  1628. function array_merge(byVal firstArray, byVal secondArray)
  1629. dim totalSize
  1630. dim i,j
  1631. dim combinedArray
  1632. 'Ensure that we're dealing with arrays.
  1633. if not isArray(firstArray) then
  1634. firstArray = Array(firstArray)
  1635. end if
  1636. if not isArray(secondArray) then
  1637. secondArray = Array(secondArray)
  1638. end if
  1639. 'Set up the new array.
  1640. totalSize = uBound(firstArray,2) + uBound(secondArray,2) + 1
  1641. combinedArray = firstArray
  1642. redim preserve combinedArray(uBound(firstArray,1),totalSize)
  1643. for i = 0 to uBound(secondArray,2)
  1644. for j = 0 to uBound(firstArray,1)
  1645. combinedArray(j,uBound(firstArray,2) + 1 + i) = secondArray(j,i)
  1646. next
  1647. next
  1648. array_merge = combinedArray
  1649. end function
  1650. function formattime(t)
  1651. dim omm,odd,ohh,ostr
  1652. omm = month(t)
  1653. odd = day(t)
  1654. ohh = hour(t)
  1655. ostr = cstr(t)
  1656. if len(omm) = 1 then ostr = replace(ostr,"-"&omm,"-0"&omm,1,1)
  1657. if len(odd) = 1 then ostr = replace(ostr,"-"&odd,"-0"&odd,1,1)
  1658. if len(ohh) = 1 then ostr = replace(ostr," "&ohh," 0"&ohh,1,1)
  1659. formattime = ostr
  1660. end function
  1661. function getMax(arr)
  1662. dim i, max
  1663. if not isArray(arr) then
  1664. arr = Array(arr)
  1665. end if
  1666. max = cint(arr(0))
  1667. for i = 0 to ubound(arr)
  1668. if cint(arr(i)) > cint(max) then max = cint(arr(i))
  1669. next
  1670. getMax = max
  1671. end function
  1672. '日志文件筛选后存入xml
  1673. function logToxml(oLog, isMulti, bl, d1, d2, prename)
  1674. dim ao, arr, bl_arr, i, j, arr1, arr2
  1675. set ao = new arrayoperate
  1676. arr = ao.stringtoarray(oLog) '日志存入数组
  1677. if isMulti = false then
  1678. arr1 = arrayremove(0,2,arr,""""&trim(bl)&"""",""""&d1&"""",""""&d2&"""")
  1679. call arrToxml(0, arr1, d1, intervaltime, itime, trim(bl), prename)
  1680. call arrToxml_all(arr1, d1, trim(bl), prename)
  1681. else
  1682. bl_arr = split(trim(bl),",")
  1683. for i = 0 to ubound(bl_arr)
  1684. arr2 = arrayremove(0,2,arr,""""&trim(bl_arr(i))&"""",""""&d1&"""",""""&d2&"""")
  1685. call arrToxml(i, arr2, d1, intervaltime, itime, trim(bl_arr(i)), prename)
  1686. call arrToxml_all(arr2, d1, trim(bl_arr(i)), prename)
  1687. next
  1688. end if
  1689. set ao = nothing
  1690. end function
  1691. '数组到xml.data.xml
  1692. function arrToxml(num, arr, d1, intervaltime, itime, bl, prename)
  1693. dim xml, xmlFile, tags, nodeValue, preValue
  1694. xmlFile = server.MapPath("temp/" & prename & "_data.xml")
  1695. set xml = server.CreateObject("MicroSoft.XMLDom")
  1696. xml.Load(xmlFile)
  1697. if xml.parseError.errorCode <> 0 then
  1698. Response.Write "xml.parseError.errorCode = " & xml.parseError.errorCode
  1699. Response.Write "xml.parseError.reason = " & xml.parseError.reason
  1700. Response.Write "xml.parseError.line = " & xml.parseError.line
  1701. Response.End
  1702. end if
  1703. for i = 1 to itime - 1
  1704. chart_temp = arrayremove(0, 2, arr, """" & trim(bl) & """", """" & formattime(dateadd("s",intervaltime*(i-1),d1)) & """", """" & formattime(dateadd("s",intervaltime*i,d1)) & """")
  1705. if ubound(chart_temp,2) <> -1 then
  1706. xml.getElementsByTagName("graph")(num).childNodes.item(i-1).text = dotwithonebit(chart_temp(1,ubound(chart_temp,2)),2)
  1707. end if
  1708. chart_temp = ""
  1709. next
  1710. xml.save xmlFile
  1711. set xml = nothing
  1712. end function
  1713. '数组到xml.alldata.xml
  1714. function arrToxml_all(arr, d1, bl, prename)
  1715. dim xml_all, xmlFile_all, i, node_subdata, node_varname, node_value, node_happentime, varname
  1716. xmlFile_all = server.MapPath("temp/" & prename & "_alldata.xml")
  1717. set xml_all = server.CreateObject("MicroSoft.XMLDom")
  1718. xml_all.Load(xmlFile_all)
  1719. varname = xml_getVarDesc(replace(bl,"""",""))
  1720. if xml_all.parseError.errorCode <> 0 then
  1721. Response.Write "xml.parseError.errorCode = " & xml_all.parseError.errorCode
  1722. Response.Write "xml.parseError.reason = " & xml_all.parseError.reason
  1723. Response.Write "xml.parseError.line = " & xml_all.parseError.line
  1724. Response.End
  1725. end if
  1726. for i = 0 to ubound(arr,2)
  1727. set node_subdata = xml_all.createElement("subdata")
  1728. set node_varname = xml_all.createElement("varname")
  1729. node_varname.text = varname
  1730. set node_value = xml_all.createElement("value")
  1731. node_value.text = dotwithonebit(arr(1,i),2)
  1732. set node_happentime = xml_all.createElement("happentime")
  1733. node_happentime.text = replace(arr(2,i),"""","")
  1734. node_subdata.appendChild(node_varname)
  1735. node_subdata.appendChild(node_value)
  1736. node_subdata.appendChild(node_happentime)
  1737. xml_all.getElementsByTagName("data")(0).appendChild(node_subdata)
  1738. next
  1739. xml_all.save xmlFile_all
  1740. set xml_all = nothing
  1741. end function
  1742. function xml_getVarDesc(varName)
  1743. dim rsxml, desc, sql
  1744. sql = "select description from t_dev_variant where varname = '" & varName & "'"
  1745. set rsxml = server.CreateObject("adodb.recordset")
  1746. rsxml.open sql, conn, 1, 1
  1747. if rsxml.bof and rsxml.eof then
  1748. desc = ""
  1749. else
  1750. desc = rsxml("description")
  1751. end if
  1752. xml_getVarDesc = desc
  1753. rsxml.close
  1754. set rsxml = nothing
  1755. end function
  1756. function xml_getUnit(varName)
  1757. dim rsxml, str, sql
  1758. sql = "select unit from t_dev_variant where varname = '" & varName & "'"
  1759. set rsxml = server.CreateObject("adodb.recordset")
  1760. rsxml.open sql, conn, 1, 1
  1761. if rsxml.bof and rsxml.eof then
  1762. str = ""
  1763. else
  1764. str = rsxml(0)
  1765. end if
  1766. xml_getUnit = rsxml(0)
  1767. set rsxml = nothing
  1768. end function
  1769. function dotwithonebit(d,n)
  1770. dim od, odstr
  1771. if isNumeric(d) and instr(d,".") > 0 then
  1772. odstr = split(d,".")
  1773. od = odstr(0) & "." & left(odstr(1),n)
  1774. else
  1775. od = d
  1776. end if
  1777. dotwithonebit = od
  1778. end function
  1779. %>