Index: schedule/Module/Scheduling.php
===================================================================
--- schedule/Module/Scheduling.php	(revision 16720)
+++ schedule/Module/Scheduling.php	(revision 16721)
@@ -1,5 +1,6 @@
 <?php
 	include '../include/factdb.php';
-	include '../function/SplitDelete.php';
+
+	//include '../function/SplitDelete.php';
 ?>
 <table width="100%" id="TableHolder" >
Index: schedule/Transaction/insert.php
===================================================================
--- schedule/Transaction/insert.php	(revision 16720)
+++ schedule/Transaction/insert.php	(revision 16721)
@@ -15,5 +15,5 @@
 $insertdate = $TimeEX[2]."-".$TimeEX[1]."-".$TimeEx[0];
 $value = $_GET['Data'];
-$Date = $_GET['Date2'];
+$date = $_GET['Date'];
 //$date = new DateTime($_GET['Date']);
 $n_value = explode(",",$value);
Index: schedule/authenticate/body.php
===================================================================
--- schedule/authenticate/body.php	(revision 16720)
+++ schedule/authenticate/body.php	(revision 16721)
@@ -60,9 +60,48 @@
 					</div>
 						<div style="border:2px solid white; width:100%;" id="Scheduling">
+						<?php
+						
+						include 'function/SplitDelete.php';
+					//	include 'Module/Scheduling';
+						?>
+						
 							<script type="text/javascript">
-								$(document).ready(function(){
-									$('#Scheduling').fadeIn('slow').load('Module/Scheduling.php');
-								});
+								// $(document).ready(function(){
+								
+										
+									// $('#Scheduling').fadeOut('slow').load('Module/Scheduling.php').fadeIn('slow');
+								
+								// });
 							</script>
+							<table width="100%" id="TableHolder" >
+
+	<tr>
+		<td width="184" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center"  >Time</td>
+		
+		<td width="170" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center"  >Measurement</td>
+		<td width="145" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center"  >Source list</td>
+		<td width="316" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center"  >Value</td>
+		<td width="141" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Transaction</td>
+	</tr>
+	<tr>
+	
+		
+		<td style="border:0px solid white; color:#37DFB1; font-size:14px;"   colspan="4">&nbsp;</td>
+	</tr>
+
+</table>
+<table width="100%" id="TableH" class="myTable">
+</table>
+<table width="100%" id="TableH1" class="myTable">
+</table>
+
+<table width="100%">
+	<tr>
+	
+	
+		<td style="border:0px solid white; color:#37DFB1; font-size:14px;"  width="80%" align="center">&nbsp;</td>
+	
+	</tr>
+</table>
 						</div>
 						<div style="border:2px solid white; width:100%;" align="center" id="SchedulingAppend">
Index: schedule/function/SplitDelete.php
===================================================================
--- schedule/function/SplitDelete.php	(revision 16720)
+++ schedule/function/SplitDelete.php	(revision 16721)
@@ -1,13 +1,231 @@
 <script type="text/javascript">
  $(document).ready(function(){
+ 
  var timeValue;
 var meas;
 var meas2;
 var getTableId;
- window.cnt=2;
+ window.cnt=0;
+ 
+	
+
+	
+					//-------------------------------- fetch----------------------------//
+					
+			
+	
+							//-----------------------------------------------//
+									//end fetch						
+
+							//------------------------------------------------//
+	var x = 0;
+	
+	<?php    
+	
+	
+	include '../include/factdb.php';
+						 $day = $_GET['days'];
+						$days = Date('Y-m-d',strtotime($day));
+						?>
+						//alert('<?php echo $day; ?>');
+						
+						<?php
+							
+						
+					$fetch = mysql_query("SELECT * FROM schedule") or die(mysql_error());
+					
+					while($rows = mysql_fetch_array($fetch)){
+					$timestamp=strtotime($rows['fLastUpdate']);
+					$timestamp2 = date('Y-m-d',$timestamp);
+					$date_time = date('H:i',$timestamp);
+					//$time_new = $date_time->format('H:i:s')
+					if($days == $timestamp2){
+					
+					
+					?>
+					cnt++;
+				
+ 
+ 
  	var table = document.createElement("table");
+		table.setAttribute('id',"table"+cnt);
+		table.setAttribute('width','100%');
+	var tr = document.createElement('tr');
+	var td3=document.createElement('td');
+		td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
+		td3.appendChild(
+			input = document.createElement("input"),
+					input.setAttribute("type","time"),
+					input.setAttribute("id","Time"+cnt),
+					input.setAttribute("max","24"),
+					input.setAttribute("min","1"),
+					input.setAttribute("required",true),
+					input.setAttribute("value",'<?php echo $date_time; ?>')
+				
+		);
+			td3.appendChild(
+			button=document.createElement('input'),
+			button.setAttribute('type','button'),
+			button.setAttribute('value','[+]'),
+			button.setAttribute('id','btnAddTime'),
+			button.onclick=function(){
+			
+			
+			
+			if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 01;   
+
+			timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 
+
+						function pad(number, length) {
+				   
+							var str = '' + number;
+							while (str.length < length) {
+								str = '0' + str;
+							}
+				   
+						return str;
+
+						}
+
+			 meas = "name"; meas2 = "time";   getTableId = '#table'+cnt;  split1();    }else{   alert("please enter value for time to add measurement");   }
+
+				
+			}
+		);
+	var td=document.createElement('td');
+		td.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
+		td.appendChild(
+			sourcecbo= document.createElement('select'),
+				sourcecbo.setAttribute('id','source'+cnt),
+<?php
+			$source=mysql_query("SELECT*FROM source");
+			while($rowsource=mysql_fetch_array($source))
+			{
+?>
+				sourcecbo.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
+			}
+?>
+			sourcecbo.setAttribute('id','source'+cnt)
+					
+		);
+	var td1=document.createElement('td');
+		td1.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px;text-align:center;");
+		td1.appendChild(
+			measurementcbo= document.createElement('select'),
+				measurementcbo.setAttribute('id','measurement'+cnt),
+<?php
+			$measure=mysql_query("SELECT*FROM measurement");
+			while($rowmeasure=mysql_fetch_array($measure))
+			{
+?>
+				measurementcbo.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
+			}
+?>
+			measurementcbo.setAttribute('id','measurement'+cnt)
+		);
+				td1.appendChild(
+			button=document.createElement('input'),
+			button.setAttribute('type','button'),
+			button.setAttribute('value','[+]'),
+			button.setAttribute('id','btnAddTime'),
+			button.onclick=function(){
+			if($('#Time1').val() != ""){ timeValue = $('#Time1').val();  meas = "hidden"; meas2 = true; getTableId = '#table'+cnt; split1();    }else{   alert("please enter value for time to add measurement");   }
+
+				
+			}
+		);
+	var td2=document.createElement('td');
+		td2.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
+		td2.appendChild(
+			input = document.createElement('input'),
+			input.setAttribute('type','text'),
+			input.setAttribute('id','txtData'+cnt),
+			input.setAttribute('value','<?php  echo $rows['fData']; ?>')
+			
+			
+		);
+	var td4=document.createElement('td');
+		td4.setAttribute("style","border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;");
+		td4.appendChild(
+			button = document.createElement('input'),
+			button.setAttribute("type",'button'),
+			button.setAttribute('id','btnSplit'),
+			button.setAttribute('value','Split'),
+			button.onclick= function()
+			{
+
+			if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 30;   
+
+
+			timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2); 
+
+						function pad(number, length) {
+				   
+							var str = '' + number;
+							while (str.length < length) {
+								str = '0' + str;
+							}
+				   
+						return str;
+
+						};
+
+			 meas = "name"; meas2 = "time";  getTableId = '#table'+cnt;  split1();    }else{   alert("please enter value for time to add measurement");   }
+
+				 
+				
+			}
+		);
+		td4.appendChild(
+			button=document.createElement('input'),
+			button.setAttribute('type','button'),
+			button.setAttribute('value','Delete'),
+			button.setAttribute('id','btnDelete'),
+			button.onclick=function(){
+				$('#table'+cnt).remove();
+			}
+		);
+		
+		tr.appendChild(td3);
+		tr.appendChild(td1);
+		tr.appendChild(td);
+		
+		tr.appendChild(td2);
+		tr.appendChild(td4);
+		table.appendChild(tr);
+	
+		$('#TableH1').append(table);
+	
+	<?php
+	}
+			}
+					?>
+					
+					if(cnt==0){
+					var table = document.createElement("table");
 		table.setAttribute('id',"table2");
 		table.setAttribute('width','100%');
 	var tr = document.createElement('tr');
+		tr.setAttribute('id','');
+		tr.setAttribute('class','');
 	var td3=document.createElement('td');
 		td3.setAttribute('style','border:1px solid white; color:#37DFB1; font-size:14px; text-align:center;');
@@ -19,5 +237,4 @@
 					input.setAttribute("min","1"),
 					input.setAttribute("required",true)
-				
 		);
 			td3.appendChild(
@@ -27,8 +244,5 @@
 			button.setAttribute('id','btnAddTime'),
 			button.onclick=function(){
-			
-			
-			
-			if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 01;   
+			if($('#Time2').val() != ""){ var splitting = $('#Time2').val().split(':'); var add = 01;   
 
 			timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 
@@ -43,7 +257,5 @@
 						return str;
 
-						}
-
-			 meas = "name"; meas2 = "time";   getTableId = '#table2';  split1();    }else{   alert("please enter value for time to add measurement");   }
+						};  meas = "name"; meas2 = "time";  getTableId = '#table1';  split();    }else{   alert("please enter value for time to add measurement");   }
 
 				
@@ -56,21 +268,18 @@
 				sourcecbo.setAttribute('id','source1'),
 <?php
-			$source=mysql_query("SELECT*FROM source");
-			while($rowsource=mysql_fetch_array($source))
-			{
-?>
+				$source=mysql_query("SELECT*FROM source");
+				while($rowsource=mysql_fetch_array($source))
+				{
+?>				
 				sourcecbo.appendChild(
 					option=document.createElement('option'),
-							
-								option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
-								option.setAttribute('selected',true),
-							
-								option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
-							
-				
-				),
-<?php
-			}
-?>
+							option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
+							option.setAttribute('selected',true),
+							option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
+				
+				),
+<?php
+				}
+ ?>
 			sourcecbo.setAttribute('id','source1')
 					
@@ -103,5 +312,5 @@
 			button.setAttribute('id','btnAddTime'),
 			button.onclick=function(){
-			if($('#Time1').val() != ""){ timeValue = $('#Time1').val();  meas = "hidden"; meas2 = true; getTableId = '#table2'; split1();    }else{   alert("please enter value for time to add measurement");   }
+			if($('#Time2').val() != ""){ timeValue = $('#Time2').val();  meas = "hidden"; meas2 = true;  getTableId = '#table1';  split();    }else{   alert("please enter value for time to add measurement");   }
 
 				
@@ -114,5 +323,4 @@
 			input.setAttribute('type','text'),
 			input.setAttribute('id','txtData1')
-			
 			
 		);
@@ -126,7 +334,5 @@
 			button.onclick= function()
 			{
-
-			if($('#Time1').val() != ""){  var splitting = $('#Time1').val().split(':'); var add = 30;   
-
+				 if($('#Time2').val() != ""){  var splitting = $('#Time2').val().split(':'); var add = 30;   
 
 			timeValue =pad(splitting[0],2)+':'+ pad((Number(splitting[1]) + Number(add)),2); 
@@ -141,10 +347,8 @@
 						return str;
 
-						};
-
-			 meas = "name"; meas2 = "time";  getTableId = '#table2';  split1();    }else{   alert("please enter value for time to add measurement");   }
-
+						}
+
+			 meas = "name"; meas2 = "time"; getTableId = '#table1';   split();    }else{   alert("please enter value for time to add measurement");   }
 				 
-				
 			}
 		);
@@ -155,8 +359,9 @@
 			button.setAttribute('id','btnDelete'),
 			button.onclick=function(){
-				$('#table2').remove();
-			}
-		);
-		
+				$('#table1').remove();
+
+			}
+		);
+	
 		tr.appendChild(td3);
 		tr.appendChild(td1);
@@ -166,8 +371,6 @@
 		tr.appendChild(td4);
 		table.appendChild(tr);
-	
+		
 		$('#TableH1').append(table);
-	
-		
 		
 	var table = document.createElement("table");
@@ -323,8 +526,10 @@
 		$('#TableH1').append(table);
 		
-		var meas;
+		
+	}
+	var meas;
 		var timeValue;
 		var pad;
-	
+	if(cnt==0){  cnt=2; }	
 	function split()
 	{
Index: schedule/function/function.php
===================================================================
--- schedule/function/function.php	(revision 16720)
+++ schedule/function/function.php	(revision 16721)
@@ -12,10 +12,4 @@
 	$(document).ready(function GetDate(){
 	 // for fupdate
-	 
-	 
-	
-	 
-	
-	
 	<?php
 	
@@ -27,6 +21,7 @@
 	?>
 	$('#save').click(function(){
-
-
+var dtr;
+		 dtr = '<?php echo $_GET['days'];  ?>';
+			//alert(dtr);
 		var InputValue = [];
 		var selectedSource = [];
@@ -58,5 +53,5 @@
 		
 		if(checks == 0){
-		window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+day+'-'+month+'-'+year;
+		window.location = 'Transaction/insert.php?Time='+selectedTime+'&Source='+selectedSource+'&measure='+selectedMeasurement+'&Data='+InputValue+'&Date='+dtr;
 	}else{
 	
