source: schedule/Module/calendar.php@ 15917

Last change on this file since 15917 was 15917, checked in by tanio, 11 years ago
File size: 6.3 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 <script src="js/jquery-1.7.2.min.js"></script>
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'
77 },
78 xAxis: {
79 type:'datetime'
80 },
81 series: []
82 };*/
83 var lines = xmlhttp.responseText.split('\n');
84 var arr;
85 var arrTime = [];
86 var Time = [];
87 var colon = [];
88 var Temp = [];
89 var source = [];
90 for(var row=0;row<lines.length; row++)
91 {
92 var f = lines[row].split(',');
93 Time[row]=f[0];
94
95 for(var c=0;c<Time.length;c++)
96 {
97 var cst=Time[c].split(':');
98 colon[c]=cst[0];
99 Temp[c]=(parseInt(cst[1]/60*100)||parseFloat("0"));
100 for(var i=1;i<colon.length;i++)
101 {
102 var st=colon[i].split('T');
103 arrTime[i]=(parseFloat(st[1])||parseFloat("0"));
104 }
105 }
106 //arr[row]="["+f[4]+"]";
107 newline[row]=(parseFloat(f[4])||parseFloat("0"));
108 var s=[];
109 for(var c=0;c<newline.length;c++)
110 {
111 if(newline[c]==0)
112 {
113
114 }
115 else
116 s.push(parseFloat(newline[c]));
117 }
118 var finaldata=[];
119 var a=[];
120 for(var i=0;i<arrTime.length;i++)
121 {
122 if(arrTime[i]==undefined)
123 {
124 }
125 else if(arrTime[i]==0&&Temp[i]==0&&newline[i]==0)
126 {
127
128 }
129 else if(newline[i]==0)
130 {
131 }
132 else
133 finaldata.push("["+arrTime[i]+'.'+Temp[i]+','+newline[i]+"]");
134 }
135
136 }
137 //source.push($('#box2view').val());
138
139
140
141
142 newdata=s;
143 newtime=finaldata;
144 document.getElementById('data').innerHTML=finaldata;
145
146 /*options.series.push({
147
148 data:[finaldata]
149 });*/
150 //var chart = new Highcharts.Chart(options);
151 var chart = new Highcharts.Chart({
152 chart: {
153 renderTo: 'container' /* display to div Graph*/
154 },
155
156 xAxis: {
157 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"]
158 },
159 series:[], /* array of Data */
160
161 remove:function()
162 {
163 return false;
164 },
165
166 exporting: { /*--------------------*/
167 buttons: { /* */
168 exportButton: { /* Export */
169 menuItems: null, /* to */
170 onclick: function() { /* PNG.file */
171 this.exportChart(); /*--------------------*/
172 }
173 }
174 }
175 }
176
177
178
179 });
180
181 // the button handler
182 //newdata=[[21,4],[5,6],[7,8],[3,41]];
183
184 if (chart.series) {
185 chart.addSeries({name:"wa",
186 data: parseFloat(newdata)
187 });
188 }
189
190
191 }
192 }
193 xmlhttp.open("GET","http://www.fact-project.org/smartfact/index.php?source="+'Mrk+421'+"&time="+year+"-"+month+"-"+day,true);
194 xmlhttp.send();
195 $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year);
196
197 });
198
199 //]]></script>
200 </td>
201 </tr>
202
203 </table>
204 </td>
205 </tr>
206 </table>
207
208 </body>
209</html>
210
211
Note: See TracBrowser for help on using the repository browser.