source: schedule/function/function.php@ 15783

Last change on this file since 15783 was 15774, checked in by tanio, 11 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
9 <?php
10
11 $cntsource=mysql_query("SELECT COUNT(*) as `SourceID` FROM source");
12 $rowcnt=mysql_fetch_array($cntsource);
13 $Total= $rowcnt['SourceID'];
14 ?>
15 $('#save').click(function(){
16 var InputValue = [];
17 var selectedSource = [];
18 var selectedTime = [];
19 var selectedMeasurement = [];
20 var Time;
21 var Source;
22 var measure;
23 var value;
24 for(var i=1;i<<?php echo $Total; ?>;i++)
25 {
26 if($('#Time').val()||$('#Time').val()>0)
27 {
28 Time=$('#Time'+i).val();
29 Source=$('select[id="source'+i+'"]').val();
30 measure=$('select[id="measurement'+i+'"]').val();
31 value=$('#txtData'+i).val();
32 selectedMeasurement.push(measure);
33 selectedSource.push(Source);
34 selectedTime.push(Time);
35 InputValue.push(value);
36 }
37 }
38 window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+fullday;
39 });
40
41 });
42 </script>
Note: See TracBrowser for help on using the repository browser.