source: schedule/Module/calendar.php@ 15874

Last change on this file since 15874 was 15874, checked in by tanio, 12 years ago
File size: 5.2 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 lines = xmlhttp.responseText.split('\n');
75 var arr;
76 var arrTime = [];
77 var Time = [];
78 var colon = [];
79 var Temp = [];
80
81 for(var row=0;row<lines.length; row++)
82 {
83 var f = lines[row].split(',');
84 Time[row]=f[0];
85
86 for(var c=0;c<Time.length;c++)
87 {
88 var cst=Time[c].split(':');
89 colon[c]=cst[0];
90 Temp[c]=(parseInt(cst[1]/60*100)||parseInt("0"));
91 for(var i=1;i<colon.length;i++)
92 {
93 var st=colon[i].split('T');
94 arrTime[i]=(parseInt(st[1])||parseInt("0"));
95 }
96 }
97 //arr[row]="["+f[4]+"]";
98 newline[row]=(parseFloat(f[4])||parseInt("0"));
99 var s=[];
100 for(var c=0;c<newline.length;c++)
101 {
102 if(newline[c]==0)
103 {
104
105 }
106 else
107 s.push(parseFloat(newline[c]));
108 }
109 var finaldata=[];
110 var a=[];
111 for(var i=0;i<arrTime.length;i++)
112 {
113 if(arrTime[i]==undefined)
114 {
115 }
116 else if(arrTime[i]==0&&Temp[i]==0&&newline[i]==0)
117 {
118
119 }
120 else if(newline[i]==0)
121 {
122 }
123 else
124 finaldata.push("["+arrTime[i]+'.'+Temp[i]+','+newline[i]+"]");
125 }
126
127 }
128
129 var temp = "";
130 var Hours = "";
131
132
133
134 newdata=s;
135 document.getElementById('data').innerHTML=finaldata;
136
137 $(function () {
138 var data = [parseFloat(finaldata)];
139
140 var options = {
141 chart: {
142 renderTo: 'container'
143 },
144 xAxis: {
145 type:'datetime'
146 },
147 series: []
148 };
149 //data = JSON.parse(data);
150
151 options.series.push({data:data});
152
153 var chart = new Highcharts.Chart(options);
154 });
155
156
157 }
158 }
159 xmlhttp.open("GET","http://www.fact-project.org/smartfact/index.php?source="+'Mrk+421'+"&time="+year+"-"+month+"-"+day,true);
160 xmlhttp.send();
161 $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year);
162
163 });
164
165 //]]></script>
166 </td>
167 </tr>
168
169 </table>
170 </td>
171 </tr>
172 </table>
173
174 </body>
175</html>
176
177
Note: See TracBrowser for help on using the repository browser.