source: schedule/Module/calendar.php@ 15702

Last change on this file since 15702 was 15702, checked in by tanio, 11 years ago
File size: 5.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 xmlhttp;
61 if (window.XMLHttpRequest)
62 {// code for IE7+, Firefox, Chrome, Opera, Safari
63 xmlhttp=new XMLHttpRequest();
64 }
65 else
66 {// code for IE6, IE5
67 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
68 }
69 xmlhttp.onreadystatechange=function()
70 {
71 if (xmlhttp.readyState==4 && xmlhttp.status==200)
72 {
73 var lines = xmlhttp.responseText.split('\n');
74 var arr = [];
75 var arrTime = [];
76 var Time = [];
77 var colon = [];
78 for(var row=0;row<lines.length; row++)
79 {
80 var f = lines[row].split(',');
81 Time[row]=f[0];
82 //var DateT= new Date(Time);
83 //arr[row]="["+f[4]+"]";
84 for(var t=0; t<Time.length;t++)
85 {
86 var x=Time[t].split('T');
87 arr[t]=x[1];
88 for(var st=0;st<arr.length;st++)
89 {
90 var c=Time[st].split(':');
91
92 newline[row]=(parseFloat(f[4])||parseInt("0"));
93
94
95 }
96 //h[t]=x[1];
97
98 }
99
100 }
101 newdata=newline.join(",");
102 document.getElementById('data').innerHTML=newdata;
103 $(function () {
104 //var data = '[{"name":"Station 1","data":"1360191600,398.625"},{"name":"Station 1","data":"1360192500,398.625"},{"name":"Station 1","data":"1360193400,398.25"},{"name":"Station 1","data":"1360194300,397.375"},{"name":"Station 1","data":"1360195200,397.5"},{"name":"Station 1","data":"1360196100,397.5"},{"name":"Station 1","data":"1360199700,396.75"},{"name":"Station 1","data":"1360200600,397"}]';
105
106
107 var options = {
108 chart: {
109 renderTo: 'container'
110 },
111 xAxis: {
112 type:'datetime'
113 },
114 series: []
115 };
116
117 newline = JSON.parse(newline);
118 var names = [];
119 $.each(newline, function (i, ligne) {
120 var ind = names.indexOf(ligne.name),
121 splited = ligne.newline.split(','),
122 x = parseFloat(splited[0]),
123 y = parseFloat(splited[1]);
124 if (ind == -1) {
125 ind = names.push(ligne.name) - 1;
126 options.series.push({
127 data: [],
128 name: ligne.name
129 });
130 }
131 if(!isNaN(x) && !isNaN(y)){
132 options.series[ind].newline.push([x,y]);
133 }
134 });
135
136 console.log(options);
137
138 var chart = new Highcharts.Chart(options);
139 });
140
141 }
142 }
143 xmlhttp.open("GET","http://www.fact-project.org/smartfact/index.php?source="+'Mrk+421'+"&time="+year+"-"+month+"-"+day,true);
144 xmlhttp.send();
145 $('#Graph').load('chart.php?day='+day+"&month="+month+"&year="+year+"&new="+newdata);
146
147 });
148
149 //]]></script>
150 </td>
151 </tr>
152
153 </table>
154 </td>
155 </tr>
156 </table>
157
158 </body>
159</html>
Note: See TracBrowser for help on using the repository browser.