<?php $ci = get_instance();?>
<?php if(! isset($no_footer) || $no_footer == FALSE):?>
	<!--<footer class="footer">
		<?php echo $ci->fm->decrypt($this->company_name);?>
		&copy;
		2015
	</footer>-->
<?php endif;?>

<script src="<?php echo base_url("assets/js/jquery-1.11.1.min.js")?>"></script>
<script src="<?php echo base_url("assets/js/jquery.js")?>"></script>
<script src="<?php echo base_url("assets/js/bootstrap.min.js")?>"></script>
<script src="<?php echo base_url("assets/js/wow.min.js")?>"></script>
<script src="<?php echo base_url("assets/js/jquery.nicescroll.js")?>"></script>
<script src="<?php echo base_url("assets/js/jquery.app.js")?>"></script>

<script src="<?php echo base_url("assets/Select2-3.5.0/select2.min.js")?>"></script>
<script src="<?php echo base_url("assets/switch/js/bootstrap-switch.min.js")?>"></script>
<script src="<?php echo base_url("assets/datepicker/js/bootstrap-datepicker.js")?>"></script>
<script src="<?php echo base_url("assets/fancybox/jquery.fancybox.js")?>"></script>
<script src="<?php echo base_url("assets/fancybox/jquery.fancybox.pack.js")?>"></script>
<script src="<?php echo base_url("assets/timepicker/js/bootstrap-timepicker.js")?>"></script>
<script src="<?php echo base_url("assets/smoothscroll/smoothscroll.js")?>"></script>
<script src="<?php echo base_url("assets/modernizr/modernizr.custom.54674.js")?>"></script>
<script src="<?php echo base_url("assets/bootstrap3-editable/js/bootstrap-editable.js")?>"></script>
<script src="<?php echo base_url("assets/perfect-scrollbar/js/perfect-scrollbar.js")?>"></script>
<script src="<?php echo base_url("assets/perfect-scrollbar/js/perfect-scrollbar.jquery.js")?>"></script>
<script src="<?php echo base_url("assets/kartik-v-bootstrap-fileinput/js/plugins/piexif.min.js");?>" type="text/javascript"></script>
<script src="<?php echo base_url("assets/kartik-v-bootstrap-fileinput/js/fileinput (Edited by JL).js");?>" type="text/javascript"></script>
<script src="<?php echo base_url("assets/EZView/EZView.js")?>" type="text/javascript"></script>
<script src="<?php echo base_url("assets/EZView/draggable.js")?>" type="text/javascript"></script>
<script src="<?php echo base_url("assets/js/openJS.js")?>"></script>
<script src="<?php echo base_url("assets/js/jquery.tablesorter.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("assets/uppy/js/uppy.js")?>"></script>

<?php $this->load->view("includes/custom_function");?>
<script>
	$(document).ready(function(){
		$("aside").perfectScrollbar();
		//To Prevent IOS redirect to Safari---
		$("a").bind("click", function(e){
			if($(this).attr("data-global-link") != "1"){
				e.preventDefault();
	
				var href = $(this).attr("href");
				if(["", "javascript:;"].indexOf(href) == -1 && href.substr(0, 1) != "#"){
					window.location = href;
				}
			}
		});
		//------------------------------------

//		$("li.has-submenu.child_has_access a.menu_btn_parent").click();
		$("li.has-submenu.child_has_access").addClass("active");

		if(localStorage.<?php echo $ci->config->item('project');?>_menu_collapse == null || localStorage.<?php echo $ci->config->item('project');?>_menu_collapse == 0){
			menu_collapse();
		}
	});

	function menu_collapse(){
		$("aside.left-panel").toggleClass("collapsed");

		localStorage.<?php echo $ci->config->item('project');?>_menu_collapse = $("aside.left-panel").hasClass("collapsed")? 1:0;
	}

	function time_diff_translate(diff){
		diff = to_int(diff);

		var string = "";
		if(diff >= 86400){	//Day
			string += Math.floor(diff / 86400) + "D";
			diff -= Math.floor(diff / 86400) * 86400;
		}
		if(diff >= 3600 || string != ""){	//Hour
			if(string != "") string += " ";
			
			string += Math.floor(diff / 3600) + "h";
			diff -= Math.floor(diff / 3600) * 3600;
		}
//		if(diff >= 60 || string != ""){	//Minute
			if(string != "") string += " ";
			
			string += Math.floor(diff / 60) + "m";
			diff -= Math.floor(diff / 60) * 60;
//		}
//		if(diff >= 0){	//Second
//			if(string != "") string += " ";
//			
//			string += diff + "s";
//			diff = 0;
//		}

		return string;
	}
	function roundOff_toFixed2(number){
    	var formatted_number = ((number * 100).toFixed(0) / 100).toFixed(2);
    	return formatted_number;
    }
</script>