Index: /schedule/Module/control.php
===================================================================
--- /schedule/Module/control.php	(revision 17509)
+++ /schedule/Module/control.php	(revision 17510)
@@ -1,3 +1,3 @@
-<script language="javascript">
+<script>
 'use strict';
 	var ctr;
@@ -15,5 +15,9 @@
 		var targetView = table;
 		var cctr=$('.dataTable tr').length;
-		 ctr=cctr+1;
+                ctr=cctr+1;
+                var input_data;
+                var select;
+                var option;
+                var selection;
 		// CREATE ELEMENT	
 		var newtr = document.createElement("tr");
@@ -138,4 +142,5 @@
 { 
     $day = $_GET['days'];
+?> addRowClone(); <?php
 }
 else
@@ -144,12 +149,12 @@
 }
 $prev_time = array();
-?>addRowClone();
-
-function addRowClone1(nextrow){
+?>
+
+function addRowCloneNew(nextrow){
 	var targetView = document.getElementById("Data");
 	// CREATE ELEMENT
 	// COUNT LIST
-	var list     = $(".datalisting").length;
-	var newlist = list+1;
+        var list     = $(".datalisting").length;
+        var newlist = list+1;
 	var cctr=$('.dataTable tr').length;
         ctr=cctr+1;
@@ -193,5 +198,5 @@
 			input_data.setAttribute("value","+"),
 			input_data.onclick = function(){
-				addRowClone1("list_"+newlist);
+				addRowCloneNew("list_"+newlist);
 			}
 		);
@@ -299,9 +304,9 @@
 
 	newdiv.appendChild(newtable);
-	if(nextrow != null){	
-		var doc = document.getElementById(nextrow);
-		$(doc).after(newdiv);
+        if(nextrow != null){
+            var doc = document.getElementById(nextrow);
+            $(doc).after(newdiv);
 	}else{
-		targetView.appendChild(newdiv);
+            targetView.appendChild(newdiv);
 	}
 }
@@ -323,5 +328,5 @@
         $actualtime = date('Y-m-d H:i:s', $timestamp);
 		$timestamp2 = date('Y-m-d',$timestamp);
-		$date_time = date('H:i:s',$timestamp);
+		$date_time = date('H:i',$timestamp);
 		$prev_time[$cnt3]= $date_time;
 			?>
@@ -331,6 +336,7 @@
 			// COUNT LIST
 			var list     = $(".datalisting").length;
-			var newlist = list+1;
-			
+                        var newlist = list+1;
+                        <?php $cnt++ ?>;
+                        
 			var cctr=$('.dataTable tr').length;
                         ctr=cctr+1;
@@ -341,5 +347,5 @@
 				 
 			var newdiv   = document.createElement("div");
-				newdiv.setAttribute("id","list_"+newlist);
+                                newdiv.setAttribute("id", "list_<?php echo $cnt; ?>");
 				newdiv.setAttribute("class","datalisting");
 				newdiv.setAttribute("style","margin:5px 0;");
@@ -377,6 +383,6 @@
 					input_data.setAttribute("value","+"),
 					input_data.onclick = function(){
-						addRowClone1("list_<?php echo $cnt+1; ?>");
-					}
+                                            addRowCloneNew("list_<?php echo $cnt; ?>");
+                                        }
 				);
                                 
@@ -422,5 +428,5 @@
 					input_data.setAttribute("value","+"),
 					input_data.onclick = function(){ 
-					return addRowClone1(newtr<?php echo $cnt; ?>);
+					return addRow(newtr<?php echo $cnt; ?>);
 						ctr++;
 					});
@@ -477,10 +483,9 @@
 			newInnertable.appendChild(newtr<?php echo $cnt; ?>);
 			
-                            <?php
-
-                                $cnt++;
+                <?php
+
                         $prevtimestamp = $timestamp;
-                                }
-                                ?>
+                }
+                ?>
 
 			var newtd_c6 = document.createElement("td");
@@ -517,5 +522,5 @@
 ?>
 	$('#save').attr('value','SAVE');
-	addRowClone1();
+	addRowCloneNew();
 <?php
 }
