Changeset 16918 for schedule/js/function.js
- Timestamp:
- 06/26/13 20:30:01 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/js/function.js
r16915 r16918 18 18 Table.push(id); 19 19 }); 20 alert(Table); 20 21 GetSaveData(Time,Data,Source,Measure); // Function call of saving the data 22 }); 23 24 /*$('#update').click(function(){ 25 Time = []; 26 Data = []; 27 Source = []; 28 Measure = []; 29 Table = []; 30 $('div#TableHolder table').each(function(){ 31 id=$(this).attr('id'); 32 Table.push(id); 33 Time.push('#'+id+' input#Time'); 34 Data.push('#'+id+' input#txtData'); 35 Source.push('#'+id+' select#source :selected'); 36 Measure.push('#'+id+' select#measurement :selected'); 37 Table.push(id); 38 }); 21 39 alert(Table); 22 }); 40 GetUpdatedData(Time,Data,Source,Measure); 41 });*/ 42 23 43 24 44 }; … … 33 53 for(i=0;i<$('div#TableHolder table').length;i++) 34 54 { 55 //Table[i].val(); 35 56 $(Time[i]).each(function(){ 36 57 TimeSave.push($(this).val()); // extracting each data into a value … … 45 66 MeasureSave.push($(this).val()); // extracting each data into a value 46 67 }); 68 alert(DataSave); 47 69 } 48 70 if($('#save').val()=='UPDATE') … … 93 115 94 116 }; 117 /* 118 function GetUpdatedData(Time,Data,Source,Measure){ 119 var checks=0; 120 TimeSave = []; 121 DataSave = []; 122 SourceSave = []; 123 MeasureSave = []; 124 for(i=0;i<Time.length;i++) 125 { 126 $(Time[i]).each(function(){ 127 TimeSave.push($(this).val()); 128 }); 129 $(Data[i]).each(function(){ 130 DataSave.push($(this).val()); 131 }); 132 $(Source[i]).each(function(){ 133 SourceSave.push($(this).val()); 134 }); 135 $(Measure[i]).each(function(){ 136 MeasureSave.push($(this).val()); 137 }); 138 } 139 if(checks == 0) 140 { 141 $.ajax({ 142 type: "POST", 143 cache: false, 144 url: "Transaction/update.php", 145 data: "Time="+TimeSave+'&Source='+SourceSave+'&measure='+MeasureSave+'&Data='+DataSave+'&Date='+year+'-'+month+'-'+day, 146 success: function(data) { 147 alert('Successfully updated ! '+year+'-'+month+'-'+day); 148 } 149 }); 150 } 151 else 152 { 153 154 alert("Please fill all the details!"); 155 } 156 }*/
Note:
See TracChangeset
for help on using the changeset viewer.