source: schedule/Module/calendar.php@ 15988

Last change on this file since 15988 was 15988, checked in by tanio, 12 years ago
File size: 8.7 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 type: 'scatter'
78 },
79
80 xAxis: {
81 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"]
82 },
83 series:[{data:[]}], /* array of Data */
84
85 remove:function()
86 {
87 return false;
88 },
89
90 exporting: { /*--------------------*/
91 buttons: { /* */
92 exportButton: { /* Export */
93 menuItems: null, /* to */
94 onclick: function() { /* PNG.file */
95 this.exportChart(); /*--------------------*/
96 }
97 }
98 }
99 }
100
101
102
103 };
104 var lines = xmlhttp.responseText.split('\n');
105 var arr;
106 var arrTime = [];
107 var Time = [];
108 var colon = [];
109 var Temp = [];
110 var source = [];
111 for(var row=0;row<lines.length; row++)
112 {
113 var f = lines[row].split(',');
114 Time[row]=f[0];
115
116 for(var c=0;c<Time.length;c++)
117 {
118 var cst=Time[c].split(':');
119 colon[c]=cst[0];
120 Temp[c]=(parseInt(cst[1]/60*100)||parseFloat("0"));
121 for(var i=1;i<colon.length;i++)
122 {
123 var st=colon[i].split('T');
124 arrTime[i]=(parseFloat(st[1])||parseFloat("0"));
125 }
126 }
127 //arr[row]="["+f[4]+"]";
128 newline[row]=(parseFloat(f[4])||parseFloat("0"));
129 var s=[];
130 for(var c=0;c<newline.length;c++)
131 {
132 if(newline[c]==0)
133 {
134
135 }
136 else
137 s.push(parseFloat(newline[c]));
138 }
139 var finaldata=[];
140 var a=[];
141 for(var i=1;i<arrTime.length-1;i++)
142 {
143 if(arrTime[i]==0)
144 {
145 if(Temp[i]==8)
146 {
147 finaldata.push(arrTime[i]+24+'.08');
148 }
149 else
150 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
151 }
152 else if(arrTime[i]==1)
153 {
154 if(Temp[i]==8)
155 {
156 finaldata.push(arrTime[i]+24+'.08');
157 }
158 else
159 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
160 }
161 else if(arrTime[i]==2)
162 {
163 if(Temp[i]==8)
164 {
165 finaldata.push(arrTime[i]+24+'.08');
166 }
167 else
168 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
169 }
170 else if(arrTime[i]==3)
171 {
172 if(Temp[i]==8)
173 {
174 finaldata.push(arrTime[i]+24+'.08');
175 }
176 else
177 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
178 }
179 else if(arrTime[i]==4)
180 {
181 if(Temp[i]==8)
182 {
183 finaldata.push(arrTime[i]+24+'.08');
184 }
185 else
186 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
187 }
188 else if(arrTime[i]==5)
189 {
190 if(Temp[i]==8)
191 {
192 finaldata.push(arrTime[i]+24+'.08');
193 }
194 else
195 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
196 }
197 else if(arrTime[i]==6)
198 {
199 if(Temp[i]==8)
200 {
201 finaldata.push(arrTime[i]+24+'.08');
202 }
203 else
204 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
205 }
206 else if(arrTime[i]==7)
207 {
208 if(Temp[i]==8)
209 {
210 finaldata.push(arrTime[i]+24+'.08');
211 }
212 else
213 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
214 }
215 else if(arrTime[i]==8)
216 {
217 if(Temp[i]==8)
218 {
219 finaldata.push(arrTime[i]+24+'.08');
220 }
221 else
222 finaldata.push(arrTime[i]+24+'.'+Temp[i]);
223 }
224 else if(Temp[i]==8)
225 {
226
227 finaldata.push(arrTime[i]+24+'.08');
228
229 }
230 else
231 finaldata.push(arrTime[i]+'.'+Temp[i]);
232
233 }
234 for(var i=0;i<finaldata.length;i++)
235 {
236 a.push("["+parseFloat(finaldata[i])+"]");
237 }
238
239 }
240
241
242
243
244 var chart = new Highcharts.Chart(options);
245 newdata=s;
246 newtime=a;
247 document.getElementById('data').innerHTML=finaldata+"T"+s;
248 //document.getElementById('sourcelist').innerHTML=; //aki man edit kuya
249 newdata1=newdata;
250
251 /*options.series.push({
252
253 data:[parseFloat(finaldata),parseFloat(newdata1)]
254 });*/
255 var cnt="";
256 for(var i=0;i<s.length;i++)
257 {
258 if(finaldata[i]==finaldata.length)
259 {
260
261 finaldata[i]+=1;
262 chart.series[0].addPoint({
263 x:finaldata[i],
264 y:newdata[i]
265 })
266 }
267 else
268 chart.series[0].addPoint({
269 x:finaldata[i],
270 y:newdata[i]
271 })
272 cnt+=i;
273 }
274
275 document.getElementById('sourcelist').innerHTML=cnt;
276
277
278 }
279 }
280 xmlhttp.open("GET","http://www.fact-project.org/smartfact/index.php?source="+'Mrk+421'+"&time="+year+"-"+month+"-"+day,true);
281 xmlhttp.send();
282 $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year);
283
284 });
285
286 //]]></script>
287 </td>
288 </tr>
289
290 </table>
291 </td>
292 </tr>
293 </table>
294
295 </body>
296</html>
297
298
Note: See TracBrowser for help on using the repository browser.