Changeset 16894 for schedule/function/function.php
- Timestamp:
- 06/23/13 09:54:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/function/function.php
r16738 r16894 1 1 <div id="saving"> 2 2 3 <script type="text/javascript"> 4 5 6 7 8 9 10 11 12 $(document).ready(function GetDate(){ 3 <script type="text/javascript"> 4 $(document).ready(function GetDate(day ,month ,year){ 13 5 // for fupdate 14 6 <?php … … 25 17 26 18 if(isset($_GET['days'])){ 27 echo $_GET['days']; ; 28 }else{ 19 echo $_GET['days']; 20 } 21 else 22 { 29 23 30 24 echo date("Y-m-d"); … … 33 27 34 28 ?>'; 29 30 var InputValue = []; 31 var selectedSource = []; 32 var selectedTime = []; 33 var selectedMeasurement = []; 34 var Time; 35 var Source; 36 var measure; 37 var value; 38 var checks = 0; 39 for(var i=1;i <= cnt;i++) 40 { 41 if($('#Time'+i).val() != '') 42 { 43 Time=$('#Time'+i).val(); 44 Source=$('select[id="source'+i+'"]').val(); 45 measure=$('select[id="measurement'+i+'"]').val(); 46 value=$('#txtData'+i).val(); 47 selectedMeasurement.push(measure); 48 selectedSource.push(Source); 49 selectedTime.push(Time); 50 InputValue.push(value); 51 52 } 53 else 54 { 55 checks++; 56 57 } 58 } 59 if(checks == 0) 60 { 61 alert(dtr); 62 $.ajax({ 63 type: "POST", 64 cache: false, 65 url: "Transaction/insert.php", 66 data: "Time="+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr, 67 dataType: "json", 68 success: function(data) { 69 alert('Success: The text is now stored in the database.'); 70 } 71 }); 72 //window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 73 } 74 else 75 { 76 77 alert("Please fill all the details!"); 78 } 79 }); 80 81 82 83 84 85 86 87 88 89 90 91 $('#update').click(function() 92 { 35 93 //alert(dtr); 36 94 var InputValue = []; … … 62 120 } 63 121 64 if(checks == 0){ 65 window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 66 }else{ 67 68 alert("Please fill all the details!"); 69 } 70 }); 71 72 73 74 75 76 77 78 79 80 81 82 $('#update').click(function(){ 83 var dtr; 84 dtr = '<?php 85 86 if(isset($_GET['days'])){ 87 echo $_GET['days']; ; 88 }else{ 89 90 echo date("Y-m-d"); 91 92 } 93 94 ?>'; 95 //alert(dtr); 96 var InputValue = []; 97 var selectedSource = []; 98 var selectedTime = []; 99 var selectedMeasurement = []; 100 var Time; 101 var Source; 102 var measure; 103 var value; 104 var checks = 0; 105 for(var i=1;i <= cnt;i++) 122 if(checks == 0) 106 123 { 107 if($('#Time'+i).val() != '') 108 { 109 Time=$('#Time'+i).val(); 110 Source=$('select[id="source'+i+'"]').val(); 111 measure=$('select[id="measurement'+i+'"]').val(); 112 value=$('#txtData'+i).val(); 113 selectedMeasurement.push(measure); 114 selectedSource.push(Source); 115 selectedTime.push(Time); 116 InputValue.push(value); 117 118 }else{ 119 checks++; 120 124 125 $.ajax({ 126 type: "POST", 127 cache: false, 128 url: "Transaction/update.php", 129 data: "Time="+selectedTime, 130 dataType: "json", 131 success: function(data) { 132 alert('Success: The text is now stored in the database.'); 121 133 } 134 }); 135 //window.location = 'Transaction/update.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 122 136 } 123 124 if(checks == 0){ 125 window.location = 'Transaction/update.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr; 126 }else{ 137 else 138 { 127 139 128 140 alert("Please fill all the details!");
Note:
See TracChangeset
for help on using the changeset viewer.