<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/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/plugins/select2/select2.min.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>

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

</script>

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



<script type="text/javascript">
   $('#price, #buy_price').keyup(function(){
     var sellValue =$('#price').val();
     var buyValue = $('#buy_price').val();
     var buysellpv = sellValue - buyValue;

    if (buysellpv > 0) {
      $('#pv').val(buysellpv/20);
    }else{
      $('#pv').val(0);
    }

    
 });

</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>