

 </div>
            <!-- End of Main Content -->

            <!-- Footer -->
           
            <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    <!-- Logout Modal-->
    {{-- <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                    <a class="btn btn-primary" href="login.html">Logout</a>
                </div>
            </div>
        </div>
    </div> --}}

    <!-- Bootstrap core JavaScript-->
    <script src="{{ asset('/Admins/vendor/jquery/jquery.min.js') }}"></script>
    <script src="{{ asset('/Admins/vendor/bootstrap/js/bootstrap.bundle.min.js') }}"></script>

    <!-- Core plugin JavaScript-->
    <script src="{{ asset('/Admins/vendor/jquery-easing/jquery.easing.min.js') }}"></script>

    <!-- Custom scripts for all pages-->
    <!--<script src="{{ asset('/Admins/js/sb-admin-2.min.js') }}"></script>-->

    <!-- Page level plugins -->
    <!--<script src="{{ asset('/Admins/vendor/chart.js/Chart.min.js') }}"></script>-->

    <!-- Page level custom scripts -->
    <!--<script src="{{ asset('/Admins/js/demo/chart-area-demo.js') }}"></script>-->
    <!--<script src="{{ asset('/Admins/js/demo/chart-pie-demo.js') }}"></script>-->
    
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
     <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
    
    
    <script src="/Admins/ckeditor/ckeditor.js"></script>

  <script>
      CKEDITOR.replace('editor' , {
          width:'100%',

      });

      CKEDITOR.replace('editor2' , {
          width:'100%',

      });
    </script>

    <script>
        $(document).ready(function(){

             $('.select2').select2();

            $('#val').blur(function () {
                var total = parseFloat($('#sub_total').val());
                var tax = parseFloat($(this).val());
                var new_total = Math.max(total + (total * tax) / 100).toFixed(2);
             $('#grand_total').val(new_total);
        });


                 var count_id = 2;
                 var count_name = 1;
                 var id = 1;

            $('#AddProduct').click(function(){
                var form = $("#Product").eq(0).clone();
                form.find("input[type=text]").val("");
                form.find('#textarea').val("");
                form.find('.product_name').attr({name: "product_name["+count_name+"]"});
                form.find('.product_description').attr({name: "product_description["+count_name+"]"});
                form.find('.product_quantity').attr({name: "product_quantity["+count_name+"]" , id: "quantity_"+count_id});
                form.find('.unit_price').attr({name: "unit_price["+count_name+"]" , id: "unit_price_"+count_id});
                form.find('.billing_type').attr({name: "billing_type["+count_name+"]"});
                form.find('.total').attr({name: "total["+count_name+"]" , id: "total_"+count_id});


                form.show().insertBefore('#Product');

                 count_name++;
                 count_id++;
                 id++;

            });

            $(document).on('blur' , '.unit_price' , function () {
                 var quantity = $('#quantity_'+id).val();
                var sub = Number($('#sub_total').val());
                var unit_price = parseFloat($('#unit_price_'+id).val());
                var total = quantity * unit_price;
                $('#total_'+id).val(total.toFixed(2));
                $('#grand_total').val(total + sub);
                $('#sub_total').val(total + sub);
    });
            
        });
    </script>
    @yield('script')

</body>

</html>