Changeset 16918 for schedule/function/SplitDelete.php
- Timestamp:
- 06/26/13 20:30:01 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/function/SplitDelete.php
r16913 r16918 1 1 <script type="text/javascript"> 2 2 $(document).ready(function(){ 3 var name ='';4 var value ='';3 var name; 4 var value; 5 5 var timeValue; 6 6 var meas; 7 7 var meas2; 8 var x=0; 9 var measurement=0; 8 10 var getTableId; 9 11 var is=0; … … 282 284 getTableId =get; 283 285 name="name"; value = '#table2'; 286 measurement = 0; 284 287 meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name'); 285 288 split2(); }else{ alert("please enter value for time to add measurement"); } … … 343 346 aa = $(this).val(); 344 347 }); 345 if(aa != ""){ timeValue =aa; name="name"; value=$(this).attr('name'); meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split2(); }else{ alert("please enter value for time to add measurement"); }348 if(aa != ""){ timeValue =aa; name="name"; value=$(this).attr('name'); measurement = 1; meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split2(); }else{ alert("please enter value for time to add measurement"); } 346 349 347 350 … … 462 465 getTableId =get; 463 466 name="name"; value = '#table1'; 464 467 measurement = 0; 465 468 meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name'); 466 469 split2(); }else{ alert("please enter value for time to add measurement"); } … … 525 528 }); 526 529 527 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"); }530 if(aa != ""){ timeValue = aa; name="name"; value="#table1"; measurement=1; meas = "hidden"; meas2 = true; getTableId = $(this).attr('name'); split2(); }else{ alert("please enter value for time to add measurement"); } 528 531 529 532 … … 577 580 table.setAttribute('id',"table"+cnt); 578 581 table.setAttribute('width','100%'); 579 table.setAttribute(name,value);582 if(measurement==1){ table.setAttribute(name,value); } 580 583 var tr = document.createElement('tr'); 581 584 tr.setAttribute('id',''); … … 604 607 button.setAttribute('id','btnAddTime'), 605 608 button.setAttribute(meas,meas2), 606 button.setAttribute('name',' #table'+cnt),609 button.setAttribute('name','table'+cnt), 607 610 608 611 button.onclick=function(){ … … 611 614 aa = $(this).val(); 612 615 }); 613 bb = $(this).closest('table').attr('name'); 616 617 if(value == 'undefined'){ bb = $(this).closest('table').attr('name'); }else{ 618 bb = value; } 614 619 if(aa != ""){var splitting = aa.split(':'); var add = 01; 615 620 … … 630 635 var s = 0; var get; 631 636 var nn; 632 nn = bb;637 nn = '#'+$(this).attr("name"); 633 638 $("table").each(function() { 634 639 if($(this).attr("name")==nn){ … … 645 650 646 651 name="name"; value = bb; 647 meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); }652 meas = "class"; meas2 = "time"; getTableId = get; measurement =0; split1(); }else{ alert("please enter value for time to add measurement"); } 648 653 649 654 … … 702 707 button.setAttribute('name','#table'+cnt), 703 708 button.onclick=function(){ 704 var aa ;705 var bb ;709 var aa,cc=0; 710 var bb,dd; 706 711 $('div#TableHolder #table'+cnt+' #Time').each(function(){ 707 712 aa = $(this).val(); 713 714 715 708 716 }); 709 bb = $(this).closest('table').attr('name'); 717 dd= $(this).attr('name'); 718 //alert(dd); 719 if($('div#TableHolder '+dd+' #Time').is(':visible')){ 720 cc=0; 721 //alert(cc); 722 }else{ 723 cc=1; 724 } 725 //alert(value); 726 x = 1; 727 if(meas2 == 'time' && measurement == 0 && cc != 1){ bb = '#'+$(this).closest('table').attr('id'); }else{ 728 bb = value; } 710 729 if(aa != "") 711 730 { … … 717 736 meas2 = true; 718 737 getTableId = $(this).attr('name'); 738 //alert(getTableId); 739 measurement = 1; 719 740 split1(); 720 741 } … … 772 793 table.setAttribute('id',"table"+cnt); 773 794 table.setAttribute('width','100%'); 774 table.setAttribute(name,value);795 if(measurement==1){ table.setAttribute(name,value); } 775 796 var tr = document.createElement('tr'); 776 797 tr.setAttribute('id',''); … … 797 818 button.setAttribute('id','btnAddTime'), 798 819 button.setAttribute(meas,meas2), 799 button.setAttribute('name',' #table'+cnt),820 button.setAttribute('name','table'+cnt), 800 821 801 822 button.onclick=function(){ … … 804 825 aa = $(this).val(); 805 826 }); 806 bb = $(this).closest('table').attr('name'); 827 if(value == 'undefined'){ bb = $(this).closest('table').attr('name'); }else{ 828 bb = value; } 807 829 if(aa != ""){ var splitting = aa.split(':'); var add = 01; 808 830 … … 835 857 }); 836 858 837 name="name"; value=bb; meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); }859 name="name"; value=bb; measurement=0; meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); } 838 860 839 861 … … 890 912 button.setAttribute('type','button'), 891 913 button.setAttribute('value','[+]'), 892 button.setAttribute('id','btnAddTime '),914 button.setAttribute('id','btnAddTimes'), 893 915 button.setAttribute('name','#table'+cnt), 894 916 button.onclick=function(){ 895 917 896 var aa ;897 var bb ;918 var aa,cc=0; 919 var bb,dd; 898 920 $('div#TableHolder #table'+cnt+' #Time').each(function(){ 899 921 aa = $(this).val(); 922 900 923 }); 901 902 bb = $(this).closest('table').attr('name'); 924 dd= $(this).attr('name'); 925 if($('div#TableHolder '+dd+' #Time').is(':visible')){ 926 cc=0; 927 //alert(cc); 928 }else{ 929 cc=1; 930 } 931 x=1; 932 if(meas2 == 'time' && measurement == 0 && cc!=1){ bb = '#'+$(this).closest('table').attr('id'); }else{ 933 bb = value; } 903 934 904 935 if(aa != "") … … 911 942 meas2 = true; 912 943 getTableId = $(this).attr('name'); 944 measurement =1; 913 945 split1(); 914 946 }
Note:
See TracChangeset
for help on using the changeset viewer.