Index: pro-violet-viettel/sourcecode/application/views/layout/admin/footer.php
===================================================================
--- pro-violet-viettel/sourcecode/application/views/layout/admin/footer.php	(revision 590)
+++ pro-violet-viettel/sourcecode/application/views/layout/admin/footer.php	(revision 623)
@@ -1,179 +1,198 @@
-		<!-- basic scripts -->
+<!-- basic scripts -->
 
-		<!--[if !IE]> -->
+<!--[if !IE]> -->
 
-		<script type="text/javascript">
-			window.jQuery || document.write("<script src='<?php echo $base_url;?>assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
-		</script>
+<script type="text/javascript">
+    window.jQuery || document.write("<script src='<?php echo $base_url; ?>assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
+</script>
 
-		<!-- <![endif]-->
+<!-- <![endif]-->
 
-		<!--[if IE]>
+<!--[if IE]>
 <script type="text/javascript">
- window.jQuery || document.write("<script src='<?php echo $base_url;?>assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
+window.jQuery || document.write("<script src='<?php echo $base_url; ?>assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
 </script>
 <![endif]-->
 
-		<script type="text/javascript">
-			if("ontouchend" in document) document.write("<script src='<?php echo $base_url;?>assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
-		</script>
-		<script src="<?php echo $base_url;?>assets/js/bootstrap.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/typeahead-bs2.min.js"></script>
+<script type="text/javascript">
+    if ("ontouchend" in document)
+        document.write("<script src='<?php echo $base_url; ?>assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
+</script>
+<script src="<?php echo $base_url; ?>assets/js/bootstrap.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/typeahead-bs2.min.js"></script>
 
-		<!-- page specific plugin scripts -->
+<!-- page specific plugin scripts -->
 
-		<!--[if lte IE 8]>
-		  <script src="<?php echo $base_url;?>assets/js/excanvas.min.js"></script>
-		<![endif]-->
+<!--[if lte IE 8]>
+  <script src="<?php echo $base_url; ?>assets/js/excanvas.min.js"></script>
+<![endif]-->
 
-		<script src="<?php echo $base_url;?>assets/js/jquery-ui-1.10.3.custom.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/jquery.ui.touch-punch.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/jquery.slimscroll.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/jquery.easy-pie-chart.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/jquery.sparkline.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/flot/jquery.flot.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/flot/jquery.flot.pie.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/flot/jquery.flot.resize.min.js"></script>
-		<script src="<?php echo $base_url; ?>assets/js/jquery.validate.min.js"></script>
-		<!-- ace scripts -->
+<script src="<?php echo $base_url; ?>assets/js/jquery-ui-1.10.3.custom.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/jquery.ui.touch-punch.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/jquery.slimscroll.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/jquery.easy-pie-chart.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/jquery.sparkline.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/flot/jquery.flot.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/flot/jquery.flot.pie.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/flot/jquery.flot.resize.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/jquery.validate.min.js"></script>
+<!-- ace scripts -->
 
-		<script src="<?php echo $base_url;?>assets/js/ace-elements.min.js"></script>
-		<script src="<?php echo $base_url;?>assets/js/ace.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/ace-elements.min.js"></script>
+<script src="<?php echo $base_url; ?>assets/js/ace.min.js"></script>
 
-		<!-- inline scripts related to this page -->
+<!-- inline scripts related to this page -->
 
-		<script type="text/javascript">
-			jQuery(function($) {
+<script type="text/javascript">
+    jQuery(function ($) {
 
-				
 
-				var d6 = [];
-				for (var i = 0; i < 14; i += 0.5 + Math.random()) {
-					d6.push([i, Math.sqrt(2*i + Math.sin(i) + 5)]);
-				} 
 
-				var traffix_charts = $('#traffix-charts').css({'width':'100%' , 'height':'320px'}); 
-				$.plot("#traffix-charts", [
-					{data: d6,lines: { show: true }, step: { show: true } },
-				]); 
+        var d6 = [];
+        for (var i = 0; i < 14; i += 0.5 + Math.random()) {
+            d6.push([i, Math.sqrt(2 * i + Math.sin(i) + 5)]);
+        }
 
-				//Android's default browser somehow is confused when tapping on label which will lead to dragging the task
-				//so disable dragging when clicking on label
-				var agent = navigator.userAgent.toLowerCase();
-				if("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent))
-				  $('#tasks').on('touchstart', function(e){
-					var li = $(e.target).closest('#tasks li');
-					if(li.length == 0)return;
-					var label = li.find('label.inline').get(0);
-					if(label == e.target || $.contains(label, e.target)) e.stopImmediatePropagation() ;
-				});
-			
-				$('#tasks').sortable({
-					opacity:0.8,
-					revert:true,
-					forceHelperSize:true,
-					placeholder: 'draggable-placeholder',
-					forcePlaceholderSize:true,
-					tolerance:'pointer',
-					stop: function( event, ui ) {//just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved
-						$(ui.item).css('z-index', 'auto');
-					}
-					}
-				);
-				$('#tasks').disableSelection();
-				$('#tasks input:checkbox').removeAttr('checked').on('click', function(){
-					if(this.checked) $(this).closest('li').addClass('selected');
-					else $(this).closest('li').removeClass('selected');
-				});
-				
-			
-			});
-			
-			function show_box(id) {
-			 jQuery('.widget-box.visible').removeClass('visible');
-			 jQuery('#'+id).addClass('visible');
-			}
+        var traffix_charts = $('#traffix-charts').css({'width': '100%', 'height': '320px'});
+        $.plot("#traffix-charts", [
+            {data: d6, lines: {show: true}, step: {show: true}},
+        ]);
 
-			$('#register-button').click(function(){
-			$('#modal-login').modal('show')
-			})
+        //Android's default browser somehow is confused when tapping on label which will lead to dragging the task
+        //so disable dragging when clicking on label
+        var agent = navigator.userAgent.toLowerCase();
+        if ("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent))
+            $('#tasks').on('touchstart', function (e) {
+                var li = $(e.target).closest('#tasks li');
+                if (li.length == 0)
+                    return;
+                var label = li.find('label.inline').get(0);
+                if (label == e.target || $.contains(label, e.target))
+                    e.stopImmediatePropagation();
+            });
 
-			$('#validation-edit-form').validate({
-				errorElement: 'label',
-				errorClass: 'help-block',
-				focusInvalid: true,
-				rules: {
-					password: {
-						required: true,
-					},
-					username: {
-						required: true
-					}
-				},
-		
-				messages: {
-					username: {
-						required: "Vui lÃ²ng nháº­p tÃ i khoáº£n !",
-					},
-					password: {
-						required: "Vui lÃ²ng nháº­p máº­t kháº©u !",
-					}
-				},
+        $('#tasks').sortable({
+            opacity: 0.8,
+            revert: true,
+            forceHelperSize: true,
+            placeholder: 'draggable-placeholder',
+            forcePlaceholderSize: true,
+            tolerance: 'pointer',
+            stop: function (event, ui) {//just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved
+                $(ui.item).css('z-index', 'auto');
+            }
+        }
+        );
+        $('#tasks').disableSelection();
+        $('#tasks input:checkbox').removeAttr('checked').on('click', function () {
+            if (this.checked)
+                $(this).closest('li').addClass('selected');
+            else
+                $(this).closest('li').removeClass('selected');
+        });
 
-				highlight: function (e) {
-					$(e).closest('label').removeClass('has-info').addClass('has-error');
-				},
-		
-				success: function (e) {
-					$(e).closest('label').removeClass('has-error').addClass('has-info');
-					$(e).remove();
-				},
-			});
-                             
-		</script>
-                <?php
-                if (isset($adminjs))
+
+    });
+
+    function show_box(id) {
+        jQuery('.widget-box.visible').removeClass('visible');
+        jQuery('#' + id).addClass('visible');
+    }
+
+    $('#register-button').click(function () {
+        $('#modal-login').modal('show')
+    })
+
+    $('#validation-edit-form').validate({
+        errorElement: 'label',
+        errorClass: 'help-block',
+        focusInvalid: true,
+        rules: {
+            password: {
+                required: true,
+            },
+            username: {
+                required: true
+            }
+        },
+        messages: {
+            username: {
+                required: "Vui lÃ²ng nháº­p tÃ i khoáº£n !",
+            },
+            password: {
+                required: "Vui lÃ²ng nháº­p máº­t kháº©u !",
+            }
+        },
+        highlight: function (e) {
+            $(e).closest('label').removeClass('has-info').addClass('has-error');
+        },
+        success: function (e) {
+            $(e).closest('label').removeClass('has-error').addClass('has-info');
+            $(e).remove();
+        },
+    });
+
+</script>
+<?php
+if (isset($adminjs)) {
+    foreach ($adminjs as $file) {
+        ?>
+        <script type="text/javascript" src="<?php echo $base_url; ?><?php echo $file ?>"></script>
+        <?php
+    }
+}
+?>
+<script>
+    $('#validation-add-form').validate({
+        errorElement: 'label',
+        errorClass: 'help-block',
+        focusInvalid: true,
+        rules: {
+            password: {
+                required: true,
+            },
+            username: {
+                required: true
+            }
+        },
+        messages: {
+            username: {
+                required: "Vui lÃ²ng nháº­p tÃ i khoáº£n !",
+            },
+            password: {
+                required: "Vui lÃ²ng nháº­p máº­t kháº©u !",
+            }
+        },
+        /*
+         highlight: function (e) {
+         $(e).closest('label').removeClass('has-info').addClass('has-error');
+         },
+         
+         success: function (e) {
+         $(e).closest('label').removeClass('has-error').addClass('has-info');
+         $(e).remove();
+         },*/
+    });
+    var last_time=0;
+    $(document).ajaxStart(function () {
+       if ($.now()>(last_time+60000))
+       {
+            $.ajax({
+                url: "<?php echo $base_url; ?>admin/home/is_timeout",
+                type: "POST",
+                data: $("#package_register").serialize(),
+                success: function (data, textStatus, jqXHR)
                 {
-                foreach ($adminjs as $file)
-                {
-                ?>
-                <script type="text/javascript" src="<?php echo $base_url;?><?php echo $file?>"></script>
-                <?php
-                }
-                }
-                ?>
-		<script>
-		$('#validation-add-form').validate({
-				errorElement: 'label',
-				errorClass: 'help-block',
-				focusInvalid: true,
-				rules: {
-					password: {
-						required: true,
-					},
-					username: {
-						required: true
-					}
-				},
-		
-				messages: {
-					username: {
-						required: "Vui lÃ²ng nháº­p tÃ i khoáº£n !",
-					},
-					password: {
-						required: "Vui lÃ²ng nháº­p máº­t kháº©u !",
-					}
-				},
-				/*
-				highlight: function (e) {
-					$(e).closest('label').removeClass('has-info').addClass('has-error');
-				},
-		
-				success: function (e) {
-					$(e).closest('label').removeClass('has-error').addClass('has-info');
-					$(e).remove();
-				},*/
-			});
-		</script>
-	</body>
+                    var results = jQuery.parseJSON(data);
+                    if (results.login==0)
+                    {
+                    window.location.href = "<?php echo $base_url; ?>admin/home";
+                    }
+                },
+            });
+            last_time=$.now();
+        }
+    });
+</script>
+</body>
 </html>
