Changeset 16894 for schedule/function
- Timestamp:
- 06/23/13 09:54:35 (12 years ago)
- Location:
- schedule/function
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/function/SplitDelete.php
r16873 r16894 33 33 cnt++; 34 34 35 <<<<<<< .mine 36 $('#save').hide(); 37 $('#update').show(); 38 39 var div= document.createElement("div"); 40 div.setAttribute('id','TableHolder'); 41 ======= 35 42 $('#save').hide(); 36 43 $('#update').show(); 37 44 var div= document.createElement("div"); 38 45 div.setAttribute('id','TableHolder'); 46 >>>>>>> .r16893 39 47 var table = document.createElement("table"); 40 48 table.setAttribute('id',"table"+cnt); … … 62 70 63 71 72 <<<<<<< .mine 73 64 74 if($('#Time').val() != ""){ var splitting = $('#Time').val().split(':'); var add = 01; 75 ======= 76 if($('#Time').val() != ""){ var splitting = $('#Time').val().split(':'); var add = 01; 77 >>>>>>> .r16893 65 78 66 79 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 96 109 getTableId =get; 97 110 111 <<<<<<< .mine 112 113 name="name"; value=""; meas = "name"; meas2 = "time"; //getTableId = $(this).attr('name'); 114 split1(); }else{ alert("please enter value for time to add measurement"); } 115 116 ======= 98 117 99 118 name="name"; value=""; meas = "name"; meas2 = "time"; // getTableId = $(this).attr('name'); 100 119 split1(); }else{ alert("please enter value for time to add measurement"); } 101 120 121 >>>>>>> .r16893 102 122 103 123 } … … 178 198 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 179 199 td4.appendChild( 200 <<<<<<< .mine 201 ======= 180 202 button = document.createElement('input'), 181 203 button.setAttribute("type",'button'), … … 223 245 ); 224 246 td4.appendChild( 247 >>>>>>> .r16893 225 248 button=document.createElement('input'), 226 249 button.setAttribute('type','button'), … … 276 299 button.setAttribute('name','#table2'), 277 300 button.onclick=function(){ 301 <<<<<<< .mine 302 var aa; 303 $('div#TableHolder #table2 #Time').each(function(){ 304 aa = $(this).val(); 305 }); 306 if(aa != ""){ var splitting =aa.split(':'); var add = 01; 307 ======= 278 308 var aa; 279 309 $('div#TableHolder #table2 #Time').each(function(){ … … 281 311 }); 282 312 if(aa != ""){ var splitting =aa.split(':'); var add = 01; 313 >>>>>>> .r16893 283 314 284 315 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 386 417 var td4=document.createElement('td'); 387 418 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 419 388 420 td4.appendChild( 421 <<<<<<< .mine 422 ======= 389 423 button = document.createElement('input'), 390 424 button.setAttribute("type",'button'), … … 426 460 ); 427 461 td4.appendChild( 462 >>>>>>> .r16893 428 463 button=document.createElement('input'), 429 464 button.setAttribute('type','button'), … … 443 478 tr.appendChild(td4); 444 479 table.appendChild(tr); 480 <<<<<<< .mine 445 481 div.appendChild(table); 446 482 $('#TableH1').append(div); 447 483 448 484 var div= document.createElement("div"); 449 485 div.setAttribute('id','TableHolder'); 486 ======= 487 div.appendChild(table); 488 $('#TableH1').append(div); 489 490 var div= document.createElement("div"); 491 div.setAttribute('id','TableHolder'); 492 >>>>>>> .r16893 450 493 var table = document.createElement("table"); 451 494 table.setAttribute('id',"table1"); … … 471 514 button.setAttribute('name','#table1'), 472 515 button.onclick=function(){ 516 <<<<<<< .mine 517 var aa; 518 $('div#TableHolder #table2 #Time').each(function(){ 519 aa = $(this).val(); 520 }); 521 if(aa !='') { var splitting =aa.split(':'); var add = 01; 522 ======= 473 523 var aa; 474 524 $('div#TableHolder #table1 #Time').each(function(){ … … 477 527 478 528 if(aa != ""){ var splitting = aa.split(':'); var add = 01; 529 >>>>>>> .r16893 479 530 480 531 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 489 540 return str; 490 541 542 <<<<<<< .mine 543 }; 544 545 546 var s = 0; var get; 547 548 $("table").each(function() { 549 if($(this).attr("name")=='#table2'){ 550 get = "#"+$(this).attr("id"); 551 552 s =1; 553 }else{ 554 if(s==0){ 555 get = '#table'+cnt; 556 } 557 } 558 }); 559 getTableId =get; 560 name="name"; value=""; 561 562 name="name"; value=""; meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name'); 563 split2(); }else{ alert("please enter value for time to add measurement"); } 564 ======= 491 565 }; 492 566 … … 506 580 }); 507 581 getTableId =get; 582 >>>>>>> .r16893 508 583 509 584 … … 565 640 button.setAttribute('name','#table1'), 566 641 button.onclick=function(){ 642 <<<<<<< .mine 643 $('div#TableHolder #table1 #Time').each(function(){ 644 aa = $(this).val(); 645 }); 646 647 if(aa != ""){ timeValue = aa; name="name"; value="#table1"; meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split2(); }else{ alert("please enter value for time to add measurement"); } 648 ======= 567 649 var aa; 568 650 $('div#TableHolder #table1 #Time').each(function(){ … … 571 653 572 654 if(aa != ""){ timeValue = aa; name="name"; value="#table1"; meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split2(); }else{ alert("please enter value for time to add measurement"); } 655 >>>>>>> .r16893 573 656 574 657 … … 585 668 var td4=document.createElement('td'); 586 669 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 670 587 671 td4.appendChild( 672 <<<<<<< .mine 673 ======= 588 674 button = document.createElement('input'), 589 675 button.setAttribute("type",'button'), … … 632 718 ); 633 719 td4.appendChild( 720 >>>>>>> .r16893 634 721 button=document.createElement('input'), 635 722 button.setAttribute('type','button'), … … 655 742 } 656 743 var meas; 744 <<<<<<< .mine 745 var timeValue; 746 var pad; 747 if(cnt==0){ cnt=2; } 748 function split2() 749 ======= 657 750 var timeValue; 658 751 var pad; 659 752 if(cnt==0){ cnt=2; } 660 753 function split2() 754 >>>>>>> .r16893 661 755 { 662 756 … … 703 797 if(aa != ""){var splitting = aa.split(':'); var add = 01; 704 798 799 705 800 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 706 801 … … 716 811 } 717 812 813 <<<<<<< .mine 718 814 var s = 0; var get; 719 815 var nn; … … 733 829 734 830 name="name"; value=$(this).attr('name'); 831 meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); } 832 833 ======= 834 var s = 0; var get; 835 var nn; 836 nn = $(this).attr('name'); 837 $("table").each(function() { 838 if($(this).attr("name")==nn){ 839 840 get = "#"+$(this).attr("id"); 841 //get = $(this).attr("name"); 842 s =1; 843 }else{ 844 if(s==0){ 845 get = '#table'+cnt; 846 } 847 } 848 }); 849 850 name="name"; value=$(this).attr('name'); 735 851 meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); } 736 852 853 >>>>>>> .r16893 737 854 738 855 } … … 762 879 763 880 ); 881 <<<<<<< .mine 882 var td1=document.createElement('td'); 883 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); 884 td1.appendChild( 885 measurementcbo= document.createElement('select'), 886 measurementcbo.setAttribute('id','measurement'), 887 ======= 764 888 var td1=document.createElement('td'); 765 889 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); … … 767 891 measurementcbo= document.createElement('select'), 768 892 measurementcbo.setAttribute('id','measurement'), 893 >>>>>>> .r16893 769 894 <?php 770 895 $measure=mysql_query("SELECT*FROM measurement"); … … 772 897 { 773 898 ?> 774 775 776 777 778 899 measurementcbo.appendChild( 900 option=document.createElement('option'), 901 option.setAttribute('value','<?php echo $rowmeasure['fMeasurementKey']; ?>'), 902 option.setAttribute('selected',true), 903 option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>")) 779 904 ), 780 905 <?php … … 823 948 var td4=document.createElement('td'); 824 949 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 950 825 951 td4.appendChild( 952 <<<<<<< .mine 953 ======= 826 954 button = document.createElement('input'), 827 955 button.setAttribute("type",'button'), … … 866 994 ); 867 995 td4.appendChild( 996 >>>>>>> .r16893 868 997 button=document.createElement('input'), 869 998 button.setAttribute('type','button'), … … 1017 1146 button.setAttribute('name','#table'+cnt), 1018 1147 button.onclick=function(){ 1148 <<<<<<< .mine 1149 1150 if($('#Time').val() != ""){ timeValue = $('#Time').val(); 1151 name = "name"; value = $(this).attr('name'); meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split1(); }else{ alert("please enter value for time to add measurement"); } 1152 ======= 1019 1153 var aa; 1020 1154 $('div#TableHolder #table'+cnt+' #Time').each(function(){ … … 1023 1157 if(aa != ""){ timeValue = aa; 1024 1158 name = "name"; value = $(this).attr('name'); meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split1(); }else{ alert("please enter value for time to add measurement"); } 1159 >>>>>>> .r16893 1025 1160 1026 1161 … … 1038 1173 var td4=document.createElement('td'); 1039 1174 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 1175 1040 1176 td4.appendChild( 1177 <<<<<<< .mine 1178 ======= 1041 1179 button = document.createElement('input'), 1042 1180 button.setAttribute("type",'button'), … … 1077 1215 ); 1078 1216 td4.appendChild( 1217 >>>>>>> .r16893 1079 1218 button=document.createElement('input'), 1080 1219 button.setAttribute('type','button'), -
schedule/function/button.php
r16739 r16894 1 <?php 2 include '../include/factdb.php'; 3 $x = 0; 4 $day = $_GET['days']; 5 $days = Date('Y-m-d',strtotime($day)); 6 7 $fetch = mysql_query("SELECT * FROM schedule") or die(mysql_error()); 8 9 while($rows = mysql_fetch_array($fetch)){ 10 $timestamp=strtotime($rows['fLastUpdate']); 11 $timestamp2 = date('Y-m-d',$timestamp); 12 $date_time = date('H:i',$timestamp); 13 //$time_new = $date_time->format('H:i:s') 14 if($days == $timestamp2){ 15 $x++; 16 17 } 18 19 } 20 21 22 if($x==0){ 23 24 ?><input type="button" id="save" value="SAVE" class="button" title="Click to save"> <input type="button" id="LoadPrev" value="Load Previous Night" class="button" title="Click to load previous night"> 25 <?php 26 27 }else{ 28 ?><input type="button" id="update" value="UPDATE" class="button" title="Click to save"> <input type="button" id="LoadPrev" value="Load Previous Night" class="button" title="Click to load previous night"> 29 <?php 30 31 } 32 33 ?> 1 <input type="button" id="save" value="SAVE" class="button" title="Click to save"> 2 3 <input type="button" id="LoadPrev" value="Load Previous Night" class="button" title="Click to load previous night"> 34 4 35 5 -
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.