Index: schedule/Module/control.php
===================================================================
--- schedule/Module/control.php	(revision 17458)
+++ schedule/Module/control.php	(revision 17459)
@@ -380,5 +380,8 @@
 		
 	<?php
-	while($rows = mysql_fetch_array($fetch))
+	
+	$observations = mysql_query("SELECT * FROM schedule WHERE fStart = '$timestamp'")
+
+	while($rows = mysql_fetch_array($observations))
 	{
 	?>
@@ -388,86 +391,93 @@
 				newtd_c2.appendChild(
 					selection = document.createElement("select"),
-		<?php   
-		$selectm = mysql_query("SELECT * FROM measurement");
-		while($rowmeasure = mysql_fetch_array($selectm))
-		{
-		?>
-					selection.appendChild(
-					option = document.createElement("option"),
-					option.setAttribute("value","<?php echo $rowmeasure['fMeasurementKey']; ?>"),
-					<?php  if($rows['fMeasurementTypeKey']==$rowmeasure['fMeasurementKey']){ echo "option.setAttribute('selected',true),";}   ?>
-					option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))
-					),
-		<?php 
-		} 
-		?>
+			<?php   
+			$selectm = mysql_query("SELECT * FROM measurement");
+			while($rowmeasure = mysql_fetch_array($selectm))
+			{
+			?>
+						selection.appendChild(
+						option = document.createElement("option"),
+						option.setAttribute("value","<?php echo $rowmeasure['fMeasurementKey']; ?>"),
+						<?php  if($rows['fMeasurementTypeKey']==$rowmeasure['fMeasurementKey']){ echo "option.setAttribute('selected',true),";}   ?>
+						option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))
+						),
+			<?php 
+			} 
+			?>
 						
 						
-					selection.setAttribute('id','measure'),
-					selection.setAttribute('class','measure')
-				);
-				newtd_c2.setAttribute("width","115");
-				newtd_c2.setAttribute("align","center");
-				newtd_c2.appendChild(
-					input_data = document.createElement("input"),
-					input_data.setAttribute("type","button"),
-					input_data.setAttribute("value","+"),
-					input_data.onclick = function(){ 
-					return addRow(newtr<?php echo $cnt; ?>);
-						ctr++;
-					});
-			var newtd_c3 = document.createElement("td");
-				newtd_c3.setAttribute("width","98");
-				newtd_c3.setAttribute("align","center");
-				newtd_c3.appendChild(
-					selection = document.createElement("select"),
+						selection.setAttribute('id','measure'),
+						selection.setAttribute('class','measure')
+					);
+					newtd_c2.setAttribute("width","115");
+					newtd_c2.setAttribute("align","center");
+					newtd_c2.appendChild(
+						input_data = document.createElement("input"),
+						input_data.setAttribute("type","button"),
+						input_data.setAttribute("value","+"),
+						input_data.onclick = function(){ 
+						return addRow(newtr<?php echo $cnt; ?>);
+							ctr++;
+						});
+				var newtd_c3 = document.createElement("td");
+					newtd_c3.setAttribute("width","98");
+					newtd_c3.setAttribute("align","center");
+					newtd_c3.appendChild(
+						selection = document.createElement("select"),
+			<?php
+			$select = mysql_query("SELECT * FROM source");
+			while($rowsource = mysql_fetch_array($select))
+			{
+			?>
+							selection.appendChild(
+							option = document.createElement("option"),
+							option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
+							<?php if($rows['fSourceKey'] == $rowsource['fSourceKEY']){ echo "option.setAttribute('selected',true),"; } ?>
+							option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
+							),
+			<?php
+			} 
+			?>
+					
+						selection.setAttribute('id','source'),																			// End of retrieving
+						selection.setAttribute('class','source')																			// End of retrieving
+					);
+				var newtd_c4 = document.createElement("td");
+					newtd_c4.setAttribute("width","119");
+					newtd_c4.setAttribute("align","center");
+					newtd_c4.appendChild(
+						input_data = document.createElement("input"),
+						input_data.setAttribute("type","text"),
+						input_data.setAttribute("class","selected"),
+						input_data.setAttribute("size","12"),
+						input_data.setAttribute("value","<?php echo $rows['fData']; ?>"),
+						input_data.setAttribute("placeholder","Value")
+					);
+				var newtd_c5 = document.createElement("td");
+					newtd_c5.setAttribute("width","115");
+					newtd_c5.setAttribute("align","center");
+					newtd_c5.setAttribute("width","115");
+					newtd_c5.setAttribute("align","center");
+					newtd_c5.appendChild(
+						input_data = document.createElement("input"),
+						input_data.setAttribute("type","button"),
+						input_data.setAttribute("value","Delete"),
+						input_data.onclick = function(){ return clearNode(newtr<?php echo $cnt; ?>);
+						}
+					);
+			
+				newtr<?php echo $cnt; ?>.appendChild(newtd_c2);
+				newtr<?php echo $cnt; ?>.appendChild(newtd_c3);
+				newtr<?php echo $cnt; ?>.appendChild(newtd_c4);
+				newtr<?php echo $cnt; ?>.appendChild(newtd_c5);
+				newInnertable.appendChild(newtr<?php echo $cnt; ?>);
+			
 		<?php
-		$select = mysql_query("SELECT * FROM source");
-		while($rowsource = mysql_fetch_array($select))
-		{
+//$rows = mysql_fetch_array($fetch);	
+			
+		$cnt++;
+		$prevtimestamp = $timestamp;
+		}
 		?>
-						selection.appendChild(
-						option = document.createElement("option"),
-						option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
-						<?php if($rows['fSourceKey'] == $rowsource['fSourceKEY']){ echo "option.setAttribute('selected',true),"; } ?>
-						option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
-						),
-		<?php
-		} 
-		?>
-					
-					selection.setAttribute('id','source'),																			// End of retrieving
-					selection.setAttribute('class','source')																			// End of retrieving
-				);
-			var newtd_c4 = document.createElement("td");
-				newtd_c4.setAttribute("width","119");
-				newtd_c4.setAttribute("align","center");
-				newtd_c4.appendChild(
-					input_data = document.createElement("input"),
-					input_data.setAttribute("type","text"),
-					input_data.setAttribute("class","selected"),
-					input_data.setAttribute("size","12"),
-					input_data.setAttribute("value","<?php echo $rows['fData']; ?>"),
-					input_data.setAttribute("placeholder","Value")
-				);
-			var newtd_c5 = document.createElement("td");
-				newtd_c5.setAttribute("width","115");
-				newtd_c5.setAttribute("align","center");
-				newtd_c5.setAttribute("width","115");
-				newtd_c5.setAttribute("align","center");
-				newtd_c5.appendChild(
-					input_data = document.createElement("input"),
-					input_data.setAttribute("type","button"),
-					input_data.setAttribute("value","Delete"),
-					input_data.onclick = function(){ return clearNode(newtr<?php echo $cnt; ?>);
-					}
-				);
-			
-			newtr<?php echo $cnt; ?>.appendChild(newtd_c2);
-			newtr<?php echo $cnt; ?>.appendChild(newtd_c3);
-			newtr<?php echo $cnt; ?>.appendChild(newtd_c4);
-			newtr<?php echo $cnt; ?>.appendChild(newtd_c5);
-			newInnertable.appendChild(newtr<?php echo $cnt; ?>);
-			
 			var newtd_c6 = document.createElement("td");
 				newtd_c6.appendChild(newInnertable);
@@ -498,21 +508,17 @@
 				//$(targetView).after(newtr<?php echo $cnt; ?>);
 			}
+
 	<?php
-//$rows = mysql_fetch_array($fetch);	
-			
-		$cnt++;
-		$prevtimestamp = $timestamp;
 	}
-}
-
-if(mysql_num_rows($fetch)<1)
-{
-?>
-	$('#save').attr('value','SAVE');
-	addRowClone1();
-<?php
-}
-
-?>
+
+	if(mysql_num_rows($fetch)<1)
+	{
+	?>
+		$('#save').attr('value','SAVE');
+		addRowClone1();
+	<?php
+	}
+
+	?>
 
 			
