 <!-- BEGIN: Footer-->
    <footer class="footer footer-static footer-light navbar-border navbar-shadow">
      <p class="clearfix blue-grey lighten-2 text-sm-center mb-0 px-2"><span class="float-md-left d-block d-md-inline-block">Copyright &copy; 2019 <a class="text-bold-800 grey darken-2" href="#" target="_blank"><?php echo $org_name;?></a></span><span class="float-md-right d-none d-lg-block">GravitySoft<i class="ft-heart pink"></i><span id="scroll-top"></span></span></p>
    </footer>
    <!-- END: Footer-->


    <!-- BEGIN: Vendor JS-->
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/vendors.min.js"></script>
     <script src="<?php echo base_url(); ?>app-assets/js/core/libraries/jquery_ui/jquery-ui.min.js"></script>
  <!--   <script src="https://code.jquery.com/jquery-3.5.1.js"></script>-->
     <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/datatable/datatables.min.js"></script>

    <script src="<?php echo base_url(); ?>app-assets/vendors/js/forms/select/select2.full.min.js"></script>
     <script src="<?php echo base_url(); ?>app-assets/vendors/js/pickers/pickadate/picker.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/pickers/pickadate/picker.date.js"></script>
    <!-- BEGIN Vendor JS-->
    <script src="<?php echo base_url(); ?>assets/js/angular.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/ng-pattern-restrict.min.js"></script>
    <!--<script type="text/javascript" src="https://cdn.rawgit.com/AlphaGit/ng-pattern-restrict/master/src/ng-pattern-restrict.min.js"></script>-->
    <script src="<?php echo base_url(); ?>assets/js/ngStorage.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/ng-infinite-scroll.min.js"></script>
    <!-- BEGIN: Page Vendor JS-->
    <!-- END: Page Vendor JS
     <script src="<?php //echo base_url(); ?>assets/js/jquery.chained.js" type="text/javascript" charset="utf-8"></script>-->
     
     <script src="<?php echo base_url(); ?>assets/js/validate_num_text.js"></script>
     <script src="<?php echo base_url(); ?>assets/js/time.js"></script>
    <!-- BEGIN: Theme JS-->
    <script src="<?php echo base_url(); ?>app-assets/js/core/app-menu.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/core/app.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/customizer.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/footer.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/ui/jquery-ui/navigations.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/pages/invoice-template.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/ui/jquery-ui/autocomplete.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/ui/jquery-ui/dialog-tooltip.min.js"></script>
    <!--<script src="<?php //echo base_url(); ?>app-assets/js/scripts/bootstrap-multiselect.js"></script>
     END: Theme JS-->
    
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/forms/select/form-select2.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/pickers/dateTime/pick-a-datetime.min.js"></script>
    
       <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/datatable/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/datatable/buttons.bootstrap4.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/jszip.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/pdfmake.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/vfs_fonts.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/buttons.html5.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/buttons.print.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/vendors/js/tables/buttons.colVis.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/tables/datatables-extensions/datatable-button/datatable-html5.min.js"></script>
    <script src="<?php echo base_url(); ?>app-assets/js/scripts/tables/datatables/datatable-basic.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/chosen_select/chosen.jquery.js"></script>
    
    <!--toastr-->
    <script src="<?php echo base_url(); ?>assets/js/toastr.js"></script>
    
   <!-- Responsive Print -->
    <script src="<?php echo base_url(); ?>assets/js/responsive_print.js"></script>
    
   <!-- <script src="<?php //echo base_url(); ?>assets/js/sms_template.js"></script>-->
 <!--  <script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
   <script src="https://cdn.datatables.net/rowgroup/1.2.0/js/dataTables.rowGroup.min.js"></script>-->
   
    <script type="text/javascript">
	var btn='NewReport';
	</script>
    <script type="text/javascript" src="<?php echo base_url(); ?>assets/js_pdf/tableToExcel.js"></script>
	<script type="text/javascript">
	function method(s) {
	//alert(s);
	//tableToExcel('table', s);
	tableToExcel('tableID', s);
	}
	</script>
	<script>
	 /*   $(document).ready(function()
        { 
               $(document).bind("contextmenu",function(e){
                      return false;
               }); 
        }) */
	</script>
	
	<script type="text/javascript">

    <?php if($this->session->flashdata('success')){ ?>
        toastr.success("<?php echo $this->session->flashdata('success'); ?>");
    <?php }else if($this->session->flashdata('error')){  ?>
        toastr.error("<?php echo $this->session->flashdata('error'); ?>");
    <?php }else if($this->session->flashdata('warning')){  ?>
        toastr.warning("<?php echo $this->session->flashdata('warning'); ?>");
    <?php }else if($this->session->flashdata('info')){  ?>
        toastr.info("<?php echo $this->session->flashdata('info'); ?>");
    <?php } ?>

    </script>
	
	<script type="text/javascript">
	var idleTime = 0;
	$(document).ready(function () {
		//Increment the idle time counter every minute.
		//idleInterval = setInterval(timerIncrement, 60000); // 1 minute
		//Zero the idle timer on mouse movement.
		idleInterval = setInterval(timerIncrement, 300000);
		$('body').mousemove(function (e) {
			//alert("mouse moved" + idleTime);
			idleTime = 0;
		});
		$('body').keypress(function (e) {
			//alert("keypressed"  + idleTime);
			idleTime = 0;
		});
		$('body').click(function() {
			//alert("mouse moved" + idleTime);
			idleTime = 0;
		});
	});
	function timerIncrement() {
		idleTime = idleTime + 1;
		if (idleTime > 10) { // 10 minutes
			alert("your session out Please login again");
			window.location.assign("<?php echo site_url('login/logout_user'); ?>");
		}
	}
</script>

<script>
/*	$(document).ready(function() {
		var branch_id = $('#branch_id').val();
		//alert(branch_id);
		$.ajax({
			type :'POST',
			dataType:'json',
			data : { branch_id : branch_id },
			url: '<?php // echo base_url();?>index.php/Damage/itemDetails',
			cache: false,
            error: function (xhr, ajaxOptions, thrownError) {
               // alert(xhr.responseText);
                //alert(thrownError);
            },
            xhr: function () {
                var xhr = new window.XMLHttpRequest();
                //Download progress
                xhr.addEventListener("progress", function (evt) {
                    console.log(evt.lengthComputable);
                    if (evt.lengthComputable) {
                        var percentComplete = evt.loaded / evt.total;
                        console.log(percentComplete );
                    }
                }, false);
                return xhr;
            },
            beforeSend: function () {
              // before send
            }
		});
	}); */
	
/*	$(document).ready(function() {
		var branch_id = $('#branch_id').val();
		$.ajax({
			type :'POST',
			dataType:'json',
			data : { branch_id : branch_id },
			url: '<?php echo base_url();?>index.php/Damage/itemDetails',
		});
	});
	$(function() {
		var item = [];
		var items = "", item_name = "";
		var fproduct = "";
		var count = 1;
	//	alert(count);
		$.getJSON('https://gsrgroup.biz/inventory_management/item_list.json',function(data) {
		    
			for(i in data.products)
			{
			    items += "<a style='width: 100%;text-align:left;' href='#demo"+data.products[i].category_id +"' class='btn btn-primary category_list' data-toggle='collapse'>" + data.products[i].category + "</a>";
				items += "<div id='demo"+data.products[i].category_id +"' class='collapse'>";
				items += "<table border='1' class='uk-table'>";
				items += "<tr style='text-align:center;'><th>Item Name</th><th>UOM</th><th style='width:100px'>Qty</th><th>Remarks</th></tr>";
				for(j in data.products[i].items)
				{
					//	$.each(data.products[i].items, function(j,e) {
					items += "<tr style='text-align:center;'>" + "<td style='width: 45%!important;'>" + data.products[i].items[j].item_name + "<input type='hidden' name='item_name[]' id='item_name' class='form-control' value='"+data.products[i].items[j].item_name+"'></td>" + "<td>" + data.products[i].items[j].uom + "<input type='hidden' name='uom[]' id='uom' class='form-control' value='"+data.products[i].items[j].uom+"'></td>"  + "<td>" + "<input type='text' name='dmg_qty[]' onkeypress='javascript:return isNumber(event)' id='dmg_qty' placeholder='Qty' class='form-control dmg_qty'><input type='hidden' name='pr_stk[]' id='pr_stk' class='form-control pr_stk' value='"+data.products[i].items[j].prsnt_stk+"'><input type='hidden' name='item_id[]' id='item_id' class='form-control' value='"+data.products[i].items[j].item_id+"'><input type='hidden' name='cat_id[]' id='cat_id' class='form-control' value='"+data.products[i].items[j].cat_id+"'><input type='hidden' name='itm_id[]' id='itm_id' class='form-control' value='"+data.products[i].items[j].itm_id+"'><input type='hidden' name='item_type[]' id='item_type' class='form-control' value='Raw Material'>" + "</td>" + "<td>" + "<input type='text' name='remarks[]' id='remarks' placeholder='Remarks' class='form-control'></td>" + "</tr>"
				}
				count++;
				items += "</table>"; 
				items += "</div>";
			}
			//alert(items);
			$('#raw_material').append(items);
			//$(items).appendTo("#item_table tbody");
		});
		
		$.getJSON('https://gsrgroup.biz/inventory_management/product_list.json',function(data) {
			for(i in data.finished_products)
			{
				fproduct += "<a style='width: 100%;text-align:left;' href='#demo"+data.finished_products[i].pr_cat_id +"' class='btn btn-primary category_list' data-toggle='collapse'>" + data.finished_products[i].prod_cat + "</a>";
				fproduct += "<div id='demo"+data.finished_products[i].pr_cat_id +"' class='collapse'>";
				fproduct += "<table border='1' class='uk-table'>";
				fproduct += "<tr style='text-align:left;'><th>Item Name</th><th>UOM</th><th style='width:100px'>Qty</th><th>Remarks</th></tr>";
				for(j in data.finished_products[i].product)
				{
					//	$.each(data.products[i].items, function(j,e) {
					fproduct += "<tr style='text-align:center;'>" + "<td style='width: 45%!important;'>" + data.finished_products[i].product[j].product_name + "<input type='hidden' name='item_name[]' id='item_name' class='form-control' value='"+data.finished_products[i].product[j].product_name+"'></td>" + "<td>" + data.finished_products[i].product[j].uom + "<input type='hidden' name='uom[]' id='uom' class='form-control' value='"+data.finished_products[i].product[j].uom+"'></td>"  + "<td>" + "<input type='text' name='dmg_qty[]' onkeypress='javascript:return isNumber(event)' id='dmg_qty' placeholder='Qty' class='form-control dmg_qty'><input type='hidden' name='pr_stk[]' id='pr_stk' class='form-control pr_stk' value='"+data.finished_products[i].product[j].prsnt_stk+"'><input type='hidden' name='item_id[]' id='item_id' class='form-control' value='"+data.finished_products[i].product[j].recipe_id+"'><input type='hidden' name='cat_id[]' id='cat_id' class='form-control' value='"+data.finished_products[i].product[j].cat_id+"'><input type='hidden' name='itm_id[]' id='itm_id' class='form-control' value='"+data.finished_products[i].product[j].recipe_no+"'><input type='hidden' name='item_type[]' id='item_type' class='form-control' value='Finished Product'>" + "</td>" + "</td>" + "<td>" + "<input type='text' name='remarks[]' id='remarks' placeholder='Remarks' class='form-control'></td>" + "</tr>"
				}
				count++;
				fproduct += "</table>"; 
				fproduct += "</div>";
			}
			//alert(fproduct);
			$('#finished_prdct').append(fproduct);
			//$(items).appendTo("#item_table tbody");
		});
	});
	/*function isNumber(evt) {
	    var iKeyCode = (evt.which) ? evt.which : evt.keyCode
	    if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57))
		return false;
	    return true;
	}*/
/*	$('.dmg_qty').each(function() { $(this).on( {'keyup': function() {
			var q1 = $(this).parent().find('.dmg_qty').val();
			var q2 = $(this).parent().find('.pr_stk').val();
				alert(q1);
			if(parseFloat(q1) <= parseFloat(q2)){
				//alert("sucess");
			}
			else{
				alert("You cant enter more than PO balance quantity");
			}
		}
		})
	}) */
</script>