source: schedule/function/function.php@ 15716

Last change on this file since 15716 was 15709, checked in by tanio, 12 years ago
File size: 1.2 KB
Line 
1 <script type="text/javascript">
2 $(document).ready(function(){
3 var currentDate = new Date();
4 var day = currentDate.getDate();
5 var month = currentDate.getMonth() + 1;
6 var year = currentDate.getFullYear();
7 var fullday=day+'-'+month+'-'+year;
8 <?php
9 $cntsource=mysql_query("SELECT COUNT(*) as `SourceID` FROM source");
10 $rowcnt=mysql_fetch_array($cntsource);
11 $Total= $rowcnt['SourceID'];
12 ?>
13 $('#save').click(function(){
14 var InputValue = [];
15 var selectedSource = [];
16 var selectedTime = [];
17 var selectedMeasurement = [];
18 var Time;
19 var Source;
20 var measure;
21 var value;
22 for(var i=1;i<<?php echo $Total; ?>;i++)
23 {
24 if($('#Time').val()||$('#Time').val()>0)
25 {
26 Time=$('#Time'+i).val();
27 Source=$('select[id="source'+i+'"]').val();
28 measure=$('select[id="measurement'+i+'"]').val();
29 value=$('#txtData'+i).val();
30 selectedMeasurement.push(measure);
31 selectedSource.push(Source);
32 selectedTime.push(Time);
33 InputValue.push(value);
34 }
35 }
36 window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+fullday;
37 });
38 $('#loadprev').click(function(){
39 addSeries(chart);
40 });
41 });
42 </script>
Note: See TracBrowser for help on using the repository browser.