Changeset 17508
- Timestamp:
- 01/13/14 12:31:03 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/control.php
r17506 r17508 134 134 <?php 135 135 $cnt=0; 136 $day=0; 136 137 if(isset($_GET['days'])) 137 138 { 138 $day = $_GET['days'];139 $day = $_GET['days']; 139 140 } 140 141 else 141 142 { 142 $day =date("Y-m-d");143 $day =date("Y-m-d"); 143 144 } 144 145 // $day=$_GET['days'];146 $days = Date('Y-m-d',strtotime($day));147 145 $prev_time = array(); 148 ?> 146 ?>addRowClone(); 147 149 148 function addRowClone1(nextrow){ 150 149 var targetView = document.getElementById("Data"); … … 154 153 var newlist = list+1; 155 154 var cctr=$('.dataTable tr').length; 156 ctr=cctr+1; 155 ctr=cctr+1; 156 var input_data; 157 var select; 158 var option; 159 var selection; 157 160 var newdiv = document.createElement("div"); 158 161 newdiv.setAttribute("id","list_"+newlist); … … 305 308 306 309 function addRowClone(nextrow){ 307 <?php 308 $fetch = mysql_query("SELECT * FROM schedule WHERE date(fStart) = '$days' ORDER BY fScheduleID AND fMeasurementID ASC") or die(mysql_error()); 310 <?php 311 $fetch = mysql_query("SELECT * FROM schedule WHERE date(fStart) = '$day' ORDER BY fScheduleID ASC, fMeasurementID ASC") or die(mysql_error()); 312 $observationsTime = mysql_query("SELECT DISTINCT fStart FROM schedule WHERE date(fStart) = '$day'"); 309 313 $cnt3=0; 310 314 $cnt2=0; 311 315 $cnt4 = 0; 312 316 $cnt5 = 0; 317 $cnt = 0; 313 318 //$data = array(); 314 319 //$counter=0; 315 while($ rows = mysql_fetch_array($fetch))320 while($times = mysql_fetch_array($observationsTime)) 316 321 { 317 $timestamp=strtotime($rows['fStart']); 322 $timestamp=strtotime($times['fStart']); 323 $actualtime = date('Y-m-d H:i:s', $timestamp); 318 324 $timestamp2 = date('Y-m-d',$timestamp); 319 325 $date_time = date('H:i:s',$timestamp); … … 328 334 329 335 var cctr=$('.dataTable tr').length; 330 ctr=cctr+1; 336 ctr=cctr+1; 337 var input_data; 338 var select; 339 var option; 340 var selection; 331 341 332 342 var newdiv = document.createElement("div"); … … 367 377 input_data.setAttribute("value","+"), 368 378 input_data.onclick = function(){ 369 addRowClone1("list_<?php echo $cnt ; ?>");379 addRowClone1("list_<?php echo $cnt+1; ?>"); 370 380 } 371 381 ); 372 373 var newtr<?php echo $cnt; ?> = document.createElement("tr"); 382 383 <?php 384 $observations = mysql_query("SELECT * FROM schedule WHERE fStart = '$actualtime'"); 385 386 while($rows = mysql_fetch_array($observations)) 387 { 388 ?> 389 390 var newtr<?php echo $cnt; ?> = document.createElement("tr"); 374 391 newtr<?php echo $cnt; ?>.setAttribute('class','tr'); 375 392 … … 405 422 input_data.setAttribute("value","+"), 406 423 input_data.onclick = function(){ 407 return addRow (newtr<?php echo $cnt; ?>);424 return addRowClone1(newtr<?php echo $cnt; ?>); 408 425 ctr++; 409 426 }); … … 460 477 newInnertable.appendChild(newtr<?php echo $cnt; ?>); 461 478 462 479 <?php 480 481 $cnt++; 482 $prevtimestamp = $timestamp; 483 } 484 ?> 485 463 486 var newtd_c6 = document.createElement("td"); 464 487 newtd_c6.appendChild(newInnertable); … … 489 512 } 490 513 <?php 491 //$rows = mysql_fetch_array($fetch); 492 493 $cnt++; 494 } 514 } 495 515 if(mysql_num_rows($fetch)<1) 496 516 {
Note:
See TracChangeset
for help on using the changeset viewer.