source: schedule/function/function.php@ 15685

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