Changeset 16899
- Timestamp:
- 06/25/13 02:46:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/function/SplitDelete.php
r16895 r16899 213 213 table.setAttribute('id',"table2"); 214 214 table.setAttribute('width','100%'); 215 table.setAttribute('name','#table2'); 215 216 var tr = document.createElement('tr'); 216 217 tr.setAttribute('id',''); … … 224 225 input.setAttribute("max","24"), 225 226 input.setAttribute("min","1"), 226 input.setAttribute("required",true) 227 input.setAttribute("required",true), 228 input.onkeyup = function(){ 229 230 231 232 233 if($('div#TableHolder #table2 #Time').val() <= 0 || $('div#TableHolder #table1 #Time').val() <=0){ 234 235 236 }else{ 237 if($('div#TableHolder #table1 #Time').val() <= $('div#TableHolder #table2 #Time').val()){ 238 alert('2nd row must be greater than 1st'); 239 } 240 } 241 242 243 244 245 246 247 } 248 249 227 250 ); 228 251 td3.appendChild( … … 233 256 button.setAttribute('name','#table2'), 234 257 button.onclick=function(){ 235 var aa;258 var aa; 236 259 $('div#TableHolder #table2 #Time').each(function(){ 237 260 aa = $(this).val(); 238 261 }); 262 239 263 if(aa != ""){ var splitting =aa.split(':'); var add = 01; 240 264 … … 254 278 var s = 0; var get; 255 279 256 $("table").each(function() { 257 if($(this).attr("name")=='#table2'){ 258 get = "#"+$(this).attr("id"); 259 260 s =1; 261 }else{ 262 if(s==0){ 263 get = '#table'+cnt; 264 } 265 } 266 }); 280 $("table").each(function() { if($(this).attr("name")=='#table2'){ get = "#"+$(this).attr("id"); s =1; }else{ if(s==0){ get = '#table'+cnt; } 281 } 282 }); 267 283 getTableId =get; 268 name="name"; value ="";269 name="name"; value="";meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name');284 name="name"; value = '#table2'; 285 meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name'); 270 286 split2(); }else{ alert("please enter value for time to add measurement"); } 271 287 … … 381 397 input.setAttribute("max","24"), 382 398 input.setAttribute("min","1"), 383 input.setAttribute("required",true) 399 input.setAttribute("required",true), 400 input.onkeyup = function(){ 401 402 403 404 405 406 if($('div#TableHolder #table2 #Time').val() <= 0 || $('div#TableHolder #table1 #Time').val() <=0){ 407 408 409 }else{ 410 if($('div#TableHolder #table1 #Time').val() <= $('div#TableHolder #table2 #Time').val()){ 411 alert(' row must be greater than previous'); 412 return false; 413 } 414 } 415 416 417 418 419 420 421 } 384 422 ); 385 423 td3.appendChild( … … 391 429 button.onclick=function(){ 392 430 var aa; 393 $('div#TableHolder #table 2#Time').each(function(){431 $('div#TableHolder #table1 #Time').each(function(){ 394 432 aa = $(this).val(); 395 433 }); 396 if(aa !='') { var splitting 434 if(aa !='') { var splitting =aa.split(':'); var add = 01; 397 435 398 436 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 413 451 414 452 $("table").each(function() { 415 if($(this).attr("name")=='#table 2'){453 if($(this).attr("name")=='#table1'){ 416 454 get = "#"+$(this).attr("id"); 417 455 … … 419 457 }else{ 420 458 if(s==0){ 421 get = '#table '+cnt;459 get = '#table1'; 422 460 } 423 461 } 424 462 }); 425 463 getTableId =get; 426 name="name"; value ="";427 428 name="name"; value="";meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name');464 name="name"; value = '#table1'; 465 466 meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name'); 429 467 split2(); }else{ alert("please enter value for time to add measurement"); } 430 468 … … 483 521 button.setAttribute('name','#table1'), 484 522 button.onclick=function(){ 523 var aa; 485 524 $('div#TableHolder #table1 #Time').each(function(){ 486 525 aa = $(this).val(); … … 532 571 function split2() 533 572 { 534 573 535 574 cnt++; 536 575 var div= document.createElement("div"); … … 553 592 input.setAttribute("id","Time"), 554 593 input.setAttribute("max","24"), 555 input.setAttribute("min", "1"),594 input.setAttribute("min",'1'), 556 595 input.setAttribute("required",true), 557 596 input.setAttribute(meas,meas2), … … 573 612 aa = $(this).val(); 574 613 }); 614 bb = $(this).closest('table').attr('name'); 575 615 if(aa != ""){var splitting = aa.split(':'); var add = 01; 576 616 … … 591 631 var s = 0; var get; 592 632 var nn; 593 nn = $(this).attr('name');633 nn = bb; 594 634 $("table").each(function() { 595 635 if($(this).attr("name")==nn){ … … 605 645 }); 606 646 607 name="name"; value =$(this).attr('name');647 name="name"; value = bb; 608 648 meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); } 609 649 … … 664 704 button.onclick=function(){ 665 705 var aa; 706 var bb; 666 707 $('div#TableHolder #table'+cnt+' #Time').each(function(){ 667 708 aa = $(this).val(); 668 709 }); 710 bb = $(this).closest('table').attr('name'); 669 711 if(aa != "") 670 712 { 671 713 name = "name"; 672 value = "#table"+cnt; 714 value = bb; 715 // alert('2'+bb); 673 716 timeValue = aa; 674 717 meas = "hidden"; … … 723 766 function split1() 724 767 { 725 768 726 769 cnt++; 727 770 var div= document.createElement("div"); … … 743 786 input.setAttribute("id","Time"), 744 787 input.setAttribute("max","24"), 745 input.setAttribute("min", "1"),788 input.setAttribute("min",'1'), 746 789 input.setAttribute("required",true), 747 790 input.setAttribute(meas,meas2), 748 791 input.setAttribute("value",timeValue) 792 749 793 ); 750 794 td3.appendChild( … … 761 805 aa = $(this).val(); 762 806 }); 807 bb = $(this).closest('table').attr('name'); 763 808 if(aa != ""){ var splitting = aa.split(':'); var add = 01; 764 809 … … 777 822 var s = 0; var get; 778 823 var nn; 779 nn = $(this).attr('name');824 nn = bb; 780 825 $("table").each(function() { 781 826 if($(this).attr("name")==nn){ … … 791 836 }); 792 837 793 name="name"; value= ""; meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); }838 name="name"; value=bb; meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); } 794 839 795 840 … … 850 895 button.onclick=function(){ 851 896 852 if($('#Time').val() != ""){ timeValue = $('#Time').val(); 853 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"); } 854 855 897 var aa; 898 var bb; 899 $('div#TableHolder #table'+cnt+' #Time').each(function(){ 900 aa = $(this).val(); 901 }); 902 903 bb = $(this).closest('table').attr('name'); 904 905 if(aa != "") 906 { 907 name = "name"; 908 value = bb; 909 //alert(value); 910 timeValue = aa; 911 meas = "hidden"; 912 meas2 = true; 913 getTableId = $(this).attr('name'); 914 split1(); 915 } 916 else 917 { 918 alert("please enter value for time to add measurement"); 919 } 856 920 } 857 921 ); … … 889 953 } 890 954 955 //$('div#TableHolder #table'+cnt+' #Time') 956 957 958 // $('div#TableHolder table #Time').keyup(function(){ 959 960 // if($('div#TableHolder #table2 #Time').val() <= 0 || $('div#TableHolder #table1 #Time').val() <=0){ 961 962 963 // }else{ 964 // if($('div#TableHolder #table1 #Time').val() <= $('div#TableHolder #table2 #Time').val()){ 965 // alert(cnt); 966 // } 967 // } 968 // }); 969 970 971 972 973 891 974 }); 892 975 </script>
Note:
See TracChangeset
for help on using the changeset viewer.