Ignore:
Timestamp:
06/01/13 02:25:37 (11 years ago)
Author:
tanio
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • schedule/function/SplitDelete.php

    r16507 r16535  
    44var meas;
    55var meas2;
     6var getTableId;
    67 window.cnt=2;
    78        var table = document.createElement("table");
     
    2627                        button.setAttribute('id','btnAddTime'),
    2728                        button.onclick=function(){
     29                       
     30                       
     31                       
    2832                        if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 01;   
    2933
     
    4145                                                }
    4246
    43                          meas = "name"; meas2 = "time";    split1();    }else{   alert("please enter value for time to add measurement");   }
     47                         meas = "name"; meas2 = "time";   getTableId = '#table2'; split1();    }else{   alert("please enter value for time to add measurement");   }
    4448
    4549                               
     
    99103                        button.setAttribute('id','btnAddTime'),
    100104                        button.onclick=function(){
    101                         if($('#Time1').val() != ""){ timeValue = $('#Time1').val();  meas = "hidden"; meas2 = true;   split1();    }else{   alert("please enter value for time to add measurement");   }
     105                        if($('#Time1').val() != ""){ timeValue = $('#Time1').val();  meas = "hidden"; meas2 = true; getTableId = '#table2'; split1();    }else{   alert("please enter value for time to add measurement");   }
    102106
    103107                               
     
    122126                        button.onclick= function()
    123127                        {
    124                          if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 30;   
     128
     129                        if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 30;   
     130
    125131
    126132                        timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);
     
    137143                                                }
    138144
    139                          meas = "name"; meas2 = "time";    split1();    }else{   alert("please enter value for time to add measurement");   }
     145                         meas = "name"; meas2 = "time";  getTableId = '#table2';  split1();    }else{   alert("please enter value for time to add measurement");   }
    140146
    141147                                 
     
    160166                tr.appendChild(td4);
    161167                table.appendChild(tr);
    162                 $('#TableH1').append(table);
     168       
     169                        $('#TableH1').append(table);
     170       
    163171               
    164172               
     
    198206                                                return str;
    199207
    200                                                 }  meas = "name"; meas2 = "time";  split();    }else{   alert("please enter value for time to add measurement");   }
     208                                                }  meas = "name"; meas2 = "time";  getTableId = '#table1'; split();    }else{   alert("please enter value for time to add measurement");   }
    201209
    202210                               
     
    253261                        button.setAttribute('id','btnAddTime'),
    254262                        button.onclick=function(){
    255                         if($('#Time2').val() != ""){ timeValue = $('#Time2').val();  meas = "hidden"; meas2 = true;    split();    }else{   alert("please enter value for time to add measurement");   }
     263                        if($('#Time2').val() != ""){ timeValue = $('#Time2').val();  meas = "hidden"; meas2 = true;  getTableId = '#table1';  split();    }else{   alert("please enter value for time to add measurement");   }
    256264
    257265                               
     
    290298                                                }
    291299
    292                          meas = "name"; meas2 = "time";    split();    }else{   alert("please enter value for time to add measurement");   }
     300                         meas = "name"; meas2 = "time"; getTableId = '#table1';   split();    }else{   alert("please enter value for time to add measurement");   }
    293301                                 
    294302                        }
     
    312320                tr.appendChild(td4);
    313321                table.appendChild(tr);
    314                 $('#TableH').append(table);
     322               
     323                        $('#TableH1').append(table);
     324               
    315325                var meas;
    316326                var timeValue;
     
    318328        function split()
    319329        {
    320         if(cnt <= 10){
     330       
    321331                cnt++;
    322332                var table = document.createElement("table");
     
    362372                                                return str;
    363373
    364                                                 }   meas = "name"; meas2 = "time";    split1();    }else{   alert("please enter value for time to add measurement");   }
     374                                                }   meas = "name"; meas2 = "time";  getTableId = '#table'+cnt;   split1();    }else{   alert("please enter value for time to add measurement");   }
    365375
    366376                               
     
    419429                        button.onclick=function(){
    420430                       
    421                         if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val();  meas = "hidden"; meas2 = true;    split1();    }else{   alert("please enter value for time to add measurement");   }
     431                        if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val();  meas = "hidden"; meas2 = true; getTableId = '#table'+cnt;   split1();    }else{   alert("please enter value for time to add measurement");   }
    422432
    423433                               
     
    456466                                                }
    457467
    458                          meas = "name"; meas2 = "time";    split();    }else{   alert("please enter value for time to add measurement");   }
     468                         meas = "name"; meas2 = "time";  getTableId = '#table'+cnt;  split();    }else{   alert("please enter value for time to add measurement");   }
    459469                                }
    460470                        );
     
    477487                        tr.appendChild(td4);
    478488                        table.appendChild(tr);
    479                         $('#TableH').append(table);
    480         }else{
    481        
    482         alert("  only 10 sources are allowed!   ");
    483        
    484         }
     489       
     490                        $(table).insertAfter($(getTableId));
     491       
     492       
    485493       
    486494        }
    487495        function split1()
    488496        {
    489         if(cnt <= 10){
     497       
    490498                cnt++;
    491499                var table = document.createElement("table");
     
    529537                                                return str;
    530538
    531                                                 }  meas = "name"; meas2 = "time";   split1();    }else{   alert("please enter value for time to add measurement");   }
     539                                                }  meas = "name"; meas2 = "time";   getTableId = '#table'+cnt; split1();    }else{   alert("please enter value for time to add measurement");   }
    532540
    533541                               
     
    587595                        button.onclick=function(){
    588596               
    589                         if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val();  meas = "hidden"; meas2 = true;    split1();    }else{   alert("please enter value for time to add measurement");   }
     597                        if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val();  meas = "hidden"; meas2 = true; getTableId = '#table'+cnt;   split1();    }else{   alert("please enter value for time to add measurement");   }
    590598
    591599                               
     
    623631
    624632                                                }
    625 
    626                          meas = "name"; meas2 = "time";    split();    }else{   alert("please enter value for time to add measurement");   }
     633                               
     634                         meas = "name"; meas2 = "time"; getTableId = '#table'+cnt;    split();    }else{   alert("please enter value for time to add measurement");   }
    627635                                }
    628636                        );
     
    644652                        tr.appendChild(td4);
    645653                        table.appendChild(tr);
    646                         $('#TableH1').append(table);
    647                         }else{
    648        
    649         alert("  only 10 sources are allowed!   ");
    650         }
     654                       
     655                        $(table).insertAfter($(getTableId));
    651656        }
    652657       
Note: See TracChangeset for help on using the changeset viewer.