source: schedule/Module/calendar.php@ 15950

Last change on this file since 15950 was 15950, checked in by tanio, 12 years ago
File size: 6.0 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html>
3 <head>
4 <link type="text/css" rel="stylesheet" href="Module/src/css/jscal2.css" />
5 <link type="text/css" rel="stylesheet" href="Module/src/css/border-radius.css" />
6
7 <link id="skin-win2k" title="Win 2K" type="text/css" rel="alternate stylesheet" href="Module/src/css/win2k/win2k.css" />
8
9 <script src="js/highcharts.js"></script>
10 <script src="js/exporting.js"></script>
11
12 <script src="Module/src/js/jscal2.js"></script>
13 <script src="Module/src/js/unicode-letter.js"></script>
14
15 <script src="Module/src/js/lang/en.js"></script>
16<style type="text/css">
17 .highlight { color: #f00 !important; }
18 .highlight2 { color: #0f0 !important; font-weight: bold; }
19 </style>
20
21 </head>
22 <body style="background-color: #fff">
23
24 <table>
25 <tr>
26 <td valign="top" style="width: 30em;">
27 <div id="cont"></div>
28 <script type="text/javascript">
29 var DATE_INFO = {
30 20130507: { klass: "highlight", tooltip: "%Y/%m/%d (%A)<br />That was yesterday" },
31 20130508: { klass: "highlight", tooltip: "And this is TODAY" }
32 };
33
34 function getDateInfo(date, wantsClassName) {
35 var as_number = Calendar.dateToInt(date);
36 return DATE_INFO[as_number];
37 };
38 var CAL = Calendar.setup({
39 cont: "cont",
40 // weekNumbers: true,
41 selectionType: Calendar.SEL_MULTIPLE,
42 showTime: 24,
43 //fdow : 1,
44 dateInfo:getDateInfo
45 // titleFormat: "%B %Y"
46 })
47 </script>
48 </td>
49
50 <tr>
51 <td>
52 <script type="text/javascript">//<![CDATA[
53
54 CAL.addEventListener("onSelect", function(){
55 var day =this.selection.print("%d").join("\n");
56 var month =this.selection.print("%m").join("\n");
57 var year =this.selection.print("%Y").join("\n");
58 var newline = [];
59 var newdata;
60 var newtime;
61 var xmlhttp;
62 if (window.XMLHttpRequest)
63 {// code for IE7+, Firefox, Chrome, Opera, Safari
64 xmlhttp=new XMLHttpRequest();
65 }
66 else
67 {// code for IE6, IE5
68 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
69 }
70 xmlhttp.onreadystatechange=function()
71 {
72 if (xmlhttp.readyState==4 && xmlhttp.status==200)
73 {
74 var options = {
75 chart: {
76 renderTo: 'container' /* display to div Graph*/
77 },
78
79 xAxis: {
80 categories:["12PM","1PM","2PM","3PM","4PM","5PM","6PM","7PM","8PM","9PM","10PM","11PM","12AM","1AM","2AM","3AM","4AM","5AM","6AM","7AM","8AM","9AM","10AM","12PM"]
81 },
82 series:[], /* array of Data */
83
84 remove:function()
85 {
86 return false;
87 },
88
89 exporting: { /*--------------------*/
90 buttons: { /* */
91 exportButton: { /* Export */
92 menuItems: null, /* to */
93 onclick: function() { /* PNG.file */
94 this.exportChart(); /*--------------------*/
95 }
96 }
97 }
98 }
99
100
101
102 };
103 var lines = xmlhttp.responseText.split('\n');
104 var arr;
105 var arrTime = [];
106 var Time = [];
107 var colon = [];
108 var Temp = [];
109 var source = [];
110 for(var row=0;row<lines.length; row++)
111 {
112 var f = lines[row].split(',');
113 Time[row]=f[0];
114
115 for(var c=0;c<Time.length;c++)
116 {
117 var cst=Time[c].split(':');
118 colon[c]=cst[0];
119 Temp[c]=(parseInt(cst[1]/60*100)||parseFloat("0"));
120 for(var i=1;i<colon.length;i++)
121 {
122 var st=colon[i].split('T');
123 arrTime[i]=(parseFloat(st[1])||parseFloat("0"));
124 }
125 }
126 //arr[row]="["+f[4]+"]";
127 newline[row]=(parseFloat(f[4])||parseFloat("0"));
128 var s=[];
129 for(var c=0;c<newline.length;c++)
130 {
131 if(newline[c]==0)
132 {
133
134 }
135 else
136 s.push(parseFloat(newline[c]));
137 }
138 var finaldata=[];
139 var a=[];
140 for(var i=0;i<arrTime.length;i++)
141 {
142 if(arrTime[i]==undefined)
143 {
144 }
145 else if(arrTime[i]==0&&Temp[i]==0&&newline[i]==0)
146 {
147
148 }
149 else if(newline[i]==0)
150 {
151 }
152 else
153 finaldata.push(parseFloat(arrTime[i])+'.'+parseFloat(Temp[i]));
154 }
155 for(var i=0;i<finaldata.length;i++)
156 {
157 a.push("["+parseFloat(finaldata[i])+"]");
158 }
159
160 }
161 //source.push($('#box2view').val());
162
163
164
165
166 newdata=s;
167 newtime=a;
168 document.getElementById('data').innerHTML=finaldata;
169 newdata1=newdata;
170
171 options.series.push({
172
173 data:newdata1
174 });
175 var chart = new Highcharts.Chart(options);
176
177
178
179 }
180 }
181 xmlhttp.open("GET","http://www.fact-project.org/smartfact/index.php?source="+'Mrk+421'+"&time="+year+"-"+month+"-"+day,true);
182 xmlhttp.send();
183 $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year);
184
185 });
186
187 //]]></script>
188 </td>
189 </tr>
190
191 </table>
192 </td>
193 </tr>
194 </table>
195
196 </body>
197</html>
198
199
Note: See TracBrowser for help on using the repository browser.