Index: schedule/Transaction/insert.php
===================================================================
--- schedule/Transaction/insert.php	(revision 16069)
+++ schedule/Transaction/insert.php	(revision 16070)
@@ -34,9 +34,8 @@
 						for($j=0;$j<=$new_limit-1;$j++){
 
-							echo $Times[$i];
+							echo $Times[$j];
 							echo "sgsdgdsg";
-							$ex_counter = explode(":",$Times[$i]);
-							//$ex_counter2 = explode(" ",$ex_counter[1]);
-							
+							$ex_counter = explode(":",$Times[$j]);
+					
 							$counter[$j] = $ex_counter[0];
 									
@@ -44,14 +43,24 @@
 									echo "<br />";
 						if($new_limit > 0){
-							for($j=0;$j<=$new_limit-1;$j++){		
+							for($j=0;$j<=$new_limit;$j++){		
 									
-								for($y=0;$y<=$new_limit-1;$y++){
+								for($y=0;$y<=$new_limit;$y++){
+									if($y > 0){
+										if($counter[$j]==$counter[$y]){
+										
+											if(empty($by_count[$y]) || $by_count[$y] == 0){
 									
-									if($counter[$j]==$counter[$y+1]){
+												$by_count[$y] = $y;
+											}else{
+											
+												 $by_count[$y] = 0;
+											}
+										}
+									}else{
 									
-										if(empty($by_count[$j])){
 									
-											$by_count[$j] = $y;
-										}
+									$by_count[$y] = 0;
+									
+									
 									}
 									
