<script src="{{asset('assets/js/jquery.min.js')}}"></script>
<script src="{{asset('assets/js/popper.min.js')}}"></script>
<script src="{{asset('assets/js/bootstrap.min.js')}}"></script>
<script src="{{asset('assets/js/modernizr.min.js')}}"></script>
<script src="{{asset('assets/js/detect.js')}}"></script>
<script src="{{asset('assets/js/jquery.slimscroll.js')}}"></script>
<script src="{{asset('assets/js/vertical-menu.js')}}"></script>
<!-- Switchery js -->
<script src="{{asset('assets/plugins/switchery/switchery.min.js')}}"></script>
<!-- Apex js -->
<script src="{{asset('assets/plugins/apexcharts/apexcharts.min.js')}}"></script>
<script src="{{asset('assets/plugins/apexcharts/irregular-data-series.js')}}"></script>
<!-- Vector Maps js -->
<script src="{{asset('assets/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js')}}"></script>
<script src="{{asset('assets/plugins/jvectormap/jquery-jvectormap-world-mill-en.js')}}"></script>
<!-- Slick js -->
<script src="{{asset('assets/plugins/slick/slick.min.js')}}"></script>
<!-- Dashboard js -->
<script src="{{asset('assets/js/custom/custom-dashboard-crypto.js')}}"></script>
<!-- Core js -->
<script src="{{asset('assets/js/core.js')}}"></script>
<!-- End js -->
<script src="{{asset('assets/plugins/sweet-alert2/sweetalert2.min.js')}}"></script>
<script src="{{asset('assets/js/custom/custom-sweet-alert.js')}}"></script>

<script src="{{asset('assets/plugins/select2/select2.min.js')}}"></script> 

<script src="{{asset('assets/plugins/datatables/jquery.dataTables.min.js')}}"></script>
<script src="{{asset('assets/plugins/datatables/dataTables.bootstrap4.min.js')}}"></script>
<script src="{{asset('assets/js/custom/custom-table-datatable.js')}}"></script>
<script src="{{asset('assets/js/custom/custom-form-select.js')}}"></script>
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>

<script>
    $('#summernote').summernote({
      placeholder: 'Product Details...',
      tabsize: 2,
      height: 150
    });
  </script>
  <script>
    $('#summernote1').summernote({
      placeholder: 'Product Details...',
      tabsize: 2,
      height: 150
    });
  </script>

<!-- Confirm Password Matched for pass change-->
<script>
  $('#password, #confirm_pass').on('keyup', function () {
    if ($('#password').val() == "") {
      $('#mess').html(' ').css('color', '#ff4242');
    } else {
    
      if ($('#password').val() == $('#confirm_pass').val()) {
        $('#mess').html('Confirm Password Matched').css('color', 'rgb(0 22 255)');
      } else {
        $('#mess').html('Confirm Password Not Matched').css('color', '#ff4242');
      }
    }
  });
</script>

<script>
  $('#pin, #conf_pin').on('keyup', function () {
    if ($('#pin').val() == "") {
      $('#pinmessage').html(' ').css('color', '#ff4242');
    } else {
    
      if ($('#pin').val() == $('#conf_pin').val()) {
        $('#pinmessage').html('Confirm PIN Matched').css('color', 'rgb(0 22 255)');
      } else {
        $('#pinmessage').html('Confirm PIN Not Matched').css('color', '#ff4242');
      }
    }
  });
</script>

<!-- Charge Amount Calculate -->
<script>
$(document).ready(function() {
  $("#amount").keyup(function(){
    var amount =parseFloat($('#amount').val());
    if (amount > 0) {
      $('#net_amount').val(amount-(amount*10/100));
      $('#vat').val(amount*10/100);
    }else{
      $('#net_amount').val(0);
      $('#vat').val(0);
    }
  });
})
</script>


<script>
  $(document).ready(function () {
    
    $('#username').blur(function(){
      var nuchks ='';
      var username = $('#username').val();
      var _token = $('input[name="_token"]').val();
      $.ajax({
        url:"{{route('chkuser')}}",
        method: "POST",
        data:{username:username, _token:_token},
        success:function(result){
          if (result=='not_unique') {
            $('#nuchks').html('User Exist! Try Another.').css('color', '#E11D64');
            $('#username').addClass('has_error');
            $('#register').attr('disabled', 'disabled');
          }else if (result=='unique') {
            $('#nuchks').html(' ').css('color', '#fff');
            $('#username').addClass('has_error');
            $('#register').attr('disabled', 'disabled'); 
          }else if (result=='invalid') {
            $('#nuchks').html(' ').css('color', '#fff');
            $('#username').addClass('has_error');
            $('#register').attr('disabled', 'disabled');    
          }
        }
      });
    });
  });

</script>


<script>
  $(document).ready(function () {
    
    $('#refer').blur(function(){
      var ref ='';
      var refer = $('#refer').val();
      var _token = $('input[name="_token"]').val();
      $.ajax({
        url:"{{route('chkrefer')}}",
        method: "POST",
        data:{refer:refer, _token:_token},
        success:function(result){
          if (result=='unique') {
            $('#ref').html('Invalid Refer! Try Another.').css('color', '#E11D64');
            $('#refer').addClass('has_error');
            $('#register').attr('disabled', 'disabled');
          }else if (result=='not_unique') {
            $('#ref').html(' ').css('color', '#fff');
            $('#refer').addClass('has_error');
            $('#register').attr('disabled', 'disabled'); 
          }else if (result=='invalid') {
            $('#ref').html(' ').css('color', '#fff');
            $('#refer').addClass('has_error');
            $('#register').attr('disabled', 'disabled');    
          }
        }
      });
    });
  });

</script>

<script type="text/javascript">
  $(document).ready(function() {
     $('#unit').keyup(function(){
       var unit = $('#unit').val();
       var total = 1500*unit;

      if (total > 0) {
        $('#total_amount').val(total);
      }else{
        $('#total_amount').val(1500);
      }
      
   });

  });

</script>

<script type="text/javascript">
   $('#bqty, #price').keyup(function(){
     var qty =$('#bqty').val();
     var price =$('#price').val();

    if (qty > 0) {
      $('#payamnt').text(qty*1000);
      $('#payamnts').text(qty*price);
    }else{
      $('#payamnt').text(0);
      $('#payamnts').text(0);
    }
 });
</script>

<script>
$(document).ready(function(){
    $("#btype").change(function(){
        $(this).find("option:selected").each(function(){
            var optionValue = $(this).attr("value");
            if(optionValue == 1){
                $("#FS").hide();
                $("#ST").show();
            }else {
                $("#FS").show();
                $("#ST").hide();
            }
        });
    }).change();
});
</script>

   