Index: /schedule/Module/control.php
===================================================================
--- /schedule/Module/control.php	(revision 17554)
+++ /schedule/Module/control.php	(revision 17555)
@@ -2,6 +2,4 @@
 'use strict';
 var ctr;
-var testdata = "old data";
-var pastdata = false;
 var transPrevNight = 1;
 	
@@ -25,7 +23,8 @@
 		// CREATE ELEMENT	
 		var newtr = document.createElement("tr");
-			newtr.setAttribute("class","tr");
+                newtr.setAttribute("class","tr");
+                newtr.setAttribute("width", "100%");
 		var newtd_c1 = document.createElement("td");
-			newtd_c1.setAttribute("width","147");
+			//newtd_c1.setAttribute("width","120");
 			newtd_c1.setAttribute("align","center");
 			newtd_c1.appendChild(
@@ -37,8 +36,9 @@
 			);
 		var newtd_c2 = document.createElement("td");
-			newtd_c2.setAttribute("width","138");
+			newtd_c2.setAttribute("width","20%");
 			newtd_c2.setAttribute("align","center");
 			newtd_c2.appendChild(
-				select = document.createElement("select"),
+                                             select = document.createElement("select"),
+                                             select.setAttribute("style", "width=100px"),
 				select.setAttribute("class","measure"),
 				$.ajax({																	//Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
@@ -57,6 +57,5 @@
 				})																				// End of retrieving
 			);
-			newtd_c2.setAttribute("width","115");
-			newtd_c2.setAttribute("align","center");
+                        newtd_c2.setAttribute("align","center");
 			newtd_c2.appendChild(
 				input_data = document.createElement("input"),
@@ -68,8 +67,9 @@
 			);
 		var newtd_c3 = document.createElement("td");
-			newtd_c3.setAttribute("width","98");
+			newtd_c3.setAttribute("width","20%");
 			newtd_c3.setAttribute("align","center");
 			newtd_c3.appendChild(
-					selection = document.createElement("select"),
+                                             selection = document.createElement("select"),
+                                             selection.setAttribute("style", "width=100px"),
 					selection.setAttribute("class","source"),
 					$.ajax({																	//Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
@@ -78,5 +78,10 @@
 						success:function(data)
 						{
-							var obj = $.parseJSON(data);
+                                                       var obj = $.parseJSON(data);
+                                                       selection.appendChild(
+                                                             option = document.createElement('option'),
+                                                             option.setAttribute('value', 0),
+                                                             option.appendChild(document.createTextNode("---"))
+                                                       );
 							$.each(obj,function(){
 							selection.appendChild(
@@ -90,5 +95,5 @@
 			);
 		var newtd_c4 = document.createElement("td");
-			newtd_c4.setAttribute("width","119");
+			newtd_c4.setAttribute("width","50%");
 			newtd_c4.setAttribute("align","center");
 			newtd_c4.appendChild(
@@ -96,10 +101,10 @@
 				input_data.setAttribute("type","text"),
 				input_data.setAttribute("class","selected"),
-				input_data.setAttribute("size","12"),
+				input_data.setAttribute("size","50"),
 				input_data.setAttribute("placeholder","Value")
 			);
 		var newtd_c5 = document.createElement("td");
-			newtd_c5.setAttribute("width","115");
-			newtd_c5.setAttribute("align","center");
+                        newtd_c5.setAttribute("align","center");
+                        newtd_c5.setAttribute("width", "10%");
 			newtd_c5.appendChild(
 				input_data = document.createElement("input"),
@@ -129,5 +134,14 @@
     $day =date("Y-m-d");
 }
-$prev = mysql_query("SELECT date(fStart) AS PrevDate FROM schedule WHERE (date(fStart) < '2014-01-26') ORDER BY date(fStart) DESC LIMIT 1");
+if(isset($_GET['prev']))
+{ 
+    $prevday = $_GET['prev'];
+}
+else
+{
+    $prevday = 'false';
+}
+
+/*$prev = mysql_query("SELECT date(fStart) AS PrevDate FROM schedule WHERE (date(fStart) < '2014-01-26') ORDER BY date(fStart) DESC LIMIT 1");
 $prevnight = mysql_fetch_array($prev);
   if(mysql_num_rows($prevnight) > 0) {
@@ -137,9 +151,10 @@
   }
 $prevday = date('Y-m-d', strtotime($day .' -1 day'));
-$prev_time = array();
+$prev_time = array();*/
 ?>
 
 function addRowCloneNew(nextrow){
-	var targetView = document.getElementById("Data");
+    var targetView = document.getElementById("Data");
+targetView.setAttribute("width", "100%");
 	// CREATE ELEMENT
 	// COUNT LIST
@@ -155,5 +170,6 @@
 		newdiv.setAttribute("id","list_"+newlist);
 		newdiv.setAttribute("class","datalisting");
-		newdiv.setAttribute("style","margin:5px 0;");
+                newdiv.setAttribute("style","margin:5px 0;");
+                newdiv.setAttribute("width", "100%");
 	var newtable = document.createElement("table");
 		newtable.setAttribute("class","dataTable");
@@ -166,12 +182,12 @@
 		newInnertable.setAttribute("width","100%");
 		newInnertable.setAttribute("border","1");
-		
 		newInnertable.setAttribute("cellspacing","0");
 		newInnertable.setAttribute("cellpadding","0");
 		
 	var newtr = document.createElement("tr");
-		newtr.setAttribute('class','tr');
+                newtr.setAttribute('class','tr');
+        newtr.setAttribute("width", "100%");
 	var newtd_c1 = document.createElement("td");
-		newtd_c1.setAttribute("width","200");
+		newtd_c1.setAttribute("width","15%");
                 newtd_c1.setAttribute("align","center");
                 newtd_c1.setAttribute("valign", "top");
@@ -179,6 +195,7 @@
 			input_data = document.createElement("input"),
 			input_data.setAttribute("type","time"),
-			input_data.setAttribute("class","time"),
-			input_data.setAttribute("size","10"),
+                                     input_data.setAttribute("class","time"),
+                                     //input_data.setAttribute("width", "50%"),
+			input_data.setAttribute("size","5"),
 			input_data.setAttribute("autofocus","true")
 		);
@@ -193,5 +210,5 @@
 	var newtd_c2 = document.createElement("td");
 	
-		newtd_c2.setAttribute("width","138");
+		newtd_c2.setAttribute("width","20%");
 		newtd_c2.setAttribute("align","center");
 		newtd_c2.appendChild(
@@ -215,7 +232,5 @@
 			
 		);
-		newtd_c2.setAttribute("width","115");
-		newtd_c2.setAttribute("align","center");
-		newtd_c2.appendChild(
+                newtd_c2.appendChild(
 			input_data = document.createElement("input"),
 			input_data.setAttribute("type","button"),
@@ -226,5 +241,5 @@
 			});
 	var newtd_c3 = document.createElement("td");
-		newtd_c3.setAttribute("width","98");
+		newtd_c3.setAttribute("width","20%");
 		newtd_c3.setAttribute("align","center");
 		newtd_c3.appendChild(
@@ -236,7 +251,12 @@
 				success:function(data)
 				{
-					var obj = $.parseJSON(data);
-					$.each(obj,function(){
-					selection.appendChild(
+                                    var obj = $.parseJSON(data);
+                                selection.appendChild(
+                                                             option = document.createElement('option'),
+                                                             option.setAttribute('value', 0),
+                                                             option.appendChild(document.createTextNode("---"))
+                                                       );
+                                        $.each(obj,function(){
+                                        selection.appendChild(
 						option=document.createElement('option'),
 						option.setAttribute('value',this['fSourceKEY']),
@@ -248,20 +268,19 @@
 		);
 	var newtd_c4 = document.createElement("td");
-		newtd_c4.setAttribute("width","119");
+		newtd_c4.setAttribute("width","50%");
 		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("class","selected"),
+                                     //input_data.setAttribute("width", "100%"),
+			input_data.setAttribute("size","50"),
 			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"),
+                var newtd_c5 = document.createElement("td");
+                newtd_c5.setAttribute("width", "10%");
+                newtd_c5.setAttribute("align","center");
+        newtd_c5.appendChild(
+                        input_data = document.createElement("input"),
 			input_data.setAttribute("type","button"),
 			input_data.setAttribute("value","Delete"),
@@ -277,6 +296,6 @@
 		newtd_c6.appendChild(newInnertable);
 
-	var newtd_c7 = document.createElement("td");
-		newtd_c7.setAttribute("width","115");
+            var newtd_c7 = document.createElement("td");
+                newtd_c7.setAttribute("width", "10%");
                 newtd_c7.setAttribute("align","center");
                 newtd_c7.setAttribute("valign", "top");
@@ -306,5 +325,5 @@
 <?php
 $fetch = mysql_query("SELECT * FROM schedule WHERE date(fStart) = '$day' ORDER BY fScheduleID ASC, fMeasurementID ASC") or die(mysql_error());
-$observationsTime = mysql_query("SELECT DISTINCT fStart FROM schedule WHERE date(fStart) = '$day'");
+$observationsTime = mysql_query("SELECT DISTINCT fStart FROM schedule WHERE date(fStart) = '$day' ORDER BY fScheduleID ASC");
 $cnt3=0;
 $cnt2=0;
@@ -314,8 +333,6 @@
 $cntrow = 0;
 $pastdate =  'false';
-$pasttime = 'false';
+$pasttime = 'true';
 date_default_timezone_set("UTC");
-//$data  = array();
-//$counter=0;
 	while($times = mysql_fetch_array($observationsTime))
 	{
@@ -323,28 +340,7 @@
             $testdate = date('Y-m-d H:i:s', $times['fStart']);
             $testing = date('Y-m-d H:i', $timestamp);
+            $curSchedId = $times['fScheduleID'];
             $actualtime = date('Y-m-d H:i:s', $timestamp);
-            if(strtotime(date('Y-m-d', $timestamp)) == strtotime(date('Y-m-d', time()))) {
-                $fetch_next = mysql_query("SELECT * FROM schedule WHERE (fStart > '$testing' AND date(fStart) = '$day') ORDER BY fStart LIMIT 1");
-                $next_data = mysql_fetch_array($fetch_next);
-                if (mysql_num_rows($fetch_next) > 0) {
-                    $next_date = strtotime($next_data['fStart']);
-                    $test = date('Y-m-d H:i', $next_date);
-                    if(strtotime(date('Y-m-d H:i', $next_date)) > strtotime(date('Y-m-d H:i', time()))) {
-                        $pasttime = 'true';
-                    } else {
-                        $pasttime = 'false';
-                    }
-                } else {
-                    $pasttime = 'true';
-                }
-            }
-            else {
-                $pasttime = 'false';
-            }
-		$timestamp2 = date('Y-m-d',$timestamp);
-		$date_time = date('H:i',$timestamp);
-                $prev_time[$cnt3]= $date_time;
-                
-
+            if($prevday == 'false') {
                 if(strtotime(date('Y-m-d H:i', $timestamp)) < strtotime(date('Y-m-d H:i', time()))) {
                     $pastdate = 'true';
@@ -353,5 +349,35 @@
                     $pastdate = 'false';
                 }
+            }
+
+            if(strtotime(date('Y-m-d', $timestamp)) == strtotime(date('Y-m-d', time()))) {
+                $fetch_next = mysql_query("SELECT DISTINCT fStart FROM schedule WHERE (fStart > '$testing' AND date(fStart) = '$day') ORDER BY fScheduleID ASC LIMIT 1");
+                $next_data = mysql_fetch_array($fetch_next);
+                if ($pasttime == 'true') {
+                    if (mysql_num_rows($fetch_next) > 0) {
+                        $next_date = strtotime($next_data['fStart']);
+                        $test = date('H:i', $next_date);
+                        if(strtotime(date('H:i', $next_date)) <  strtotime(date('H:i', time()))) {
+                            $pasttime = 'true';
+                        } else {
+                            $pasttime = 'false';
+                        }
+                    } else {
+                        $pasttime = 'false';
+                    }
+                }
+                if((strtotime(date('Hi', $timestamp)) >= strtotime('0000')) && (strtotime(date('Hi', $timestamp)) <= strtotime('0800'))) {
+                   $pastdate = 'false';
+                }
+            }
+            else {
+                $pasttime = 'false';
+            }
+
+                $date_time = date('H:i', $timestamp);
+                $prev_time[$cnt3]= $date_time;
+
                 ?>
+
                     $('#save').attr('value','UPDATE');
 		       var targetView = document.getElementById("Data");
@@ -389,7 +415,7 @@
 				newInnertable.setAttribute("cellspacing","0");
 				newInnertable.setAttribute("cellpadding","0");
-			
+                                
 			var newtd_c1 = document.createElement("td");
-				newtd_c1.setAttribute("width","200");
+				newtd_c1.setAttribute("width","15%");
                                 newtd_c1.setAttribute("align","center");
                                 newtd_c1.setAttribute("valign", "top");
@@ -399,5 +425,5 @@
                                         input_data.setAttribute("type","time"),
 					input_data.setAttribute("class","time"),
-					input_data.setAttribute("size","10"),
+					input_data.setAttribute("size","5"),
 					input_data.setAttribute("value","<?php echo $date_time; ?>"),
                                         input_data.setAttribute("autofocus","true"),
@@ -409,5 +435,5 @@
                                         input_data.setAttribute("type","time"),
 					input_data.setAttribute("class","time"),
-					input_data.setAttribute("size","10"),
+					input_data.setAttribute("size","5"),
 					input_data.setAttribute("value","<?php echo $date_time; ?>"),
                                         input_data.setAttribute("autofocus","true")
@@ -418,5 +444,6 @@
 					input_data = document.createElement("input"),
 					input_data.setAttribute("type","button"),
-                                        input_data.setAttribute("value","+"),
+                                                         input_data.setAttribute("value","+"),
+                                                         input_data.setAttribute("disabled", "disabled"),
                                         input_data.onclick = function(){
                                             addRowCloneNew("list_<?php echo $cnt; ?>");
@@ -433,5 +460,5 @@
                                         }
                                     );
-                                <?php } else { ?>
+                                <?php } else {  ?>
                                     newtd_c1.appendChild(
 					input_data = document.createElement("input"),
@@ -442,5 +469,5 @@
                                         }
                                 );
-                                <?php } }
+                                <?php }}
                         $observations = mysql_query("SELECT * FROM schedule WHERE fStart = '$actualtime'");
 
@@ -455,22 +482,24 @@
                         <?php if ($pastdate == 'true') { ?>                             		       
                                 var newtd_c2 = document.createElement("td");
-				newtd_c2.setAttribute("width","138");
+				newtd_c2.setAttribute("width","20%");
                                 newtd_c2.setAttribute("align","center");
                                 <?php   
                                    $cur_measurement = $rows[fMeasurementTypeKey];
-                                   $selectm = mysql_query("SELECT fMeasurement FROM measurement WHERE fMeasurementKey = '$cur_measurement'");
+                                   $selectm = mysql_query("SELECT * FROM measurement WHERE fMeasurementKey = '$cur_measurement'");
                                    $rowmeasure = mysql_fetch_array($selectm);
                                 ?>
                                 newtd_c2.appendChild(
-                                   selection = document.createElement("input"),
-                                   selection.setAttribute("value", "<?php echo $rowmeasure['fMeasurement']; ?>"),
-                                   selection.setAttribute("type","text"),
-                                   selection.setAttribute("class","selected"),
-                                   selection.setAttribute("size", "12"),
-                                   selection.setAttribute("placeholder", "Value"),
-                                   selection.setAttribute("disabled", "disabled")
-                                );
-                                newtd_c2.setAttribute("width","115");
-                                newtd_c2.setAttribute("align","center");
+                                   selection = document.createElement("select"),
+                                                     selection.appendChild(
+                                                     option = document.createElement("option"),
+                                                     option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>")),
+                                                    option.setAttribute("value", "<?php echo $rowmeasure['fMeasurementKey']; ?>"),
+                                                    option.setAttribute('selected', true)
+                                   ),
+                                   selection.setAttribute('id', 'measure'),
+                                   selection.setAttribute('class','measure'),
+                                   selection.setAttribute('disabled', 'disabled'),
+                                                     selection.setAttribute("style", "width:100px")
+                                   );
                                 newtd_c2.appendChild(
 					input_data = document.createElement("input"),
@@ -484,22 +513,35 @@
 
                                 var newtd_c3 = document.createElement("td");
-				newtd_c3.setAttribute("width","98");
+				newtd_c3.setAttribute("width","20%");
 				newtd_c3.setAttribute("align","center");
                                 <?php
                                 $cur_source = $rows['fSourceKey'];
-                                $select = mysql_query("SELECT fSourceName FROM source WHERE fSourceKey = '$cur_source'");
-                                $rowsource = mysql_fetch_array($select); ?>
+                                $select = mysql_query("SELECT *  FROM source WHERE fSourceKey = '$cur_source'");
+                                if(mysql_num_rows($select)<1) {
+                                    $sourcename = '---';
+                                    $sourcekey = 0;
+                                }
+                                else {
+                                    $rowsource = mysql_fetch_array($select);
+                                    $sourcename = $rowsource['fSourceName'];
+                                    $sourcekey = $rowsource['fSourceKey'];
+                                }?>
                                 newtd_c3.appendChild(
-                                   selection = document.createElement("input"),
-                                   selection.setAttribute("value", "<?php echo $rowsource['fSourceName']; ?>"),
-                                   selection.setAttribute("type","text"),
-                                   selection.setAttribute("class","selected"),
-                                   selection.setAttribute("size", "12"),
-                                   selection.setAttribute("placeholder", "Value"),
-                                   selection.setAttribute("disabled", "disabled")
+                                   selection = document.createElement("select"),
+                                                     selection.appendChild(
+                                                     option = document.createElement("option"),
+                                                     option.appendChild(document.createTextNode("<?php echo $sourcename; ?>")),
+                                                    option.setAttribute("value", "<?php echo $sourcekey; ?>"),
+                                                    option.setAttribute('selected', true)
+                                   ),
+                                   selection.setAttribute('id', 'source'),
+                                   selection.setAttribute('class','source'),
+                                   selection.setAttribute('disabled', 'disabled'),
+                                                     selection.setAttribute("style", "width:120px")
+                                   
 				);
 
                                 var newtd_c4 = document.createElement("td");
-				newtd_c4.setAttribute("width","119");
+				newtd_c4.setAttribute("width","50%");
 				newtd_c4.setAttribute("align","center");
                                 newtd_c4.appendChild(
@@ -507,14 +549,12 @@
 					input_data.setAttribute("type","text"),
 					input_data.setAttribute("class","selected"),
-					input_data.setAttribute("size","12"),
+					input_data.setAttribute("size","50"),
 					input_data.setAttribute("value","<?php echo $rows['fData']; ?>"),
                                         input_data.setAttribute("placeholder","Value"),
-                                        input_data.setAttribute("disabled", "disbaled")
+                                        input_data.setAttribute("disabled", "disabled")
 				);
 
                                 var newtd_c5 = document.createElement("td");
-				newtd_c5.setAttribute("width","115");
-				newtd_c5.setAttribute("align","center");
-				newtd_c5.setAttribute("width","115");
+                                newtd_c5.setAttribute("width", "10%");
                                 newtd_c5.setAttribute("align","center");
                                 newtd_c5.appendChild(
@@ -529,5 +569,5 @@
                         <?php } else  { ?>
                                 var newtd_c2 = document.createElement("td");
-				newtd_c2.setAttribute("width","138");
+				newtd_c2.setAttribute("width","20%");
                                 newtd_c2.setAttribute("align","center");
                                 newtd_c2.appendChild(
@@ -548,8 +588,7 @@
                                    ?>
 				   selection.setAttribute('id','measure'),
-				   selection.setAttribute('class','measure')
+                                       selection.setAttribute('class','measure'),
+                                       selection.setAttribute("style", "width=100px")
                                 );
-                                newtd_c2.setAttribute("width","115");
-                                newtd_c2.setAttribute("align","center");
                                 newtd_c2.appendChild(
 					input_data = document.createElement("input"),
@@ -562,10 +601,17 @@
 
                                 var newtd_c3 = document.createElement("td");
-				newtd_c3.setAttribute("width","98");
+				newtd_c3.setAttribute("width","20%");
 				newtd_c3.setAttribute("align","center");
 				newtd_c3.appendChild(
                                 selection = document.createElement("select"),
+                                selection.appendChild(
+                                        option = document.createElement("option"),
+                                        option.setAttribute('value', 0),
+                                        <?php
+ if($rows['fSourceKey'] == 0) { echo "option.setAttribute('selected', true),"; }?>
+                                        option.appendChild(document.createTextNode("---"))),
                                 <?php
                                 $select = mysql_query("SELECT * FROM source");
+                                                     
                                 while($rowsource = mysql_fetch_array($select))
                                 {
@@ -574,5 +620,7 @@
 					option = document.createElement("option"),
 					option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
-					<?php if($rows['fSourceKey'] == $rowsource['fSourceKEY']){ echo "option.setAttribute('selected',true),"; } ?>
+                                        <?php if($rows['fSourceKey'] == $rowsource['fSourceKEY']){
+                                            echo "option.setAttribute('selected',true),";
+                                        }?>
 					option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
 					),
@@ -581,9 +629,10 @@
                                 ?>
                                 selection.setAttribute('id','source'),																			// End of retrieving
-				selection.setAttribute('class','source')																			// End of retrieving
+                                    selection.setAttribute('class','source'),
+                                    selection.setAttribute("style", "width=100px")// End of retrieving
 				);
 
                                 var newtd_c4 = document.createElement("td");
-				newtd_c4.setAttribute("width","119");
+				newtd_c4.setAttribute("width","50%");
 				newtd_c4.setAttribute("align","center");
                                 newtd_c4.appendChild(
@@ -591,5 +640,5 @@
 					input_data.setAttribute("type","text"),
 					input_data.setAttribute("class","selected"),
-					input_data.setAttribute("size","12"),
+					input_data.setAttribute("size","50"),
 					input_data.setAttribute("value","<?php echo $rows['fData']; ?>"),
 					input_data.setAttribute("placeholder","Value")
@@ -597,9 +646,7 @@
 
                                 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(
+                                newtd_c5.setAttribute("width", "10%");
+                                newtd_c5.setAttribute("align","center");
+                                newtd_c5.appendChild(
 					input_data = document.createElement("input"),
 					input_data.setAttribute("type","button"),
@@ -625,7 +672,7 @@
                         newtd_c6.appendChild(newInnertable);
 
-			var newtd_c7 = document.createElement("td");
-				newtd_c7.setAttribute("width","115");
-                                newtd_c7.setAttribute("align","center");
+                            var newtd_c7 = document.createElement("td");
+                        newtd_c7.setAttribute("width", "10%");
+                        newtd_c7.setAttribute("align","center");
                                 newtd_c7.setAttribute("valign", "top");
                                 <?php if ($pastdate == 'true') { ?>
@@ -658,5 +705,4 @@
 			}else{
 				targetView.appendChild(newdiv<?php echo $cnt;?>);
-				//$(targetView).after(newtr<?php echo $cnt; ?>);
 			}
 	<?php
@@ -664,21 +710,19 @@
 if(mysql_num_rows($fetch)<1)
 {
+    if(strtotime(Date('Y-m-d', strtotime($day))) >= strtotime(Date('Y-m-d'))) {
 ?>
 	$('#save').attr('value','SAVE');
-	addRowCloneNew();
+        addRowCloneNew();
+        $('#LoadPrev').removeAttr("disabled");
+        $('#save').removeAttr("disabled");
 <?php
+    }
+    else {?>
+        $('#LoadPrev').attr('disabled', 'disabled');
+        $('#save').attr('disabled', 'disabled');
+<?php    }
 }
-
 ?>
-			
 }
-
-$('#LoadPrev').click(function() {
-if(transPrevNight == 1) {
-  $('#Scheduling').load('Module/Scheduling.php?days=<?php echo $prevday;?>');
-  transPrevNight = 0;
-}
-});
-
 </script>
 	
