- Timestamp:
- 01/16/14 09:20:29 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/control.php
r17510 r17511 3 3 var ctr; 4 4 5 6 7 while(child != null)5 function clearNode(node){ 6 var child = node.childNodes[0]; 7 while(child != null) 8 8 { 9 9 node.removeChild(child); 10 10 child = node.childNodes[0]; 11 } 11 } 12 12 } 13 13 … … 138 138 <?php 139 139 $cnt=0; 140 $day=0;140 $day=0; 141 141 if(isset($_GET['days'])) 142 142 { … … 185 185 var newtd_c1 = document.createElement("td"); 186 186 newtd_c1.setAttribute("width","200"); 187 newtd_c1.setAttribute("align","center"); 187 newtd_c1.setAttribute("align","center"); 188 newtd_c1.setAttribute("valign", "top"); 188 189 newtd_c1.appendChild( 189 190 input_data = document.createElement("input"), … … 289 290 var newtd_c7 = document.createElement("td"); 290 291 newtd_c7.setAttribute("width","115"); 291 newtd_c7.setAttribute("align","center"); 292 newtd_c7.setAttribute("align","center"); 293 newtd_c7.setAttribute("valign", "top"); 292 294 newtd_c7.appendChild( 293 295 input_data = document.createElement("input"), … … 321 323 $cnt5 = 0; 322 324 $cnt = 0; 325 $cntrow = 0; 323 326 //$data = array(); 324 327 //$counter=0; … … 337 340 var list = $(".datalisting").length; 338 341 var newlist = list+1; 339 <?php $cnt++ ?>;342 <?php $cnt++;?> 340 343 341 344 var cctr=$('.dataTable tr').length; … … 346 349 var selection; 347 350 348 var newdiv = document.createElement("div");349 newdiv .setAttribute("id", "list_<?php echo $cnt; ?>");350 newdiv .setAttribute("class","datalisting");351 newdiv .setAttribute("style","margin:5px 0;");351 var newdiv<?php echo $cnt; ?> = document.createElement("div"); 352 newdiv<?php echo $cnt; ?>.setAttribute("id", "list_<?php echo $cnt; ?>"); 353 newdiv<?php echo $cnt; ?>.setAttribute("class","datalisting"); 354 newdiv<?php echo $cnt; ?>.setAttribute("style","margin:5px 0;"); 352 355 353 356 var newtable = document.createElement("table"); … … 369 372 var newtd_c1 = document.createElement("td"); 370 373 newtd_c1.setAttribute("width","200"); 371 newtd_c1.setAttribute("align","center"); 374 newtd_c1.setAttribute("align","center"); 375 newtd_c1.setAttribute("valign", "top"); 372 376 newtd_c1.appendChild( 373 377 input_data = document.createElement("input"), … … 392 396 while($rows = mysql_fetch_array($observations)) 393 397 { 394 ?> 395 396 var newtr<?php echo $cnt; ?> = document.createElement("tr"); 397 newtr<?php echo $cnt; ?>.setAttribute('class','tr'); 398 398 $cntrow++; 399 ?> 400 401 var newtr<?php echo $cntrow; ?> = document.createElement("tr"); 402 newtr<?php echo $cntrow; ?>.setAttribute('class','tr'); 403 399 404 var newtd_c2 = document.createElement("td"); 400 405 newtd_c2.setAttribute("width","138"); … … 428 433 input_data.setAttribute("value","+"), 429 434 input_data.onclick = function(){ 430 return addRow(newtr<?php echo $cnt; ?>);431 435 return addRow(newtr<?php echo $cntrow; ?>); 436 ctr++; 432 437 }); 433 438 var newtd_c3 = document.createElement("td"); … … 474 479 input_data.setAttribute("type","button"), 475 480 input_data.setAttribute("value","Delete"), 476 input_data.onclick = function(){ return clearNode(newtr<?php echo $cnt; ?>); 481 input_data.onclick = function(){ return clearNode(newtr<?php echo $cntrow; ?>); 482 477 483 } 478 484 ); 479 newtr<?php echo $cnt ; ?>.appendChild(newtd_c2);480 newtr<?php echo $cnt ; ?>.appendChild(newtd_c3);481 newtr<?php echo $cnt ; ?>.appendChild(newtd_c4);482 newtr<?php echo $cnt ; ?>.appendChild(newtd_c5);483 newInnertable.appendChild(newtr<?php echo $cnt; ?>);484 485 newtr<?php echo $cntrow; ?>.appendChild(newtd_c2); 486 newtr<?php echo $cntrow; ?>.appendChild(newtd_c3); 487 newtr<?php echo $cntrow; ?>.appendChild(newtd_c4); 488 newtr<?php echo $cntrow; ?>.appendChild(newtd_c5); 489 newInnertable.appendChild(newtr<?php echo $cntrow; ?>); 490 485 491 <?php 486 492 … … 494 500 var newtd_c7 = document.createElement("td"); 495 501 newtd_c7.setAttribute("width","115"); 496 newtd_c7.setAttribute("align","center"); 502 newtd_c7.setAttribute("align","center"); 503 newtd_c7.setAttribute("valign", "top"); 497 504 newtd_c7.appendChild( 498 505 input_data = document.createElement("input"), 499 506 input_data.setAttribute("type","button"), 500 507 input_data.setAttribute("value","Delete Main"), 501 input_data.onclick = function(){ return clearNode(newdiv ); }508 input_data.onclick = function(){ return clearNode(newdiv<?php echo $cnt; ?>); } 502 509 ); 503 510 … … 508 515 newtable.appendChild(newtd_c7); 509 516 510 newdiv .appendChild(newtable);517 newdiv<?php echo $cnt; ?>.appendChild(newtable); 511 518 if(nextrow != null){ 512 519 var doc = document.getElementById(nextrow); 513 $(doc).after(newdiv );520 $(doc).after(newdiv<?php echo $cnt;?>); 514 521 }else{ 515 targetView.appendChild(newdiv );522 targetView.appendChild(newdiv<?php echo $cnt;?>); 516 523 //$(targetView).after(newtr<?php echo $cnt; ?>); 517 524 }
Note:
See TracChangeset
for help on using the changeset viewer.