- Timestamp:
- 06/23/13 09:57:05 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/function/SplitDelete.php
r16894 r16895 27 27 $timestamp2 = date('Y-m-d',$timestamp); 28 28 $date_time = date('H:i',$timestamp); 29 //$time_new = $date_time->format('H:i:s')29 30 30 if($days == $timestamp2) 31 31 { … … 33 33 cnt++; 34 34 35 <<<<<<< .mine36 35 $('#save').hide(); 37 36 $('#update').show(); … … 39 38 var div= document.createElement("div"); 40 39 div.setAttribute('id','TableHolder'); 41 =======42 $('#save').hide();43 $('#update').show();44 var div= document.createElement("div");45 div.setAttribute('id','TableHolder');46 >>>>>>> .r1689347 40 var table = document.createElement("table"); 48 41 table.setAttribute('id',"table"+cnt); … … 70 63 71 64 72 <<<<<<< .mine73 65 74 66 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 >>>>>>> .r1689378 67 79 68 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 109 98 getTableId =get; 110 99 111 <<<<<<< .mine112 100 113 101 name="name"; value=""; meas = "name"; meas2 = "time"; //getTableId = $(this).attr('name'); 114 102 split1(); }else{ alert("please enter value for time to add measurement"); } 115 103 116 =======117 118 name="name"; value=""; meas = "name"; meas2 = "time"; // getTableId = $(this).attr('name');119 split1(); }else{ alert("please enter value for time to add measurement"); }120 121 >>>>>>> .r16893122 104 123 105 } … … 198 180 td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;"); 199 181 td4.appendChild( 200 <<<<<<< .mine201 =======202 button = document.createElement('input'),203 button.setAttribute("type",'button'),204 button.setAttribute('id','btnSplit'),205 button.setAttribute('value','Split'),206 button.setAttribute('name','#table'+cnt),207 button.onclick= function()208 {209 210 if($('#Time').val() != ""){ var splitting = $('#Time').val().split(':'); var add = 30;211 212 213 var limit = 60;214 var adds =0;215 adds = (Number(splitting[1]) + Number(add));216 if(adds >= limit){217 adds = Number(adds) - Number(limit);218 timeValue =pad(Number(splitting[0])+1,2)+':'+ pad(adds,2);219 220 }else{221 222 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);223 }224 function pad(number, length) {225 226 var str = '' + number;227 while (str.length < length) {228 str = '0' + str;229 }230 231 return str;232 233 };234 235 236 name="name"; value="";237 meas = "name"; meas2 = "time";238 getTableId = $(this).attr('name');239 split1();240 }else{ alert("please enter value for time to add measurement"); }241 242 243 244 }245 );246 td4.appendChild(247 >>>>>>> .r16893248 182 button=document.createElement('input'), 249 183 button.setAttribute('type','button'), … … 299 233 button.setAttribute('name','#table2'), 300 234 button.onclick=function(){ 301 <<<<<<< .mine302 235 var aa; 303 236 $('div#TableHolder #table2 #Time').each(function(){ … … 305 238 }); 306 239 if(aa != ""){ var splitting =aa.split(':'); var add = 01; 307 =======308 var aa;309 $('div#TableHolder #table2 #Time').each(function(){310 aa = $(this).val();311 });312 if(aa != ""){ var splitting =aa.split(':'); var add = 01;313 >>>>>>> .r16893314 240 315 241 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 419 345 420 346 td4.appendChild( 421 <<<<<<< .mine422 =======423 button = document.createElement('input'),424 button.setAttribute("type",'button'),425 button.setAttribute('id','btnSplit'),426 button.setAttribute('value','Split'),427 button.setAttribute('name','#table2'),428 button.onclick= function()429 {430 var aa;431 $('div#TableHolder #table2 #Time').each(function(){432 aa = $(this).val();433 });434 if(aa != ""){ var splitting = aa.split(':'); var add = 30; var limit = 60;435 var adds =0;436 adds = (Number(splitting[1]) + Number(add));437 if(adds >= limit){438 adds = Number(adds) - Number(limit);439 timeValue =pad(Number(splitting[0])+1,2)+':'+ pad(adds,2);440 441 }else{442 443 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);444 }445 function pad(number, length) {446 447 var str = '' + number;448 while (str.length < length) {449 str = '0' + str;450 }451 452 return str;453 454 }455 456 meas = "name"; meas2 = "time"; getTableId = $(this).attr('name');457 split2(); }else{ alert("please enter value for time to add measurement"); }458 459 }460 );461 td4.appendChild(462 >>>>>>> .r16893463 347 button=document.createElement('input'), 464 348 button.setAttribute('type','button'), … … 478 362 tr.appendChild(td4); 479 363 table.appendChild(tr); 480 <<<<<<< .mine481 364 div.appendChild(table); 482 365 $('#TableH1').append(div); … … 484 367 var div= document.createElement("div"); 485 368 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 >>>>>>> .r16893493 369 var table = document.createElement("table"); 494 370 table.setAttribute('id',"table1"); … … 514 390 button.setAttribute('name','#table1'), 515 391 button.onclick=function(){ 516 <<<<<<< .mine517 392 var aa; 518 393 $('div#TableHolder #table2 #Time').each(function(){ … … 520 395 }); 521 396 if(aa !='') { var splitting =aa.split(':'); var add = 01; 522 =======523 var aa;524 $('div#TableHolder #table1 #Time').each(function(){525 aa = $(this).val();526 });527 528 if(aa != ""){ var splitting = aa.split(':'); var add = 01;529 >>>>>>> .r16893530 397 531 398 timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; … … 540 407 return str; 541 408 542 <<<<<<< .mine543 409 }; 544 410 … … 562 428 name="name"; value=""; meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name'); 563 429 split2(); }else{ alert("please enter value for time to add measurement"); } 564 =======565 };566 567 568 var s = 0; var get;569 570 $("table").each(function() {571 if($(this).attr("name")=='#table1'){572 get = "#"+$(this).attr("id");573 574 s =1;575 }else{576 if(s==0){577 get = '#table'+cnt;578 }579 }580 });581 getTableId =get;582 >>>>>>> .r16893583 584 585 name="name"; value=""; meas = "class"; meas2 = "time"; //getTableId = $(this).attr('name');586 split2(); }else{ alert("please enter value for time to add measurement"); }587 430 588 431 … … 640 483 button.setAttribute('name','#table1'), 641 484 button.onclick=function(){ 642 <<<<<<< .mine643 485 $('div#TableHolder #table1 #Time').each(function(){ 644 486 aa = $(this).val(); … … 646 488 647 489 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 =======649 var aa;650 $('div#TableHolder #table1 #Time').each(function(){651 aa = $(this).val();652 });653 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 >>>>>>> .r16893656 490 657 491 … … 670 504 671 505 td4.appendChild( 672 <<<<<<< .mine673 =======674 button = document.createElement('input'),675 button.setAttribute("type",'button'),676 button.setAttribute('id','btnSplit'),677 button.setAttribute('value','Split'),678 button.setAttribute('name','#table1'),679 button.onclick= function()680 {681 var aa;682 $('div#TableHolder #table1 #Time').each(function(){683 aa = $(this).val();684 });685 if(aa != ""){ var splitting = aa.split(':'); var add = 30;686 687 var limit = 60;688 var adds =0;689 adds = (Number(splitting[1]) + Number(add));690 if(adds >= limit){691 adds = Number(adds) - Number(limit);692 timeValue =pad(Number(splitting[0])+1,2)+':'+ pad(adds,2);693 694 }else{695 696 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);697 }698 function pad(number, length) {699 700 var str = '' + number;701 while (str.length < length) {702 str = '0' + str;703 }704 705 return str;706 707 }708 709 710 name="name"; value="";711 712 meas = "class"; meas2 = "time";713 714 getTableId = $(this).attr('name');715 split2(); }else{ alert("please enter value for time to add measurement"); }716 717 }718 );719 td4.appendChild(720 >>>>>>> .r16893721 506 button=document.createElement('input'), 722 507 button.setAttribute('type','button'), … … 742 527 } 743 528 var meas; 744 <<<<<<< .mine745 529 var timeValue; 746 530 var pad; 747 531 if(cnt==0){ cnt=2; } 748 532 function split2() 749 =======750 var timeValue;751 var pad;752 if(cnt==0){ cnt=2; }753 function split2()754 >>>>>>> .r16893755 533 { 756 534 … … 811 589 } 812 590 813 <<<<<<< .mine814 591 var s = 0; var get; 815 592 var nn; … … 831 608 meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); } 832 609 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');851 meas = "class"; meas2 = "time"; getTableId = get; split1(); }else{ alert("please enter value for time to add measurement"); }852 853 >>>>>>> .r16893854 610 855 611 } … … 879 635 880 636 ); 881 <<<<<<< .mine882 637 var td1=document.createElement('td'); 883 638 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;"); … … 885 640 measurementcbo= document.createElement('select'), 886 641 measurementcbo.setAttribute('id','measurement'), 887 =======888 var td1=document.createElement('td');889 td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");890 td1.appendChild(891 measurementcbo= document.createElement('select'),892 measurementcbo.setAttribute('id','measurement'),893 >>>>>>> .r16893894 642 <?php 895 643 $measure=mysql_query("SELECT*FROM measurement"); … … 950 698 951 699 td4.appendChild( 952 <<<<<<< .mine953 =======954 button = document.createElement('input'),955 button.setAttribute("type",'button'),956 button.setAttribute('id','btnSplit'),957 button.setAttribute('value','Split'),958 button.setAttribute('name','#table'+cnt),959 button.onclick=function(){960 var aa;961 $('div#TableHolder #table'+cnt+' #Time').each(function(){962 aa = $(this).val();963 });964 if(aa != ""){ var splitting = aa.split(':'); var add = 30;965 966 var limit = 60;967 var adds =0;968 adds = (Number(splitting[1]) + Number(add));969 if(adds >= limit){970 adds = Number(adds) - Number(limit);971 timeValue =pad(Number(splitting[0])+1,2)+':'+ pad(adds,2);972 973 }else{974 975 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);976 }977 function pad(number, length) {978 979 var str = '' + number;980 while (str.length < length) {981 str = '0' + str;982 }983 984 return str;985 986 }987 988 meas = "class"; meas2 = "time";989 990 991 getTableId = $(this).attr('name');992 split2(); }else{ alert("please enter value for time to add measurement"); }993 }994 );995 td4.appendChild(996 >>>>>>> .r16893997 700 button=document.createElement('input'), 998 701 button.setAttribute('type','button'), … … 1146 849 button.setAttribute('name','#table'+cnt), 1147 850 button.onclick=function(){ 1148 <<<<<<< .mine1149 851 1150 852 if($('#Time').val() != ""){ timeValue = $('#Time').val(); 1151 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"); } 1152 =======1153 var aa;1154 $('div#TableHolder #table'+cnt+' #Time').each(function(){1155 aa = $(this).val();1156 });1157 if(aa != ""){ timeValue = aa;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 >>>>>>> .r168931160 854 1161 855 … … 1175 869 1176 870 td4.appendChild( 1177 <<<<<<< .mine1178 =======1179 button = document.createElement('input'),1180 button.setAttribute("type",'button'),1181 button.setAttribute('id','btnSplit'),1182 button.setAttribute('value','Split'),1183 button.setAttribute('name','#table'+cnt),1184 button.onclick=function(){1185 var aa;1186 $('div#TableHolder #table'+cnt+' #Time').each(function(){1187 aa = $(this).val();1188 });1189 if(aa != ""){ var splitting = aa.split(':'); var add = 30;1190 1191 var limit = 60;1192 var adds =0;1193 adds = (Number(splitting[1]) + Number(add));1194 if(adds >= limit){1195 adds = Number(adds) - Number(limit);1196 timeValue =pad(Number(splitting[0])+1,2)+':'+ pad(adds,2);1197 1198 }else{1199 1200 timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2);1201 }1202 function pad(number, length) {1203 1204 var str = '' + number;1205 while (str.length < length) {1206 str = '0' + str;1207 }1208 1209 return str;1210 1211 }1212 1213 meas = "name"; meas2 = "time"; getTableId = $(this).attr('name'); split2(); }else{ alert("please enter value for time to add measurement"); }1214 }1215 );1216 td4.appendChild(1217 >>>>>>> .r168931218 871 button=document.createElement('input'), 1219 872 button.setAttribute('type','button'),
Note:
See TracChangeset
for help on using the changeset viewer.