Changeset 17518 for schedule/Module
- Timestamp:
- 01/17/14 22:10:15 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/control.php
r17516 r17518 327 327 $cnt = 0; 328 328 $cntrow = 0; 329 $pastdate = 'false' 329 $pastdate = 'false'; 330 330 $pasttime = 'false'; 331 date_default_timezone_set("UTC"); 331 332 //$data = array(); 332 333 //$counter=0; … … 334 335 { 335 336 $timestamp=strtotime($times['fStart']); 336 $curdate = strtotime(date('Y-m-d')); 337 $actualtime = date('Y-m-d H:i:s', $timestamp); 337 $testdate = date('Y-m-d H:i:s', $times['fStart']); 338 $testing = date('Y-m-d H:i', $timestamp); 339 $actualtime = date('Y-m-d H:i:s', $timestamp); 340 if(strtotime(date('Y-m-d', $timestamp)) == strtotime(date('Y-m-d', time()))) { 341 $fetch_next = mysql_query("SELECT * FROM schedule WHERE (fStart > '$testing' AND date(fStart) = '$day') ORDER BY fStart LIMIT 1"); 342 $next_data = mysql_fetch_array($fetch_next); 343 if (mysql_num_rows($fetch_next) > 0) { 344 $next_date = strtotime($next_data['fStart']); 345 $test = date('Y-m-d H:i', $next_date); 346 if(strtotime(date('Y-m-d H:i', $next_date)) > strtotime(date('Y-m-d H:i', time()))) { 347 $pasttime = 'true'; 348 } else { 349 $pasttime = 'false'; 350 } 351 } else { 352 $pasttime = 'true'; 353 } 354 } 355 else { 356 $pasttime = 'false'; 357 } 338 358 $timestamp2 = date('Y-m-d',$timestamp); 339 359 $date_time = date('H:i',$timestamp); 340 360 $prev_time[$cnt3]= $date_time; 341 if(strtotime($timestamp2) < strtotime(date('Y-m-d'))) { 342 $pastdate = 'true'; 361 362 363 if(strtotime(date('Y-m-d H:i', $timestamp)) < strtotime(date('Y-m-d H:i', time()))) { 364 $pastdate = 'true'; 343 365 } 344 else if(strtotime($timestamp2) == strtotime(date('Y-m-d'))) { 345 if(strtotime($date_time) < strtotime(date('H:i'))) { 346 $pastdate = 'true'; 347 } 348 } else { 366 else { 349 367 $pastdate = 'false'; 350 368 } … … 399 417 input_data.setAttribute("autofocus","true"), 400 418 input_data.setAttribute("disabled") 401 ); 402 newtd_c1.appendChild( 403 input_data = document.createElement("input"), 404 input_data.setAttribute("type","button"), 405 input_data.setAttribute("value","+"), 406 input_data.setAttribute("disabled"), 407 input_data.onclick = function(){ 408 addRowCloneNew("list_<?php echo $cnt; ?>"); 409 } 410 ); 411 412 <?php } else { ?> 419 ); 420 <?php } else { ?> 413 421 newtd_c1.appendChild( 414 422 input_data = document.createElement("input"), … … 418 426 input_data.setAttribute("value","<?php echo $date_time; ?>"), 419 427 input_data.setAttribute("autofocus","true") 420 ); 428 ); 429 <?php } 430 if($pasttime == 'true') { ?> 421 431 newtd_c1.appendChild( 422 432 input_data = document.createElement("input"), … … 426 436 addRowCloneNew("list_<?php echo $cnt; ?>"); 427 437 } 428 ); 429 <?php } 438 ); 439 <?php } else { if ($pastdate == 'true') { ?> 440 newtd_c1.appendChild( 441 input_data = document.createElement("input"), 442 input_data.setAttribute("type","button"), 443 input_data.setAttribute("value","+"), 444 input_data.setAttribute("disabled"), 445 input_data.onclick = function(){ 446 addRowCloneNew("list_<?php echo $cnt; ?>"); 447 } 448 ); 449 <?php } else { ?> 450 newtd_c1.appendChild( 451 input_data = document.createElement("input"), 452 input_data.setAttribute("type","button"), 453 input_data.setAttribute("value","+"), 454 input_data.onclick = function(){ 455 addRowCloneNew("list_<?php echo $cnt; ?>"); 456 } 457 ); 458 <?php } } 430 459 $observations = mysql_query("SELECT * FROM schedule WHERE fStart = '$actualtime'"); 431 460 … … 675 704 676 705 $('#LoadPrev').click(function() { 677 678 706 }); 679 707 </script>
Note:
See TracChangeset
for help on using the changeset viewer.