Ignore:
Timestamp:
05/30/13 20:11:38 (11 years ago)
Author:
tanio
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • schedule/function/SplitDelete.php

    r16422 r16507  
    2626                        button.setAttribute('id','btnAddTime'),
    2727                        button.onclick=function(){
    28                         if($('#Time1').val() != ""){ timeValue = $('#Time1').val();  meas = "disabled"; meas2 = true;    split1();    }else{   alert("please enter value for time to add measurement");   }
     28                        if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 01;   
     29
     30                        timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1];
     31
     32                                                function pad(number, length) {
     33                                   
     34                                                        var str = '' + number;
     35                                                        while (str.length < length) {
     36                                                                str = '0' + str;
     37                                                        }
     38                                   
     39                                                return str;
     40
     41                                                }
     42
     43                         meas = "name"; meas2 = "time";    split1();    }else{   alert("please enter value for time to add measurement");   }
    2944
    3045                               
     
    107122                        button.onclick= function()
    108123                        {
    109                           meas = "name"; meas2 = "time";
    110                                 timeValue = "";
    111                                 split1();
     124                         if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 30;   
     125
     126                        timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);
     127
     128                                                function pad(number, length) {
     129                                   
     130                                                        var str = '' + number;
     131                                                        while (str.length < length) {
     132                                                                str = '0' + str;
     133                                                        }
     134                                   
     135                                                return str;
     136
     137                                                }
     138
     139                         meas = "name"; meas2 = "time";    split1();    }else{   alert("please enter value for time to add measurement");   }
     140
    112141                                 
    113142                               
     
    156185                        button.setAttribute('id','btnAddTime'),
    157186                        button.onclick=function(){
    158                         if($('#Time2').val() != ""){ timeValue = $('#Time2').val();  meas = "disabled"; meas2 = true;    split();    }else{   alert("please enter value for time to add measurement");   }
     187                        if($('#Time2').val() != ""){ var splitting = $('#Time2').val().split(':'); var add = 01;   
     188
     189                        timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1];
     190
     191                                                function pad(number, length) {
     192                                   
     193                                                        var str = '' + number;
     194                                                        while (str.length < length) {
     195                                                                str = '0' + str;
     196                                                        }
     197                                   
     198                                                return str;
     199
     200                                                }  meas = "name"; meas2 = "time";   split();    }else{   alert("please enter value for time to add measurement");   }
    159201
    160202                               
     
    233275                        button.onclick= function()
    234276                        {
    235                                  meas = "name"; meas2 = "time";
    236                                 timeValue = "";
    237                                 split();
     277                                 if($('#Time2').val() != ""){  var splitting = $('#Time2').val().split(':'); var add = 30;   
     278
     279                        timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);
     280
     281                                                function pad(number, length) {
     282                                   
     283                                                        var str = '' + number;
     284                                                        while (str.length < length) {
     285                                                                str = '0' + str;
     286                                                        }
     287                                   
     288                                                return str;
     289
     290                                                }
     291
     292                         meas = "name"; meas2 = "time";    split();    }else{   alert("please enter value for time to add measurement");   }
    238293                                 
    239294                        }
     
    294349                        button.setAttribute(meas,meas2),
    295350                        button.onclick=function(){
    296                         if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val();  meas = "disabled"; meas2 = true;    split1();    }else{   alert("please enter value for time to add measurement");   }
     351                        if($('#Time'+cnt).val() != ""){var splitting = $('#Time'+cnt).val().split(':'); var add = 01;   
     352
     353                        timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1];
     354
     355                                                function pad(number, length) {
     356                                   
     357                                                        var str = '' + number;
     358                                                        while (str.length < length) {
     359                                                                str = '0' + str;
     360                                                        }
     361                                   
     362                                                return str;
     363
     364                                                }   meas = "name"; meas2 = "time";    split1();    }else{   alert("please enter value for time to add measurement");   }
    297365
    298366                               
     
    373441                                button.setAttribute('value','Split'),
    374442                                button.onclick=function(){
    375                                 timeValue = "";
    376                                 meas = "name"; meas2 = "time";
    377                                         split();
     443                                 if($('#Time'+cnt).val() != ""){  var splitting = $('#Time'+cnt).val().split(':'); var add = 30;   
     444
     445                        timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);
     446
     447                                                function pad(number, length) {
     448                                   
     449                                                        var str = '' + number;
     450                                                        while (str.length < length) {
     451                                                                str = '0' + str;
     452                                                        }
     453                                   
     454                                                return str;
     455
     456                                                }
     457
     458                         meas = "name"; meas2 = "time";    split();    }else{   alert("please enter value for time to add measurement");   }
    378459                                }
    379460                        );
     
    435516                        button.setAttribute(meas,meas2),
    436517                        button.onclick=function(){
    437                         if($('#Time'+cnt).val() != ""){ timeValue = $('#Time'+cnt).val();  meas = "disabled"; meas2 = true;    split1();    }else{   alert("please enter value for time to add measurement");   }
     518                        if($('#Time'+cnt).val() != ""){ var splitting = $('#Time'+cnt).val().split(':'); var add = 01;   
     519
     520                        timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1];
     521
     522                                                function pad(number, length) {
     523                                   
     524                                                        var str = '' + number;
     525                                                        while (str.length < length) {
     526                                                                str = '0' + str;
     527                                                        }
     528                                   
     529                                                return str;
     530
     531                                                }  meas = "name"; meas2 = "time";   split1();    }else{   alert("please enter value for time to add measurement");   }
    438532
    439533                               
     
    515609                                button.setAttribute('value','Split'),
    516610                                button.onclick=function(){
    517                                 timeValue = "";
    518                                 meas = "name"; meas2 = "time";
    519                                         split1();
     611                                 if($('#Time'+cnt).val() != ""){  var splitting = $('#Time'+cnt).val().split(':'); var add = 30;   
     612
     613                        timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);
     614
     615                                                function pad(number, length) {
     616                                   
     617                                                        var str = '' + number;
     618                                                        while (str.length < length) {
     619                                                                str = '0' + str;
     620                                                        }
     621                                   
     622                                                return str;
     623
     624                                                }
     625
     626                         meas = "name"; meas2 = "time";    split();    }else{   alert("please enter value for time to add measurement");   }
    520627                                }
    521628                        );
Note: See TracChangeset for help on using the changeset viewer.